entry_point
stringlengths
1
65
original_triton_python_code
stringlengths
208
619k
optimised_triton_code
stringlengths
1.15k
275k
repo_name
stringlengths
7
115
module_name
stringlengths
1
65
synthetic
bool
1 class
uuid
int64
0
18.5k
licenses
listlengths
1
6
stars
int64
0
19.8k
sha
stringlengths
40
40
repo_link
stringlengths
72
180
MaxMarginRankingLoss
import torch import torch.nn.functional as F import torch.nn as nn import torch as th import torch.optim import torch.utils.data class MaxMarginRankingLoss(nn.Module): def __init__(self, margin=1): super(MaxMarginRankingLoss, self).__init__() self.loss = th.nn.MarginRankingLoss(margin) se...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch as th import torch.optim import torch.utils.data asser...
awesome-archive/Video-to-Online-Platform
MaxMarginRankingLoss
false
6,287
[ "Apache-2.0" ]
1
4f91724133a817e79bce91e0abbd46cf38a31167
https://github.com/awesome-archive/Video-to-Online-Platform/tree/4f91724133a817e79bce91e0abbd46cf38a31167
LinearBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from functools import partial...
derwind/dmfont
LinearBlock
false
15,173
[ "MIT" ]
95
17a91a9cc1917d2485eaa8e92b68245578920c76
https://github.com/derwind/dmfont/tree/17a91a9cc1917d2485eaa8e92b68245578920c76
JaccardScore
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn.modules.loss import _Loss assert_size_stride = torch._C._dynamo.guards.asse...
BloodAxe/segmentation-networks-benchmark
JaccardScore
false
7,858
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
Polynomial3
import torch class Polynomial3(torch.nn.Module): def __init__(self): """ In the constructor we instantiate four parameters and assign them as member parameters. """ super(Polynomial3, self).__init__() self.a = torch.nn.Parameter(torch.randn(())) self.b = torch.nn.P...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
LbsIrving/PyTorch
Polynomial3
false
766
[ "MIT" ]
0
314dbe9efc9e0116a7342d4ae3ab168c1c3afa32
https://github.com/LbsIrving/PyTorch/tree/314dbe9efc9e0116a7342d4ae3ab168c1c3afa32
ResidualBlock
import torch import torch.nn as nn def conv3x3(in_ch, out_ch, stride=1): """3x3 convolution with padding.""" return nn.Conv2d(in_ch, out_ch, kernel_size=3, stride=stride, padding=1) class ResidualBlock(nn.Module): """Simple residual block with two 3x3 convolutions. Args: in_ch (int): number...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Chrisa142857/CompressAI
ResidualBlock
false
13,503
[ "Apache-2.0" ]
62
75760096b9700a58d346351251d544050f3418fb
https://github.com/Chrisa142857/CompressAI/tree/75760096b9700a58d346351251d544050f3418fb
Anomaly
import torch import torch.utils.data from torch import nn class Anomaly(nn.Module): def __init__(self, window=1024): self.window = window super(Anomaly, self).__init__() self.layer1 = nn.Conv1d(window, window, kernel_size=1, stride=1, padding=0) self.layer2 = nn.Conv1d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.utils.data from ...
sccc19/anomalydetector
Anomaly
false
16,440
[ "MIT" ]
180
a963ef8d7f30971e99d21a748d059e26f2163b09
https://github.com/sccc19/anomalydetector/tree/a963ef8d7f30971e99d21a748d059e26f2163b09
Sinkhorn
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn as nn from sklearn import * assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_st...
CityU-AIM-Group/SIGMA
Sinkhorn
false
17,461
[ "MIT" ]
5
19f89777db8d42f750a9b87756d3326c7efd18f5
https://github.com/CityU-AIM-Group/SIGMA/tree/19f89777db8d42f750a9b87756d3326c7efd18f5
AlbertAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
jxhe/unify-parameter-efficient-tuning
AlbertAttention
false
15,784
[ "Apache-2.0" ]
101
3222ce2c0079566a28043e22380eb4ab6ad14389
https://github.com/jxhe/unify-parameter-efficient-tuning/tree/3222ce2c0079566a28043e22380eb4ab6ad14389
Attention
import torch import torch.nn as nn class Attention(nn.Module): def __init__(self, input_dim, feature_dim): super(Attention, self).__init__() self.feature_dim = feature_dim self.input_dim = input_dim weight = torch.zeros(self.feature_dim, self.feature_dim) nn.init.kaiming_u...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
ForoughA/CORGI
Attention
false
8,104
[ "MIT" ]
22
c28ecd0e0375569f9f05e94e6ae5b7a994caacf5
https://github.com/ForoughA/CORGI/tree/c28ecd0e0375569f9f05e94e6ae5b7a994caacf5
TensorRepeat
import torch class TensorRepeat(torch.nn.Module): """ duolicate a 1D tensor into N channels (grayscale to rgb for instance) code derived from https://github.com/pytorch/vision/blob/main/torchvision/transforms/transforms.py """ def __init__(self, num_output_channels=1): super().__init__() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
georand/distributedpytorch
TensorRepeat
false
10,063
[ "MIT" ]
0
69341b364830ad62968ea5646e485dff6b0b24f2
https://github.com/georand/distributedpytorch/tree/69341b364830ad62968ea5646e485dff6b0b24f2
DecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
jkimbf/transformer-1
DecoderLayer
false
15,733
[ "Apache-2.0" ]
233
6cd29731197822d6db641cdbfad3b045b8a294e4
https://github.com/jkimbf/transformer-1/tree/6cd29731197822d6db641cdbfad3b045b8a294e4
PPReLU
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
IrisDinge/YoloV3_DOTA
PPReLU
false
5,357
[ "MIT" ]
1
cdfe6375a2323e9ee162e50a46478d8a66529e6c
https://github.com/IrisDinge/YoloV3_DOTA/tree/cdfe6375a2323e9ee162e50a46478d8a66529e6c
SigmoidRange
import torch import torch.nn as nn from typing import * def sigmoid_range(x, low, high): """Sigmoid function with range `(low, high)`""" return torch.sigmoid(x) * (high - low) + low class SigmoidRange(nn.Module): """Sigmoid module with range `(low, high)`""" def __init__(self, low, high): s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from typing import * assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dy...
LaurenSpiegel/fastai_docs
SigmoidRange
false
757
[ "Apache-2.0" ]
0
4fe6b62116d88dea9610548133e6cadb6b260a73
https://github.com/LaurenSpiegel/fastai_docs/tree/4fe6b62116d88dea9610548133e6cadb6b260a73
FusedConvBN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
youkaichao/tutorials
FusedConvBN
false
13,202
[ "BSD-3-Clause" ]
0
af34b10b70d99659eb016a2a1d5c31b9ae8ba3da
https://github.com/youkaichao/tutorials/tree/af34b10b70d99659eb016a2a1d5c31b9ae8ba3da
ChamferLoss
import torch import torch.nn as nn import torch.nn.parallel import torch.utils.data import torch.utils class ChamferLoss(nn.Module): def __init__(self): super(ChamferLoss, self).__init__() self.use_cuda = torch.cuda.is_available() def forward(self, preds, gts): P = self.batch_pairwis...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
BossunWang/soft-intro-vae-pytorch
ChamferLoss
false
13,806
[ "Apache-2.0" ]
144
10841fe2ae1aea12dbf43347dea63ee25d951864
https://github.com/BossunWang/soft-intro-vae-pytorch/tree/10841fe2ae1aea12dbf43347dea63ee25d951864
SmoothL1Loss
import torch import torch.nn as nn import torch.nn.functional as F class SmoothL1Loss(nn.Module): """SmoothL1Loss loss . Args: use_target_weight (bool): Option to use weighted MSE loss. Different joint types may have different target weights. loss_weight (float): Weight of the los...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
ZephyrII/mmpose_charger
SmoothL1Loss
false
12,012
[ "Apache-2.0" ]
0
ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
https://github.com/ZephyrII/mmpose_charger/tree/ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
SuperpointDescriptor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
wx-b/SOLD2
SuperpointDescriptor
false
16,744
[ "MIT" ]
347
71c3243f9d3a695788d0a6bfd134b9849425900a
https://github.com/wx-b/SOLD2/tree/71c3243f9d3a695788d0a6bfd134b9849425900a
JaccardLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import torch.backends.cudnn assert_size_stride = torch._C._dynamo.gu...
cxz/tgs-salt-identification-challenge
JaccardLoss
false
6,515
[ "MIT" ]
1
859f3d7f2d3184532c42c34444500eec3b03b1c8
https://github.com/cxz/tgs-salt-identification-challenge/tree/859f3d7f2d3184532c42c34444500eec3b03b1c8
Caps_Conv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math from torch import nn assert_size_stride = torch._C._dynamo.guards.as...
WdBlink/AugMix-3DOCUNet-Brats2019
Caps_Conv
false
5,960
[ "MIT" ]
1
125c6c8682b51a550eeac9173d13d0a211576abc
https://github.com/WdBlink/AugMix-3DOCUNet-Brats2019/tree/125c6c8682b51a550eeac9173d13d0a211576abc
RingLoss
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import warnings import torch.nn as nn assert_size_stride = torch._C._dynamo.gua...
ArronHZG/ABD-Net
RingLoss
false
9,588
[ "MIT" ]
0
4f6d15f4d389a55549ea10a2e00d4a5cdecb5753
https://github.com/ArronHZG/ABD-Net/tree/4f6d15f4d389a55549ea10a2e00d4a5cdecb5753
PKT
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math fr...
UBCDingXin/RepDistiller
PKT
false
14,519
[ "BSD-2-Clause" ]
1,347
dcc043277f2820efafd679ffb82b8e8195b7e222
https://github.com/UBCDingXin/RepDistiller/tree/dcc043277f2820efafd679ffb82b8e8195b7e222
RSubFloat
import torch class RSubFloat(torch.nn.Module): def __init__(self): super(RSubFloat, self).__init__() def forward(self, x): return 1.0 - x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
NVIDIA-AI-IOT-private/torch2trt
RSubFloat
false
10,531
[ "MIT" ]
0
953d60039e0c81e90eea467c3df2e6e3f7040242
https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242
UpConv_Blocks
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
HRHLALALA/GoalGAN
UpConv_Blocks
false
9,103
[ "MIT" ]
0
01443f2a578333a0d5ab3a449bc7da69f5023190
https://github.com/HRHLALALA/GoalGAN/tree/01443f2a578333a0d5ab3a449bc7da69f5023190
WeightedView
import torch import torch.nn as nn import torch.optim import torch.utils.data class WeightedView(nn.Module): """Calculate weighted view Args: num_groups: int, number of groups (views) reduce_dimension: bool, default False. If True, reduce dimension dim dim: default -1. Only used w...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn import torch.optim import torch.utils.data assert_s...
BeautyOfWeb/AffinityNet
WeightedView
false
7,763
[ "MIT" ]
34
d3f79823fa0182328894483165d4f0853740ee53
https://github.com/BeautyOfWeb/AffinityNet/tree/d3f79823fa0182328894483165d4f0853740ee53
LxmertAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ashutoshbsathe/SmBop
LxmertAttention
false
9,813
[ "MIT" ]
0
ce5f67ec070df55b84d7f3617659011732020c96
https://github.com/ashutoshbsathe/SmBop/tree/ce5f67ec070df55b84d7f3617659011732020c96
NormedLinear
import torch import torch.nn.functional as F from torch import nn class NormedLinear(nn.Linear): """Normalized Linear Layer. Args: tempeature (float, optional): Tempeature term. Default to 20. power (int, optional): Power term. Default to 1.0. eps (float, optional): The minimal value ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Parskatt/mmdetection
NormedLinear
false
927
[ "Apache-2.0" ]
0
ee4cfa29e7f479b2454b1f1355f8c05be62d8466
https://github.com/Parskatt/mmdetection/tree/ee4cfa29e7f479b2454b1f1355f8c05be62d8466
TanhGaussianPolicy
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from typing import List from ...
redvinaa/multiagent-path-finding-continuous
TanhGaussianPolicy
false
10,722
[ "MIT" ]
0
2d4ba3388f9b951c443ba72a33bd7af4f461275f
https://github.com/redvinaa/multiagent-path-finding-continuous/tree/2d4ba3388f9b951c443ba72a33bd7af4f461275f
Ternary
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
C-SUNSHINE/TOQ-Nets-PyTorch-Release
Ternary
false
17,137
[ "MIT" ]
6
05e06bf633fb3c6b610dda9a5126ecd7af1db02f
https://github.com/C-SUNSHINE/TOQ-Nets-PyTorch-Release/tree/05e06bf633fb3c6b610dda9a5126ecd7af1db02f
SDSDRLoss
import torch def apply_reduction(losses, reduction='none'): """Apply reduction to collection of losses.""" if reduction == 'mean': losses = losses.mean() elif reduction == 'sum': losses = losses.sum() return losses class SDSDRLoss(torch.nn.Module): """Scale-dependent signal-to-di...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
leoauri/auraloss
SDSDRLoss
false
15,902
[ "Apache-2.0" ]
272
0e3362674ae1b53aa61c6a631fb4e6970c5683c1
https://github.com/leoauri/auraloss/tree/0e3362674ae1b53aa61c6a631fb4e6970c5683c1
WNConv2d
import torch from torch import nn import torch.utils.data class WNConv2d(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, stride=1, padding=0, bias=True, activation=None): super().__init__() self.conv = nn.utils.weight_norm(nn.Conv2d(in_channel, out_channel, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Shivanshu-Gupta/KaoKore-VQ-VAE2
WNConv2d
false
1,093
[ "MIT" ]
0
38a88ba312dee3c0e2c1aaf02e1c1754ba19ac0c
https://github.com/Shivanshu-Gupta/KaoKore-VQ-VAE2/tree/38a88ba312dee3c0e2c1aaf02e1c1754ba19ac0c
Block
import torch import torch.nn as nn def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). This is the same as the DropConnect impl I created for EfficientNet, etc networks, however, the original name is ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Junhojuno/vision-transformer
Block
false
5,440
[ "MIT" ]
1
38f8a17967e91e98f767c8e5754081ee8bcd72b4
https://github.com/Junhojuno/vision-transformer/tree/38f8a17967e91e98f767c8e5754081ee8bcd72b4
DoubleResolutionLayer
import torch import torch.nn as nn class DoubleResolutionLayer(nn.Module): def forward(self, x): x = nn.functional.interpolate(x, scale_factor=2, mode='nearest') return x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
BeningSobariah/ark-stroller
DoubleResolutionLayer
false
11,236
[ "Apache-2.0" ]
0
af2036a1726523d5aca9b1040bfc1fad5c3420f2
https://github.com/BeningSobariah/ark-stroller/tree/af2036a1726523d5aca9b1040bfc1fad5c3420f2
Dense
import torch import numpy as np import torch.nn as nn def get_einsum_string(ndims, einsum_symbols=None): if einsum_symbols is None: einsum_symbols = ['u', 'v', 'w', 'x', 'y', 'z'] assert ndims <= len(einsum_symbols) einsum_prefix = '' for i in range(ndims): einsum_prefix += einsum_symb...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
yyht/Funnel_Transformer
Dense
false
16,781
[ "MIT" ]
193
4b35a794d5e122a8054471863a52d4eac1c39dcd
https://github.com/yyht/Funnel_Transformer/tree/4b35a794d5e122a8054471863a52d4eac1c39dcd
ClassWisePool
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
Ecocytus/Roberta-ZeroShot-Label
ClassWisePool
false
5,097
[ "MIT" ]
1
8a6d74187a0e2fd5b1b75549cfb724f54269c5a5
https://github.com/Ecocytus/Roberta-ZeroShot-Label/tree/8a6d74187a0e2fd5b1b75549cfb724f54269c5a5
PolicyBasis
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
Sha-Lab/SynPo
PolicyBasis
false
8,747
[ "MIT" ]
18
8ac35a01d2c810187b9c14b914bcb792ed73caa9
https://github.com/Sha-Lab/SynPo/tree/8ac35a01d2c810187b9c14b914bcb792ed73caa9
BasicModel4_MultiArgs
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
YNNEKUW/captum
BasicModel4_MultiArgs
false
11,983
[ "BSD-3-Clause" ]
0
c8b5357b21f2ddf440e5f0ce25635977292aa5d1
https://github.com/YNNEKUW/captum/tree/c8b5357b21f2ddf440e5f0ce25635977292aa5d1
Masked_MSE_Loss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
bg459/gan-ensembling-loader
Masked_MSE_Loss
false
14,949
[ "MIT" ]
86
5ff6fae5fd5ced0a48ef2cd3dcb1d74aa1dadce8
https://github.com/bg459/gan-ensembling-loader/tree/5ff6fae5fd5ced0a48ef2cd3dcb1d74aa1dadce8
SelfAttention
import math import torch import torch.nn as nn from torch.nn import init def weights_init(init_type='gaussian'): def init_fun(m): classname = m.__class__.__name__ if (classname.find('Conv') == 0 or classname.find('Linear') == 0 ) and hasattr(m, 'weight'): if init_type == '...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
fanyix/flownet2
SelfAttention
false
6,698
[ "Apache-2.0" ]
1
0643beef59eeaf4cf4907d0d51f486ffd713363f
https://github.com/fanyix/flownet2/tree/0643beef59eeaf4cf4907d0d51f486ffd713363f
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mingweima/hintplaygame
Attention
false
4,013
[ "MIT" ]
0
31f35a22111a2e5e7e5d8e90f92326bc784c5fe7
https://github.com/mingweima/hintplaygame/tree/31f35a22111a2e5e7e5d8e90f92326bc784c5fe7
TransformerLayer
import math import torch import uuid from torch import Tensor import torch.nn as nn from typing import Tuple import torch.nn.functional as F from typing import Optional from typing import Dict from torch.nn import Parameter def gelu(x): """Implementation of the gelu activation function. For information: Open...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
William-Zhanng/Protein_affinity
TransformerLayer
false
6,018
[ "MIT" ]
1
8abd12073b182274bf464ff23fd3be406c4e39ac
https://github.com/William-Zhanng/Protein_affinity/tree/8abd12073b182274bf464ff23fd3be406c4e39ac
WNConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
imatge-upc/pixelcoordEDL
WNConv2d
false
6,873
[ "MIT" ]
1
353632feed6ac8c93758c1a2a1b7a477e7ff053c
https://github.com/imatge-upc/pixelcoordEDL/tree/353632feed6ac8c93758c1a2a1b7a477e7ff053c
GELU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.utils.model_zoo import torch.nn.parallel import torch.optim import...
HelenR6/imagenet-r
GELU
false
13,758
[ "MIT" ]
155
0bf04f2bf5d60d1098fc9a78f4e8c042e434eb69
https://github.com/HelenR6/imagenet-r/tree/0bf04f2bf5d60d1098fc9a78f4e8c042e434eb69
Arc2
from torch.nn import Module import torch import numpy as np class Arc2(Module): def __init__(self, num_bends): super(Arc2, self).__init__() self.num_bends = num_bends self.register_buffer('range', torch.arange(0, float(num_bends))) def a(self, t): return torch.cos(np.pi * t /...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch.nn import Module import numpy as np assert_size_stride = torch...
avecplezir/dnn-mode-connectivity
Arc2
false
1,502
[ "BSD-2-Clause" ]
0
9a92ca370571f542b33060f637239172a0d08bba
https://github.com/avecplezir/dnn-mode-connectivity/tree/9a92ca370571f542b33060f637239172a0d08bba
Downsample
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.model_zoo assert_size_stride = torch._C...
KamilDeja/guided-diffusion
Downsample
false
2,448
[ "MIT" ]
0
d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837
https://github.com/KamilDeja/guided-diffusion/tree/d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837
MaskUpdate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
DLwbm123/LBAM_inpainting
MaskUpdate
false
17,192
[ "MIT" ]
7
c809c3cedf09cda7c175e930c7834ac39d8f526f
https://github.com/DLwbm123/LBAM_inpainting/tree/c809c3cedf09cda7c175e930c7834ac39d8f526f
OutputLayer
import torch import torch.nn as nn import torch.nn.functional as F def masked_softmax(logits, mask, dim=-1, log_softmax=False): """Take the softmax of `logits` over given dimension, and set entries to 0 wherever `mask` is 0. Args: logits (torch.Tensor): Inputs to the softmax function. mas...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
abhirajtiwari/QANet
OutputLayer
false
18,227
[ "MIT" ]
4
85e1db4edf0710169268a091e7d7959e524f1ceb
https://github.com/abhirajtiwari/QANet/tree/85e1db4edf0710169268a091e7d7959e524f1ceb
StochasticGate
import torch import torchvision.transforms.functional as F import torch.nn as nn import torch.nn.functional as F class StochasticGate(nn.Module): """Stochastically merges features from two levels with varying size of the receptive field """ def __init__(self): super(StochasticGate, self).__i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
candacelax/1-stage-wseg
StochasticGate
false
3,294
[ "Apache-2.0" ]
0
7a24791a3a78454e6611399ba55a808491551543
https://github.com/candacelax/1-stage-wseg/tree/7a24791a3a78454e6611399ba55a808491551543
NB
import torch class NB(torch.nn.Module): """ Yang Comment: Usage in forward: x : Ground truth mu: Prediction theta: Another trainable parameter with shape=[xdim(number of count variables)], simply initialize a nn.Parameter(torch.randn(xdim)) in the model Be careful, we need the nega...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math assert_size...
SchubertLab/mvTCR
NB
false
8,750
[ "MIT" ]
16
d815749e24650f69ef68054e0078d490af91b71d
https://github.com/SchubertLab/mvTCR/tree/d815749e24650f69ef68054e0078d490af91b71d
BlurPool2d
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import * import...
aktgpt/brevis
BlurPool2d
false
18,278
[ "MIT" ]
8
0c3dcabd241ea50cafbc2012250804e1ecb7555e
https://github.com/aktgpt/brevis/tree/0c3dcabd241ea50cafbc2012250804e1ecb7555e
MLPTanH
import torch import torch.nn as nn import torch.nn.parallel import torch.utils.data import torch.onnx import torch.optim import torch.utils.data.distributed class MLPTanH(nn.Module): def __init__(self, input_dim, hidden_dim, vocab_size): super(MLPTanH, self).__init__() self.input_dim = input_dim ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
kiathwe97/examples
MLPTanH
false
10,353
[ "BSD-3-Clause" ]
0
b4a8792023db8c50c7e9fb186bd982edd0dce3ce
https://github.com/kiathwe97/examples/tree/b4a8792023db8c50c7e9fb186bd982edd0dce3ce
MLP
import random import torch import numpy as np from torch import nn class MLP(nn.Module): def __init__(self, kernels, num_features, num_hiddens, normalize=True, num_updates=3000, batch_size=128, weight_decay=0.0001, soft_preds=False ): super().__init__() self.kernels = kernels ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
openmynet/tract
MLP
false
12,860
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
0
a9aba6edcfeacd34f781f08717ae374bfbaba80e
https://github.com/openmynet/tract/tree/a9aba6edcfeacd34f781f08717ae374bfbaba80e
Net
import torch import torch.nn.functional as F import torch.nn as nn class Net(nn.Module): def __init__(self, N_STATES, N_ACTIONS): super(Net, self).__init__() self.fc1 = nn.Linear(N_STATES, 80) self.fc1.weight.data.normal_(0, 0.1) self.fc2 = nn.Linear(80, 60) self.fc2.weigh...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
cariosr/States-Joeynmt
Net
false
9,849
[ "MIT" ]
0
6b2eb67b990b586fe2bc4fb49004d749bc4f33be
https://github.com/cariosr/States-Joeynmt/tree/6b2eb67b990b586fe2bc4fb49004d749bc4f33be
Critic
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.parallel class Critic(nn.Module): def __init__(self, state_dim, action_dim): super(Critic, self).__init__() self.l1 = nn.Linear(state_dim + action_dim, 400) self.l2 = nn.Linear(400, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
Manojbhat09/Sane-annotation-shape-complete
Critic
false
17,701
[ "Apache-2.0" ]
9
03b298b2c0a187be979ff31ad2a39238b72a6d78
https://github.com/Manojbhat09/Sane-annotation-shape-complete/tree/03b298b2c0a187be979ff31ad2a39238b72a6d78
BSConvU
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride ...
YingqiLiulll/scrips_for_SR
BSConvU
false
1,263
[ "MIT" ]
0
04fa6fdaf157e913d3e2521cd80315a10a2ccedc
https://github.com/YingqiLiulll/scrips_for_SR/tree/04fa6fdaf157e913d3e2521cd80315a10a2ccedc
NoiseInjection
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import device import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
delldu/StyleGAN2
NoiseInjection
false
6,559
[ "MIT", "BSD-2-Clause", "Apache-2.0" ]
1
4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3
https://github.com/delldu/StyleGAN2/tree/4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3
BBoxTransform
import torch from torch import nn class BBoxTransform(nn.Module): def forward(self, anchors, regression): """ decode_box_outputs adapted from https://github.com/google/automl/blob/master/efficientdet/anchors.py Args: anchors: [batchsize, boxes, (y1, x1, y2, x2)] r...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_...
awesome-amy/efficientmask
BBoxTransform
false
12,139
[ "MIT" ]
0
2456d52af92f765de771fbb6bd27fe2b9f19533b
https://github.com/awesome-amy/efficientmask/tree/2456d52af92f765de771fbb6bd27fe2b9f19533b
LossDice
import torch import torch.nn as nn class LossAbstract(nn.Module): """A named loss function, that loss functions should inherit from. Args: device (str): device key """ def __init__(self, device='cuda:0'): super().__init__() self.device = device self.name = self...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
MECLabTUDA/OOD-Gen
LossDice
false
17,628
[ "MIT" ]
5
f85ea9106ae1425f18e34c9d82fa3ca4925d8d9e
https://github.com/MECLabTUDA/OOD-Gen/tree/f85ea9106ae1425f18e34c9d82fa3ca4925d8d9e
cross_entropy_prob
import torch import torch.nn as nn import torch.nn.functional as F class cross_entropy_prob(nn.Module): def __init__(self): super(cross_entropy_prob, self).__init__() def forward(self, pred, soft_targets): pred = F.log_softmax(pred) loss = torch.mean(torch.sum(-soft_targets * pred, 1...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
zwx8981/DBCNN-Pytorch
cross_entropy_prob
false
16,830
[ "MIT" ]
150
16c3156054a30a3eabb45dffcf538f42452a14f3
https://github.com/zwx8981/DBCNN-Pytorch/tree/16c3156054a30a3eabb45dffcf538f42452a14f3
FC
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
chenxi-wang/cs420-codes
FC
false
6,435
[ "MIT" ]
1
756b71ea4f4d8c4694c8c3f32ed9d1c6e89fad15
https://github.com/chenxi-wang/cs420-codes/tree/756b71ea4f4d8c4694c8c3f32ed9d1c6e89fad15
Attention
import torch import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): def __init__(self, attn_dims): super().__init__() self.W = nn.Linear(attn_dims, attn_dims, bias=False) self.v = nn.Linear(attn_dims, 1, bias=False) def forward(self, encoder_seq_proj, query...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Dacrol/WaveRNN-server
Attention
false
11,328
[ "MIT" ]
0
5189829cec71938ff7ec2e3eb59e73af1382430a
https://github.com/Dacrol/WaveRNN-server/tree/5189829cec71938ff7ec2e3eb59e73af1382430a
pg_model
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
anthonytec2/ssp-rl-final
pg_model
false
3,122
[ "MIT" ]
0
4004678f7b820989d69824bd492307b3ed227b7a
https://github.com/anthonytec2/ssp-rl-final/tree/4004678f7b820989d69824bd492307b3ed227b7a
LayerNorm
import torch import torch.nn as nn import torch.nn import torch.onnx import torch.utils.checkpoint class LayerNorm(nn.Module): def __init__(self, hidden_size, epsilon, cast_fp16=True, formula=0): super().__init__() self.layer_norm = nn.LayerNorm(hidden_size, eps=epsilon) self.layer_norm.b...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn import torch.onnx import torch.utils.chec...
almiliMSFT/onnxruntime
LayerNorm
false
14,802
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
FC_Q
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class FC_Q(nn.Module): def __init__(self, state_dim, num_actions): super(FC_Q, self).__init__() self.q1 = nn.Linear(state_dim, 256) self.q2 = nn.Linear(256, 256) self.q3 = nn.Linear(256, num...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Thibaud-Ardoin/d4rl_evaluations
FC_Q
false
14,499
[ "Apache-2.0" ]
123
135b23d3aecc234aacaeaaa019fbc7101d9b87ec
https://github.com/Thibaud-Ardoin/d4rl_evaluations/tree/135b23d3aecc234aacaeaaa019fbc7101d9b87ec
VQVAEQuantize
import torch from torch import nn import torch.nn.functional as F from scipy.cluster.vq import kmeans2 class VQVAEQuantize(nn.Module): """ Neural Discrete Representation Learning, van den Oord et al. 2017 https://arxiv.org/abs/1711.00937 Follows the original DeepMind implementation https://github...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
crizCraig/deep-vector-quantization
VQVAEQuantize
false
15,103
[ "MIT" ]
326
c3c026a1ccea369bc892ad6dde5e6d6cd5a508a4
https://github.com/crizCraig/deep-vector-quantization/tree/c3c026a1ccea369bc892ad6dde5e6d6cd5a508a4
ATLoss
import torch import torch.nn as nn from torch.nn import functional as F class ATLoss(nn.Module): """ Module for calculating AT Loss :param norm_type (int): Norm to be used in calculating loss """ def __init__(self, norm_type=2): super(ATLoss, self).__init__() self.p = norm_type ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn from t...
PiaCuk/KD_Lib
ATLoss
false
14,184
[ "MIT" ]
360
153299d484e4c6b33793749709dbb0f33419f190
https://github.com/PiaCuk/KD_Lib/tree/153299d484e4c6b33793749709dbb0f33419f190
BertAttention
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn import torch.utils.checkpoint class BertSelfAttention(nn.Module): def __init__(self, config): super().__init__() if (config.hidden_size % config.num_attention_heads != 0 and not hasattr(config...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Hzfinfdu/Black-Box-Tuning
BertAttention
false
4,263
[ "MIT" ]
0
64eb5505875dc1b242c6f0a2a2f07e4000c24cb4
https://github.com/Hzfinfdu/Black-Box-Tuning/tree/64eb5505875dc1b242c6f0a2a2f07e4000c24cb4
ChannelGate2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
bantiitnab/kaggle-TGS-salt-identification
ChannelGate2d
false
1,520
[ "MIT" ]
0
8b3350278b2ee8f01ba2a0734af9514d369f3228
https://github.com/bantiitnab/kaggle-TGS-salt-identification/tree/8b3350278b2ee8f01ba2a0734af9514d369f3228
SnakeHyperSolver
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
Juju-botu/diffeqml-research
SnakeHyperSolver
false
13,929
[ "Apache-2.0" ]
49
aa796c87447e5299ec4f25a07fc4d032afb1f63e
https://github.com/Juju-botu/diffeqml-research/tree/aa796c87447e5299ec4f25a07fc4d032afb1f63e
DecoderBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
asmekal/catalyst
DecoderBlock
false
12,120
[ "MIT" ]
0
e11365c0a9812649ceaef14e53061cd5117d8684
https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684
SmoothL1Loss
# AOT ID: ['1_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn.functi...
es6rc/icevision
SmoothL1Loss
false
3,475
[ "Apache-2.0" ]
0
bb78dd2e1721c2edb82fb9c1a826fe301541d2a1
https://github.com/es6rc/icevision/tree/bb78dd2e1721c2edb82fb9c1a826fe301541d2a1
SymNetsCategoryLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math assert_size_stride = t...
KevinMusgrave/pytorch-adapt
SymNetsCategoryLoss
false
13,964
[ "MIT" ]
131
ff1491e1bfcc586afb8ee619712c8816ddf10358
https://github.com/KevinMusgrave/pytorch-adapt/tree/ff1491e1bfcc586afb8ee619712c8816ddf10358
PositionwiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
dqawami/openvino_training_extensions
PositionwiseFeedForward
false
15,234
[ "Apache-2.0" ]
256
dddda1dfd651eaae2d59cecda84275b1b03bd0ad
https://github.com/dqawami/openvino_training_extensions/tree/dddda1dfd651eaae2d59cecda84275b1b03bd0ad
LayerCake
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn assert_size_s...
dionhaefner/delve
LayerCake
false
15,186
[ "MIT" ]
69
811756520cbfd8dce4427c53203ac193f61a94d1
https://github.com/dionhaefner/delve/tree/811756520cbfd8dce4427c53203ac193f61a94d1
SPHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
iofthetiger/pkuad
SPHead
false
6,902
[ "Apache-2.0" ]
1
07496d108c614c84be028f344830becc9cac8fe5
https://github.com/iofthetiger/pkuad/tree/07496d108c614c84be028f344830becc9cac8fe5
down
import torch import torch.nn as nn import torch.nn.functional as F from torch.functional import F from torch.nn import functional as F class down(nn.Module): """ A class for creating neural network blocks containing layers: Average Pooling --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU Thi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
CM-BF/FeatureFlow
down
false
13,437
[ "MIT" ]
161
06642697922f17211e5faa353e24b1a0946885b1
https://github.com/CM-BF/FeatureFlow/tree/06642697922f17211e5faa353e24b1a0946885b1
FocalLoss
import torch from torch.nn import functional as F from torch import nn import torch.backends.cudnn class FocalLoss(nn.Module): def __init__(self, gamma): super().__init__() self.gamma = gamma def forward(self, input, target): if not target.size() == input.size(): raise Va...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
cxz/tgs-salt-identification-challenge
FocalLoss
false
6,516
[ "MIT" ]
1
859f3d7f2d3184532c42c34444500eec3b03b1c8
https://github.com/cxz/tgs-salt-identification-challenge/tree/859f3d7f2d3184532c42c34444500eec3b03b1c8
GraphAttention
import torch import torch.nn as nn class GraphAttention(nn.Module): def __init__(self, d_q, d_v, alpha, dropout=0.1): super(GraphAttention, self).__init__() self.dropout = nn.Dropout(dropout) self.attention = nn.Linear(d_q + d_v, 1) self.leaky_relu = nn.LeakyReLU(alpha) def f...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions
GraphAttention
false
14,716
[ "MIT" ]
62
6e5ef241c64b5b30a6ff54ddad31e610013b8388
https://github.com/YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions/tree/6e5ef241c64b5b30a6ff54ddad31e610013b8388
SmallDecoder5_16x
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
EndyWon/Texture-Reformer
SmallDecoder5_16x
false
8,163
[ "MIT" ]
11
f84f95accb3574c7b759a7f03c0b0b4e150314b5
https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5
SCNLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
ggoh29/Simplicial-neural-network-benchmark
SCNLayer
false
6,733
[ "MIT" ]
1
9a12bcd054251790d85e3971f5473dcffaa5664b
https://github.com/ggoh29/Simplicial-neural-network-benchmark/tree/9a12bcd054251790d85e3971f5473dcffaa5664b
FocalDiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
ivadomed-profile-analysis-project/ivadomed
FocalDiceLoss
false
15,656
[ "MIT" ]
87
3b53e2cb2b210511943da439401e2471fd387876
https://github.com/ivadomed-profile-analysis-project/ivadomed/tree/3b53e2cb2b210511943da439401e2471fd387876
stack_pool
import torch import torch.nn as nn class stack_pool(nn.Module): def __init__(self): super(stack_pool, self).__init__() self.pool2 = nn.MaxPool2d(2, stride=2) self.pool2s1 = nn.MaxPool2d(2, stride=1) self.pool3s1 = nn.MaxPool2d(3, stride=1, padding=1) self.padding = nn.Repl...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
ahhaa/crowdcount-stackpool
stack_pool
false
6,133
[ "MIT" ]
1
b849b72e88d5e53a9f6b5dbc93014668aee43fb4
https://github.com/ahhaa/crowdcount-stackpool/tree/b849b72e88d5e53a9f6b5dbc93014668aee43fb4
L1NormLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data assert_size_stride = torch._C._dynamo.guards.asser...
Karenou/mmfashion
L1NormLoss
false
9,463
[ "Apache-2.0" ]
0
dfc334232d1700cde18d144f983dd5b0a7f9852a
https://github.com/Karenou/mmfashion/tree/dfc334232d1700cde18d144f983dd5b0a7f9852a
AuxiliaryConvolutions
import torch from torch import nn import torch.nn.functional as F from itertools import product as product import torch.optim import torch.utils.data class AuxiliaryConvolutions(nn.Module): """ Additional convolutions to produce higher-level feature maps. """ def __init__(self): super(Auxilia...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn from ite...
mosevg/ssd
AuxiliaryConvolutions
false
10,723
[ "MIT" ]
0
8fd9f6cc376c027427531bcf475188ae43c4b2d6
https://github.com/mosevg/ssd/tree/8fd9f6cc376c027427531bcf475188ae43c4b2d6
BCEFocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch._utils as...
ilcessadecalcular/segmentation
BCEFocalLoss
false
10,583
[ "MIT" ]
0
24ba499a399efdba212ec5e2235b72ed8270cc24
https://github.com/ilcessadecalcular/segmentation/tree/24ba499a399efdba212ec5e2235b72ed8270cc24
SimpleAbsModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleAbsModule(torch.nn.Module): def __init__(self): super(SimpleAbsModule, self).__init__() def forward(self, a): return torch.abs(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
briancoutinho/glow
SimpleAbsModule
false
12,569
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
UpsamplingPixelShuffle
import torch from torch import nn from torchvision import models as models import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed from torchvision.transforms import * import torch.onnx class shuffle(nn.Module): def __init__(self, ratio): super(shuffle, sel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn from torchvision import models as models import torch.nn.pa...
aalborov/openvino_training_extensions
UpsamplingPixelShuffle
false
6,046
[ "Apache-2.0" ]
1
a0bb39424151a98e1ca80c4aa5c865636d401785
https://github.com/aalborov/openvino_training_extensions/tree/a0bb39424151a98e1ca80c4aa5c865636d401785
CapOnlyContrastiveLoss
import torch import torch.nn as nn import torch.nn.init def cosine_sim(im, s): """Cosine similarity between all the image and sentence pairs """ return im.mm(s.t()) def order_sim(im, s): """Order embeddings similarity measure $max(0, s-im)$ """ YmX = s.unsqueeze(1).expand(s.size(0), im.size(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
ExplorerFreda/VSE-C
CapOnlyContrastiveLoss
false
13,664
[ "MIT" ]
61
52d7742adfe017eacd74f36a5953ea2ace9f5fce
https://github.com/ExplorerFreda/VSE-C/tree/52d7742adfe017eacd74f36a5953ea2ace9f5fce
MyNeural
import torch import torch.nn import torch.nn.functional as Functional class MyNeural(torch.nn.Module): def __init__(self, columns): super(MyNeural, self).__init__() self.f1 = torch.nn.Linear(columns, 32) self.f2 = torch.nn.Linear(32, 16) self.f3 = torch.nn.Linear(16, 1) def f...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn assert_size_s...
med-boubekri/Covid-Fact-Checker
MyNeural
false
12,774
[ "MIT" ]
0
7869bcd830f33aefe4afeb5b75808f479e8094f2
https://github.com/med-boubekri/Covid-Fact-Checker/tree/7869bcd830f33aefe4afeb5b75808f479e8094f2
ContrastiveLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
TuBui/deep_image_comparator
ContrastiveLoss
false
1,153
[ "MIT" ]
0
2dea7738d794b91a960ee9f41461a4e3ffcd5e44
https://github.com/TuBui/deep_image_comparator/tree/2dea7738d794b91a960ee9f41461a4e3ffcd5e44
SoftmaxCELoss
from torch.nn import Module import torch from torch.nn import functional as F from torch import nn class SoftmaxCELoss(Module): def __init__(self, num_classes, num_features, dropout=0.5): super(SoftmaxCELoss, self).__init__() self.num_classes = num_classes self.num_features = num_features...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Pandinosaurus/RandPerson
SoftmaxCELoss
false
14,159
[ "Apache-2.0" ]
83
7dd503cc1d063d95b8cf6b43d40bb93452192d6d
https://github.com/Pandinosaurus/RandPerson/tree/7dd503cc1d063d95b8cf6b43d40bb93452192d6d
ProteinResNetPooler
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class ProteinResNetPooler(nn.Module): def __init__(self, config): super().__init__() self.attention_weights = nn.Linear(config.hidden_size, 1) self.dense = nn.Linear(config.hidden_size, config.hidden_size) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
StephanHeijl/tape
ProteinResNetPooler
false
4,747
[ "BSD-3-Clause" ]
0
ec631ca53217686605477cf31af4fb8846ff660f
https://github.com/StephanHeijl/tape/tree/ec631ca53217686605477cf31af4fb8846ff660f
LabelwiseAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
JamesLYC88/LibMultiLabel
LabelwiseAttention
false
9,161
[ "MIT" ]
0
042b76b3564409d916cf735ace617319009ae118
https://github.com/JamesLYC88/LibMultiLabel/tree/042b76b3564409d916cf735ace617319009ae118
MaxPool2dDynamicSamePadding
import math import torch import torch.nn as nn import torch.nn.functional as F class MaxPool2dDynamicSamePadding(nn.MaxPool2d): """2D MaxPooling like TensorFlow's 'SAME' mode, with a dynamic image size. The padding is operated in forward function by calculating dynamically. """ def __init__(self, ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
Exdenta/torchsat
MaxPool2dDynamicSamePadding
false
13,659
[ "MIT" ]
316
70ea3db758757104fb3ba618ddf7997f0f3a75b4
https://github.com/Exdenta/torchsat/tree/70ea3db758757104fb3ba618ddf7997f0f3a75b4
WeightNet_DW
import torch import torch.nn as nn import torch.nn.functional as F class WeightNet_DW(nn.Module): """ Here we show a grouping manner when we apply WeightNet to a depthwise convolution. The grouped fc layer directly generates the convolutional kernel, has fewer parameters while achieving comparable res...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Sense-GVT/BigPretrain
WeightNet_DW
false
17,938
[ "Apache-2.0" ]
8
d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e
https://github.com/Sense-GVT/BigPretrain/tree/d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e
WayPoly
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
klaudiapalasz/torchlayers
WayPoly
false
15,835
[ "MIT" ]
573
e6edd8797875325b7c0539d75a12f0d51f494127
https://github.com/klaudiapalasz/torchlayers/tree/e6edd8797875325b7c0539d75a12f0d51f494127
convBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
AlbertZhangHIT/DnCNN
convBlock
false
18,420
[ "MIT" ]
2
8530dfa6d30424a04ae32ab036fd8cc4ac12e978
https://github.com/AlbertZhangHIT/DnCNN/tree/8530dfa6d30424a04ae32ab036fd8cc4ac12e978
Encoder
import torch from torch import nn class Encoder(nn.Module): def __init__(self, input_dim, hidden_dim, output_dim): super(Encoder, self).__init__() self.lin_input_to_hidden = nn.Linear(input_dim, hidden_dim) self.lin_hidden_to_hidden = nn.Linear(hidden_dim, hidden_dim) self.lin_hid...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
abacoelho/variational-poisson-rnn
Encoder
false
18,204
[ "MIT" ]
5
abf77f79fc64be75ae9102ec8d537f77ed9c5f8f
https://github.com/abacoelho/variational-poisson-rnn/tree/abf77f79fc64be75ae9102ec8d537f77ed9c5f8f
CDCM
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
arkel23/mmgeneration
CDCM
false
9,943
[ "Apache-2.0" ]
0
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
https://github.com/arkel23/mmgeneration/tree/41a30e2972f2037f6aac60ed761bed3fe47bfe4d
KLDivergence
import torch import torch.nn as nn import torch.nn.functional as F class KLDivergence(nn.Module): """A measure of how one probability distribution Q is different from a second, reference probability distribution P. Args: tau (float): Temperature coefficient. Defaults to 1.0. reduction (st...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
ChenDirk/mmrazor
KLDivergence
false
2,088
[ "Apache-2.0" ]
0
6f262ecd777c15efd4ee2d191cdc567071615421
https://github.com/ChenDirk/mmrazor/tree/6f262ecd777c15efd4ee2d191cdc567071615421
MockOpticalFlowModel
import torch import torch.nn as nn class MockOpticalFlowModel(nn.Module): def __init__(self, img_channels): super().__init__() self.model = nn.Conv2d(img_channels * 2, 2, kernel_size=1) def forward(self, img1, img2): x = torch.cat([img1, img2], dim=-3) return self.model(x) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
neu-vig/ezflow
MockOpticalFlowModel
false
16,159
[ "MIT" ]
94
1eb6f675e72b1de6db7b35d61ca4ef0082bae890
https://github.com/neu-vig/ezflow/tree/1eb6f675e72b1de6db7b35d61ca4ef0082bae890