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
FFN
import torch import torch.utils.data import torchvision.transforms.functional as F import torch.nn as nn import torch.nn.functional as F class FFN(nn.Module): def __init__(self, d_model, d_ffn, dropout=0): super().__init__() self.linear1 = nn.Linear(d_model, d_ffn) self.activation = F.rel...
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....
Tarandro/MOTR
FFN
false
14,558
[ "MIT" ]
191
f2bcc2df0b3bd959208e78c54a3e9d8a3434f9f4
https://github.com/Tarandro/MOTR/tree/f2bcc2df0b3bd959208e78c54a3e9d8a3434f9f4
DecoderLayer
import torch import torch.nn as nn import torch.nn.functional as F class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attn_dropo...
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....
liuruoze/mini-AlphaStar
DecoderLayer
false
15,948
[ "Apache-2.0" ]
108
cf9de2507d526a5fb8ef67676aab2ffb92738640
https://github.com/liuruoze/mini-AlphaStar/tree/cf9de2507d526a5fb8ef67676aab2ffb92738640
TotalVariationLoss
import torch import torch.nn as nn class TotalVariationLoss(nn.Module): def __init__(self): super(TotalVariationLoss, self).__init__() def forward(self, x): """ Arguments: x: a float tensor with shape [b, 3, h, w]. It represents a RGB image with pixel values i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
TropComplique/CNNMRF
TotalVariationLoss
false
18,011
[ "MIT" ]
3
602f861b14ed240acac89e6502e69f797d4f4a49
https://github.com/TropComplique/CNNMRF/tree/602f861b14ed240acac89e6502e69f797d4f4a49
SpatialAttention
import torch import torch.nn as nn class SpatialAttention(nn.Module): def __init__(self, kernel=3): super(SpatialAttention, self).__init__() self.conv1 = nn.Conv2d(2, 1, kernel_size=kernel, padding=kernel // 2, bias=False) self.sigmoid = nn.Sigmoid() def forward(self, x)...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Alpkant/CDCN
SpatialAttention
false
8,892
[ "MIT" ]
0
4d4401824b8652a10739615e02e67148521739d2
https://github.com/Alpkant/CDCN/tree/4d4401824b8652a10739615e02e67148521739d2
Skew
import torch import torch.nn as nn 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 Skew(nn.Module): def forward(self, X): A = X.triu(1) return A - A.transpose(-1, -2) d...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.quantization import torch.onnx import torch.nn.parallel import torch.utils.data import torch.fx import to...
MartinRenaudin/tutorials
Skew
false
2,753
[ "BSD-3-Clause" ]
0
035d6827d77c52fed2a927f105e39fd73516f093
https://github.com/MartinRenaudin/tutorials/tree/035d6827d77c52fed2a927f105e39fd73516f093
CanineAttention
# 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....
Clemens123/transformers
CanineAttention
false
13,225
[ "Apache-2.0" ]
0
22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
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...
ivadomed-profile-analysis-project/ivadomed
MultiClassDiceLoss
false
15,653
[ "MIT" ]
87
3b53e2cb2b210511943da439401e2471fd387876
https://github.com/ivadomed-profile-analysis-project/ivadomed/tree/3b53e2cb2b210511943da439401e2471fd387876
SincFilter
import torch import numpy as np import torch.utils.data import torch.nn as torch_nn class SincFilter(torch_nn.Module): """ SincFilter Given the cut-off-frequency, produce the low-pass and high-pass windowed-sinc-filters. If input cut-off-frequency is (batchsize=1, signal_length, 1), ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy as np import torch.utils.data import torch.nn as torch_nn as...
Ninushkat/Impact-Synth-Hardware
SincFilter
false
14,116
[ "MIT" ]
55
37a2ecfec51b052b39d1ad0d4676f09d5f00e3c2
https://github.com/Ninushkat/Impact-Synth-Hardware/tree/37a2ecfec51b052b39d1ad0d4676f09d5f00e3c2
TransformerBasicHead
# 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....
Drill-D/SlowFast
TransformerBasicHead
false
2,174
[ "Apache-2.0" ]
0
d55ae1cf30a9415858a9bd5da983790a2b418653
https://github.com/Drill-D/SlowFast/tree/d55ae1cf30a9415858a9bd5da983790a2b418653
UpConv
import torch import torch.nn as nn class UpConv(nn.Module): def __init__(self, input_nc, output_nc, kernel_size): super(UpConv, self).__init__() self.deconv = nn.ConvTranspose2d(in_channels=input_nc, out_channels =output_nc, kernel_size=2, bias=True, stride=2, padding=0) 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 ...
kkrish39/realtime-depth-prediction-from-monocular-videos
UpConv
false
7,042
[ "BSD-3-Clause" ]
1
9cde9c1a6df6c91af1ada80b3aaeebae03fc59dc
https://github.com/kkrish39/realtime-depth-prediction-from-monocular-videos/tree/9cde9c1a6df6c91af1ada80b3aaeebae03fc59dc
UnbalancedLoss
# 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...
Kwonyoung-Ryu/DeepGlobalRegistration
UnbalancedLoss
false
11,613
[ "MIT" ]
0
0045118d96182047f4c09c4c4fe2a1b2b527cc5f
https://github.com/Kwonyoung-Ryu/DeepGlobalRegistration/tree/0045118d96182047f4c09c4c4fe2a1b2b527cc5f
LayerScaling
# 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 import torch.nn.parallel import torch.optim import torch....
Ajk4/online-normalization
LayerScaling
false
8,826
[ "BSD-3-Clause" ]
0
84895855fb8b099ad8c1266dc325bec41d72ecf5
https://github.com/Ajk4/online-normalization/tree/84895855fb8b099ad8c1266dc325bec41d72ecf5
scSE
import torch import torch.nn as nn class cSE(nn.Module): def __init__(self, in_channels): super().__init__() reduced_filters = 1 if in_channels // 2 == 0 else in_channels // 2 self.global_avg_pool = nn.AdaptiveAvgPool2d(output_size=(1, 1)) self.pointwise_1 = nn.Conv2d(in_channels=...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
mattroz/yatopi
scSE
false
3,996
[ "MIT" ]
0
278bac6f3d2f13916ae9d43309b9f38b608426bd
https://github.com/mattroz/yatopi/tree/278bac6f3d2f13916ae9d43309b9f38b608426bd
Encoder1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
MingSun-Tse/Collaborative-Distillation
Encoder1
false
14,018
[ "MIT" ]
172
915712674af82ff91d926d922c14988cce0430f3
https://github.com/MingSun-Tse/Collaborative-Distillation/tree/915712674af82ff91d926d922c14988cce0430f3
PatchEmbedding
# 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 ...
aditya-agrawal-30502/vformer
PatchEmbedding
false
14,747
[ "MIT" ]
90
e1f4950f980238442ff1dc39a8f0791e4fbc9dac
https://github.com/aditya-agrawal-30502/vformer/tree/e1f4950f980238442ff1dc39a8f0791e4fbc9dac
MeanPoolWithMask
import torch from torch import nn import torch.utils.data class MeanPoolWithMask(nn.Module): def __init__(self): super(MeanPoolWithMask, self).__init__() self.inf = 10000000000000.0 def forward(self, tensor, mask, dim=0): masks = mask.view(mask.size(0), mask.size(1), -1).float() ...
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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._...
LindaCY/fastNLP
MeanPoolWithMask
false
17,613
[ "Apache-2.0" ]
4
3fa95b6cfc31211453bc21792e3eef87948858da
https://github.com/LindaCY/fastNLP/tree/3fa95b6cfc31211453bc21792e3eef87948858da
EmbedComp
# 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.optim import torch.utils.data import torch.ba...
Divyanshu23/model-zoo
EmbedComp
false
8,087
[ "MIT" ]
43
2eea6df691d302e182bb1ff8ec5af3542de562ba
https://github.com/Divyanshu23/model-zoo/tree/2eea6df691d302e182bb1ff8ec5af3542de562ba
SoftCrossEntropyLoss
import torch from torch import Tensor from typing import List import torch.nn as nn import torch.nn.functional as F class SoftCrossEntropyLoss(nn.Module): """ Calculate the CrossEntropyLoss with soft targets :param weight: Weight to assign to each of the classes. Default: None :type weight: list of f...
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 typing import Lis...
SenWu/fonduer
SoftCrossEntropyLoss
false
5,811
[ "MIT" ]
1
c4f8d95cec97552b34412c6787eb7370ae17424f
https://github.com/SenWu/fonduer/tree/c4f8d95cec97552b34412c6787eb7370ae17424f
ScaledDotProductAttention
import torch from torch import nn class ScaledDotProductAttention(nn.Module): """ Attention mechansims usually scale values based on relationships between keys and queries. Attention(Q,K,V) = A(Q,K)*V where A() is a normalization function. A common choice for the normalization function is 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 from torch._inductor.runtime....
KalleBylin/tft_webapp
ScaledDotProductAttention
false
9,227
[ "Apache-2.0" ]
0
008f109e77f8bada417655dab482f340adb8cb6b
https://github.com/KalleBylin/tft_webapp/tree/008f109e77f8bada417655dab482f340adb8cb6b
AttnConnector
# 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 ...
ruinunca/NeuralDialog-ZSDG
AttnConnector
false
16,352
[ "Apache-2.0" ]
132
c20359541036ea876a126d1c7c172b820476dcb2
https://github.com/ruinunca/NeuralDialog-ZSDG/tree/c20359541036ea876a126d1c7c172b820476dcb2
maxout
import torch import torch.nn as nn import torch.utils.data class maxout(nn.Module): """ maxout network """ def __init__(self, in_feature, out_feature, pool_size): super(maxout, self).__init__() self.in_feature = in_feature self.out_feature = out_feature self.pool_size ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
Angelinaa/KOBE
maxout
false
45
[ "MIT" ]
0
4d25487051e2791a977e59297f70a25e51806466
https://github.com/Angelinaa/KOBE/tree/4d25487051e2791a977e59297f70a25e51806466
C3
import torch import torch.nn as nn from collections import OrderedDict class C3(nn.Module): def __init__(self): super(C3, self).__init__() self.c3 = nn.Sequential(OrderedDict([('c3', nn.Conv2d(32, 64, kernel_size=(3, 3), bias=32)), ('relu3', nn.ReLU())])) def forward(self, img): ...
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 from co...
devillove084/DeepSignal
C3
false
12,260
[ "MIT" ]
0
1fe122b32752b11e10ca4bef3d07ddd7de4348b5
https://github.com/devillove084/DeepSignal/tree/1fe122b32752b11e10ca4bef3d07ddd7de4348b5
CRF
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
lzx325/NCRF
CRF
false
12,757
[ "Apache-2.0" ]
0
2fc081184e3bc45b043e4c8c0a94644a0149e54c
https://github.com/lzx325/NCRF/tree/2fc081184e3bc45b043e4c8c0a94644a0149e54c
LovaszLoss
import torch import numpy as np from torch import nn import torch.nn.functional as F from itertools import filterfalse def jaccard(outputs, targets, per_image=False, non_empty=False, min_pixels=5): batch_size = outputs.size()[0] eps = 0.001 if not per_image: batch_size = 1 dice_target = target...
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 numpy as np from torch import nn import torch.nn.functional as F from itertools im...
kevinkwshin/kaggle-pneumothorax
LovaszLoss
false
16,124
[ "MIT" ]
74
24b91a9425097023f0cc7781a9380cb247babe22
https://github.com/kevinkwshin/kaggle-pneumothorax/tree/24b91a9425097023f0cc7781a9380cb247babe22
Decoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
Markussorensen/mlops_exercises
Decoder
false
2,633
[ "Apache-2.0" ]
0
52a3198367b66bbe0a5cfdc7a9424789b03273db
https://github.com/Markussorensen/mlops_exercises/tree/52a3198367b66bbe0a5cfdc7a9424789b03273db
Allocation
# 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....
pjordan/dmch
Allocation
false
4,120
[ "Apache-2.0" ]
0
84e04ddb0679007b15acfdc275e0e3f51e50d9f2
https://github.com/pjordan/dmch/tree/84e04ddb0679007b15acfdc275e0e3f51e50d9f2
Sparsemax
from torch.autograd import Function import torch import torch.nn as nn def _make_ix_like(X, dim): d = X.size(dim) rho = torch.arange(1, d + 1, device=X.device, dtype=X.dtype) view = [1] * X.dim() view[0] = -1 return rho.view(view).transpose(0, dim) def _roll_last(X, dim): if dim == -1: ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.autograd import Function import torch.nn as nn assert_size_stride = torch._C._...
roholazandie/entmax
Sparsemax
false
7,587
[ "MIT" ]
1
657374e6a792ec6840b6f78bc759cc1f51570aad
https://github.com/roholazandie/entmax/tree/657374e6a792ec6840b6f78bc759cc1f51570aad
RobertaClassificationHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
HebatallaTarek/Empathy-Mental-Health
RobertaClassificationHead
false
15,677
[ "BSD-3-Clause" ]
66
16e2a5f93aabd22803bb39805f8e76c8bea0ccf2
https://github.com/HebatallaTarek/Empathy-Mental-Health/tree/16e2a5f93aabd22803bb39805f8e76c8bea0ccf2
ResBlock
import torch from torch import nn from torchvision import models as models import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch.onnx class ResBlock(nn.Module): def __init__(self, num_of_channels): super(ResBlock, self).__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._inductor.runtime....
JinYAnGHe/openvino_training_extensions
ResBlock
false
2,717
[ "Apache-2.0" ]
0
a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee
https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee
adder2d
from torch.autograd import Function import math import torch import torch.nn as nn def adder2d_function(X, W, stride=1, padding=0): n_filters, _d_filter, h_filter, w_filter = W.size() n_x, _d_x, h_x, w_x = X.size() h_out = (h_x - h_filter + 2 * padding) / stride + 1 w_out = (w_x - w_filter + 2 * paddi...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch.autograd import Function import math import torch.nn as nn ass...
mark531593296/AdderNet
adder2d
false
10,443
[ "BSD-3-Clause" ]
0
2936728f537c0cceb8a47727630e5723af86df61
https://github.com/mark531593296/AdderNet/tree/2936728f537c0cceb8a47727630e5723af86df61
AlphaEntropy
# 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...
Gromy1211/torch-light
AlphaEntropy
false
11,455
[ "MIT" ]
0
c7d7a9bc5ab1eab03d800a27d9325859516f01e6
https://github.com/Gromy1211/torch-light/tree/c7d7a9bc5ab1eab03d800a27d9325859516f01e6
LayerNorm
import torch from torch import nn class LayerNorm(nn.Module): def __init__(self, d_model, eps=1e-06): super(LayerNorm, self).__init__() self.gamma = nn.Parameter(torch.ones(d_model)) self.beta = nn.Parameter(torch.zeros(d_model)) self.eps = eps def forward(self, x): 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.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Adelashl6/mask_transformers
LayerNorm
false
4,804
[ "MIT" ]
1
2a2e4d1b40ae3ed546cb850d041af246806b63e7
https://github.com/Adelashl6/mask_transformers/tree/2a2e4d1b40ae3ed546cb850d041af246806b63e7
VarianceLayer
# 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 numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
GuYuanjie/DeepFusionPrior
VarianceLayer
false
5,227
[ "MIT" ]
1
a7126e073ed8c49b6a9a662492b64aaeee56cc01
https://github.com/GuYuanjie/DeepFusionPrior/tree/a7126e073ed8c49b6a9a662492b64aaeee56cc01
_MultipleInputNetwork
# 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_...
Yifanfanfanfan/torchutils
_MultipleInputNetwork
false
18,129
[ "MIT" ]
9
939331d28fcee97bfb0a4b2eaab8e799877fb0dc
https://github.com/Yifanfanfanfan/torchutils/tree/939331d28fcee97bfb0a4b2eaab8e799877fb0dc
TuckERLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
CogNLP/CogKGE
TuckERLoss
false
5,016
[ "MIT" ]
1
70d851d6489600c1e90eb25b0388a3ceba2f078c
https://github.com/CogNLP/CogKGE/tree/70d851d6489600c1e90eb25b0388a3ceba2f078c
MultiHeadAttention
# 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....
ngbsLab/Korean-Speech-Recognition
MultiHeadAttention
false
7,344
[ "Apache-2.0" ]
1
3867bf7d23222da6812c9b98a93d3c6f7b3c80fc
https://github.com/ngbsLab/Korean-Speech-Recognition/tree/3867bf7d23222da6812c9b98a93d3c6f7b3c80fc
disparityregression
# 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 numpy as np from torch import nn import torch.utils.data from torch.autograd import Variable import torch.nn.parallel import torch.ut...
Sarah20187/X-StereoLab
disparityregression
false
14,453
[ "MIT" ]
192
9ae8c1413307e7df91b14a7f31e8a95f9e5754f9
https://github.com/Sarah20187/X-StereoLab/tree/9ae8c1413307e7df91b14a7f31e8a95f9e5754f9
FCVAE
import torch from torch.nn import functional as F from torch import nn class BaseVAE(nn.Module): """ Base abstract class for the Variational Autoencoders """ def __init__(self, channels=1, width=28, height=28, z_dim=2): """ Constructor Parameters: channels - The n...
import torch from torch import device 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...
mbusy/vae
FCVAE
false
7,201
[ "MIT" ]
1
455e382a557b72fc944460331e5dd010ff83a76a
https://github.com/mbusy/vae/tree/455e382a557b72fc944460331e5dd010ff83a76a
ClassAttentionBlock
import torch from torch import Tensor from torch import nn class MLP(nn.Module): def __init__(self, dim, hidden_dim, out_dim=None) ->None: super().__init__() out_dim = out_dim or dim self.fc1 = nn.Linear(dim, hidden_dim) self.act = nn.GELU() self.fc2 = nn.Linear(hidden_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....
alhamami/Object-Detection-And-Tracking
ClassAttentionBlock
false
18,320
[ "MIT" ]
5
a211a1dc103e812c539cd0ee16a2da4251943bed
https://github.com/alhamami/Object-Detection-And-Tracking/tree/a211a1dc103e812c539cd0ee16a2da4251943bed
Critic
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Critic(nn.Module): """Critic (Value) Model.""" def __init__(self, state_size, action_size, seed, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np import tor...
david-varela/collaboration_and_competition
Critic
false
12,250
[ "MIT" ]
0
a170cc02eb3917af19d6aafa8b37f6089b83c35f
https://github.com/david-varela/collaboration_and_competition/tree/a170cc02eb3917af19d6aafa8b37f6089b83c35f
NormalIsotropicCovarianceLayer
import abc import math import torch class ProbabilisticLayer(torch.nn.Module, metaclass=abc.ABCMeta): """Probabilistic layer to be used by the encoder/decoder of a Variational AutoEncoder. """ @abc.abstractmethod def forward(self, inputs): """Compute the parameters of the distribution 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.triton_helpers import libdevice, math as tl_math im...
bolajiy/beer
NormalIsotropicCovarianceLayer
false
14,969
[ "MIT" ]
46
6fe968c7ca4864437890aa6bd705755c2580696e
https://github.com/bolajiy/beer/tree/6fe968c7ca4864437890aa6bd705755c2580696e
Swish
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
klaudiapalasz/torchlayers
Swish
false
15,843
[ "MIT" ]
573
e6edd8797875325b7c0539d75a12f0d51f494127
https://github.com/klaudiapalasz/torchlayers/tree/e6edd8797875325b7c0539d75a12f0d51f494127
PixelNormLayer
import torch import torch.nn as nn class PixelNormLayer(nn.Module): """Implements pixel-wise feature vector normalization layer.""" def __init__(self, epsilon=1e-08): super().__init__() self.epsilon = epsilon def forward(self, x): return x / torch.sqrt(torch.mean(x ** 2, dim=1, k...
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_...
CV-IP/interfacegan
PixelNormLayer
false
13,441
[ "MIT" ]
855
5a556b8e693f6e1888f769f653aaafaaccca5dc2
https://github.com/CV-IP/interfacegan/tree/5a556b8e693f6e1888f769f653aaafaaccca5dc2
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 ...
sourcery-ai-bot/Megatron-LM
VitMlpHead
false
4,377
[ "MIT" ]
0
f27f44e2c49d1cb39b2288bef6f7d837e11094cb
https://github.com/sourcery-ai-bot/Megatron-LM/tree/f27f44e2c49d1cb39b2288bef6f7d837e11094cb
LinearModel
import torch import torch.utils.data import torch.nn import torch.optim class LinearModel(torch.nn.Module): def __init__(self, _in, out): super(LinearModel, self).__init__() self.input = torch.nn.Linear(_in, _in) self.hidden_1 = torch.nn.Linear(_in, out) self.hidden_2 = torch.nn.L...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn import torch.optim assert_size_stride = ...
ajsampathk/trt_pose
LinearModel
false
18,234
[ "MIT" ]
7
592e038cacaf43b6a502b759a035a4e7cae9db9e
https://github.com/ajsampathk/trt_pose/tree/592e038cacaf43b6a502b759a035a4e7cae9db9e
SqueezeExcite
import torch from torchvision.transforms import functional as F import torch.nn as nn import torch.nn.functional as F def _make_divisible(v, divisor, min_value=None): """ This function is taken from the original tf repo. It ensures that all layers have a channel number that is divisible by 8 It can be...
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...
JaminFong/dali-pytorch
SqueezeExcite
false
8,330
[ "Apache-2.0" ]
41
7bd5d2380d210a32d24c7309da69c8d2c5db8759
https://github.com/JaminFong/dali-pytorch/tree/7bd5d2380d210a32d24c7309da69c8d2c5db8759
LinearZeros
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
Eladhi/VI_Glow
LinearZeros
false
5,122
[ "MIT" ]
1
9c48fbf8fa10c81fc2354a07fcc2837a77d06cef
https://github.com/Eladhi/VI_Glow/tree/9c48fbf8fa10c81fc2354a07fcc2837a77d06cef
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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
xuewengeophysics/Conformer
Block
false
13,141
[ "Apache-2.0" ]
0
e769a1ac9ab110dae2a356a4de1e06ccd0e95041
https://github.com/xuewengeophysics/Conformer/tree/e769a1ac9ab110dae2a356a4de1e06ccd0e95041
CA_Block
import torch import torch.nn as nn class CA_Block(nn.Module): def __init__(self, in_dim): super(CA_Block, self).__init__() self.chanel_in = in_dim self.gamma = nn.Parameter(torch.ones(1)) self.softmax = nn.Softmax(dim=-1) def forward(self, x): """ 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Mhaiyang/CVPR2021_PFNet
CA_Block
false
8,556
[ "BSD-3-Clause" ]
24
2c4cab0730e6a0619fad79092f0b34f71c3b56c4
https://github.com/Mhaiyang/CVPR2021_PFNet/tree/2c4cab0730e6a0619fad79092f0b34f71c3b56c4
InvGridSamplerNumerator
# 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 numpy as np fro...
EasyTry/coordinate_based_inpainting
InvGridSamplerNumerator
false
8,054
[ "MIT" ]
13
cbe0e3a58c8cb2054f0536a56f57264fd9967d63
https://github.com/EasyTry/coordinate_based_inpainting/tree/cbe0e3a58c8cb2054f0536a56f57264fd9967d63
PA_UP
# 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...
YingqiLiulll/scrips_for_SR
PA_UP
false
1,288
[ "MIT" ]
0
04fa6fdaf157e913d3e2521cd80315a10a2ccedc
https://github.com/YingqiLiulll/scrips_for_SR/tree/04fa6fdaf157e913d3e2521cd80315a10a2ccedc
DiceLoss
import functools import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization def reduce_loss(loss, reduction): """Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "...
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...
ImportPaddle/APCNet
DiceLoss
false
2,369
[ "MIT" ]
0
68ade1f83827b4cdd60ee4b6ac25454397100316
https://github.com/ImportPaddle/APCNet/tree/68ade1f83827b4cdd60ee4b6ac25454397100316
ElectronicAsymptotic
import torch from torch import nn class ElectronicAsymptotic(nn.Module): """Jastrow factor with a correct electronic cusp. The Jastrow factor is calculated from distances between all pairs of electrons, :math:`d_{ij}`, .. math:: \\mathrm \\gamma :=\\sum_{ij}-\\frac{c}{\\alpha(1+\\alp...
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...
MikeEntwistle/deepqmc
ElectronicAsymptotic
false
17,730
[ "MIT" ]
4
b5c20bf1768f04227becd5079c6b40aefc97d26c
https://github.com/MikeEntwistle/deepqmc/tree/b5c20bf1768f04227becd5079c6b40aefc97d26c
Downsample
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.parallel assert_size_stride = torch._C._dy...
javierrodenas/clearml_javi
Downsample
false
10,358
[ "Apache-2.0" ]
0
b6326104fe6a6f522223c2ac3d87468990a9e6f2
https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2
FocalLoss
import torch import torch.nn.functional as F from torch import nn as nn class FocalLoss(nn.Module): """Focal loss function for imbalanced dataset. Args: alpha (float): weighing factor between 0 and 1. Alpha may be set by inverse class frequency gamma (float): modulati...
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 ...
marshuang80/pe-slice-finder
FocalLoss
false
7,163
[ "Apache-2.0" ]
1
2426a55c404e8eb694110351d604d6bdd613e5ae
https://github.com/marshuang80/pe-slice-finder/tree/2426a55c404e8eb694110351d604d6bdd613e5ae
Net1
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim class Net1(nn.Module): def __init__(self): super(Net1, self).__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1) self.conv2...
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 ...
Yixiao99/deep-learning-containers
Net1
false
14,702
[ "Apache-2.0" ]
383
01f078adf5abfb92e802b326511981bdd4a8c85c
https://github.com/Yixiao99/deep-learning-containers/tree/01f078adf5abfb92e802b326511981bdd4a8c85c
EncoderLayer
# 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....
cclauss/nonauto-nmt
EncoderLayer
false
15,022
[ "BSD-3-Clause" ]
262
efcbe4f2329b140ac3ce06abb6409457cebc8e49
https://github.com/cclauss/nonauto-nmt/tree/efcbe4f2329b140ac3ce06abb6409457cebc8e49
MultiscalePixelLoss
import torch import torch.nn as nn class MultiscalePixelLoss(nn.Module): def __init__(self, loss_f=nn.L1Loss(), scale=5): super(MultiscalePixelLoss, self).__init__() self.criterion = loss_f self.downsample = nn.AvgPool2d(2, stride=2, count_include_pad=False) self.weights = [1, 0.5...
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 ...
grofit/traiNNer
MultiscalePixelLoss
false
15,510
[ "Apache-2.0" ]
78
12d006fd44ed304e4178839c53b1f3d95ca25dcb
https://github.com/grofit/traiNNer/tree/12d006fd44ed304e4178839c53b1f3d95ca25dcb
GELU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.parallel import torch._utils import torch...
Alicegaz/torchok
GELU
false
16,930
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
IndepAnisotropicGaussianUVLoss
import math import torch import torch.utils.data import torch.nn.functional as F from torch import nn class IndepAnisotropicGaussianUVLoss(nn.Module): """ Loss for the case of independent residuals with anisotropic covariances: $Sigma_i = sigma_i^2 I + r_i r_i^T$ The loss (negative log likelihood) is ...
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...
BUPT-PRIV/detectron2
IndepAnisotropicGaussianUVLoss
false
11,239
[ "Apache-2.0" ]
0
3163664cd5f43d50ea1966f410dc82410b9ccbf4
https://github.com/BUPT-PRIV/detectron2/tree/3163664cd5f43d50ea1966f410dc82410b9ccbf4
RMSPE
import torch import torch.nn as nn class RMSPE(nn.Module): def __init__(self, eps: 'float'=1e-08): super().__init__() self.eps = eps def forward(self, pred: 'torch.Tensor', target: 'torch.Tensor'): return torch.sqrt(torch.mean(torch.square((pred - target).abs() / ( target...
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...
Phimos/SIGSPATIAL-2021-GISCUP-3rd-Solution
RMSPE
false
8,648
[ "MIT" ]
11
79fcf9941c28cdb2eb38a3654e1514a1d998a41c
https://github.com/Phimos/SIGSPATIAL-2021-GISCUP-3rd-Solution/tree/79fcf9941c28cdb2eb38a3654e1514a1d998a41c
GAT
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F class GraphAttention(nn.Module): """ Simple GAT layer, similar to https://arxiv.org/abs/1710.10903 """ def __init__(self, in_features, out_features, dropout, alpha, concat=True): super(GraphAttention, 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 import triton_helpers from torch._inductor.runtime....
new2scala/graph-cnn.pytorch
GAT
false
16,191
[ "MIT" ]
330
8bee0c2ed687dcfdb277c71b70c8ea747b6ca9c7
https://github.com/new2scala/graph-cnn.pytorch/tree/8bee0c2ed687dcfdb277c71b70c8ea747b6ca9c7
QueryModule
import torch from torch import nn from torch.nn import functional as F class QueryModule(nn.Module): """ A neural module that takes as input a feature map and an attention and produces a feature map as output. Extended Summary ---------------- A :class:`QueryModule` takes a feature map and an...
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...
kdexd/probnmn-clevr
QueryModule
false
15,793
[ "MIT" ]
69
9c1b2286cf30e9fb045370153c9242a39760e02e
https://github.com/kdexd/probnmn-clevr/tree/9c1b2286cf30e9fb045370153c9242a39760e02e
AvgPoolHead
import torch import torch.nn as nn import torch.optim class AvgPoolHead(nn.Module): def __init__(self, in_channels, out_channels, fea_map_size): super(AvgPoolHead, self).__init__() self.avgpool = nn.AvgPool2d(fea_map_size, stride=1) self.fc = nn.Linear(in_channels, out_channels) def ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.optim assert_size_stride = torch._C._dynamo.g...
NiteshBharadwaj/structured_aleatoric_uncertainty_for_human_pose
AvgPoolHead
false
905
[ "MIT" ]
0
c74fb7384be562f0a0f1966b3fadf19e13a235f2
https://github.com/NiteshBharadwaj/structured_aleatoric_uncertainty_for_human_pose/tree/c74fb7384be562f0a0f1966b3fadf19e13a235f2
InnerProductNetwork
import torch import torch.utils.data class InnerProductNetwork(torch.nn.Module): def forward(self, x): """ :param x: Float tensor of size ``(batch_size, num_fields, embed_dim)`` """ num_fields = x.shape[1] row, col = list(), list() for i in range(num_fields - 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.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_...
Fanxingye/Autotabular
InnerProductNetwork
false
5,150
[ "Apache-2.0" ]
1
d630c78290a52f8c73885afb16884e18135c34f6
https://github.com/Fanxingye/Autotabular/tree/d630c78290a52f8c73885afb16884e18135c34f6
TransformerDecoderLayer
# 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....
M4rt1nM4yr/recipient_line_detection_DAS22
TransformerDecoderLayer
false
823
[ "MIT" ]
0
be5ed87940ff2c2740cf86130743538a2ba6ac4b
https://github.com/M4rt1nM4yr/recipient_line_detection_DAS22/tree/be5ed87940ff2c2740cf86130743538a2ba6ac4b
ClassificationModel
# 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_...
CraigWang1/EfficientDet-PyTorch
ClassificationModel
false
13,567
[ "Apache-2.0" ]
66
531d3c83338f03aa5c6f0615839c0ea5c03025f6
https://github.com/CraigWang1/EfficientDet-PyTorch/tree/531d3c83338f03aa5c6f0615839c0ea5c03025f6
MultiHeadAttention
import math import torch from torch import nn from torch.nn import functional as F import torch.utils.data class MultiHeadAttention(nn.Module): def __init__(self, channels, out_channels, n_heads, p_dropout=0.0, window_size=None, heads_share=True, block_length=None, proximal_bias=False, proximal_i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
roedoejet/vits
MultiHeadAttention
false
10,804
[ "MIT" ]
0
982e3632c876562563bc74c37d485eaf53715ecc
https://github.com/roedoejet/vits/tree/982e3632c876562563bc74c37d485eaf53715ecc
QuanConv
from torch.autograd import Function import torch import torch.utils.data.distributed import torch.nn as nn import torch.nn.functional as F import torch.utils.data def quantize(input, nbit): return Quantizer.apply(input, nbit) def dorefa_a(input, nbit_a): return quantize(torch.clamp(0.1 * input, 0, 1), nbit_...
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....
Jzz24/pytorch_quantization
QuanConv
false
13,960
[ "MIT" ]
71
0c2d93c8ce4f85dd2c34ea6f36c58d14db21bf8e
https://github.com/Jzz24/pytorch_quantization/tree/0c2d93c8ce4f85dd2c34ea6f36c58d14db21bf8e
AUXModule
# 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_...
HamzaFarhan/segmentation_models.pytorch
AUXModule
false
11,473
[ "MIT" ]
0
b7803df1d17027f329e267ba4c55144adfdd4da9
https://github.com/HamzaFarhan/segmentation_models.pytorch/tree/b7803df1d17027f329e267ba4c55144adfdd4da9
Gradient
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init as init class Gradient(nn.Module): def __init__(self): super(Gradient, self).__init__() kernel_v = [[0, -1, 0], [0, 0, 0], [0, 1, 0]] kernel_h = [[0, 0, 0], [-1, 0, 1], [0, 0, 0]] kernel_h...
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 ...
RunqiuBao/Event_ESTRNN
Gradient
false
14,339
[ "MIT" ]
180
6d156cc42a3a33bd0b4b7c4c4be98f943ff53acb
https://github.com/RunqiuBao/Event_ESTRNN/tree/6d156cc42a3a33bd0b4b7c4c4be98f943ff53acb
ScaledDotProductAttentionMemory
import torch import numpy as np import torch.nn as nn class ScaledDotProductAttentionMemory(nn.Module): """ Scaled dot-product attention with memory """ def __init__(self, d_model, d_k, d_v, h, m): """ :param d_model: Output dimensionality of the model :param d_k: Dimensionali...
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....
CurryYuan/X-Trans2Cap
ScaledDotProductAttentionMemory
false
7,951
[ "Apache-2.0" ]
11
c78a27209f14fcbbec74fe8b5edc06faea2e7d44
https://github.com/CurryYuan/X-Trans2Cap/tree/c78a27209f14fcbbec74fe8b5edc06faea2e7d44
SmoothL1Loss
# 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...
CityU-AIM-Group/HTD
SmoothL1Loss
false
17,115
[ "MIT" ]
5
0be9fd844118c275abc6053b3cbd5ffb589e62ee
https://github.com/CityU-AIM-Group/HTD/tree/0be9fd844118c275abc6053b3cbd5ffb589e62ee
DiceLoss
import torch class DiceLoss(torch.nn.Module): def __init__(self, weight=None, size_average=True, per_image=False, eps =1e-06): super().__init__() self.size_average = size_average self.register_buffer('weight', weight) self.per_image = per_image self.eps = eps ...
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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
sebasmos/Spacenet7TRDP
DiceLoss
false
12,955
[ "Apache-2.0" ]
0
03b5819321108017f8f8c2d359264c8e18d9e38a
https://github.com/sebasmos/Spacenet7TRDP/tree/03b5819321108017f8f8c2d359264c8e18d9e38a
ConvInRelu
import torch import numpy as np from torch import nn import torch.onnx class ConvInRelu(nn.Module): def __init__(self, channels_in, channels_out, kernel_size, stride=1): super(ConvInRelu, self).__init__() self.n_params = 0 self.channels = channels_out self.reflection_pad = nn.Refl...
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....
JuanFuriaz/donkey_share
ConvInRelu
false
11,608
[ "MIT" ]
0
caad831ca21094f05f9084f881ca3bbfa4168e4c
https://github.com/JuanFuriaz/donkey_share/tree/caad831ca21094f05f9084f881ca3bbfa4168e4c
LaplacianPyramidLayer
import torch from typing import Tuple import torch.nn as nn from torch.nn import functional as F class PyramidDown(nn.Module): def __init__(self) ->None: super(PyramidDown, self).__init__() self.filter = nn.Parameter(torch.tensor([[1, 4, 6, 4, 1], [4, 16, 24, 16, 4], [6, 24, 36, 24, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.nn import functional as F assert_size_stride = ...
masanorihirano/pytorch_extra_mhirano
LaplacianPyramidLayer
false
7,174
[ "MIT" ]
1
d19e07445567c069793b7ca1a22a846d7cbce58d
https://github.com/masanorihirano/pytorch_extra_mhirano/tree/d19e07445567c069793b7ca1a22a846d7cbce58d
ClsCriterion
import torch import torch.nn as nn class ClsCriterion(nn.Module): def __init__(self): super(ClsCriterion, self).__init__() def forward(self, predict, label, batch_weight=None): """ :param predict: B*C log_softmax result :param label: B*C one-hot label :param batch_wei...
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...
PaperCodeSubmission/ICML2020-697
ClsCriterion
false
8,661
[ "MIT" ]
12
00f7732c236b9c6234e76a47dfebe5de314d5c01
https://github.com/PaperCodeSubmission/ICML2020-697/tree/00f7732c236b9c6234e76a47dfebe5de314d5c01
SimpleASinModule
# 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.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleASinModule
false
14,643
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
DilConv1dWithGLU
# 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 ...
Napkin-DL/my-aws-example
DilConv1dWithGLU
false
9,343
[ "MIT-0" ]
0
c6e8a1ec60468938c259fcec7542c85f5464c898
https://github.com/Napkin-DL/my-aws-example/tree/c6e8a1ec60468938c259fcec7542c85f5464c898
GCN
from torch.nn import Module import math import torch from torch import nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn.modules.module import Module class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __ini...
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....
CVIR/CoMix
GCN
false
7,907
[ "Apache-2.0" ]
13
593b5b3ba6e060018e4b55ab288dab71c2ee2e18
https://github.com/CVIR/CoMix/tree/593b5b3ba6e060018e4b55ab288dab71c2ee2e18
Policy
# 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_...
akashkmr27089/ReinforcementLearning_Udacity_Deep_Reinforcemnt_Learning
Policy
false
3,083
[ "MIT" ]
0
b7dc13b0116898848d8d0b8a95b7af182982bd6b
https://github.com/akashkmr27089/ReinforcementLearning_Udacity_Deep_Reinforcemnt_Learning/tree/b7dc13b0116898848d8d0b8a95b7af182982bd6b
BinaryMin
# 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 abc import inspect import warnings import torch.nn as nn import torch.nn.parallel ...
Johnsonms/NNI_master
BinaryMin
false
11,572
[ "MIT" ]
0
e5e5c7aed89cf3189cffe1056464833c15eb54ff
https://github.com/Johnsonms/NNI_master/tree/e5e5c7aed89cf3189cffe1056464833c15eb54ff
PinballLoss
import torch import torch.nn as nn class PinballLoss(nn.Module): """ Pinball Loss Computes the pinball loss between y and y_hat. Parameters ---------- y: tensor actual values in torch tensor. y_hat: tensor (same shape as y) predicted values in torch tensor. tau: float, between 0 and 1 t...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
venkatkorapaty/esrnn
PinballLoss
false
11,005
[ "MIT" ]
0
411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c
https://github.com/venkatkorapaty/esrnn/tree/411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c
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_...
ngduduong/captum
BasicModel_ConvNet_One_Conv
false
4,080
[ "BSD-3-Clause" ]
0
6fe5f0f23ea975e73e0c0dee79bdc01b4223d283
https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283
ContinuousActor
# 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 numpy as np ...
pjordan/rlcc
ContinuousActor
false
7,474
[ "Apache-2.0" ]
1
e84b8b5c14680dbad2efae22756fb40606b2384a
https://github.com/pjordan/rlcc/tree/e84b8b5c14680dbad2efae22756fb40606b2384a
NormalizeOutput
import torch import torch.nn.functional as F from torch import nn import torch.optim class NormalizeOutput(nn.Module): """ Module that scales the input tensor to the unit norm w.r.t. the specified axis. Actually, the module analog of `torch.nn.functional.normalize` """ def __init__(self, dim=1, p...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn import ...
agermanidis/HiDT
NormalizeOutput
false
18,232
[ "BSD-3-Clause" ]
4
69192bb26785fc4e05038c45d05f2f880dd362d0
https://github.com/agermanidis/HiDT/tree/69192bb26785fc4e05038c45d05f2f880dd362d0
L2Norm
import torch from itertools import product as product import torch.nn as nn import torch.nn.init as init class L2Norm(nn.Module): def __init__(self, n_channels, scale): super(L2Norm, self).__init__() self.n_channels = n_channels self.gamma = scale or None self.eps = 1e-10 ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from itertools import product as product import torch.nn as nn import torch.nn....
AlanSavio25/AVSR-Dataset-Pipeline
L2Norm
false
18,407
[ "MIT" ]
2
6e6d44eca6133c2e0223e9be8d011be0b68c73d1
https://github.com/AlanSavio25/AVSR-Dataset-Pipeline/tree/6e6d44eca6133c2e0223e9be8d011be0b68c73d1
CmapPafHeadAttention
import torch import torch.utils.data import torch.nn import torch.optim class UpsampleCBR(torch.nn.Sequential): def __init__(self, input_channels, output_channels, count=1, num_flat=0): layers = [] for i in range(count): if i == 0: inch = input_channels els...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn import torch.optim assert_size_stride = ...
tucachmo2202/trt_pose
CmapPafHeadAttention
false
13,082
[ "MIT" ]
0
b847fc197c32219dc2d719c2b42906603da0988a
https://github.com/tucachmo2202/trt_pose/tree/b847fc197c32219dc2d719c2b42906603da0988a
TensorClamp
# 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
Akababa/torch2trt
TensorClamp
false
18,427
[ "MIT" ]
2
03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7
https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7
NormalizedGramMatrix
import torch import torch.nn as nn def normalize_by_stddev(tensor): """ divides channel-wise by standard deviation of channel """ channels = tensor.shape[1] stddev = tensor.std(dim=(0, 2)).view(1, channels, 1) + 1e-15 return tensor.div(stddev) class NormalizedGramMatrix(nn.Module): """ ...
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 ...
ChuckHend/nst-zoo
NormalizedGramMatrix
false
2,113
[ "MIT" ]
0
130e485289c5a9417c3dc36980b87373f12f3697
https://github.com/ChuckHend/nst-zoo/tree/130e485289c5a9417c3dc36980b87373f12f3697
LayerNorm
# 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 import torch.nn.parallel import torch.optim import torch....
amazon-research/network-deconvolution-pp
LayerNorm
false
18,347
[ "Apache-2.0" ]
6
99e27ecec7d27c7c4c3fb230e96005bdcbf6f2ce
https://github.com/amazon-research/network-deconvolution-pp/tree/99e27ecec7d27c7c4c3fb230e96005bdcbf6f2ce
PositionWiseFeedForwardNetworks
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
L-Zhe/FasySeq
PositionWiseFeedForwardNetworks
false
8,417
[ "Apache-2.0" ]
34
2cd2abd290666b1e118d8ad11c973b58ca4f0573
https://github.com/L-Zhe/FasySeq/tree/2cd2abd290666b1e118d8ad11c973b58ca4f0573
StepRankerLogistic
import torch from torch import nn class StepRankerLogistic(nn.Module): """a logistic ranker""" def __init__(self, parent_dim, child_short_dim, child_full_dim, hidden_dim ): super(StepRankerLogistic, self).__init__() if child_full_dim is not None: self.hidden = nn.Linear(pa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
YilunZhou/wikihow-embedding
StepRankerLogistic
false
18,140
[ "MIT" ]
8
bfbcaf6aca854cd7e0dedfd5ecf77627138e8425
https://github.com/YilunZhou/wikihow-embedding/tree/bfbcaf6aca854cd7e0dedfd5ecf77627138e8425
MaskedMSELoss
import torch import torch.nn as nn class MaskedMSELoss(nn.Module): def __init__(self): super(MaskedMSELoss, self).__init__() self.loss = nn.MSELoss(reduction='sum') def forward(self, pred, target, mask): """ pred -> batch*seq_len target -> batch*seq_len mask -...
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...
RaleLee/conv-emotion
MaskedMSELoss
false
11,825
[ "MIT" ]
0
1b07223cbdfd52eb31e913e982d18ff1ed3daf08
https://github.com/RaleLee/conv-emotion/tree/1b07223cbdfd52eb31e913e982d18ff1ed3daf08
VarianceC
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cud...
caixin1998/pl-template
VarianceC
false
10,112
[ "BSD-3-Clause" ]
0
6918f0289ab2b32d107e5722617d25c9a683399c
https://github.com/caixin1998/pl-template/tree/6918f0289ab2b32d107e5722617d25c9a683399c
CCAMDec
from torch.nn import Module import torch from torchvision.datasets import * from torch.nn import Parameter from torch.nn import Softmax from torchvision.transforms import * class CCAMDec(Module): """ CCAM decoding module """ def __init__(self): super(CCAMDec, self).__init__() self.sof...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ruijieren98/DANet
CCAMDec
false
16,359
[ "MIT" ]
2,190
e38d61e371179833c08888fd5a1ee444cf5bd875
https://github.com/ruijieren98/DANet/tree/e38d61e371179833c08888fd5a1ee444cf5bd875
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 math import torch.utils.data import torch import torch.nn as nn import to...
bomtorazek/contrastive-unpaired-translation
ToRGB
false
12,203
[ "BSD-3-Clause" ]
0
07c048038375e1b9a4e464154b8dbc49f5e16ede
https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede
AconC
import torch import torch.nn as nn class AconC(nn.Module): """ ACON activation (activate or not) AconC: (p1*x-p2*x) * sigmoid(beta*(p1*x-p2*x)) + p2*x, beta is a learnable parameter according to "Activate or Not: Learning Customized Activation" <https://arxiv.org/pdf/2009.04759.pdf>. """ def __in...
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...
LTTBasic/lecttue-diagonosis
AconC
false
749
[ "MIT" ]
0
a9573f79da1fa8dcdd649bfd819ffad67ecad309
https://github.com/LTTBasic/lecttue-diagonosis/tree/a9573f79da1fa8dcdd649bfd819ffad67ecad309
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...
MattAlexMiracle/SmartPatch
Conv2dBlock
false
17,690
[ "MIT" ]
7
c485cb433d8e085d6eae10a335ee19f5e6c1a41c
https://github.com/MattAlexMiracle/SmartPatch/tree/c485cb433d8e085d6eae10a335ee19f5e6c1a41c
adder2d
# 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 math as tl_math from torch.autograd import Function import math import torch.nn as nn ass...
Xyfuture/AdderNet
adder2d
false
11,992
[ "BSD-3-Clause" ]
0
62f567164175558622748464fb2f47d37d579b29
https://github.com/Xyfuture/AdderNet/tree/62f567164175558622748464fb2f47d37d579b29