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
Hidden2Discrete
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint import torch.jit class Hidden2Discrete(nn.Module): def __init__(self, input_size, y_size, k_size, is_lstm=False, has_bias=True ): super(Hidden2Discrete, self).__init__() self.y_size = y_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 from torch._inductor.runtime....
RoderickGu/Pretraining_GPT
Hidden2Discrete
false
17,855
[ "Apache-2.0" ]
4
0a3ecd38116dc271e273f57490b9b45b660bf401
https://github.com/RoderickGu/Pretraining_GPT/tree/0a3ecd38116dc271e273f57490b9b45b660bf401
ConvModule
import torch import warnings import torch.nn as nn def build_norm_layer(cfg, num_features, postfix=''): """ Build normalization layer Args: cfg (dict): cfg should contain: type (str): identify norm layer type. layer args: args needed to instantiate a norm layer. re...
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 warnings import torch....
Complicateddd/Complicateddd-ROITransformer
ConvModule
false
11,309
[ "Apache-2.0" ]
0
2adfbf98892d569c460d100c6e2169c5fa3a9b82
https://github.com/Complicateddd/Complicateddd-ROITransformer/tree/2adfbf98892d569c460d100c6e2169c5fa3a9b82
Net
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(1, 16, 3, 1) self.conv2 = nn.Conv2d(16, 40, 2, 1) self.fc1 = nn.Linear(3 * 3 * 40, 400) self.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....
tkhkaeio/PyTorch-GAN
Net
false
10,882
[ "MIT" ]
0
565c67cae168a42c6822c787562a1f7a5b35a2ab
https://github.com/tkhkaeio/PyTorch-GAN/tree/565c67cae168a42c6822c787562a1f7a5b35a2ab
SiamFC
# 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 import torch.nn as nn import torch.nn.functional as F assert_size_stride = torch...
LIANGKE23/Siamese-FC-KF-CF
SiamFC
false
17,608
[ "MIT" ]
10
3d9db19c0f39f0588a5061cd182bfbfc37dca76f
https://github.com/LIANGKE23/Siamese-FC-KF-CF/tree/3d9db19c0f39f0588a5061cd182bfbfc37dca76f
Norm
# 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 torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
Hyunseung-Kim/molGCT
Norm
false
8,236
[ "Apache-2.0" ]
10
5a2604337cf0a9d3c725295ccb7c8ea4b0144636
https://github.com/Hyunseung-Kim/molGCT/tree/5a2604337cf0a9d3c725295ccb7c8ea4b0144636
Invertible1x1Conv
import torch import torch.utils.data from torch import nn class Flow(nn.Module): """ Generic class for flow functions """ def __init__(self): super().__init__() def forward(self, z): """ :param z: input variable, first dimension is batch dim :return: transformed z...
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.utils.data from torch import nn assert_size_stride = torch._C._dyna...
pkulwj1994/normalizing-flows
Invertible1x1Conv
false
16,296
[ "MIT" ]
96
326321c4aea4a3f6ab703f82e21277a79cd7d9e4
https://github.com/pkulwj1994/normalizing-flows/tree/326321c4aea4a3f6ab703f82e21277a79cd7d9e4
WorldNet
import torch class WorldNet(torch.nn.Module): def __init__(self, input_dim, hidden_dim, output_dim): super(WorldNet, self).__init__() self.fc_in = torch.nn.Linear(input_dim, hidden_dim) self.fc_1 = torch.nn.Linear(hidden_dim, hidden_dim) self.fc_2 = torch.nn.Linear(hidden_dim, 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
tim-ts-chu/mbpo
WorldNet
false
10,854
[ "MIT" ]
0
0d98e6e80499a82812d3361658e0707c0b489fc5
https://github.com/tim-ts-chu/mbpo/tree/0d98e6e80499a82812d3361658e0707c0b489fc5
SimpleReshapeModel
import torch import torch.jit import torch.onnx import torch.nn class SimpleReshapeModel(torch.nn.Module): def __init__(self, shape): super(SimpleReshapeModel, self).__init__() self.shape = shape def forward(self, tensor): combined = tensor + tensor return combined.reshape(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 import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
andreas-hommel/glow
SimpleReshapeModel
false
3,350
[ "Apache-2.0" ]
0
2bbbf8188a2a941e85677c83f2146bbd076a262e
https://github.com/andreas-hommel/glow/tree/2bbbf8188a2a941e85677c83f2146bbd076a262e
RelativeSelfAttentionLayer
# 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....
ishine/tfm-tts
RelativeSelfAttentionLayer
false
3,703
[ "MIT" ]
0
a964736467851ddec8f8e8933b9550cbe7d7d7eb
https://github.com/ishine/tfm-tts/tree/a964736467851ddec8f8e8933b9550cbe7d7d7eb
SelfGate
# 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, math as tl_math im...
awesome-archive/AI-Writer
SelfGate
false
6,276
[ "BSD-3-Clause" ]
1
abdcd5582f81fca2f677a020360654865bf82065
https://github.com/awesome-archive/AI-Writer/tree/abdcd5582f81fca2f677a020360654865bf82065
FreqUpsample
import torch from torch import Tensor from torch import nn from torch.nn import functional as F class FreqUpsample(nn.Module): def __init__(self, factor: 'int', mode='nearest'): super().__init__() self.f = float(factor) self.mode = mode def forward(self, x: 'Tensor') ->Tensor: ...
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...
Rikorose/DeepFilterNet
FreqUpsample
false
14,306
[ "ECL-2.0", "Apache-2.0", "MIT" ]
54
afe6bfb53efae70207e18df7ed372c2cfe337fee
https://github.com/Rikorose/DeepFilterNet/tree/afe6bfb53efae70207e18df7ed372c2cfe337fee
SoftMaxAvgPoolModel
import torch import torch.cuda import torch.nn import torch.utils.data import torch.fx import torch.utils.tensorboard._pytorch_graph import torch.onnx.symbolic_caffe2 class SoftMaxAvgPoolModel(torch.nn.Module): def __init__(self): super(SoftMaxAvgPoolModel, self).__init__() self.sfmax = torch.nn....
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.cuda impo...
quic-araha/aimet
SoftMaxAvgPoolModel
false
10,657
[ "BSD-3-Clause" ]
0
1afd5ce23f06bed74fec9812d5d2ea256ac4a650
https://github.com/quic-araha/aimet/tree/1afd5ce23f06bed74fec9812d5d2ea256ac4a650
ShiftedConv
# 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 import torch.nn as nn from numpy import prod assert_size_stride = to...
raphaelreme/CPC_audio
ShiftedConv
false
10,843
[ "MIT" ]
0
a2b045d5f03f4a73beaab9b481244e454edacbaa
https://github.com/raphaelreme/CPC_audio/tree/a2b045d5f03f4a73beaab9b481244e454edacbaa
PMA
import math import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def qkv_attention(queries, keys, values, presence=None): """ Transformer-like self-attention. Args: queries: Tensor of shape [B, N, d_k]. keys: Tensor of shape [B, M, d_k]. values: : Tensor...
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....
KohavTal/SCAE_Project
PMA
false
8,421
[ "Apache-2.0" ]
40
bc6d1c3697fcb9327dd96e9657c3299b47cf355e
https://github.com/KohavTal/SCAE_Project/tree/bc6d1c3697fcb9327dd96e9657c3299b47cf355e
Critic
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Critic(nn.Module): """Critic (Value) Model.""" def __init__(self, state_size, action_size, seed, ...
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 numpy as np import tor...
adriaciurana/udacity-project-3
Critic
false
9,679
[ "MIT" ]
0
806f78e35a6699eeb0a3272e326d0edc199d16be
https://github.com/adriaciurana/udacity-project-3/tree/806f78e35a6699eeb0a3272e326d0edc199d16be
NHDUnitV2
# 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_...
YiqunChen1999/NTIRE2021NHDehazing
NHDUnitV2
false
1,280
[ "MIT" ]
0
3341ae561ac8caff7f40ddf6d4408032a28ff13c
https://github.com/YiqunChen1999/NTIRE2021NHDehazing/tree/3341ae561ac8caff7f40ddf6d4408032a28ff13c
LayerNorm
# 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 torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
AntiAegis/PyTorch-GAN
LayerNorm
false
4,866
[ "MIT" ]
1
1cb951b3ad3a58b749c1802f84947b85f72c8367
https://github.com/AntiAegis/PyTorch-GAN/tree/1cb951b3ad3a58b749c1802f84947b85f72c8367
RNN_net
# 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....
CMOONCS/DeepLearning
RNN_net
false
13,439
[ "MIT" ]
86
748107d27e466bb18559b828642a4cace6431dc2
https://github.com/CMOONCS/DeepLearning/tree/748107d27e466bb18559b828642a4cace6431dc2
BasicModel_ConvNet_MaxPool1d
import torch import torch.nn as nn class BasicModel_ConvNet_MaxPool1d(nn.Module): """Same as above, but with the MaxPool2d replaced with a MaxPool1d. This is useful because the MaxPool modules behave differently to other modules from the perspective of the DeepLift Attributions """ def __init...
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....
ngduduong/captum
BasicModel_ConvNet_MaxPool1d
false
4,092
[ "BSD-3-Clause" ]
0
6fe5f0f23ea975e73e0c0dee79bdc01b4223d283
https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283
LocallyConnected
# 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...
Rishab26/causalnex
LocallyConnected
false
14,312
[ "Apache-2.0" ]
1,523
127d9324a3d68c1795299c7522f22cdea880f344
https://github.com/Rishab26/causalnex/tree/127d9324a3d68c1795299c7522f22cdea880f344
ComplexLinear
import torch from torch import nn import torch.utils class ComplexLinear(nn.Module): def __init__(self, in_features, out_features): super(ComplexLinear, self).__init__() self.fc_r = nn.Linear(in_features, out_features) self.fc_i = nn.Linear(in_features, out_features) def forward(self...
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 import torch.utils assert_size_stride = torch._C._dynamo.gu...
muqiaoy/dl_signal
ComplexLinear
false
16,123
[ "MIT" ]
54
3a30d14982016644bfc96a7d1ca0109b441f17fd
https://github.com/muqiaoy/dl_signal/tree/3a30d14982016644bfc96a7d1ca0109b441f17fd
ConvExpansion
# 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...
Jincheng-Sun/Kylearn-pytorch
ConvExpansion
false
654
[ "MIT" ]
0
e72f2ab45a3f4724e843a27bec37664d3612fdca
https://github.com/Jincheng-Sun/Kylearn-pytorch/tree/e72f2ab45a3f4724e843a27bec37664d3612fdca
Inequality
import math import torch from torch import nn class Normalize(nn.Module): def __init__(self, distribution=None, **kwargs): super().__init__() self.distribution = distribution self.data_ = [] if distribution is None: pass elif distribution == 'normal': ...
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 math from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guard...
C-SUNSHINE/TOQ-Nets-PyTorch-Release
Inequality
false
17,129
[ "MIT" ]
6
05e06bf633fb3c6b610dda9a5126ecd7af1db02f
https://github.com/C-SUNSHINE/TOQ-Nets-PyTorch-Release/tree/05e06bf633fb3c6b610dda9a5126ecd7af1db02f
GSA
import torch from torch import nn class GSAHelper(nn.Module): def __init__(self, d): super().__init__() self.d = d self.fc_k = nn.Linear(self.d, self.d) self.fc_q = nn.Linear(self.d, self.d) self.fc_kq = nn.Linear(self.d, self.d) def forward(self, k, q): m = k...
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....
VKCOM/TopicsDataset
GSA
false
5,930
[ "MIT" ]
1
149919321ba61a8f17b22f62f60f4aedec43d72b
https://github.com/VKCOM/TopicsDataset/tree/149919321ba61a8f17b22f62f60f4aedec43d72b
G_Small
import torch import torch.nn as nn class Conv2d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, bn =False, activation='leakyrelu', dropout=False): super(Conv2d, self).__init__() padding = int((kernel_size - 1) / 2) self.conv = nn.Conv2d(in_channels...
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_...
RQuispeC/pytorch-ACSCP
G_Small
false
8,762
[ "MIT" ]
25
c83f08632012c2245250ff9c5140814461db575c
https://github.com/RQuispeC/pytorch-ACSCP/tree/c83f08632012c2245250ff9c5140814461db575c
BottleneckBlock
import math import torch import torch.nn as nn import torch.utils.data import torch.nn.parallel import torch.optim import torch.utils.data.distributed def init_layer(L): if isinstance(L, nn.Conv2d): n = L.kernel_size[0] * L.kernel_size[1] * L.out_channels L.weight.data.normal_(0, math.sqrt(2.0 / 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 math import torch.nn a...
Aamer98/FeatureNorm
BottleneckBlock
false
7
[ "MIT" ]
0
fbf3d3b4cef81b3351347d272eb51b6cdd9f0cc5
https://github.com/Aamer98/FeatureNorm/tree/fbf3d3b4cef81b3351347d272eb51b6cdd9f0cc5
cnn_7layer_alt
import torch import torch.nn as nn import torch.nn.functional as F class cnn_7layer_alt(nn.Module): def __init__(self, in_ch, in_dim, width=2, linear_size=128): super(cnn_7layer_alt, self).__init__() self.conv1 = nn.Conv2d(in_ch, 4 * width, 3, stride=1, padding=1) self.conv2 = nn.Conv2d(4...
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_...
Mahoumaru/auto_LiRPA
cnn_7layer_alt
false
11,682
[ "BSD-3-Clause" ]
0
b03a6c36eb1b921726778359d6d2b94e0cd7e480
https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480
AveragedHausdorffLoss
import torch import torch.nn as nn def cdist(x, y): """ Input: x is a Nxd Tensor y is a Mxd Tensor Output: dist is a NxM matrix where dist[i,j] is the norm between x[i,:] and y[j,:] i.e. dist[i,j] = ||x[i,:]-y[j,:]|| """ differences = x.unsqueeze(1) - y.unsqueeze(0) d...
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 assert...
adriangrepo/segmentl
AveragedHausdorffLoss
false
18,264
[ "MIT" ]
5
9b520bf6cfd005eef9bba3db36ee6b3bb373b085
https://github.com/adriangrepo/segmentl/tree/9b520bf6cfd005eef9bba3db36ee6b3bb373b085
HuberLoss
import torch import torch.nn as nn class HuberLoss(nn.Module): def __init__(self): super().__init__() self.loss = nn.SmoothL1Loss() def forward(self, logits, labels): loss = self.loss(logits, labels) return loss def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch....
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 ...
hslrock/Reinforcement-Learning-Implementation
HuberLoss
false
10,171
[ "MIT" ]
0
31db7e31c92f8e01609bf51d3f8f22211ec0fd5d
https://github.com/hslrock/Reinforcement-Learning-Implementation/tree/31db7e31c92f8e01609bf51d3f8f22211ec0fd5d
PowerPropLinear
# 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....
dlpbc/powerpropagation-pytorch
PowerPropLinear
false
6,587
[ "MIT" ]
1
99e29ce25ede9330cb8f624cb1fa7ffef6f82f03
https://github.com/dlpbc/powerpropagation-pytorch/tree/99e29ce25ede9330cb8f624cb1fa7ffef6f82f03
Normalize
# 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 torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
jingraham/struct2seq
Normalize
false
15,691
[ "MIT" ]
106
22e497a2b565fe82f17e12ea37e89dcf4e50e92f
https://github.com/jingraham/struct2seq/tree/22e497a2b565fe82f17e12ea37e89dcf4e50e92f
ConLoss
import torch import torch.nn as nn import torch.nn.functional as F class ConLoss(nn.Module): def __init__(self, device, margin=2): super(ConLoss, self).__init__() self.margin = margin self.device = device def forward(self, output1, output2, label): diff = F.pairwise_distance(...
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 import...
Devanshu-singh-VR/FaceRecognition
ConLoss
false
2,157
[ "MIT" ]
0
f596d1964f4f43174ffe5bac6d6437a7d22c3593
https://github.com/Devanshu-singh-VR/FaceRecognition/tree/f596d1964f4f43174ffe5bac6d6437a7d22c3593
UnpoolAvgHealpix
import torch class UnpoolAvgHealpix(torch.nn.Module): """Healpix Average Unpooling module Parameters ---------- kernel_size : int Pooling kernel width """ def __init__(self, kernel_size, *args, **kwargs): """kernel_size should be 4, 16, 64, etc.""" 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 reinterpret...
ownzonefeng/weather_prediction
UnpoolAvgHealpix
false
7,427
[ "MIT" ]
1
723c02b6b3c0a40751d87572b66c7a4e040dec92
https://github.com/ownzonefeng/weather_prediction/tree/723c02b6b3c0a40751d87572b66c7a4e040dec92
HuberLoss
# 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 from torch import nn a...
NagisaZj/ProMP
HuberLoss
false
11,726
[ "MIT" ]
0
539739ae2b7d5fdcad00855da695f643b23df4b3
https://github.com/NagisaZj/ProMP/tree/539739ae2b7d5fdcad00855da695f643b23df4b3
Critic
import torch import torch.nn as nn import torch.nn.functional as F 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, 300) self.l3 = nn.Linear(300, 1) ...
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_...
KuangenZhang/StructuredRL
Critic
false
5,463
[ "MIT" ]
1
9b05e5034ff0e045aabf83786efb0859f08e989a
https://github.com/KuangenZhang/StructuredRL/tree/9b05e5034ff0e045aabf83786efb0859f08e989a
ChannelSpatialSELayer3D
# 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 ...
YilinLiu97/AmygNet-Pytorch
ChannelSpatialSELayer3D
false
18,147
[ "MIT" ]
3
d5bb244fd930791345d38f09870a7ded633f4622
https://github.com/YilinLiu97/AmygNet-Pytorch/tree/d5bb244fd930791345d38f09870a7ded633f4622
SelectAdaptivePool2d
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torchvision.transforms.functional as F from torch.nn import functional as F def adaptive_avgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_max = F.adaptive_max_pool2d(x, output_size...
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.functional as F import torch.utils.data import torchvision.transforms.functional as F from torch.nn im...
BigFishMaster/tnt
SelectAdaptivePool2d
false
17,482
[ "BSD-3-Clause" ]
3
8b80bb3b194eb87ac18924428ef0924c2fb263c5
https://github.com/BigFishMaster/tnt/tree/8b80bb3b194eb87ac18924428ef0924c2fb263c5
AnswerModule
import torch import torch.nn as nn import torch.nn.init as init class AnswerModule(nn.Module): def __init__(self, vocab_size, hidden_size): super(AnswerModule, self).__init__() self.z = nn.Linear(2 * hidden_size, vocab_size) init.xavier_normal_(self.z.state_dict()['weight']) self....
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.nn.init as init assert_size_stride = torch._C...
kirubarajan/Dynamic-Memory-Network-Plus
AnswerModule
false
12,674
[ "Apache-2.0" ]
0
0613287ef5a959c7b260afcea2c31afcfb0ea189
https://github.com/kirubarajan/Dynamic-Memory-Network-Plus/tree/0613287ef5a959c7b260afcea2c31afcfb0ea189
FloorDivAssign
import torch class FloorDivAssign(torch.nn.Module): def __init__(self): super(FloorDivAssign, self).__init__() def forward(self, x, y): x //= y return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), 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 from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit d...
PogChamper/torch2trt
FloorDivAssign
false
14,186
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
Softmax
# 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 math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
SaumilShah66/dqn_uav
Softmax
false
9,584
[ "MIT" ]
0
2bf780369e964b870624aebcff16c0714cad03c1
https://github.com/SaumilShah66/dqn_uav/tree/2bf780369e964b870624aebcff16c0714cad03c1
PrimaryCapsLayer
# 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 ...
shwetasrsh/MNIST-baselines
PrimaryCapsLayer
false
16,437
[ "MIT" ]
61
aa888e201a1dddda13e7b278cab8f940d57538db
https://github.com/shwetasrsh/MNIST-baselines/tree/aa888e201a1dddda13e7b278cab8f940d57538db
LayerNorm
import torch import torch.nn as nn class LayerNorm(nn.Module): def __init__(self, dim, eps=1e-05): super().__init__() self.eps = eps self.g = nn.Parameter(torch.ones(1, dim, 1, 1)) self.b = nn.Parameter(torch.zeros(1, dim, 1, 1)) def forward(self, x): std = torch.var(...
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 assert_size_stride = torch._C._dynamo.guards.assert_size_...
AlansBoyHeart/vit-pytorch
LayerNorm
false
1,920
[ "MIT" ]
0
1959adae0bdd7801475bba34d7d61bdc529b4616
https://github.com/AlansBoyHeart/vit-pytorch/tree/1959adae0bdd7801475bba34d7d61bdc529b4616
InnerProductLayer
# 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 from sklearn.metrics import * assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = tor...
Sunmyunghan/Final_Project
InnerProductLayer
false
1,221
[ "MIT" ]
0
28cde293dc6d07521b2e1c5613b20444aea91d21
https://github.com/Sunmyunghan/Final_Project/tree/28cde293dc6d07521b2e1c5613b20444aea91d21
ResNet
# 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_...
Maosef/easy-to-hard
ResNet
false
8,555
[ "MIT" ]
44
711ec0965229444a6c51b1b06a4e2cad3e32d02e
https://github.com/Maosef/easy-to-hard/tree/711ec0965229444a6c51b1b06a4e2cad3e32d02e
BlendLinear
import torch import torch.nn as nn import torch.utils.data class BlendLinear(nn.Module): def __init__(self, dim_in, dim_out, layer_type=nn.Linear, **unused_kwargs): super(BlendLinear, self).__init__() self._layer0 = layer_type(dim_in, dim_out) self._layer1 = layer_type(dim_in, dim_out) ...
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.data assert_size_stride = torch._C._dyn...
Justin-Tan/ffjord
BlendLinear
false
681
[ "MIT" ]
0
2caf8a4ff84933672fe0d94255d665b3dd7a6791
https://github.com/Justin-Tan/ffjord/tree/2caf8a4ff84933672fe0d94255d665b3dd7a6791
SFCN
# 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_...
L597383845/row-col-table-recognition
SFCN
false
17,548
[ "MIT" ]
7
617718751861b3f4e35a4b34dde4c898575e6818
https://github.com/L597383845/row-col-table-recognition/tree/617718751861b3f4e35a4b34dde4c898575e6818
ScaleNorm
import torch from torch import nn class ScaleNorm(nn.Module): def __init__(self, dim, eps=1e-05): super().__init__() self.scale = dim ** -0.5 self.eps = eps self.g = nn.Parameter(torch.ones(1)) def forward(self, x): norm = torch.norm(x, dim=-1, keepdim=True) * self.sc...
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 from torch import nn assert_...
booydar/x-transformers
ScaleNorm
false
3,233
[ "MIT" ]
0
97f0a854fdf4df8a3fbf6a580e2375463af3538c
https://github.com/booydar/x-transformers/tree/97f0a854fdf4df8a3fbf6a580e2375463af3538c
BMNLoss
# 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 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._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_ma...
Viditagarwal7479/Video-Swin-Transformer
BMNLoss
false
18,064
[ "Apache-2.0" ]
9
37910ef3141c7b2eef76544f9ec8bdf26ec94c7d
https://github.com/Viditagarwal7479/Video-Swin-Transformer/tree/37910ef3141c7b2eef76544f9ec8bdf26ec94c7d
NormedConv2d
import torch from torch import nn class NormedConv2d(nn.Conv2d): """Normalized Conv2d 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 of divisor to keep ...
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...
Bo396543018/mmdetection
NormedConv2d
false
7,794
[ "Apache-2.0" ]
16
eb337336d3c239dc1d20534496f69df41ae9a300
https://github.com/Bo396543018/mmdetection/tree/eb337336d3c239dc1d20534496f69df41ae9a300
T5LayerNorm
import torch import torch.nn as nn import torch.utils.checkpoint class T5LayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-06): """ Construct a layernorm module in the T5 style No bias and no subtraction of mean. """ super().__init__() self.weight = nn.Parameter...
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.utils.checkpoint assert_size_stride = torch....
Hzfinfdu/Black-Box-Tuning
T5LayerNorm
false
2,458
[ "MIT" ]
0
64eb5505875dc1b242c6f0a2a2f07e4000c24cb4
https://github.com/Hzfinfdu/Black-Box-Tuning/tree/64eb5505875dc1b242c6f0a2a2f07e4000c24cb4
RGBBlock
import torch from torch import nn import torch.nn.functional as F class Conv2DMod(nn.Module): def __init__(self, in_chan, out_chan, kernel, demod=True, stride=1, dilation=1, **kwargs): super().__init__() self.filters = out_chan self.demod = demod self.kernel = kernel ...
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...
mahmoudnafifi/HistoGAN
RGBBlock
false
15,997
[ "MIT" ]
169
50be1482638ace3ec85d733e849dec494ede155b
https://github.com/mahmoudnafifi/HistoGAN/tree/50be1482638ace3ec85d733e849dec494ede155b
GatedConv1d
import torch import torch.nn as nn class MaskedConv1d(nn.Conv1d): def __init__(self, in_channels, out_channels, kernel_size, dilation=1, groups=1, bias=True, causal=True): if causal: padding = (kernel_size - 1) * dilation else: padding = (kernel_size - 1) * dilatio...
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...
lonePatient/TorchBlocks
GatedConv1d
false
15,963
[ "MIT" ]
82
4a65d746cc8a396cb7df73ed4644d97ddf843e29
https://github.com/lonePatient/TorchBlocks/tree/4a65d746cc8a396cb7df73ed4644d97ddf843e29
MultiHeadedAttention
import math import torch from typing import Optional from typing import Tuple from torch import nn class MultiHeadedAttention(nn.Module): """Multi-Head Attention layer. Args: n_head (int): The number of heads. n_feat (int): The number of features. dropout_rate (float): Dropout rate. ...
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....
Mashiro083/wenet-onnx
MultiHeadedAttention
false
8,532
[ "Apache-2.0" ]
18
ae8f8451d73fa9ceac6f7738194543e83959ca86
https://github.com/Mashiro083/wenet-onnx/tree/ae8f8451d73fa9ceac6f7738194543e83959ca86
Highway
# 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 import nn assert_s...
abhinonymous/MSMARCO-Question-Answering
Highway
false
14,746
[ "MIT" ]
127
bfdd802d20b63322adca23f1da1f6a5931593920
https://github.com/abhinonymous/MSMARCO-Question-Answering/tree/bfdd802d20b63322adca23f1da1f6a5931593920
FocalLoss
import torch import torch.nn as nn import torch.nn.functional as F class FocalLoss(nn.Module): def __init__(self, alpha: 'float'=0.25, gamma: 'float'=2, reduction: 'str'='none'): """ Original implementation from https://github.com/facebookresearch/fvcore/blob/master/fvcore/nn/focal_loss.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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
VisualJoyce/ChengyuBERT
FocalLoss
false
18,063
[ "MIT" ]
8
605db3a4b3241dd4d02baa41a68bf23b5b00b36d
https://github.com/VisualJoyce/ChengyuBERT/tree/605db3a4b3241dd4d02baa41a68bf23b5b00b36d
GCNLayer
import torch import torch.nn as nn class GCNLayer(nn.Module): def __init__(self, c_in, c_out): super().__init__() self.projection = nn.Linear(c_in, c_out) def forward(self, node_feats, adj_matrix): """ Args: node_feats: Tensor with node features of shape [batch_si...
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...
jiwidi/lightning-tutorials
GCNLayer
false
15,703
[ "Apache-2.0" ]
114
70ba437447f345d4d6ba089d5b30fd1da2cbc04b
https://github.com/jiwidi/lightning-tutorials/tree/70ba437447f345d4d6ba089d5b30fd1da2cbc04b
OptimizedMLP
import torch import torch.optim import torch.jit import torch.nn as nn class OptimizedMLP(nn.Module): def __init__(self, num_in_features: 'int', num_out_features: 'int'): super(OptimizedMLP, self).__init__() self.act = nn.ELU() self.l_in = nn.Linear(in_features=num_in_features, out_featur...
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.optim ...
plaveczlambert/deep_euler_tests
OptimizedMLP
false
7,501
[ "MIT" ]
1
a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a
https://github.com/plaveczlambert/deep_euler_tests/tree/a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a
RNN
# 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....
jrbtaylor/recurrent_pytorch
RNN
false
10,326
[ "Apache-2.0" ]
0
09ee203a86b70a32aec3e97d7daa646caf8fd182
https://github.com/jrbtaylor/recurrent_pytorch/tree/09ee203a86b70a32aec3e97d7daa646caf8fd182
GramMatrix
import torch import torch.nn as nn import torch.utils.data class GramMatrix(nn.Module): def forward(self, input): b, c, h, w = input.size() F = input.view(b, c, h * w) G = torch.bmm(F, F.transpose(1, 2)) G.div_(h * w) return G def get_inputs(): return [torch.rand([4,...
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.data assert_size_stride = torch._C._dyn...
Reytuag/non-stationary_texture_syn
GramMatrix
false
14,295
[ "MIT" ]
351
005d3e4ead3dfa2164b14c5b3bf41cdc15fd3b0b
https://github.com/Reytuag/non-stationary_texture_syn/tree/005d3e4ead3dfa2164b14c5b3bf41cdc15fd3b0b
BertLayer
# 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....
brendon-boldt/minbert-assignment
BertLayer
false
12,274
[ "Apache-2.0" ]
0
0b562d791d34a40fd3c0383a0a32b4eeb2171cb5
https://github.com/brendon-boldt/minbert-assignment/tree/0b562d791d34a40fd3c0383a0a32b4eeb2171cb5
CPAMDec
from torch.nn import Module import torch from torchvision.datasets import * from torch.nn import Conv2d from torch.nn import Parameter from torch.nn import Linear from torch.nn import Softmax from torchvision.transforms import * class CPAMDec(Module): """ CPAM decoding module """ def __init__(self, i...
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....
ruijieren98/DANet
CPAMDec
false
16,348
[ "MIT" ]
2,190
e38d61e371179833c08888fd5a1ee444cf5bd875
https://github.com/ruijieren98/DANet/tree/e38d61e371179833c08888fd5a1ee444cf5bd875
ConvSig
import math import torch import torch.nn.functional as F from torch.nn import Conv2d from torch.nn import Sigmoid class PadSameConv2d(torch.nn.Module): def __init__(self, kernel_size, stride=1): """ Imitates padding_mode="same" from tensorflow. :param kernel_size: Kernelsize of the convol...
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 import torch.nn.functional as F from torch.nn import Conv2d from tor...
shlomi-amitai/monorec
ConvSig
false
10,908
[ "MIT" ]
0
74571c6cd8d06ae4fb15cbee5a41147c54c78556
https://github.com/shlomi-amitai/monorec/tree/74571c6cd8d06ae4fb15cbee5a41147c54c78556
HardNegativeContrastiveLoss
import torch import torch.nn as nn class HardNegativeContrastiveLoss(nn.Module): def __init__(self, nmax=1, margin=0.2): super(HardNegativeContrastiveLoss, self).__init__() self.margin = margin self.nmax = nmax def forward(self, imgs, caps): scores = torch.mm(imgs, caps.t()) ...
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_...
maxgreat/dsve-loc
HardNegativeContrastiveLoss
false
16,047
[ "BSD-3-Clause-Clear" ]
56
dd6807d02c0d5fd3e215be8e5c7a88e73102e561
https://github.com/maxgreat/dsve-loc/tree/dd6807d02c0d5fd3e215be8e5c7a88e73102e561
Benefit3
import torch import torch.nn as nn class Benefit3(nn.Module): def __init__(self): super(Benefit3, self).__init__() self.delta = torch.nn.Parameter(torch.FloatTensor([0.03]), requires_grad=True) def forward(self, I, A, B): self.Y = I * self.delta + A * self.delta ** 2 + 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
DingLyu/Investigating-and-Modeling-the-Dynamics-of-Long-Ties
Benefit3
false
11,348
[ "MIT" ]
0
aa37c3d5c85a8d1696db3dda7dcb22782b737d17
https://github.com/DingLyu/Investigating-and-Modeling-the-Dynamics-of-Long-Ties/tree/aa37c3d5c85a8d1696db3dda7dcb22782b737d17
Attention
import math import torch from torch import nn import torch.nn.functional as F class Attention(nn.Module): def __init__(self, hidden_size): super(Attention, self).__init__() self.hidden_size = hidden_size self.attn = nn.Linear(self.hidden_size * 2, hidden_size) self.v = nn.Paramete...
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....
AmitMY/seq2seq
Attention
false
8,837
[ "MIT" ]
0
1ad7c09188537729e5b18356f5c36fad1928d245
https://github.com/AmitMY/seq2seq/tree/1ad7c09188537729e5b18356f5c36fad1928d245
Split
import torch import torch.nn as nn class Split(nn.Module): def __init__(self): super(Split, self).__init__() def forward(self, x): n = int(x.size(1) / 2) x1 = x[:, :n, :, :].contiguous() x2 = x[:, n:, :, :].contiguous() return x1, x2 def inverse(self, x1, x2): ...
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...
lingzenan/invertible-resnet
Split
false
7,090
[ "MIT" ]
1
57b1c0de51a885aed074b77628f3b0c85c548e70
https://github.com/lingzenan/invertible-resnet/tree/57b1c0de51a885aed074b77628f3b0c85c548e70
ResidualBlock_noBN
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init def initialize_weights(net_l, scale=1): if not isinstance(net_l, list): net_l = [net_l] for net in net_l: for m in net.modules(): if isinstance(m, nn.Conv2d): init.kaimin...
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 ...
juyongjiang/Simple-SR
ResidualBlock_noBN
false
7,009
[ "MIT" ]
1
76820511abc04fbe6e4a79d23c67aee97406d563
https://github.com/juyongjiang/Simple-SR/tree/76820511abc04fbe6e4a79d23c67aee97406d563
LabelSmoothingCrossEntropy
import torch from torch import nn class LabelSmoothingCrossEntropy(nn.Module): def __init__(self, eps=0.1, reduction='mean', ignore_index=-100): """LabelSmoothingCrossEntropy, no-softmax-input 对logits进行smoothing, 即log_softmax后进行操作 args: ignore_index: (int, optional): Specifies...
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 ...
dumpmemory/Pytorch-NLU
LabelSmoothingCrossEntropy
false
15,252
[ "Apache-2.0" ]
115
864fb9acc7751fc51abd3d05d24b5a9a7eab7110
https://github.com/dumpmemory/Pytorch-NLU/tree/864fb9acc7751fc51abd3d05d24b5a9a7eab7110
FastRCNNPredictor
import torch from torch import nn import torch.nn.functional as F import torch.utils.data from torchvision.transforms import functional as F class FastRCNNPredictor(nn.Module): """ Standard classification + bounding box regression layers for Fast R-CNN. Arguments: in_channels (int): number of...
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 import torch.utils.data assert_size_stride = torch._C._dyna...
CancerDataScience/NuCLS
FastRCNNPredictor
false
17,390
[ "MIT" ]
7
c172b55b18d4ea78c3f51a8fd28ee6c2595c8360
https://github.com/CancerDataScience/NuCLS/tree/c172b55b18d4ea78c3f51a8fd28ee6c2595c8360
SpatialAttention2d
# 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 assert_size_stride = torch._C._dynamo....
elmajdma/seismic-deeplearning
SpatialAttention2d
false
15,298
[ "MIT" ]
270
bc084abe153509c40b45f8bf0f80dfda1049d7dc
https://github.com/elmajdma/seismic-deeplearning/tree/bc084abe153509c40b45f8bf0f80dfda1049d7dc
SoftTarget
import torch import torch.nn.functional as F import torch.nn as nn import torch._utils from itertools import product as product import torch.utils.data.distributed class SoftTarget(nn.Module): """ Distilling the Knowledge in a Neural Network https://arxiv.org/pdf/1503.02531.pdf """ def __init__(self, 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 import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
wangxianliang/FaceX-Zoo
SoftTarget
false
13,088
[ "Apache-2.0" ]
0
b0555c88a0350fa7b59c317f3a171f551fef4e6e
https://github.com/wangxianliang/FaceX-Zoo/tree/b0555c88a0350fa7b59c317f3a171f551fef4e6e
NasPathBranch
import torch import torch.utils.data import torch.nn as nn def conv1x1(in_channels, out_channels, stride=1, groups=1, bias=False): """ Convolution 1x1 layer. Parameters: ---------- in_channels : int Number of input channels. out_channels : int Number of output channels. st...
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.utils.data import torch.nn as nn assert_size_stride = torch._C._dyn...
HyperGAN/imgclsmob
NasPathBranch
false
17,685
[ "MIT" ]
9
88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3
https://github.com/HyperGAN/imgclsmob/tree/88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3
RegLoss
# 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.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
BELIEVEfxy/LightSANs
RegLoss
false
7,772
[ "MIT" ]
17
94ce7e59d144dbc787153b8c486cad334790ec6e
https://github.com/BELIEVEfxy/LightSANs/tree/94ce7e59d144dbc787153b8c486cad334790ec6e
Connect2Model
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F class Connect2Model(nn.Module): def __init__(self, board_size, action_size, device): super(Connect2Model, self).__init__() self.device = device self.size = board_size self.action_size = action_si...
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....
ShokuninSan/AlphaZeroSimple
Connect2Model
false
1,074
[ "MIT" ]
0
e32e6a28f872a046705a3f68882139688d5a43c3
https://github.com/ShokuninSan/AlphaZeroSimple/tree/e32e6a28f872a046705a3f68882139688d5a43c3
Normalize
import torch from torchvision.datasets import * import torch.nn as nn import torch.nn.functional as F from torchvision.transforms import * class Normalize(nn.Module): """Performs :math:`L_p` normalization of inputs over specified dimension. Does: .. math:: v = \\frac{v}{\\max(\\lVert v \\rVert_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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torchvision.datasets im...
tousifulhaque/DANet
Normalize
false
4,457
[ "MIT" ]
0
1a0c91f0e551a071b5e335b4157313780a8a1b1a
https://github.com/tousifulhaque/DANet/tree/1a0c91f0e551a071b5e335b4157313780a8a1b1a
layer_2_to_1
# 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...
HyTruongSon/InvariantGraphNetworks-PyTorch
layer_2_to_1
false
17,413
[ "Apache-2.0" ]
7
da9fdaa4f858d6fcae14b08a59d4b172a2aabaf8
https://github.com/HyTruongSon/InvariantGraphNetworks-PyTorch/tree/da9fdaa4f858d6fcae14b08a59d4b172a2aabaf8
ContextGate
# 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.cuda import torch.distributed assert_size_str...
ChenRocks/Distill-BERT-Textgen-ONMT
ContextGate
false
17,100
[ "MIT" ]
7
d83dd1a95af7513cbfae4a2768f6effc2f3a589f
https://github.com/ChenRocks/Distill-BERT-Textgen-ONMT/tree/d83dd1a95af7513cbfae4a2768f6effc2f3a589f
ModuloMapIDList
# 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 abc import torch.nn import torch.optim assert_size_stride = torch._C._dy...
BerenLuthien/ReAgent
ModuloMapIDList
false
13,387
[ "BSD-3-Clause" ]
1,156
52f666670a7fa03206812ef48949f6b934d400f7
https://github.com/BerenLuthien/ReAgent/tree/52f666670a7fa03206812ef48949f6b934d400f7
AttDot
# 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._inductor.runtime....
ishine/NISQA
AttDot
false
15,615
[ "MIT" ]
223
2c8917f30c4e4bbca3a48e9852301f1e2480a741
https://github.com/ishine/NISQA/tree/2c8917f30c4e4bbca3a48e9852301f1e2480a741
Net
import torch import torch.nn as nn class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(3, 3, kernel_size=7, stride=1, bias=False, padding=3) self.conv2 = nn.Conv2d(3, 3, kernel_size=7, stride=1, bias=False, padding=3) ...
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...
alirezadavoudi/tensorflow-vs-pytorch
Net
false
18,277
[ "MIT" ]
4
1c0ccda8004591f3f29d4787d7b3bbfbc397523f
https://github.com/alirezadavoudi/tensorflow-vs-pytorch/tree/1c0ccda8004591f3f29d4787d7b3bbfbc397523f
FocalLossV1
# 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 libdevice, math as tl_math import torc...
chizhu/pytorch-loss
FocalLossV1
false
6,439
[ "MIT" ]
1
c8fbd78771f11a910b0b51ae3697c09761dd9696
https://github.com/chizhu/pytorch-loss/tree/c8fbd78771f11a910b0b51ae3697c09761dd9696
Pooler
# 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 ...
ExtremeViscent/ColossalAI-Examples
Pooler
false
2,658
[ "Apache-2.0" ]
0
98ced2435d8d814f06740ab10d3e277ca91a83c7
https://github.com/ExtremeViscent/ColossalAI-Examples/tree/98ced2435d8d814f06740ab10d3e277ca91a83c7
L2Norm
import torch import torch.nn as nn from itertools import product as product import torch.nn.init as init class L2Norm(nn.Module): def __init__(self, n_channels, scale): super(L2Norm, self).__init__() self.n_channels = n_channels self.gamma = scale or None self.eps = 1e-10 ...
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 from itertools import product as product import torch.nn....
AnupKumarGupta/syncnet_python
L2Norm
false
11,249
[ "MIT" ]
0
932b4621cf6aa090baac7c7de22d0649bde9fbbd
https://github.com/AnupKumarGupta/syncnet_python/tree/932b4621cf6aa090baac7c7de22d0649bde9fbbd
SingleGate
import torch import torch.multiprocessing from torch import nn import torch.utils.data class SingleGate(nn.Module): def __init__(self, vector_dim, topic_dim): super().__init__() assert vector_dim == topic_dim self.fusion_linear = nn.Linear(vector_dim + topic_dim, 1) self.sigmoid =...
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.multiprocessing from torch import nn import torch.utils.data assert...
WuDiDaBinGe/TAKG
SingleGate
false
1,238
[ "MIT" ]
0
83e608e677a4ee74722d18cb5ef430f4f6c6ad31
https://github.com/WuDiDaBinGe/TAKG/tree/83e608e677a4ee74722d18cb5ef430f4f6c6ad31
LayerNorm
import torch import torch.nn as nn import torch.optim import torch.autograd import torch.nn import torch.nn.init class LayerNorm(nn.Module): def __init__(self, dim, mean=0.0, std=1.0, fixed=False, eps=1e-06, ball =False): super(LayerNorm, self).__init__() self.eps = eps self.ball ...
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.optim import torch.autograd import torch.nn ...
FilippoC/-deep-syntactic-dependency-parsing-release
LayerNorm
false
17,280
[ "MIT" ]
4
30e2571ea930c2fd81559f5a2a971e3738cc6d39
https://github.com/FilippoC/-deep-syntactic-dependency-parsing-release/tree/30e2571ea930c2fd81559f5a2a971e3738cc6d39
Hsigmoid
# 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...
IgorDavidyuk/pytorch-mobilenet-v3
Hsigmoid
false
2,359
[ "Apache-2.0" ]
0
48678f80d9390b530cb97966db492cf01d1c4a43
https://github.com/IgorDavidyuk/pytorch-mobilenet-v3/tree/48678f80d9390b530cb97966db492cf01d1c4a43
SpatialSoftmax
import torch import torch.utils.data import torch.random import torch.nn.functional as F def marginal_softmax(heatmap, dim): marginal = torch.mean(heatmap, dim=dim) sm = F.softmax(marginal, dim=2) return sm def prob_to_keypoints(prob, length): ruler = torch.linspace(0, 1, length).type_as(prob).expan...
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.dat...
DuaneNielsen/keypoints
SpatialSoftmax
false
8,032
[ "MIT" ]
42
302fa02966d4372ac9b5aaa3d8dc24684be0b252
https://github.com/DuaneNielsen/keypoints/tree/302fa02966d4372ac9b5aaa3d8dc24684be0b252
ACNetwork
import torch import torch.nn as nn class ACNetwork(nn.Module): def __init__(self, num_actions, num_states): super(ACNetwork, self).__init__() self.fc1 = nn.Linear(num_states, 1024) self.fc2 = nn.Linear(1024, 512) self.action = nn.Linear(512, num_actions) self.softmax = nn....
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....
Devanshu-singh-VR/Reinforcement-Learning_Mixed
ACNetwork
false
9,040
[ "MIT" ]
0
6b8b23977864f918ab8958b729d0faabcca720e4
https://github.com/Devanshu-singh-VR/Reinforcement-Learning_Mixed/tree/6b8b23977864f918ab8958b729d0faabcca720e4
ShallowNet
import torch import torch.nn as nn class ShallowNet(nn.Module): def __init__(self, n_features): super(ShallowNet, self).__init__() self.a1 = nn.Linear(n_features, 2) def forward(self, x): return torch.sigmoid(self.a1(x)) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def...
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...
SkBlaz/KBNR
ShallowNet
false
5,830
[ "MIT" ]
1
4c37fe3fdfa7719572affd617e2dab43a54ba1d5
https://github.com/SkBlaz/KBNR/tree/4c37fe3fdfa7719572affd617e2dab43a54ba1d5
AttentionModule
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class AttentionModule(nn.Module): def __init__(self, dim): super().__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) self.conv2 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) ...
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 ...
SpyrosMouselinos/DeltaFormers
AttentionModule
false
5,851
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
JointsMSELoss
import torch import torch.nn as nn import torch.utils.data class JointsMSELoss(nn.Module): def __init__(self): super(JointsMSELoss, self).__init__() self.criterion = nn.MSELoss(reduction='mean') def forward(self, output, target, target_weight=None): batch_size = output.size(0) ...
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.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
shunya-toyokawa/qanet_human_parts_segmentatiom
JointsMSELoss
false
16,433
[ "MIT" ]
72
5527b247acd65534b455c26e3692a14b31669602
https://github.com/shunya-toyokawa/qanet_human_parts_segmentatiom/tree/5527b247acd65534b455c26e3692a14b31669602
PredictTargets
# 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 from torch import n...
dmcinerney/ehr-extraction-models
PredictTargets
false
6,589
[ "Apache-2.0" ]
1
c7e7e176f69a2558d420c607254ed7e98b5e836a
https://github.com/dmcinerney/ehr-extraction-models/tree/c7e7e176f69a2558d420c607254ed7e98b5e836a
TokenEmbedding
import torch import torch.nn as nn class TokenEmbedding(nn.Module): def __init__(self, c_in, d_model): super(TokenEmbedding, self).__init__() padding = 1 if torch.__version__ >= '1.5.0' else 2 self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_model, kernel_size=3, pa...
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...
Ares-Long/Time
TokenEmbedding
false
11,285
[ "Apache-2.0" ]
0
7827463613f45baea82de189a890afb7394e73e4
https://github.com/Ares-Long/Time/tree/7827463613f45baea82de189a890afb7394e73e4
decoder5
# 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....
MingSun-Tse/PytorchWCT
decoder5
false
9,390
[ "MIT" ]
0
9d11cc0995c0610c129b78ff5f72a26f4d60e10a
https://github.com/MingSun-Tse/PytorchWCT/tree/9d11cc0995c0610c129b78ff5f72a26f4d60e10a
Model
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_inputs, num_outputs, hidden_size=256): super(Model, self).__init__() self.linear1 = nn.Linear(num_inputs, hidden_size) self.linear2 = nn.Linear(hidden_size, num_outputs) ...
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_...
PacktPublishing/Hands-On-Reinforcement-Learning-for-Games
Model
false
8,650
[ "MIT" ]
41
045b8846f2558aa8fb8ac8cef5c71ee098cb9b22
https://github.com/PacktPublishing/Hands-On-Reinforcement-Learning-for-Games/tree/045b8846f2558aa8fb8ac8cef5c71ee098cb9b22
TripletLogExpLoss
# 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, math as tl_math import numpy as np import torch.nn as nn assert_size_stride = ...
zhangxue123/deep-image-retrieval
TripletLogExpLoss
false
13,170
[ "BSD-3-Clause" ]
0
ac188856fa5a034aed3f7ed3fb617d580da44462
https://github.com/zhangxue123/deep-image-retrieval/tree/ac188856fa5a034aed3f7ed3fb617d580da44462
ConvolModel
import torch import torch.nn as nn import torch.nn.functional as F class ConvolModel(nn.Module): def __init__(self): super(ConvolModel, self).__init__() self.conv1 = nn.Conv2d(1, 5, 2) self.conv2 = nn.Conv2d(5, 10, 2) self.conv3 = nn.Conv2d(10, 10, 2) def forward(self, 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 from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
VVKot/mlinseconds-vote-prediction
ConvolModel
false
2,943
[ "MIT" ]
0
c869ae428fb8d5e83f0a47468722da968aed28c6
https://github.com/VVKot/mlinseconds-vote-prediction/tree/c869ae428fb8d5e83f0a47468722da968aed28c6
Linear
# 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 from torch.nn.parameter import Parameter assert_size_strid...
THAKAORI/SalsaNext
Linear
false
11,916
[ "MIT" ]
0
855cd7e9ebb83ee62538ba4753a011ada7bbfb6c
https://github.com/THAKAORI/SalsaNext/tree/855cd7e9ebb83ee62538ba4753a011ada7bbfb6c
TripletLoss
# 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 libdevice from torch import nn assert_...
CV-ZMH/human-action-recognition
TripletLoss
false
7,886
[ "MIT" ]
36
009bd1da71c087c3071173b325e34ed342599581
https://github.com/CV-ZMH/human-action-recognition/tree/009bd1da71c087c3071173b325e34ed342599581
LayerNorm
# 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
IBM/context-relevant-pruning-textrl
LayerNorm
false
17,405
[ "Apache-2.0" ]
8
c8630203af5df64c8e1e3c4624e4a158b40a5f27
https://github.com/IBM/context-relevant-pruning-textrl/tree/c8630203af5df64c8e1e3c4624e4a158b40a5f27