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
ScaledDotProductAttentionMemory
# 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....
mandaltanmoy1938/VisualGPT
ScaledDotProductAttentionMemory
false
16,005
[ "MIT" ]
86
9ba78948282fdca502d5030f4eccc3df562982c3
https://github.com/mandaltanmoy1938/VisualGPT/tree/9ba78948282fdca502d5030f4eccc3df562982c3
DeterministicCriticNet
import torch import numpy as np from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim class BasicNet: def __init__(self, optimizer_fn, gpu, LSTM=False): self.gpu = gpu and torch.cuda.is_available() self.LSTM = LSTM if self.gpu: ...
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 from torch...
G-Flor/deeprl
DeterministicCriticNet
false
5,176
[ "Apache-2.0" ]
1
aeae2c5d585e5853dc638968b1f090eb60abd351
https://github.com/G-Flor/deeprl/tree/aeae2c5d585e5853dc638968b1f090eb60abd351
CosMargin
import math import torch import torch.nn as nn import torch.nn.functional as F class CosMargin(nn.Module): def __init__(self, in_size, out_size, s=None, m=0.0): super(CosMargin, self).__init__() self.in_size = in_size self.out_size = out_size self.W = nn.Parameter(torch.randn(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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
belphegor2211/khoa_luan
CosMargin
false
9,985
[ "MIT" ]
0
c9c163ebf3aff3005639ce7e4020e510295d1c75
https://github.com/belphegor2211/khoa_luan/tree/c9c163ebf3aff3005639ce7e4020e510295d1c75
ComplexConvTranspose2d
import torch import torch.nn as nn import torch.utils.data import torch.onnx.operators import torch.optim import torch.optim.lr_scheduler class ComplexConvTranspose2d(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, stride=1, padding=0, output_padding=0, dilation=1, groups=1, bias=Tru...
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 import torch.onnx.operators import...
IIP-Sogang/Audio-Visual-Speech-Recognition
ComplexConvTranspose2d
false
17,426
[ "MIT" ]
9
bd03be91135acbc6162b83092d462b7fe71dd007
https://github.com/IIP-Sogang/Audio-Visual-Speech-Recognition/tree/bd03be91135acbc6162b83092d462b7fe71dd007
Residual
# 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....
SkywalkerAtlas/HRGAN
Residual
false
5,839
[ "MIT" ]
1
bf6d58c1f3c6e042c7ea70319a25e3420531d552
https://github.com/SkywalkerAtlas/HRGAN/tree/bf6d58c1f3c6e042c7ea70319a25e3420531d552
EncoderLayer
import math import torch from torch import nn import torch.nn.functional as F import torch.utils.data.distributed def matmul(x, y): if x.dim() == y.dim(): return x @ y if x.dim() == y.dim() - 1: return (x.unsqueeze(-2) @ y).squeeze(-2) return (x @ y.unsqueeze(-2)).squeeze(-2) class FeedF...
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....
xurantju/densecap
EncoderLayer
false
11,052
[ "BSD-3-Clause" ]
0
2e58501e453bf98b9cc892e5b64997f5c1dfc808
https://github.com/xurantju/densecap/tree/2e58501e453bf98b9cc892e5b64997f5c1dfc808
Scale_and_shift
# 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
BCV-Uniandes/SAMA
Scale_and_shift
false
128
[ "BSD-3-Clause" ]
0
4c732c71486af17efed17480e363298cb65c851f
https://github.com/BCV-Uniandes/SAMA/tree/4c732c71486af17efed17480e363298cb65c851f
TAGConv
import torch import torch.nn as nn class TAGConv(nn.Module): def __init__(self, in_features, out_features, K=3, bias=True): super().__init__() self.in_features = in_features self.out_features = out_features self.K = K self.w = nn.Linear(in_features * (self.K + 1), out_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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
EdisonLeeeee/Graphgallery
TAGConv
false
5,114
[ "MIT" ]
1
8ae9ef57d44f073d0ceaf3f33a3a998546f960a8
https://github.com/EdisonLeeeee/Graphgallery/tree/8ae9ef57d44f073d0ceaf3f33a3a998546f960a8
CoxPHLoss
# 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, split_scan_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 ...
gabrielasuchopar/pycox
CoxPHLoss
false
3,513
[ "BSD-2-Clause" ]
0
e4ea5f0ee26c6d3e3a468f164de2b7c426376e99
https://github.com/gabrielasuchopar/pycox/tree/e4ea5f0ee26c6d3e3a468f164de2b7c426376e99
LC_SEModule
import torch import torch.nn as nn import torch.utils.data class LC_SEModule(nn.Module): def __init__(self, channel, reduction=4): super().__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) self.conv1 = nn.Conv2d(in_channels=channel, out_channels=channel // reduction, kernel_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 import ...
COEN-390/YOLOv5-Lite
LC_SEModule
false
11,273
[ "MIT" ]
0
06a53f5d001c5d37729f55f47cbd46cc8eb63f84
https://github.com/COEN-390/YOLOv5-Lite/tree/06a53f5d001c5d37729f55f47cbd46cc8eb63f84
PredictionHead
# 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.onnx assert_size_stride = torch._C._dynamo.gu...
ephrem-git/inference
PredictionHead
false
12,350
[ "Apache-2.0" ]
0
bfbda5fc419364c3f71b5b1640f6c00e7675b212
https://github.com/ephrem-git/inference/tree/bfbda5fc419364c3f71b5b1640f6c00e7675b212
GlobalAttention
# 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....
Katarina11/PreSumm
GlobalAttention
false
11,612
[ "MIT" ]
0
616e72f038d512e9e9112af375d66a0b2e3db6cd
https://github.com/Katarina11/PreSumm/tree/616e72f038d512e9e9112af375d66a0b2e3db6cd
Mish
import torch import torch.nn as nn import torch.nn.functional as F class Mish(nn.Module): def forward(self, x): return x.mul_(F.softplus(x).tanh()) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.gu...
absallh/A_yolov3
Mish
false
18,215
[ "Apache-2.0" ]
6
550ec41de42b8efe638e887c51a568189947e049
https://github.com/absallh/A_yolov3/tree/550ec41de42b8efe638e887c51a568189947e049
GoodDiscriminator
# 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....
justaboutlola/improved-wgan-pytorch
GoodDiscriminator
false
16,210
[ "MIT" ]
412
5bb0b729809152d9129ef72a9dd28b3ff83021a2
https://github.com/justaboutlola/improved-wgan-pytorch/tree/5bb0b729809152d9129ef72a9dd28b3ff83021a2
PositionGenerator
import torch import torch.nn as nn class LayerNorm(nn.Module): """Construct a layernorm module (See citation for details).""" def __init__(self, features, eps=1e-06): super(LayerNorm, self).__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(fe...
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 ...
odb9402/MAT
PositionGenerator
false
4,111
[ "MIT" ]
0
95d8083170da2c8ce1f5898b3a556bcf54eac8cc
https://github.com/odb9402/MAT/tree/95d8083170da2c8ce1f5898b3a556bcf54eac8cc
Envelope
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_...
douglasrizzo/pytorch_geometric
Envelope
false
12,298
[ "MIT" ]
0
effc617c6ad6daad506038bb79e4407082e74740
https://github.com/douglasrizzo/pytorch_geometric/tree/effc617c6ad6daad506038bb79e4407082e74740
StyledConv
import math import torch from torch import nn from torch.nn import functional as F def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5): rest_dim = [1] * (input.ndim - bias.ndim - 1) input = input return F.leaky_relu(input + bias.view(1, bias.shape[0], *rest_dim), negative_slope=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.triton_helpers import libdevice import math from to...
YotamNitzan/pixel2style2pixel
StyledConv
false
2,995
[ "MIT" ]
0
b943f9e6de046a54b901eea1d8714cb02a71605f
https://github.com/YotamNitzan/pixel2style2pixel/tree/b943f9e6de046a54b901eea1d8714cb02a71605f
GTXCrossAttentionLayer
from _paritybench_helpers import _mock_config import math import torch from torch import nn class GTXAttention(nn.Module): def __init__(self, config, ctx_dim=None): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidde...
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....
rsgit95/med_kg_txt_multimodal
GTXCrossAttentionLayer
false
4,220
[ "Apache-2.0" ]
0
80355b0cf58e0571531ad6f9728c533110ca996d
https://github.com/rsgit95/med_kg_txt_multimodal/tree/80355b0cf58e0571531ad6f9728c533110ca996d
ConsensusAttention
import torch import torch.nn.functional as F from torch import nn from torch import einsum class ConsensusAttention(nn.Module): def __init__(self, num_patches_side, attend_self=True, local_consensus_radius=0): super().__init__() self.attend_self = attend_self self.local_consensus_...
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....
Tahlor/glom-pytorch
ConsensusAttention
false
1,130
[ "MIT" ]
0
45b2fc52af5288cd53611e497a70d53ffa303410
https://github.com/Tahlor/glom-pytorch/tree/45b2fc52af5288cd53611e497a70d53ffa303410
TorchDiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
Spiruel/solaris
TorchDiceLoss
false
11,944
[ "Apache-2.0" ]
0
eb2ce05265a462d69b01ee2b621a85a3e9082402
https://github.com/Spiruel/solaris/tree/eb2ce05265a462d69b01ee2b621a85a3e9082402
AtLocPlusCriterion
import torch import torch.nn as nn import torch.nn.init def calc_vos_simple(poses): vos = [] for p in poses: pvos = [(p[i + 1].unsqueeze(0) - p[i].unsqueeze(0)) for i in range( len(p) - 1)] vos.append(torch.cat(pvos, dim=0)) vos = torch.stack(vos, dim=0) return vos class ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn import torch.nn.init assert_size_stride = torch._C....
xunshengliuyin/ATwvo
AtLocPlusCriterion
false
4,611
[ "MIT" ]
0
7d8b7aeb7893cb59d48864a9a35f7de9dce084b4
https://github.com/xunshengliuyin/ATwvo/tree/7d8b7aeb7893cb59d48864a9a35f7de9dce084b4
Correct
# 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 import torch.utils.data.distributed assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda ...
aoranwu/grace
Correct
false
14,881
[ "BSD-2-Clause" ]
88
1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e
https://github.com/aoranwu/grace/tree/1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e
Encoder
# 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.data assert_size_stride = torch._C._dyn...
Hcnaeg/DI-engine
Encoder
false
2,385
[ "Apache-2.0" ]
0
aba0c629f87649854091e9e59d948f83962e3e1e
https://github.com/Hcnaeg/DI-engine/tree/aba0c629f87649854091e9e59d948f83962e3e1e
FinalPool
# 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.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride e...
praesc/end-to-end-SLU
FinalPool
false
4,187
[ "Apache-2.0" ]
0
c4e8a5be0ea6a8d93ea7cfd3a5bdab0560c50848
https://github.com/praesc/end-to-end-SLU/tree/c4e8a5be0ea6a8d93ea7cfd3a5bdab0560c50848
WordPredictor
# 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....
gardenia22/translate
WordPredictor
false
6,745
[ "BSD-3-Clause" ]
1
0be57c8f55b52fc9d39197efa02e05d1c1cda024
https://github.com/gardenia22/translate/tree/0be57c8f55b52fc9d39197efa02e05d1c1cda024
Model
from torch.nn import Module import torch from torch.nn.parameter import Parameter from torch.nn.modules import Module import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim from torch.nn import Parameter from torch.nn import Module class Model(Module): def __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.nn import Module from torch.nn.parameter import Parameter from torch.nn.modules import Module import torch.utils.data import torc...
FDecaYed/apex
Model
false
4,753
[ "BSD-3-Clause" ]
0
789afd89fe2c5a3e772f557055a9cf0f5e9d1241
https://github.com/FDecaYed/apex/tree/789afd89fe2c5a3e772f557055a9cf0f5e9d1241
ResidualAttentionBlock
# 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....
johnpaulbin/glide-text2im
ResidualAttentionBlock
false
12,646
[ "MIT" ]
0
4897050c4c540316dfb1ec7e6ff95698bcb20487
https://github.com/johnpaulbin/glide-text2im/tree/4897050c4c540316dfb1ec7e6ff95698bcb20487
TransformerDecoderLayer
import torch from torch import Tensor from typing import Optional from torch import nn def _get_activation_fn(activation: 'str'): if activation == 'relu': return nn.functional.relu elif activation == 'gelu': return nn.functional.gelu raise RuntimeError('activation should be relu/gelu, not ...
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....
johnjosephmorgan/snowfall
TransformerDecoderLayer
false
12,756
[ "Apache-2.0" ]
0
604d789c0aed035626d6745e6d7a427168063cae
https://github.com/johnjosephmorgan/snowfall/tree/604d789c0aed035626d6745e6d7a427168063cae
ArcFaceLoss
import math import torch from torch import nn class DenseCrossEntropy(nn.Module): """ The CrossEntropy loss that takes the one-hot vector of the gt label as the input, should be equivalent to the standard CrossEntropy implementation. The one-hot vector is meant for the ArcFaceLoss and CutMix augmenta...
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 math...
CTPLab/IID_representation_learning
ArcFaceLoss
false
4,951
[ "MIT" ]
1
b9dc13536963f9af332b039f7cc772e2f1090c62
https://github.com/CTPLab/IID_representation_learning/tree/b9dc13536963f9af332b039f7cc772e2f1090c62
L2Conv2D
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim import torch.utils.data class L2Conv2D(nn.Module): """ Convolutional layer that computes the squared L2 distance instead of the conventional inner product. """ def __init__(self, num_prototypes, num_features, w_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._inductor.runtime....
M-Nauta/ProtoTree
L2Conv2D
false
8,517
[ "MIT" ]
35
72cad5e42b0eb05c1312e5496f36b842726e081a
https://github.com/M-Nauta/ProtoTree/tree/72cad5e42b0eb05c1312e5496f36b842726e081a
scaleCompositor
import torch import torch.nn as nn class ResBlock(nn.Module): def __init__(self, in_ch, hid_ch): super(ResBlock, self).__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=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 assert_...
qbhan/pathembed
scaleCompositor
false
7,533
[ "MIT" ]
1
c21823529840593bf606e10696f5879e5adb51b2
https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2
MiniBatchStddevLayer
import torch import torch.nn as nn import torch.distributed as dist import torch.autograd as autograd import torch.utils.cpp_extension class AllGatherLayer(autograd.Function): """All gather layer with backward propagation path. Indeed, this module is to make ``dist.all_gather()`` in the backward graph. S...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.distributed as dist import torch.autograd as...
bladesaber/mmgeneration
MiniBatchStddevLayer
false
1,567
[ "Apache-2.0" ]
0
158b49f7efd8028f231f6e9ca758ae0e20dd72ae
https://github.com/bladesaber/mmgeneration/tree/158b49f7efd8028f231f6e9ca758ae0e20dd72ae
Upsample
import torch import torch.nn as nn class Upsample(nn.Module): def __init__(self, factor): super(Upsample, self).__init__() self.factor = factor def forward(self, x): x = nn.functional.interpolate(x, scale_factor=self.factor, mode= 'bilinear', align_corners=False) ...
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...
a3ahmad/DDPM
Upsample
false
1,341
[ "MIT" ]
0
180440740cb82c2b4e7e0b06a0d8e662b5aa3f05
https://github.com/a3ahmad/DDPM/tree/180440740cb82c2b4e7e0b06a0d8e662b5aa3f05
UpConv_Blocks
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
LuigiFilippoChiara/GoalGAN
UpConv_Blocks
false
8,483
[ "MIT" ]
36
11ac7448af7ac8934e6eb47a06c51d92f04dec8c
https://github.com/LuigiFilippoChiara/GoalGAN/tree/11ac7448af7ac8934e6eb47a06c51d92f04dec8c
SpatialAttention
# 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_...
Ming-er/NeuralNILM_Pytorch
SpatialAttention
false
8,572
[ "MIT" ]
22
90123a3cf7d8dedc7f513ff784a45f178aa10a9d
https://github.com/Ming-er/NeuralNILM_Pytorch/tree/90123a3cf7d8dedc7f513ff784a45f178aa10a9d
fpn_module
# 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 ...
ShenZheng2000/Syn2Real-Pytorch
fpn_module
false
6,012
[ "MIT" ]
1
214c800914e2bcd57d4ca74a4c8476a11e1b5905
https://github.com/ShenZheng2000/Syn2Real-Pytorch/tree/214c800914e2bcd57d4ca74a4c8476a11e1b5905
Foo
# 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.jit import torch...
opti-mix/glow
Foo
false
7,403
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
StableBCELoss
# 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...
kevinkwshin/kaggle-pneumothorax
StableBCELoss
false
15,805
[ "MIT" ]
74
24b91a9425097023f0cc7781a9380cb247babe22
https://github.com/kevinkwshin/kaggle-pneumothorax/tree/24b91a9425097023f0cc7781a9380cb247babe22
ArcFaceLoss
# 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 math...
aaron276h/kaggle-rcic-1st
ArcFaceLoss
false
12,040
[ "MIT" ]
0
d35e97847df3c29f548e60bc936d3fec7a0a4c08
https://github.com/aaron276h/kaggle-rcic-1st/tree/d35e97847df3c29f548e60bc936d3fec7a0a4c08
ToRGB
# 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...
uthree/gan-image-generator
ToRGB
false
11,000
[ "MIT" ]
0
85585e389b5a494393da0789d82824f8c811e263
https://github.com/uthree/gan-image-generator/tree/85585e389b5a494393da0789d82824f8c811e263
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
marcoleewow/LaTeX_OCR
Attention
false
16,017
[ "Apache-2.0" ]
290
0980ea719f8d3175a6bbf6af18873dd72d04b8c7
https://github.com/marcoleewow/LaTeX_OCR/tree/0980ea719f8d3175a6bbf6af18873dd72d04b8c7
Conv2dBlock
# 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.functional as...
belphegor2211/KLTN_GANwriting
Conv2dBlock
false
3,205
[ "MIT" ]
0
67d4d5c286ec45ef704b49c5abf9774d38bf65eb
https://github.com/belphegor2211/KLTN_GANwriting/tree/67d4d5c286ec45ef704b49c5abf9774d38bf65eb
WassersteinGANLossDiscriminator
import torch import torch.nn as nn class WassersteinGANLossDiscriminator(nn.Module): """ This class implements the Wasserstein generator GAN loss proposed in: http://proceedings.mlr.press/v70/arjovsky17a/arjovsky17a.pdf """ def __init__(self) ->None: """ Constructor method. ...
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...
ChristophReich1996/Mode_Collapse
WassersteinGANLossDiscriminator
false
7,905
[ "MIT" ]
14
937ee8bf96510fbf4070fc7e14b78276ab036b8c
https://github.com/ChristophReich1996/Mode_Collapse/tree/937ee8bf96510fbf4070fc7e14b78276ab036b8c
Fusion
import torch import torch.nn as nn class Fusion(nn.Module): def __init__(self, input_dim, hidden_dim): super(Fusion, self).__init__() self.linear = nn.Linear(input_dim * 4, hidden_dim, bias=True) self.tanh = nn.Tanh() def forward(self, x, y): z = torch.cat([x, y, x * y, x - y...
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 ...
hgrhgy/NumSeq2SQL
Fusion
false
10,223
[ "MIT" ]
0
6f22fdf108736f979afa2dbd3af14aa9ad4718aa
https://github.com/hgrhgy/NumSeq2SQL/tree/6f22fdf108736f979afa2dbd3af14aa9ad4718aa
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 from torch.nn.parameter import Parameter from torch.optim...
aerinkim/squad_2018
LayerNorm
false
3,098
[ "BSD-3-Clause" ]
0
4479fa7ce92d8ab2f2eeb1823991d416924d8561
https://github.com/aerinkim/squad_2018/tree/4479fa7ce92d8ab2f2eeb1823991d416924d8561
UNet
import torch class Block(torch.nn.Module): def __init__(self, in_channels, mid_channel, out_channels, batch_norm=False ): super().__init__() self.conv1 = torch.nn.Conv2d(in_channels=in_channels, out_channels= mid_channel, kernel_size=3, padding=1) self.conv2 = torch.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 assert_size_stride = torch._C...
amrane99/lung-segmentation
UNet
false
12,162
[ "MIT" ]
0
ab29db75ac78918da5cbf66b830acaf36cf7b44a
https://github.com/amrane99/lung-segmentation/tree/ab29db75ac78918da5cbf66b830acaf36cf7b44a
CustomizedNet
import torch import torch.nn as nn import torch.utils.data.distributed class CustomizedNet(nn.Module): def __init__(self, dropout, input_size, input_feature_num, hidden_dim, output_size): """ Simply use linear layers for multi-variate single-step forecasting. """ super()._...
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 ...
EvelynQiang/analytics-zoo
CustomizedNet
false
11,408
[ "Apache-2.0" ]
0
be5dd08abe9b14ac085817decd017862a273985a
https://github.com/EvelynQiang/analytics-zoo/tree/be5dd08abe9b14ac085817decd017862a273985a
VitMlpHead
import torch def get_args(): parser = argparse.ArgumentParser() group = parser.add_argument_group(title='input data') group.add_argument('--input', type=str, required=True, help= 'Path to input JSON') group.add_argument('--json-keys', nargs='+', default=['text'], help= 'space separate ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride ...
parsa-epfl/Megatron-LM
VitMlpHead
false
12,871
[ "MIT" ]
0
0301c00ce60b7c75f315e7aa4ff38238186762b1
https://github.com/parsa-epfl/Megatron-LM/tree/0301c00ce60b7c75f315e7aa4ff38238186762b1
DecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
sd2001/seqModeling
DecoderLayer
false
13,003
[ "MIT" ]
0
393f680de711ea8477e5450633b492298d253368
https://github.com/sd2001/seqModeling/tree/393f680de711ea8477e5450633b492298d253368
StyleMod
# 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.nn.functional as F assert_size_stride = torch...
eitanrich/ganspace-manifold
StyleMod
false
12,338
[ "Apache-2.0" ]
0
148d5d30001c43794a40bbed885601e7816f5d7d
https://github.com/eitanrich/ganspace-manifold/tree/148d5d30001c43794a40bbed885601e7816f5d7d
SoftmaxLoss
import torch import torch.nn as nn class SoftmaxLoss(nn.Module): def __init__(self, hidden_dim, speaker_num, **kwargs): """ Softmax Loss """ super(SoftmaxLoss, self).__init__() self.fc = nn.Linear(hidden_dim, speaker_num) self.loss = nn.CrossEntropyLoss() 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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
czlwang/s3prl
SoftmaxLoss
false
12,276
[ "Apache-2.0" ]
0
81d4bb8d051cee20fa87c083b8478999e1766172
https://github.com/czlwang/s3prl/tree/81d4bb8d051cee20fa87c083b8478999e1766172
SelfAttnPooler
# 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....
ankitapasad/slue-toolkit
SelfAttnPooler
false
12,096
[ "MIT" ]
0
db8155cf0fc803e21890cf4eee2ef87152aafbfc
https://github.com/ankitapasad/slue-toolkit/tree/db8155cf0fc803e21890cf4eee2ef87152aafbfc
BertSelfAttention
from _paritybench_helpers import _mock_config import math import torch from torch import nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
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....
Sy-Zhang/recurrent-transformer
BertSelfAttention
false
11,141
[ "MIT" ]
0
f66ba49a2c9ec42759d3d00d497b49ffe39e18de
https://github.com/Sy-Zhang/recurrent-transformer/tree/f66ba49a2c9ec42759d3d00d497b49ffe39e18de
BertSelfAttention
# 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....
shrishabh/cs769-assignments
BertSelfAttention
false
12,992
[ "MIT" ]
0
babce1def0d65728bf1d4e4a725d8939f1d5f9a7
https://github.com/shrishabh/cs769-assignments/tree/babce1def0d65728bf1d4e4a725d8939f1d5f9a7
Scale
# 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 import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
AmorosTech/RP-R-CNN
Scale
false
13,251
[ "MIT" ]
78
45557a69ae9789e2662e3b937feb7624319a3e73
https://github.com/AmorosTech/RP-R-CNN/tree/45557a69ae9789e2662e3b937feb7624319a3e73
TransformerSet
import torch from torch import nn class TransformerSet(nn.Module): def __init__(self, input_size, dropout=0.5, trans_head_nums=1, **kwargs): super(TransformerSet, self).__init__() self.Transformer = nn.MultiheadAttention(embed_dim=input_size, num_heads=trans_head_nums, dropout=dropout...
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....
Asichurter/MalFusionFSL
TransformerSet
false
16,992
[ "MIT" ]
4
713bf64cc07a3489f42941fd2299837075575ac0
https://github.com/Asichurter/MalFusionFSL/tree/713bf64cc07a3489f42941fd2299837075575ac0
Connection_Combination
import torch import torch.nn as nn import torch.nn.functional as F import torch.distributed import torch.nn.parallel import torch.utils.data import torch.utils.data.distributed class Connection_Combination(nn.Module): """combine 3 types of connection method by 'beta' weights to become an input node """ def _...
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 ...
senyang-ml/PoseNFS
Connection_Combination
false
16,380
[ "MIT" ]
53
1229abb69917dab1e57def3de0e3fe9a8a3164cd
https://github.com/senyang-ml/PoseNFS/tree/1229abb69917dab1e57def3de0e3fe9a8a3164cd
ResidualBlock
import torch import torch.nn as nn from functools import partial def normalization(channels): """ Make a standard normalization layer. :param channels: number of input channels. :return: an nn.Module for normalization. """ return GroupNorm32(32, channels) def ncsn_conv3x3(in_planes, out_pla...
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 ...
DeepTitan/PNDM
ResidualBlock
false
13,577
[ "Apache-2.0" ]
61
4037a4f40011c9a0d47b92303e64d47fcc7ed56a
https://github.com/DeepTitan/PNDM/tree/4037a4f40011c9a0d47b92303e64d47fcc7ed56a
Wav2Vec2ClassificationHead
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Wav2Vec2ClassificationHead(nn.Module): """Head for wav2vec classification task.""" def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) 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._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
Ayushk4/MedImaging
Wav2Vec2ClassificationHead
false
1,871
[ "MIT" ]
0
dbc8968f076385be0c8db42210817ae0940fa26a
https://github.com/Ayushk4/MedImaging/tree/dbc8968f076385be0c8db42210817ae0940fa26a
ConvolutionBlock
# 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
Seungwoo0326/WaveGrad2-1
ConvolutionBlock
false
14,450
[ "MIT" ]
45
3b202201348449b89353f28bce1596ca7939a810
https://github.com/Seungwoo0326/WaveGrad2-1/tree/3b202201348449b89353f28bce1596ca7939a810
DecayModule
import math import torch import torch.nn as nn class DecayModule(nn.Module): def __init__(self, input_size, hidden_size, bias=True, num_chunks=1, activation='relu', nodiag=False): super(DecayModule, self).__init__() self.sigmoid = nn.Sigmoid() self.tanh = nn.Tanh() self.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 math import torch.nn a...
Hritikbansal/RNNs_SVA_OOD
DecayModule
false
17,399
[ "MIT" ]
4
a1c73955342d9d35c49da5fcb7b315e37b0f75d1
https://github.com/Hritikbansal/RNNs_SVA_OOD/tree/a1c73955342d9d35c49da5fcb7b315e37b0f75d1
L1_Charbonnier_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 from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
ankurbhatia24/image-super-resolution
L1_Charbonnier_loss
false
9,752
[ "Apache-2.0" ]
0
7ebc2be70e1a940addb6ba886a663f88167e6007
https://github.com/ankurbhatia24/image-super-resolution/tree/7ebc2be70e1a940addb6ba886a663f88167e6007
GeneralizedMeanPoolingList
import torch from abc import ABC from torch import nn class GeneralizedMeanPoolingList(nn.Module, ABC): """Applies a 2D power-average adaptive pooling over an input signal composed of several input planes. The function computed is: :math:`f(X) = pow(sum(pow(X, p)), 1/p)` - At p = infinity, one get...
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 abc import ABC from torch import nn assert_size_stride = torch._C._dynamo.guards.ass...
catcodee/cluster-contrast-reid
GeneralizedMeanPoolingList
false
3,297
[ "MIT" ]
0
f6359990a4326375f23c3fd654df3fc6dcc9c579
https://github.com/catcodee/cluster-contrast-reid/tree/f6359990a4326375f23c3fd654df3fc6dcc9c579
distLinear
import torch import torch.nn as nn from torch.nn.utils.weight_norm import WeightNorm class distLinear(nn.Module): def __init__(self, indim, outdim): super(distLinear, self).__init__() self.L = nn.Linear(indim, outdim, bias=False) self.class_wise_learnable_norm = True if self.class...
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 ...
horsepurve/DeepVoro
distLinear
false
3,627
[ "MIT" ]
0
1b67a8e0d51e1c966a2af96d4b6a495f8390f608
https://github.com/horsepurve/DeepVoro/tree/1b67a8e0d51e1c966a2af96d4b6a495f8390f608
FeedForward
# 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....
mcx/annotated_deep_learning_paper_implementations
FeedForward
false
7,208
[ "MIT" ]
1
f169f3a71dd2d36eb28ad31062d3475efa367b88
https://github.com/mcx/annotated_deep_learning_paper_implementations/tree/f169f3a71dd2d36eb28ad31062d3475efa367b88
BatchSpectralPenalizationLoss
# 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.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
neka-nat/Transfer-Learning-Library
BatchSpectralPenalizationLoss
false
16,137
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
MinibatchStdLayer
import torch from torch import nn class MinibatchStdLayer(nn.Module): def __init__(self, group_size=4): super().__init__() self.group_size = group_size def forward(self, x): group_size = min(self.group_size, x.shape[0]) s = x.shape y = x.view([group_size, -1, s[1], s[...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
BillyXYB/TransEditor
MinibatchStdLayer
false
17,069
[ "MIT" ]
4
0194cd6f0e96c801d55c0cb9683e1f552bcf6d48
https://github.com/BillyXYB/TransEditor/tree/0194cd6f0e96c801d55c0cb9683e1f552bcf6d48
BertOutput
from _paritybench_helpers import _mock_config import torch import torch.nn import torch.nn as nn class BertOutput(nn.Module): """BERT output layer. Based on: BERT (pytorch-transformer) https://github.com/huggingface/transformers """ def __init__(self, config) ->None: super().__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.triton_helpers import libdevice import torch.nn imp...
Project-MONAI/MONAI
BertOutput
false
16,225
[ "Apache-2.0" ]
2,971
2bab12c67c3cc1d54a4847628ce1e879064be11c
https://github.com/Project-MONAI/MONAI/tree/2bab12c67c3cc1d54a4847628ce1e879064be11c
GELU
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class GELU(nn.Module): """Applies the Gaussian Error Linear Units function: .. math:: ext{GELU}(x) = x * \\Phi(x) where :math:`\\Phi...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.parallel import torch.optim import torch....
Crazy-Jack/SpatialExpGeneCluster
GELU
false
315
[ "MIT" ]
0
9e57c308d1c577a936a2358d0641c65b8130034f
https://github.com/Crazy-Jack/SpatialExpGeneCluster/tree/9e57c308d1c577a936a2358d0641c65b8130034f
CoreKernelTensorRing
# 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 from torch.nn import Parameter assert_size_stri...
AndresOtero/TensorDecompositionMachineLearning
CoreKernelTensorRing
false
16,917
[ "MIT" ]
3
455f16b405ec9d031999b0ebf9c5a68d3c20b233
https://github.com/AndresOtero/TensorDecompositionMachineLearning/tree/455f16b405ec9d031999b0ebf9c5a68d3c20b233
GAT
# 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....
iaongstudio/PaperRobot
GAT
false
3,674
[ "MIT" ]
0
d7d2a87822e1fb473e5c72ffc6b83d1022ecd3c1
https://github.com/iaongstudio/PaperRobot/tree/d7d2a87822e1fb473e5c72ffc6b83d1022ecd3c1
NormalAttention_gaussian
import torch import torch.nn as nn class NormalAttention_gaussian(nn.Module): def __init__(self, input_channel_num): super(NormalAttention_gaussian, self).__init__() self.c_in = input_channel_num self.value_conv = nn.Conv2d(in_channels=self.c_in, out_channels= self.c_in, kerne...
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....
Schwartz-Zha/My-invertible-resnet
NormalAttention_gaussian
false
1,030
[ "MIT" ]
0
5415975bb0d640f3bf3ef4a7b986563e84109270
https://github.com/Schwartz-Zha/My-invertible-resnet/tree/5415975bb0d640f3bf3ef4a7b986563e84109270
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
baduncan/Pytorch-seq2seq-Beam-Search
Attention
false
12,148
[ "MIT" ]
0
82e2f12563d4db520a9a9089e7205f398ca53699
https://github.com/baduncan/Pytorch-seq2seq-Beam-Search/tree/82e2f12563d4db520a9a9089e7205f398ca53699
ConvNet
import torch import torch.nn as nn import torch.nn.functional as tF class ConvNet(nn.Module): def __init__(self): super(ConvNet, self).__init__() self.conv1 = nn.Conv2d(1, 5, 3, 1) self.conv2 = nn.Conv2d(5, 6, 4, 1, bias=False) self.conv3 = nn.Conv2d(6, 7, 3, 1) self.fc1 =...
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....
amyami187/nngeometry
ConvNet
false
14,848
[ "MIT" ]
103
cb516da3f7a019e148f48ff3ef3bed0cdae0d184
https://github.com/amyami187/nngeometry/tree/cb516da3f7a019e148f48ff3ef3bed0cdae0d184
DrugDrugAttentionLayer
import torch import torch.nn.functional class DrugDrugAttentionLayer(torch.nn.Module): """Co-attention layer for drug pairs.""" def __init__(self, feature_number: 'int'): """Initialize the co-attention layer. :param feature_number: Number of input features. """ super().__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.triton_helpers import libdevice import torch.nn.fun...
YuWVandy/chemicalx
DrugDrugAttentionLayer
false
1,275
[ "Apache-2.0" ]
0
c02f979a502409c26700e6d5a1b2e6c0aa77e64c
https://github.com/YuWVandy/chemicalx/tree/c02f979a502409c26700e6d5a1b2e6c0aa77e64c
MP
from torch.nn import Module import torch import torch.utils.data from torch.nn import MaxPool2d class MP(Module): def __init__(self, k=2): super().__init__() self.m = MaxPool2d(kernel_size=k, stride=k) def forward(self, x): return self.m(x) 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._inductor.runtime import triton_helpers from torch.nn import Module import torch.utils.data from torch.nn import MaxPool2d assert...
ioangatop/yolo
MP
false
6,892
[ "MIT" ]
1
c65a72337369572bc07090f39123e2bf6ff5f4a3
https://github.com/ioangatop/yolo/tree/c65a72337369572bc07090f39123e2bf6ff5f4a3
L2
import torch import torch.nn as nn class L2(nn.Module): def __init__(self): super(L2, self).__init__() def forward(self, output, target): lossvalue = torch.norm(output - target, p=2, dim=1).mean() return lossvalue def get_inputs(): return [torch.rand([4, 4, 4, 4]), 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._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
B06901052/deep-stabilization
L2
false
97
[ "Apache-2.0" ]
0
b6030b463cf1f1128660e900669f43e742aa2651
https://github.com/B06901052/deep-stabilization/tree/b6030b463cf1f1128660e900669f43e742aa2651
ELU
import torch import torch.nn as nn class ActivationFunction(nn.Module): def __init__(self): super().__init__() self.name = self.__class__.__name__ self.config = {'name': self.name} class ELU(ActivationFunction): def forward(self, x): return torch.where(x > 0, x, torch.exp(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 math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
jiwidi/lightning-tutorials
ELU
false
15,695
[ "Apache-2.0" ]
114
70ba437447f345d4d6ba089d5b30fd1da2cbc04b
https://github.com/jiwidi/lightning-tutorials/tree/70ba437447f345d4d6ba089d5b30fd1da2cbc04b
DuelingNetwork
import torch import torch.nn as nn class DuelingNetwork(nn.Module): def __init__(self, state_size, action_size, seed): super(DuelingNetwork, self).__init__() self.seed = torch.manual_seed(seed) self.action_size = action_size self.fc1 = nn.Linear(state_size, 64) self.relu1 ...
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_...
bluebibi/rl_book_codes
DuelingNetwork
false
3,226
[ "MIT" ]
0
ef7fc9993eb66618e4b4e80e59cc2879a8db3522
https://github.com/bluebibi/rl_book_codes/tree/ef7fc9993eb66618e4b4e80e59cc2879a8db3522
SplitAndConcat
import torch import torch.nn as nn import torch.utils.data class SplitAndConcat(nn.Module): """Split the data from split_dim and concatenate in concat_dim. @param split_dim from which axis the data will be chunk @param concat_dim to which axis the data will be concatenated @param chunk size of the da...
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....
sstsai-adl/d2go
SplitAndConcat
false
16,488
[ "Apache-2.0" ]
687
6cff773797b14698043589afe57ea67cd76286f9
https://github.com/sstsai-adl/d2go/tree/6cff773797b14698043589afe57ea67cd76286f9
AttentivePooling
# 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....
AyushExel/s3prl
AttentivePooling
false
1,985
[ "MIT" ]
0
6531904e9621a778978b9cfef3ba9f582e56639a
https://github.com/AyushExel/s3prl/tree/6531904e9621a778978b9cfef3ba9f582e56639a
BCEAfterSigmoidLoss
import torch from torch import nn from torch.nn import functional import torch.autograd class Loss(nn.Module): """A loss function.""" class PointwiseLoss(Loss): """Pointwise loss functions compute an independent loss term for each triple-label pair.""" class BCEAfterSigmoidLoss(PointwiseLoss): """A lo...
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 ...
johnbachman/pykeen
BCEAfterSigmoidLoss
false
3,761
[ "MIT" ]
0
6595f6cefc462b6d1e057446e6c3ed66d36a078b
https://github.com/johnbachman/pykeen/tree/6595f6cefc462b6d1e057446e6c3ed66d36a078b
Critic
# 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 ...
LQNew/AUMC
Critic
false
17,744
[ "MIT" ]
5
c3ce9c289bc8c0912431d68ec4fe260f640df3bc
https://github.com/LQNew/AUMC/tree/c3ce9c289bc8c0912431d68ec4fe260f640df3bc
Block
import torch import torch.nn as nn import torch.nn.functional as F class LayerNorm(nn.Module): """ LayerNorm that supports two data formats: channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch_size, height, width, c...
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 ...
AnweshCR7/convNeXt
Block
false
8,868
[ "MIT" ]
0
5400dd0f7c793f497057f5548b49e3969a540504
https://github.com/AnweshCR7/convNeXt/tree/5400dd0f7c793f497057f5548b49e3969a540504
ChannelAttentionModule
import torch import numpy as np from torch import nn from torch.nn import init class SimplifiedScaledDotProductAttention(nn.Module): """ Scaled dot-product attention """ def __init__(self, d_model, h, dropout=0.1): """ :param d_model: Output dimensionality of the model :param ...
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....
LeftAttention/Attention-Codebase
ChannelAttentionModule
false
17,596
[ "Apache-2.0" ]
6
348ec66233a7c0f95a3cb5f0f11641e2a7a9b9c3
https://github.com/LeftAttention/Attention-Codebase/tree/348ec66233a7c0f95a3cb5f0f11641e2a7a9b9c3
ConvLSTMCell
import torch import torch.nn as nn from torch.autograd import Variable class ConvLSTMCell(nn.Module): def __init__(self, input_channels, hidden_channels, kernel_size, bias=True ): super(ConvLSTMCell, self).__init__() assert hidden_channels % 2 == 0 self.input_channels = input_chan...
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 ...
Kwanss/PCLNet
ConvLSTMCell
false
8,402
[ "MIT" ]
31
d288820975a9daf23eab47c52d7ea6f7dd564725
https://github.com/Kwanss/PCLNet/tree/d288820975a9daf23eab47c52d7ea6f7dd564725
TrajectoryPredictor
# 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...
CMU-MultiComp-Lab/language2pose
TrajectoryPredictor
false
4,931
[ "MIT" ]
1
b32199ae5b2b80087411504afef384e0fa689d04
https://github.com/CMU-MultiComp-Lab/language2pose/tree/b32199ae5b2b80087411504afef384e0fa689d04
ConstMult
# 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
RaoefTaki/MNTDP-forked
ConstMult
false
8,686
[ "MIT" ]
15
d9ea59a6638f6cdc93eca180ab02672f5bf5d2a1
https://github.com/RaoefTaki/MNTDP-forked/tree/d9ea59a6638f6cdc93eca180ab02672f5bf5d2a1
Decoder2
import torch import torch.nn as nn class Decoder2(nn.Module): def __init__(self, model=None, fixed=False): super(Decoder2, self).__init__() self.fixed = fixed self.conv21 = nn.Conv2d(128, 64, 3, 1, 0) self.conv12 = nn.Conv2d(64, 64, 3, 1, 0, dilation=1) self.conv11 = nn.Co...
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/Collaborative-Distillation
Decoder2
false
14,021
[ "MIT" ]
172
915712674af82ff91d926d922c14988cce0430f3
https://github.com/MingSun-Tse/Collaborative-Distillation/tree/915712674af82ff91d926d922c14988cce0430f3
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_...
ChavesLiu/pytorch-dc-tts
LayerNorm
false
13,461
[ "MIT" ]
145
29a1ab11f69b2c4316ae0a8766e995b96385a29f
https://github.com/ChavesLiu/pytorch-dc-tts/tree/29a1ab11f69b2c4316ae0a8766e995b96385a29f
HardSwish
# 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 torchvision.transforms.functional as F import torch.nn.funct...
bcaitech1/p4-mod-model_diet
HardSwish
false
6,314
[ "MIT" ]
1
36d8a747e12c375b07d132ed4d08f9fc77126a8b
https://github.com/bcaitech1/p4-mod-model_diet/tree/36d8a747e12c375b07d132ed4d08f9fc77126a8b
SRCNN
import torch from torchvision.transforms import * import torch.nn as nn class SRCNN(nn.Module): def __init__(self): super(SRCNN, self).__init__() self.input = nn.Conv2d(in_channels=3, out_channels=64, kernel_size= 9, padding=9 // 2) self.conv = nn.Conv2d(in_channels=64, out_ch...
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 torchvision.transforms i...
FYLSunghwan/VDSR-pytorch
SRCNN
false
2,641
[ "MIT" ]
0
fb862e97756078db2d5def095d46cc22a07cd014
https://github.com/FYLSunghwan/VDSR-pytorch/tree/fb862e97756078db2d5def095d46cc22a07cd014
CosLoss
import torch from torch import nn import torch.utils.data class CosLoss(nn.Module): def __init__(self, factor=6e-07, havesum=True, havemax=True): super(CosLoss, self).__init__() self.factor = factor self.havesum = havesum self.havemax = havemax def forward(self, w): m...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards...
PatrickGui/Face_Pytorch
CosLoss
false
971
[ "Apache-2.0" ]
0
ff5b820ca3978883f7cf95f0209fba3ee958c939
https://github.com/PatrickGui/Face_Pytorch/tree/ff5b820ca3978883f7cf95f0209fba3ee958c939
DiceLoss
# 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...
Geoffrey1500/mmsegmentation
DiceLoss
false
11,458
[ "Apache-2.0" ]
0
0a5544c46e6ea1e07ed47858d5fcb39a5ae974b1
https://github.com/Geoffrey1500/mmsegmentation/tree/0a5544c46e6ea1e07ed47858d5fcb39a5ae974b1
Dense
from torch.autograd import Function from torch.nn import Module import torch from torch.nn import Parameter class DenseFunction(Function): @staticmethod def forward(ctx, input, weight, bias=None): output = input.mm(weight.t()) if bias is not None: output += bias.unsqueeze(0).expan...
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 from torch.nn import Module from torch.nn im...
tczhangzhi/pytorch-parallel
Dense
false
16,535
[ "MIT" ]
117
8d8baf80dd48234386051d0bab616de5b55f8f5c
https://github.com/tczhangzhi/pytorch-parallel/tree/8d8baf80dd48234386051d0bab616de5b55f8f5c
SpatialDepthWiseConvolution
from torch.nn import Module import math import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class SpatialDepthWiseConvolution(Module): """ ## Spatial Depth Wise Convolution This is actually slower """ def __init__(self, d_k: 'int', kernel_si...
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.nn import Module import math from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd assert...
techthiyanes/annotated_deep_learning_paper_implementations
SpatialDepthWiseConvolution
false
16,572
[ "MIT" ]
3,714
8af24da2dd39a9a87482a4d18c2dc829bbd3fd47
https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47
ConvDownsample
import torch from torch import nn class ConvDownsample(nn.Module): """Convolutional Downsampling of ConvMLP.""" def __init__(self, embed_dim_in, embed_dim_out): super().__init__() self.downsample = nn.Conv2d(embed_dim_in, embed_dim_out, 3, stride= 2, padding=1) def forward(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...
Jack-Hu-2001/UniverseNet
ConvDownsample
false
13,862
[ "Apache-2.0" ]
314
03e7b8442286f951c65fe730ec86b9441005ac1b
https://github.com/Jack-Hu-2001/UniverseNet/tree/03e7b8442286f951c65fe730ec86b9441005ac1b
KLDLossWithStandardGaussian
import torch import torch.nn as nn import torch.utils.data class KLDLossWithStandardGaussian(nn.Module): def forward(self, mu, logvar): return -0.5 * torch.sum(1 + logvar - mu.pow(2) - logvar.exp()) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
atmacvit/meronymnet
KLDLossWithStandardGaussian
false
6,267
[ "MIT" ]
1
47e1a7caadc0f770439bb26a93b885f790f62804
https://github.com/atmacvit/meronymnet/tree/47e1a7caadc0f770439bb26a93b885f790f62804
InformedSender
# 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....
Daetheys/Lazimpa
InformedSender
false
7,956
[ "MIT" ]
15
21f4f4ebcdfa8b6a775b64673dd3001763c91cf1
https://github.com/Daetheys/Lazimpa/tree/21f4f4ebcdfa8b6a775b64673dd3001763c91cf1
Normalize
import torch import torch.nn as nn class Normalize(nn.Module): def __init__(self, features, epsilon=1e-06): super(Normalize, self).__init__() self.gain = nn.Parameter(torch.ones(features)) self.bias = nn.Parameter(torch.zeros(features)) self.epsilon = epsilon def forward(self...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.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