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
MiniBatchStdDev
import torch import torch.nn as nn class MiniBatchStdDev(nn.Module): """Layer that appends to every element of a batch a new ftr map containing the std of its group.""" def __init__(self, group_sz=4, unbiased_std=False): super().__init__() self.group_sz = group_sz self.unbiased_std = ...
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_...
davidleonfdez/face2anime
MiniBatchStdDev
false
1,805
[ "MIT" ]
0
896bf85a7aa28322cc9e9e586685db8cbbf39d89
https://github.com/davidleonfdez/face2anime/tree/896bf85a7aa28322cc9e9e586685db8cbbf39d89
TensorProba
import torch class TensorProba(torch.nn.Module): def __init__(self, dim=1): self.dim = dim super().__init__() def forward(self, input): total = torch.sum(input, dim=self.dim, keepdim=True) return input / total def get_inputs(): return [torch.rand([4, 4, 4, 4])] def ge...
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...
Minyus/pipelinex
TensorProba
false
14,052
[ "Apache-2.0" ]
188
f35c524ec9c50751ee27d9a42d98317e16f1c544
https://github.com/Minyus/pipelinex/tree/f35c524ec9c50751ee27d9a42d98317e16f1c544
ada_mask
# 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 ...
NJUVISION/AWnet
ada_mask
false
8,659
[ "MIT" ]
16
f47a1692819a778b513b882d36ed727f7732d37b
https://github.com/NJUVISION/AWnet/tree/f47a1692819a778b513b882d36ed727f7732d37b
AttLuong
import torch import torch.nn as nn import torch.nn.functional as F class AttLuong(torch.nn.Module): """ AttLuong: Attention according to Luong that can be used by the Alignment module. """ def __init__(self, q_dim, y_dim, softmax=True): super().__init__() self.q_dim = q_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 import triton_helpers from torch._inductor.runtime....
ishine/NISQA
AttLuong
false
15,639
[ "MIT" ]
223
2c8917f30c4e4bbca3a48e9852301f1e2480a741
https://github.com/ishine/NISQA/tree/2c8917f30c4e4bbca3a48e9852301f1e2480a741
EqualLinear
from torch.autograd import Function import math import torch from torch.nn import functional as F from torch import nn def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5): return FusedLeakyReLUFunction.apply(input, bias, negative_slope, scale) class FusedLeakyReLUFunctionBackward(Function): ...
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.autograd import Function import math from torch import nn assert_size...
BillyXYB/TransEditor
EqualLinear
false
17,068
[ "MIT" ]
4
0194cd6f0e96c801d55c0cb9683e1f552bcf6d48
https://github.com/BillyXYB/TransEditor/tree/0194cd6f0e96c801d55c0cb9683e1f552bcf6d48
Mfm
# 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_...
githubhjx/Deep-Learning-
Mfm
false
12,447
[ "Apache-2.0" ]
0
5a22fb5696d930ed334aa1cbf2b213956b1c7026
https://github.com/githubhjx/Deep-Learning-/tree/5a22fb5696d930ed334aa1cbf2b213956b1c7026
GlobalAvgPool
# 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...
Fork-for-Modify/VideoFeatureExtractor
GlobalAvgPool
false
8,101
[ "Apache-2.0" ]
15
a73bb5a575a318c2d71bc8dd2432c8941c35a77f
https://github.com/Fork-for-Modify/VideoFeatureExtractor/tree/a73bb5a575a318c2d71bc8dd2432c8941c35a77f
Multi_Head_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.triton_helpers import libdevice, math as tl_math im...
Moon-xm/Chinese-Text-Classification-Pytorch
Multi_Head_Attention
false
11,725
[ "MIT" ]
0
19fe64006418bf4296f884e4d1f038c17b34d3de
https://github.com/Moon-xm/Chinese-Text-Classification-Pytorch/tree/19fe64006418bf4296f884e4d1f038c17b34d3de
LearnMaskedDefault
import torch import torch.nn as nn import torch.utils.data import torch.nn class LearnMaskedDefault(nn.Module): """ Learns default values to fill invalid entries within input tensors. The invalid entries are represented by a mask which is passed into forward alongside the input tensor. Note the defaul...
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.utils.data import torch.nn assert_size_stride = torch....
kevinmtian/pytorchvideo
LearnMaskedDefault
false
15,824
[ "Apache-2.0" ]
2,391
168e16859a6029ef8ebeb476f9163bebb6c6b87d
https://github.com/kevinmtian/pytorchvideo/tree/168e16859a6029ef8ebeb476f9163bebb6c6b87d
ReduceMax
# 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.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.asse...
mil-tokyo/webdnn
ReduceMax
false
16,083
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
LeNet300
import torch from torch import nn class LeNet300(nn.Module): def __init__(self): super(LeNet300, self).__init__() self.fc1 = nn.Linear(784, 300, bias=True) self.r1 = nn.ReLU() self.fc2 = nn.Linear(300, 100, bias=True) self.r2 = nn.ReLU() self.fc3 = nn.Linear(100, 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 from torch import nn assert_s...
EIDOSlab/pruning-validation
LeNet300
false
2,176
[ "BSD-3-Clause" ]
0
bd8e83cf6f564def0e193a4be0f753c768fe9e75
https://github.com/EIDOSlab/pruning-validation/tree/bd8e83cf6f564def0e193a4be0f753c768fe9e75
ResBlk
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data def normalize(x, eps=1e-10): return x * torch.rsqrt(torch.sum(x ** 2, dim=1, keepdim=True) + eps) class ResBlk(nn.Module): def __init__(self, dim_in, dim_out, actv=nn.LeakyReLU(0.2), normalize= Fa...
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 import torch.utils.data as...
Noodles-321/RegistrationEval
ResBlk
false
8,651
[ "MIT" ]
38
3631d3d5bd65acf980fcfed803fa6125970f3e88
https://github.com/Noodles-321/RegistrationEval/tree/3631d3d5bd65acf980fcfed803fa6125970f3e88
LinearModel
import torch from torch import nn class LinearModel(nn.Module): def __init__(self, context_points: 'int'): super().__init__() self.window = context_points self.linear = nn.Linear(context_points, 1) def forward(self, y_c): _bs, _length, d_y = y_c.shape inp = y_c[:, -se...
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 assert_size_stride = torch._C._dynamo.guards.assert_size_st...
Piki1989/spacetimeformer
LinearModel
false
14,206
[ "MIT" ]
209
7e0caf17dd03e5d25e2766c4f7132805779bcc40
https://github.com/Piki1989/spacetimeformer/tree/7e0caf17dd03e5d25e2766c4f7132805779bcc40
ODEfunc_single_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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
shuj1234/Hopfield-ODE
ODEfunc_single_conv
false
10,823
[ "MIT" ]
0
2b770c0141082174f394b189df725088308d8bdd
https://github.com/shuj1234/Hopfield-ODE/tree/2b770c0141082174f394b189df725088308d8bdd
FFN
import torch import torch.nn as nn class FFN(nn.Module): def __init__(self, input_dim, num_class): super().__init__() self.layer1 = nn.Linear(input_dim, 256) self.layer2 = nn.Linear(256, 128) self.layer3 = nn.Linear(128, 128) self.out = nn.Linear(128, num_class) se...
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_...
baburamShapure/federatedGraphConv
FFN
false
3,157
[ "MIT" ]
0
015e502fcf1b911ab23572b00c547591a4bdf378
https://github.com/baburamShapure/federatedGraphConv/tree/015e502fcf1b911ab23572b00c547591a4bdf378
ConvNet
import torch import torch.nn as nn class ConvNet(nn.Module): """ A network with a single convolution layer. This is used for testing flop count for convolution layers. """ def __init__(self, conv_dim: 'int', input_dim: 'int', output_dim: 'int', kernel_size: 'int', spatial_dim: 'int', stri...
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...
DenXX/fvcore
ConvNet
false
2,217
[ "Apache-2.0" ]
0
4b91cf092f4f5d379b2c93398780a3b5755e7179
https://github.com/DenXX/fvcore/tree/4b91cf092f4f5d379b2c93398780a3b5755e7179
ScaledDotProductAttention
# 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....
quanha72/mesh-memory-transformer
ScaledDotProductAttention
false
12,919
[ "BSD-3-Clause" ]
0
0eeae459efdb8e85926ce8595536409fdbfc4f99
https://github.com/quanha72/mesh-memory-transformer/tree/0eeae459efdb8e85926ce8595536409fdbfc4f99
CharbonnierLoss
# 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 import functools from torch ...
Lotayou/BasicSR
CharbonnierLoss
false
2,576
[ "Apache-2.0", "MIT" ]
0
6cf9a706dd680d54f7dc26e87318ff79f76c0dbf
https://github.com/Lotayou/BasicSR/tree/6cf9a706dd680d54f7dc26e87318ff79f76c0dbf
MyLinear
# 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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
Shadowalker1995/Tutorial-Resource
MyLinear
false
14,392
[ "Apache-2.0" ]
362
71fe3d521cf9971f708fa9978e9c685c0dda6ba6
https://github.com/Shadowalker1995/Tutorial-Resource/tree/71fe3d521cf9971f708fa9978e9c685c0dda6ba6
EncoderBasicBlock
import torch import torch.nn as nn import torch.nn.functional as F class MLPBlock(nn.Module): def __init__(self, in_dim, mlp_dim, out_dim, dropout_rate=0.1): super(MLPBlock, self).__init__() self.fc1 = nn.Linear(in_dim, mlp_dim) self.fc2 = nn.Linear(mlp_dim, out_dim) self.Gelu = n...
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....
longxianlei/UtilsTools
EncoderBasicBlock
false
10,510
[ "MIT" ]
0
f45c648eb679ed59bb512b61a1af52938e326ac3
https://github.com/longxianlei/UtilsTools/tree/f45c648eb679ed59bb512b61a1af52938e326ac3
MultiClassDiceLoss
# 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...
Elameri/ivadomed
MultiClassDiceLoss
false
9,306
[ "MIT" ]
0
76b5cea46f90f938aafd5ec26e072d559c764b43
https://github.com/Elameri/ivadomed/tree/76b5cea46f90f938aafd5ec26e072d559c764b43
DoubleAttention
# 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....
rushirajsherlocked/External-Attention-pytorch
DoubleAttention
false
4,222
[ "MIT" ]
0
7d6814b2d90909adf81c62f3f8a89e30a59d6481
https://github.com/rushirajsherlocked/External-Attention-pytorch/tree/7d6814b2d90909adf81c62f3f8a89e30a59d6481
MSELoss
# 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...
anglixjtu/MSG_CHN_WACV20
MSELoss
false
14,849
[ "Apache-2.0" ]
61
6910894cf3caed2ffde27586f96b132b0c1d1a98
https://github.com/anglixjtu/MSG_CHN_WACV20/tree/6910894cf3caed2ffde27586f96b132b0c1d1a98
PSNRLoss
# 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 import torch.nn as nn from t...
gf0507033/kornia
PSNRLoss
false
12,421
[ "ECL-2.0", "Apache-2.0" ]
0
2624f40a62d3639e6d946f3ca41fd1ce4b9de82d
https://github.com/gf0507033/kornia/tree/2624f40a62d3639e6d946f3ca41fd1ce4b9de82d
RecCrossEntropyLoss
import torch from torch import nn class RecCrossEntropyLoss(nn.Module): def __init__(self, rec_ratio): super(RecCrossEntropyLoss, self).__init__() self.rec_ratio = rec_ratio def forward(self, rec, inputs, logits, targets): rec_loss = nn.MSELoss() cls_loss = nn.CrossEntropyLos...
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...
YuhengZhi/Attention-Net-with-MNIST-
RecCrossEntropyLoss
false
6,019
[ "MIT" ]
1
aa6805e4df777dee1056d5f4f4f9a9b1e4a5e4ff
https://github.com/YuhengZhi/Attention-Net-with-MNIST-/tree/aa6805e4df777dee1056d5f4f4f9a9b1e4a5e4ff
ScaledSiLU
# 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...
chris-price19/ocp
ScaledSiLU
false
1,692
[ "MIT", "BSD-3-Clause" ]
0
0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
MaskedMSE
import torch import torch.nn as nn class MaskedMSE(nn.Module): def __init__(self): super(MaskedMSE, self).__init__() self.criterion = nn.MSELoss() def forward(self, input, target, gamma=2.0): mask = gamma * target / (target + 1e-07) self.loss = self.criterion(input * mask, ta...
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...
dhruvramani/AccentTransfer
MaskedMSE
false
1,832
[ "MIT" ]
0
63a35b4aa37bc41c1f66dfb4bae76e2924183d7c
https://github.com/dhruvramani/AccentTransfer/tree/63a35b4aa37bc41c1f66dfb4bae76e2924183d7c
RelativeMSE
import torch import torch as th class RelativeMSE(th.nn.Module): """Relative Mean-Squared Error. :math:`0.5 * \\frac{(x - y)^2}{y^2 + \\epsilon}` Args: eps(float): small number to avoid division by 0. """ def __init__(self, eps=0.01): super(RelativeMSE, self).__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 from torch._inductor.runtime import triton_helpers import torch as th assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_...
PeterZs/sbmc
RelativeMSE
false
5,710
[ "Apache-2.0" ]
1
ac3f5452efe0166ea73942f37cc60b1f0e1ee555
https://github.com/PeterZs/sbmc/tree/ac3f5452efe0166ea73942f37cc60b1f0e1ee555
SqueezeEmbedding
import torch import torch.nn as nn class SqueezeEmbedding(nn.Module): """ Squeeze sequence embedding length to the longest one in the batch """ def __init__(self, batch_first=True): super(SqueezeEmbedding, self).__init__() self.batch_first = batch_first def forward(self, x, x_len...
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...
froth-synthesio/PyABSA
SqueezeEmbedding
false
15,367
[ "MIT" ]
199
61406e7a49f93f6c986dfd7e583d730b69c2861c
https://github.com/froth-synthesio/PyABSA/tree/61406e7a49f93f6c986dfd7e583d730b69c2861c
ComposeModel
import torch import torch.nn as nn import torch.nn.functional as F class L2Norm(nn.Module): def forward(self, x): if len(x.size()) > 1: return x / x.norm(p=2, dim=1, keepdim=True) else: return x / x.norm(p=2) class NonLinearModel(nn.Module): def __init__(self, input...
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....
ycsun2017/simple_transfer
ComposeModel
false
4,615
[ "Apache-2.0" ]
0
b807f7a9d818c5586c101f616d190fe9968fabbd
https://github.com/ycsun2017/simple_transfer/tree/b807f7a9d818c5586c101f616d190fe9968fabbd
MatchingTensor
import torch import torch.nn as nn import torch.nn.functional as F class MatchingTensor(nn.Module): """ Module that captures the basic interactions between two tensors. :param matching_dims: Word dimension of two interaction texts. :param channels: Number of word interaction tensor channels. :par...
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....
zfjsail/MatchZoo-py
MatchingTensor
false
4,700
[ "Apache-2.0" ]
0
c93e52e7db7e257b46bb8bf8df8ce1ab1944e2f2
https://github.com/zfjsail/MatchZoo-py/tree/c93e52e7db7e257b46bb8bf8df8ce1ab1944e2f2
Generative_Model
import torch import torch.nn as nn class Generative_Model(nn.Module): def __init__(self, input_size, hidden_size_1, hidden_size_2, output_size, n_classes): super(Generative_Model, self).__init__() self.input_size = input_size self.hidden_size_1 = hidden_size_1 self.hidden_...
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_...
frhrdr/MMD-GAN
Generative_Model
false
10,069
[ "Apache-2.0" ]
0
7522093498b658026344541ddd5c248095763fb6
https://github.com/frhrdr/MMD-GAN/tree/7522093498b658026344541ddd5c248095763fb6
FPNOutput
# 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...
dani3l125/TDNet
FPNOutput
false
15,112
[ "MIT" ]
195
3f8b5378fcc7f97c26b3760ddaf3d4402cf477d1
https://github.com/dani3l125/TDNet/tree/3f8b5378fcc7f97c26b3760ddaf3d4402cf477d1
MultiHeadAttention
import math import torch from torch import nn import torch.utils.data import torch.optim class MultiHeadAttention(nn.Module): """ Multi-head scaled dot-product attention layer. Args: hidden_size: size of the embeddings in the model, also known as d_model num_attention_heads: number of hea...
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....
RPrenger/NeMo
MultiHeadAttention
false
5,746
[ "Apache-2.0" ]
1
e8912ca6e3321347272a6a7da18e052812fb2062
https://github.com/RPrenger/NeMo/tree/e8912ca6e3321347272a6a7da18e052812fb2062
Vflip
import torch import torch.nn as nn def vflip(input: 'torch.Tensor') ->torch.Tensor: """Vertically flip a tensor image or a batch of tensor images. Input must be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`. Args: input (torch.Tensor): input tensor Returns: 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
connorlee77/kornia
Vflip
false
6,479
[ "ECL-2.0", "Apache-2.0" ]
1
af5b1f76bedf2a7fc0e0da2386b1be3032b6534f
https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f
My_loss_focus
# 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...
H-Liu1997/Pytorch_Pose_Estimation_Framework
My_loss_focus
false
5,245
[ "MIT" ]
1
06616b3459ff639f8486e6ea4f93922597788b2a
https://github.com/H-Liu1997/Pytorch_Pose_Estimation_Framework/tree/06616b3459ff639f8486e6ea4f93922597788b2a
SimpleXorModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleXorModule(torch.nn.Module): def __init__(self): super(SimpleXorModule, self).__init__() def forward(self, a, b): c = torch.logical_xor(a, b) return torch.logical_xor(c, c) def get_inputs(): return [torc...
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...
YaronBenAtar/glow
SimpleXorModule
false
14,678
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
LogitKLDivLoss
# 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 from torch ...
ygnn123/training_extensions
LogitKLDivLoss
false
4,689
[ "Apache-2.0" ]
0
c3aeba9359b0d4e0ef9c054de777d3ec081a9892
https://github.com/ygnn123/training_extensions/tree/c3aeba9359b0d4e0ef9c054de777d3ec081a9892
MSECompositionLoss
# 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 functools import torch.nn as nn from torch.nn import functional as F assert_size_s...
akimotty877/mmediting
MSECompositionLoss
false
3,065
[ "Apache-2.0" ]
0
cae872d6f3e867ba144c7c0dbc29a0ee1a29e5a6
https://github.com/akimotty877/mmediting/tree/cae872d6f3e867ba144c7c0dbc29a0ee1a29e5a6
NoiseInjection
import torch from torch import nn class NoiseInjection(nn.Module): def __init__(self, channel): super().__init__() self.weight = nn.Parameter(torch.zeros(1, channel, 1, 1)) def forward(self, image, noise): return image + self.weight * noise def get_inputs(): return [torch.rand(...
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...
KUMartin77/AAA738_StyleGAN_pytorch
NoiseInjection
false
11,597
[ "BSD-2-Clause" ]
0
ed0689102c922d336f53e374e8be2ab532a84ccd
https://github.com/KUMartin77/AAA738_StyleGAN_pytorch/tree/ed0689102c922d336f53e374e8be2ab532a84ccd
CNN
# 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....
Sheriff-A/CNN
CNN
false
9,478
[ "MIT" ]
0
59fc187e7cdf92379f52c4f942424d3a5042bf3e
https://github.com/Sheriff-A/CNN/tree/59fc187e7cdf92379f52c4f942424d3a5042bf3e
value_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
value_model
false
3,125
[ "MIT" ]
0
4004678f7b820989d69824bd492307b3ed227b7a
https://github.com/anthonytec2/ssp-rl-final/tree/4004678f7b820989d69824bd492307b3ed227b7a
ZeroLayer
# 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...
savan77/nni
ZeroLayer
false
4,276
[ "MIT" ]
0
510213393d9cae58c5a8cccd21f322f7bba4e0cf
https://github.com/savan77/nni/tree/510213393d9cae58c5a8cccd21f322f7bba4e0cf
TracedModule
import torch import torch.quantization import torch.onnx import torch.nn.parallel import torch.utils.data import torch.fx import torch.nn import torch.optim import torch.profiler class TracedModule(torch.nn.Module): def forward(self, x): x = x.type(torch.float32) return torch.floor(torch.sqrt(x) ...
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.quantization import torch.onnx import torch.nn.parallel import tor...
LeeSHa00/PyTorch-tutorials-kr
TracedModule
false
11,849
[ "BSD-3-Clause" ]
0
6a25b48b1a6cc96ea4edebeede2e419ef73b96fc
https://github.com/LeeSHa00/PyTorch-tutorials-kr/tree/6a25b48b1a6cc96ea4edebeede2e419ef73b96fc
ScaledSiLU
import torch class ScaledSiLU(torch.nn.Module): def __init__(self): super().__init__() self.scale_factor = 1 / 0.6 self._activation = torch.nn.SiLU() def forward(self, x): return self._activation(x) * self.scale_factor def get_inputs(): return [torch.rand([4, 4, 4, 4])]...
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...
Irlirion/ocp
ScaledSiLU
false
13,841
[ "MIT", "BSD-3-Clause" ]
242
6fb3e794eef31559db990300198eca20f41d8f37
https://github.com/Irlirion/ocp/tree/6fb3e794eef31559db990300198eca20f41d8f37
SqueezeExcitation
import torch from torch import Tensor import torch.nn as nn from torch.nn import functional as F class SqueezeExcitation(nn.Module): def __init__(self, input_c: 'int', expand_c: 'int', squeeze_factor: 'int'=4 ): super(SqueezeExcitation, self).__init__() squeeze_c = input_c // squeeze_fact...
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...
NephrenCake/FlameRecognition
SqueezeExcitation
false
9,408
[ "MIT" ]
0
3075a345b51c2c855a5cb2decd839065230e1484
https://github.com/NephrenCake/FlameRecognition/tree/3075a345b51c2c855a5cb2decd839065230e1484
BCEDiceLoss
# 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...
g-freire/Brain-Tumor-Segmentation
BCEDiceLoss
false
15,386
[ "MIT" ]
156
e4f258feb64c11815570e295c58bda78afd21ab9
https://github.com/g-freire/Brain-Tumor-Segmentation/tree/e4f258feb64c11815570e295c58bda78afd21ab9
CriticNet
from torch.nn import Module import torch from torch.nn import Linear import torch.nn.functional as F class CriticNet(Module): def __init__(self, hidden_size): super(CriticNet, self).__init__() self.l1 = Linear(hidden_size, hidden_size // 2) self.l2 = Linear(hidden_size // 2, 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 from torch._inductor.runtime....
geektoni/AlphaNPI
CriticNet
false
3,534
[ "MIT" ]
0
ab48cb9cfb74f3960e264da4f3eb2d6917bfb9c9
https://github.com/geektoni/AlphaNPI/tree/ab48cb9cfb74f3960e264da4f3eb2d6917bfb9c9
Highway
import torch from torch import nn from torch.nn import functional as F class Highway(nn.Module): """The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387. """ d...
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...
GavEdwards/chemicalx
Highway
false
11,441
[ "Apache-2.0" ]
0
400a983ae6ba88ae0b632d021627dbdadd47b0d0
https://github.com/GavEdwards/chemicalx/tree/400a983ae6ba88ae0b632d021627dbdadd47b0d0
FixedNorm
# 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_...
BlinkDL/RWKV-LM
FixedNorm
false
13,402
[ "BSD-2-Clause" ]
102
b48aa1d430a71ced8ae6a665c47f5dbd95f6f6ab
https://github.com/BlinkDL/RWKV-LM/tree/b48aa1d430a71ced8ae6a665c47f5dbd95f6f6ab
Block
import torch import torch.nn as nn from functools import partial class Mlp(nn.Module): def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0): super().__init__() out_features = out_features or in_features hidden_features = hidden_feat...
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....
Huzhen757/Conformer
Block
false
5,354
[ "Apache-2.0" ]
1
4f7a80cec28b9ced8c0225a85a32997f7cd2b93c
https://github.com/Huzhen757/Conformer/tree/4f7a80cec28b9ced8c0225a85a32997f7cd2b93c
TransposeConv2dLayer
# 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 ...
LenKerr/Semantic-Colorization-GAN
TransposeConv2dLayer
false
5,530
[ "MIT" ]
1
2ce52406ca6fc92e69692b451b1c9ae66ba3b76f
https://github.com/LenKerr/Semantic-Colorization-GAN/tree/2ce52406ca6fc92e69692b451b1c9ae66ba3b76f
CAMMNISTClassifier
import torch from torch import nn as nn from torch import optim as optim from torchvision import transforms as transforms class CAMMNISTClassifier(nn.Module): def __init__(self): super(CAMMNISTClassifier, self).__init__() self.conv1 = nn.Conv2d(1, 32, kernel_size=3) self.relu1 = nn.ReLU()...
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 as nn fr...
RobinMaas95/GTSRB_Visualization
CAMMNISTClassifier
false
1,008
[ "MIT" ]
0
fa837ff94e089a936ef4f4418970d262b35f70b6
https://github.com/RobinMaas95/GTSRB_Visualization/tree/fa837ff94e089a936ef4f4418970d262b35f70b6
MixerBlock
import torch import torch.nn as nn import torch.nn.functional as F class MlpBlock(nn.Module): def __init__(self, features, hidden_dim): super().__init__() self.hidden_dim = hidden_dim self.features = features self.fc1 = nn.Linear(self.features, self.hidden_dim) self.fc2 = ...
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 ...
amayuelas/NNKGReasoning
MixerBlock
false
6,191
[ "MIT" ]
1
0e3623b344fd4e3088ece897f898ddbb1f80888d
https://github.com/amayuelas/NNKGReasoning/tree/0e3623b344fd4e3088ece897f898ddbb1f80888d
AttLayer
# 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....
MIracleyin/RecBole-notebook
AttLayer
false
9,569
[ "MIT" ]
0
ef32b3e57a297ff4889dec1f63c7984f8f901a23
https://github.com/MIracleyin/RecBole-notebook/tree/ef32b3e57a297ff4889dec1f63c7984f8f901a23
ConvReluPool
import torch from torch.nn import Conv2d from torch import nn from torch.nn import functional as F def Pool(k, stride=1, pad=0): return torch.nn.MaxPool2d(k, stride=stride, padding=pad) class ConvReluPool(nn.Module): def __init__(self, fIn, fOut, k, stride=1, pool=2): super().__init__() 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._inductor.runtime import triton_helpers from torch.nn import Conv2d f...
smearle/neural-mmo
ConvReluPool
false
12,994
[ "MIT" ]
0
7f1e98857cb32bdb59a273eb71ec43bbd9793b34
https://github.com/smearle/neural-mmo/tree/7f1e98857cb32bdb59a273eb71ec43bbd9793b34
BinaryFocalLossWithLogits
import torch import torch.nn as nn def binary_focal_loss_with_logits(input: 'torch.Tensor', target: 'torch.Tensor', alpha: 'float'=0.25, gamma: 'float'=2.0, reduction: 'str'='none', eps: 'float'=1e-08) ->torch.Tensor: """Function that computes Binary Focal loss. .. math:: \\text{FL}(p_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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
ChristophReich1996/kornia
BinaryFocalLossWithLogits
false
282
[ "ECL-2.0", "Apache-2.0" ]
0
35f955b46e8015da1cb9faa28c6943ec2b09cc2a
https://github.com/ChristophReich1996/kornia/tree/35f955b46e8015da1cb9faa28c6943ec2b09cc2a
LearnedPositionalEmbedding1D
# 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 import nn import torch.nn import torch.autograd assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cud...
arkel23/yuwu
LearnedPositionalEmbedding1D
false
6,229
[ "MIT" ]
1
4dcf0e18693e09a947569ddcc7cb3ff00c7c674a
https://github.com/arkel23/yuwu/tree/4dcf0e18693e09a947569ddcc7cb3ff00c7c674a
ResizeTransform
import torch import torch.nn as nn import torch.nn.functional as nnf import torch.utils class ResizeTransform(nn.Module): """ Resize a transform, which involves resizing the vector field *and* rescaling it. """ def __init__(self, vel_resize, ndims): super().__init__() self.factor = 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 import torch.nn as nn import torch.utils assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dyna...
Alison-brie/MultiPropReg
ResizeTransform
false
7,633
[ "MIT" ]
14
526d843b161c0e2e53ec5c7c47de6964c6a44c60
https://github.com/Alison-brie/MultiPropReg/tree/526d843b161c0e2e53ec5c7c47de6964c6a44c60
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 math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards....
BigRedT/gpv-1
GeLU
false
13,386
[ "Apache-2.0" ]
45
6a0c2173b44961cb492d00f94864c461aa77641d
https://github.com/BigRedT/gpv-1/tree/6a0c2173b44961cb492d00f94864c461aa77641d
ConvMeanPool
import torch import torch.nn as nn class ConvMeanPool(nn.Module): def __init__(self, input_dim, output_dim, kernel_size=3, biases=True, adjust_padding=False): super().__init__() if not adjust_padding: conv = nn.Conv2d(input_dim, output_dim, kernel_size, stride=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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
henryaddison/score_sde_pytorch
ConvMeanPool
false
12,503
[ "Apache-2.0" ]
0
be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
https://github.com/henryaddison/score_sde_pytorch/tree/be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
ModulatedConv2d
# 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 from to...
Liamkuo/SAIR
ModulatedConv2d
false
17,637
[ "MIT" ]
6
0fb289cd975b5a196b58e7d16bac00e31fd41d39
https://github.com/Liamkuo/SAIR/tree/0fb289cd975b5a196b58e7d16bac00e31fd41d39
LayerNorm
import torch from torch import 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(x...
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 from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Steffen-Wolf/vit-pytorch
LayerNorm
false
9,611
[ "MIT" ]
0
4f590b9bd570091d9070a039ad33301516caa341
https://github.com/Steffen-Wolf/vit-pytorch/tree/4f590b9bd570091d9070a039ad33301516caa341
SequenceSummaryLayer
# 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 ...
Zaaachary/CSQA
SequenceSummaryLayer
false
1,294
[ "BSD-3-Clause" ]
0
6da6e076f67e9458deacb665d31463db14c7d860
https://github.com/Zaaachary/CSQA/tree/6da6e076f67e9458deacb665d31463db14c7d860
ActorNet
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 ActorNet(nn.Module): def __init__(self, state_size, action_size, fc1_units=128, fc2_units=128): ...
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....
bwosh/DRL_ContinuousControl
ActorNet
false
9,837
[ "MIT" ]
0
34314cd600f0da428bc6dddf1b89b64bc04d43df
https://github.com/bwosh/DRL_ContinuousControl/tree/34314cd600f0da428bc6dddf1b89b64bc04d43df
ModulatedConv2d
from torch.autograd import Function import math import torch from torch import nn import torch.nn.functional as F def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5): return FusedLeakyReLUFunction.apply(input, bias, negative_slope, scale) def make_kernel(k): k = torch.tensor(k, dtype=torch...
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.autograd...
ArashVahabpour/encoder4editing-contrastive
ModulatedConv2d
false
13,310
[ "MIT" ]
1,051
1b91afe1693e01a41118e1ce2451b7d14bec51f4
https://github.com/ArashVahabpour/encoder4editing-contrastive/tree/1b91afe1693e01a41118e1ce2451b7d14bec51f4
GeneralAttention
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F class BaseAttention(nn.Module): def __init__(self): super().__init__() def forward(self, *args, **kwargs): raise NotImplementedError class GeneralAttention(BaseAttention): """General Attention""" ...
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....
ROBINADC/BiGRU-CRF-with-Attention-for-NER
GeneralAttention
false
8,707
[ "MIT" ]
27
b9e037ebd6e1d56500ffb60c6030013982c17ded
https://github.com/ROBINADC/BiGRU-CRF-with-Attention-for-NER/tree/b9e037ebd6e1d56500ffb60c6030013982c17ded
DownRightShiftedConv2d
# 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...
stankevich-mipt/pixiv-tags-to-image
DownRightShiftedConv2d
false
4,382
[ "MIT" ]
0
220a157956296c8a5b183ffe219e7c1929342c39
https://github.com/stankevich-mipt/pixiv-tags-to-image/tree/220a157956296c8a5b183ffe219e7c1929342c39
AMSoftmaxLoss
# 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....
albertvillanova/s3prl
AMSoftmaxLoss
false
6,152
[ "MIT" ]
1
b127ade4ed2f80a1027901bbd2f204b4fb1aaf03
https://github.com/albertvillanova/s3prl/tree/b127ade4ed2f80a1027901bbd2f204b4fb1aaf03
BalancedL1Loss
# 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 functools impor...
AlphaLFC/mmdetection
BalancedL1Loss
false
4,839
[ "Apache-2.0" ]
1
45619c5b8aca0ca3e6ddc211210a8946c94694d8
https://github.com/AlphaLFC/mmdetection/tree/45619c5b8aca0ca3e6ddc211210a8946c94694d8
WeightNormLinear
# 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 ...
AntixK/Neural-Blocks
WeightNormLinear
false
17,017
[ "MIT" ]
3
018a44bbb703fc848234b95a3e604576bd9df88f
https://github.com/AntixK/Neural-Blocks/tree/018a44bbb703fc848234b95a3e604576bd9df88f
UpSample
import torch from torchvision.transforms import functional as F import torch.nn as nn import torch.nn.functional as F class UpSample(nn.Sequential): def __init__(self, skip_input, output_features): super().__init__() self.convA = nn.Conv2d(skip_input, output_features, kernel_size=3, s...
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_...
BlairLee/dataset-insights
UpSample
false
5,190
[ "Apache-2.0" ]
1
892e2ed3a2facf97cfa3a883700830d959a0c49b
https://github.com/BlairLee/dataset-insights/tree/892e2ed3a2facf97cfa3a883700830d959a0c49b
BinaryFocalLoss
import torch import torch.nn as nn def binary_focal_loss(pred, target, gamma=2.0, alpha=-1, reduction='mean'): p = torch.sigmoid(pred) loss_pos = -target * (1.0 - p) ** gamma * torch.log(p + 1e-09) loss_neg = -(1.0 - target) * p ** gamma * torch.log(1.0 - p + 1e-09) if alpha >= 0.0 and alpha <= 1.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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
VisualComputingInstitute/Person_MinkUNet
BinaryFocalLoss
false
18,041
[ "MIT" ]
4
fa39764245a022740c0a3d8c85026532fff93e74
https://github.com/VisualComputingInstitute/Person_MinkUNet/tree/fa39764245a022740c0a3d8c85026532fff93e74
QNetwork
# 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_...
AntoniaSophia/deep-reinforcement-learning
QNetwork
false
8,859
[ "MIT" ]
0
1d1c77039eea22fcf6726c35c3dd2563adfcb519
https://github.com/AntoniaSophia/deep-reinforcement-learning/tree/1d1c77039eea22fcf6726c35c3dd2563adfcb519
SimpleCumSumModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleCumSumModule(torch.nn.Module): def __init__(self, dim): super(SimpleCumSumModule, self).__init__() self.dim = dim def forward(self, tensor): return torch.cumsum(tensor, self.dim) def get_inputs(): retur...
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...
YaronBenAtar/glow
SimpleCumSumModule
false
14,663
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
AsymmetricLoss
import torch import torch.nn as nn class AsymmetricLoss(nn.Module): def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): super(AsymmetricLoss, self).__init__() self.gamma_neg = gamma_neg self.gamma_pos = gamma_pos self.cl...
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...
Pepijnnn/MasterThesis
AsymmetricLoss
false
933
[ "MIT" ]
0
7ec831f5e55f5f181e0196fa78284e2846ce2e26
https://github.com/Pepijnnn/MasterThesis/tree/7ec831f5e55f5f181e0196fa78284e2846ce2e26
Linear
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn.modules.loss class Linear(Module): """ to embedding feature """ def __init__(self, in_features, out_features, dropout=0.0, act=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.nn import Module i...
goodman1204/CAN-pytorch
Linear
false
12,462
[ "MIT" ]
0
73d9486c93dd069101c750f94a0750fff0500abb
https://github.com/goodman1204/CAN-pytorch/tree/73d9486c93dd069101c750f94a0750fff0500abb
Policy
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.optim import torch.autograd class Policy(nn.Module): def __init__(self, learning_rate, gamma, in_dim, out_dim): super(Policy, self).__init__() self.learning_rate = learning_rate 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._inductor.runtime import triton_helpers from torch._inductor.runtime....
ChangQingAAS/Deep-Reinforcement-Learning
Policy
false
591
[ "MIT" ]
0
3bc1381c632b1730a48e63e972aea62086c4287c
https://github.com/ChangQingAAS/Deep-Reinforcement-Learning/tree/3bc1381c632b1730a48e63e972aea62086c4287c
Recon_Block
# 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...
albangossard/Course-inverse-problems-and-unrolled-networks
Recon_Block
false
1,399
[ "MIT" ]
0
0d4161c905149817e3abff9e70c101f36fac4270
https://github.com/albangossard/Course-inverse-problems-and-unrolled-networks/tree/0d4161c905149817e3abff9e70c101f36fac4270
CORblock_Z
# 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 ...
ViCCo-Group/THINGSvision
CORblock_Z
false
14,561
[ "MIT" ]
45
27273564631605639287f9b3bd3c57ba8cdb720f
https://github.com/ViCCo-Group/THINGSvision/tree/27273564631605639287f9b3bd3c57ba8cdb720f
Net1
import torch import torch.nn as nn import torch.nn.functional as F class Net1(nn.Module): def __init__(self): super(Net1, self).__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = nn.Linear(16 * 5 * 5, 120) ...
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_...
AndreaCeccarelli/gpu-monitor
Net1
false
16,916
[ "MIT" ]
4
aad4dc88387a69235e9c370cb08da1f16ba4aa96
https://github.com/AndreaCeccarelli/gpu-monitor/tree/aad4dc88387a69235e9c370cb08da1f16ba4aa96
Accuracy
import torch from torch import nn def accuracy(logits, labels, ignore_index: 'int'=-100): with torch.no_grad(): valid_mask = labels != ignore_index predictions = logits.float().argmax(-1) correct = (predictions == labels) * valid_mask return correct.sum().float() / valid_mask.sum()...
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...
MachineLearningLifeScience/What-is-a-meaningful-representation-of-protein-sequences
Accuracy
false
17,667
[ "BSD-3-Clause" ]
4
2c24db6ee8763b0b6098d7509cf3325647931c11
https://github.com/MachineLearningLifeScience/What-is-a-meaningful-representation-of-protein-sequences/tree/2c24db6ee8763b0b6098d7509cf3325647931c11
PointLoss
import torch import torch.nn.parallel import torch.utils.data import torch.nn as nn def array2samples_distance(array1, array2): """ arguments: array1: the array, size: (num_point, num_feature) array2: the samples, size: (num_point, num_feature) returns: distances: each entry is th...
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.parallel import torch.utils.data import torch.nn as nn assert_size_stride...
liuyuex97/PF-Net-Point-Fractal-Network
PointLoss
false
12,725
[ "MIT" ]
0
97f248a03bcd33828e8e2175ec79bbe8c791952d
https://github.com/liuyuex97/PF-Net-Point-Fractal-Network/tree/97f248a03bcd33828e8e2175ec79bbe8c791952d
BasicModel_ConvNet_One_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 from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
YNNEKUW/captum
BasicModel_ConvNet_One_Conv
false
12,001
[ "BSD-3-Clause" ]
0
c8b5357b21f2ddf440e5f0ce25635977292aa5d1
https://github.com/YNNEKUW/captum/tree/c8b5357b21f2ddf440e5f0ce25635977292aa5d1
NormalizationLayer
# 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.init assert_size_stride = torch._C._dynamo.guards.assert_size_s...
akurniawan/jina-hub
NormalizationLayer
false
1,395
[ "Apache-2.0" ]
0
d89bc5e8f527f1212c3228a15775e222983c0087
https://github.com/akurniawan/jina-hub/tree/d89bc5e8f527f1212c3228a15775e222983c0087
IMul
import torch class IMul(torch.nn.Module): def __init__(self): super(IMul, 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit def triton_poi_fused_mul_0(in_ptr0, in_ptr1, out_ptr1, xnumel,...
bunderhi/torch2trt
IMul
false
1,599
[ "MIT" ]
0
fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d
https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d
ExponentialDecay
import torch from torch import Tensor from torch import nn from torch.jit import Final class ExponentialUpdate(nn.Module): alpha: 'Final[int]' def __init__(self, alpha: 'float'): super().__init__() self.alpha = float(alpha) def forward(self, x: 'Tensor', state: '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 Tensor from torch import nn from torch.jit import Final assert_size_stride = torch._C._dynamo.guards.assert_size_stride em...
Rikorose/clc-dns-challenge-2020
ExponentialDecay
false
8,705
[ "Apache-2.0" ]
12
4f1c078691327a75b3a338fe372ba356b450a6da
https://github.com/Rikorose/clc-dns-challenge-2020/tree/4f1c078691327a75b3a338fe372ba356b450a6da
FocalLoss
# 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 from torch ...
ChristophReich1996/3D_Baggage_Segmentation
FocalLoss
false
5,002
[ "MIT" ]
1
00392cb0fde22d3180b6baf81e404d0fcf4e2ebf
https://github.com/ChristophReich1996/3D_Baggage_Segmentation/tree/00392cb0fde22d3180b6baf81e404d0fcf4e2ebf
pdice_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 from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.utils.model_zoo assert_size_stride = torch._C._dynamo....
manuel-rdz/SGL-Retinal-Vessel-Segmentation
pdice_loss
false
15,999
[ "MIT" ]
45
7897d977e77aa0b5d3acb86e0aa74c6829d67415
https://github.com/manuel-rdz/SGL-Retinal-Vessel-Segmentation/tree/7897d977e77aa0b5d3acb86e0aa74c6829d67415
ConvNet64
import torch import torch.nn as nn def get_activation(s_act): if s_act == 'relu': return nn.ReLU(inplace=True) elif s_act == 'sigmoid': return nn.Sigmoid() elif s_act == 'softplus': return nn.Softplus() elif s_act == 'linear': return None elif s_act == 'tanh': ...
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_...
GloryyrolG/normalized-autoencoders
ConvNet64
false
554
[ "MIT" ]
0
27ccb74bb725768f9ba9ea6fa03a7a40867eebb1
https://github.com/GloryyrolG/normalized-autoencoders/tree/27ccb74bb725768f9ba9ea6fa03a7a40867eebb1
DuelingMLP
# 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_...
AlexHermansson/hindsight-experience-replay
DuelingMLP
false
16,876
[ "MIT" ]
5
65468d523bb803123d7aab9bb83abc7a3d5db3c8
https://github.com/AlexHermansson/hindsight-experience-replay/tree/65468d523bb803123d7aab9bb83abc7a3d5db3c8
PlanarNormalizingFlow
import torch import torch.nn.functional as F from torch import nn class PlanarNormalizingFlow(nn.Module): """ Planar normalizing flow [Rezende & Mohamed 2015]. Provides a tighter bound on the ELBO by giving more expressive power to the approximate distribution, such as by introducing covariance be...
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 from torch import nn assert_size_stride = torch._C._dynamo.gua...
chunglabmit/phathom
PlanarNormalizingFlow
false
6,457
[ "MIT" ]
1
304db7a95e898e9b03d6b2640172752d21a7e3ed
https://github.com/chunglabmit/phathom/tree/304db7a95e898e9b03d6b2640172752d21a7e3ed
BehlerAngular
import torch from torch import nn as nn class BehlerAngular(nn.Module): """ Compute Behler type angular contribution of the angle spanned by three atoms: :math:`2^{(1-\\zeta)} (1 + \\lambda \\cos( {\\theta}_{ijk} ) )^\\zeta` Sets of zetas with lambdas of -1 and +1 are generated automatically. A...
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 as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._emp...
Avinashpathapati/gnn
BehlerAngular
false
8,832
[ "MIT" ]
0
e06c36f5d8fb7da555c8f82e04364ba4366444c7
https://github.com/Avinashpathapati/gnn/tree/e06c36f5d8fb7da555c8f82e04364ba4366444c7
GAT
import torch import torch.nn as nn import torch.nn.functional as F from scipy.sparse import * def dropout(x, drop_prob, shared_axes=[], training=False): """ Apply dropout to input tensor. Parameters ---------- input_tensor: ``torch.FloatTensor`` A tensor of shape ``(batch_size, ..., num_ti...
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....
Ononoki-Yotsugi/IDGL
GAT
false
9,502
[ "Apache-2.0" ]
0
a99f840681a4ae26c2740ed9e9302d4e15a68c7f
https://github.com/Ononoki-Yotsugi/IDGL/tree/a99f840681a4ae26c2740ed9e9302d4e15a68c7f
RMSELoss
import torch import torch.nn as nn class RMSELoss(nn.Module): def __init__(self): super(RMSELoss, self).__init__() self.mse = nn.MSELoss() def forward(self, yhat, y): return torch.sqrt(self.mse(yhat, y)) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4...
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...
PARMAGroup/UNet-Instance-Cell-Segmentation
RMSELoss
false
8,626
[ "MIT" ]
30
79655a2c5781d2e20c7d5760f631fbb0be392292
https://github.com/PARMAGroup/UNet-Instance-Cell-Segmentation/tree/79655a2c5781d2e20c7d5760f631fbb0be392292
SoftQNetwork
import torch import torch.nn as nn import torch.nn.functional as F class SoftQNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size, init_w=0.003): super(SoftQNetwork, self).__init__() self.linear1 = nn.Linear(num_inputs + num_actions, hidden_size) self.linear2 = 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 import torch.nn as nn assert_...
biemann/rl-testbed-for-energyplus
SoftQNetwork
false
9,802
[ "MIT" ]
0
a01be4d12eda970b352729ff6cb4a3eea8ddee6a
https://github.com/biemann/rl-testbed-for-energyplus/tree/a01be4d12eda970b352729ff6cb4a3eea8ddee6a
SelfAttentionGated
# 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....
xdong73S/Match_LSTM_v2.0
SelfAttentionGated
false
4,643
[ "MIT" ]
0
dfb8cfbc2a5dafc6655eecf151a7dbcf808cd729
https://github.com/xdong73S/Match_LSTM_v2.0/tree/dfb8cfbc2a5dafc6655eecf151a7dbcf808cd729
GaussianFilter
# 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.utils.data assert_size_stride = torch._C._dyn...
alsgkals2/SRResCGAN
GaussianFilter
false
14,830
[ "MIT" ]
81
a71201a93e1819045f9c7711743812546d3a1f31
https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31
ReLU
# 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 from numbers import N...
DoggyLiu0116/MamboNet
ReLU
false
5,081
[ "MIT" ]
1
3b708091422491f660c4bd5eb12b06ce3b8a5f79
https://github.com/DoggyLiu0116/MamboNet/tree/3b708091422491f660c4bd5eb12b06ce3b8a5f79
resBlock
# 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....
SeokjaeLIM/DSLR-release
resBlock
false
8,744
[ "Apache-2.0" ]
14
861429482faf50ee3d6570948af8c48df1fc7f43
https://github.com/SeokjaeLIM/DSLR-release/tree/861429482faf50ee3d6570948af8c48df1fc7f43