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
MultiHeadAttention
import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F def attention(q, k, v, d_k, mask=None, dropout=None): scores = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(d_k) if mask is not None: mask = mask.unsqueeze(1) scores = scores.masked_fill(mask ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chenjun-110/WZCQ
MultiHeadAttention
false
1,695
[ "Apache-2.0" ]
0
e2de7743ad671e8632cfa084638555d7f1deb42f
https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f
ParameterOutput
# 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....
FilipaRamos/Rl-Pusher
ParameterOutput
false
11,424
[ "MIT" ]
0
40aa123695f7f2c96dbc11be9d92abefdf2d12c4
https://github.com/FilipaRamos/Rl-Pusher/tree/40aa123695f7f2c96dbc11be9d92abefdf2d12c4
SM
import torch from torch import nn def autopad(k, p=None): if p is None: p = k // 2 if isinstance(k, int) else [(x // 2) for x in k] return p class SM(nn.Module): def __init__(self, k=3, s=1): super(SM, self).__init__() self.avg = nn.AvgPool2d(k, stride=s, padding=autopad(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 import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
TarikToha/NWPU-Crowd-Sample-Code-for-Localization
SM
false
14,472
[ "MIT" ]
132
0e348b99ea41d4469eff2a78a75648454128d49a
https://github.com/TarikToha/NWPU-Crowd-Sample-Code-for-Localization/tree/0e348b99ea41d4469eff2a78a75648454128d49a
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....
ClashLuke/online-normalization
LayerScaling
false
13,515
[ "BSD-3-Clause" ]
55
fe08b9f8e288d628eee4f9991e562cdb4f9e997b
https://github.com/ClashLuke/online-normalization/tree/fe08b9f8e288d628eee4f9991e562cdb4f9e997b
Standardize
# 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.nn import Module from torch.nn import init from torch.nn.parameter import Parameter assert_size_stride = torch._C._dynamo.guards....
SDJustus/Deep-SAD-PyTorch
Standardize
false
1,009
[ "MIT" ]
0
4d98e6474a7256329134c075894f885a56f59281
https://github.com/SDJustus/Deep-SAD-PyTorch/tree/4d98e6474a7256329134c075894f885a56f59281
Classifier
import torch import torch.utils.data import torch.nn as nn class Classifier(nn.Module): def __init__(self, n_hid, n_out): super(Classifier, self).__init__() self.n_hid = n_hid self.n_out = n_out self.linear = nn.Linear(n_hid, n_out) def forward(self, x): tx = self.lin...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ChengzhiPiao/cogdl
Classifier
false
4,983
[ "MIT" ]
1
182e0b95b3dfbe771570037c58aacd8f677b6500
https://github.com/ChengzhiPiao/cogdl/tree/182e0b95b3dfbe771570037c58aacd8f677b6500
AGRUCell
# 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 ...
Sunmyunghan/Final_Project
AGRUCell
false
1,202
[ "MIT" ]
0
28cde293dc6d07521b2e1c5613b20444aea91d21
https://github.com/Sunmyunghan/Final_Project/tree/28cde293dc6d07521b2e1c5613b20444aea91d21
DenseSAGEConv
import math import torch import torch.nn.functional as F import torch.utils.data from torch.nn import Parameter def uniform(size, tensor): stdv = 1.0 / math.sqrt(size) if tensor is not None: tensor.data.uniform_(-stdv, stdv) class DenseSAGEConv(torch.nn.Module): """See :class:`torch_geometric.nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Bawaw/pytorch_geometric
DenseSAGEConv
false
13,409
[ "MIT" ]
62
868548d4396fc66e39b08e2ff19091a367ddac13
https://github.com/Bawaw/pytorch_geometric/tree/868548d4396fc66e39b08e2ff19091a367ddac13
mlp_2layer
# 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_...
Mahoumaru/auto_LiRPA
mlp_2layer
false
11,675
[ "BSD-3-Clause" ]
0
b03a6c36eb1b921726778359d6d2b94e0cd7e480
https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480
nnConv2dSymQuant
# 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 from torch.nn.modules.util...
IBM/energy-efficient-resilience
nnConv2dSymQuant
false
17,419
[ "Apache-2.0" ]
4
13dfcac143df218abe20ed8d8752a0bd7e5a424b
https://github.com/IBM/energy-efficient-resilience/tree/13dfcac143df218abe20ed8d8752a0bd7e5a424b
FC1
import torch import torch.nn as nn class FC1(nn.Module): def __init__(self, nInput, activate, weight): super(FC1, self).__init__() self.nInput = nInput self.fc1 = nn.Linear(self.nInput, self.nInput * 2) self.fc2 = nn.Linear(self.nInput * 2, self.nInput) self.fc3 = nn.Linea...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
Po-Chun-Chien/LUT-Net
FC1
false
11,787
[ "MIT" ]
0
413559027980db2585d939cd4a514a172b62f57d
https://github.com/Po-Chun-Chien/LUT-Net/tree/413559027980db2585d939cd4a514a172b62f57d
MegatronBertOutput
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class MegatronBertOutput(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.intermediate_size, config.hidden_size) self.dropout = nn.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 import nn import torch.utils.checkpoint assert_size_stride = torch._C...
jxhe/unify-parameter-efficient-tuning
MegatronBertOutput
false
15,766
[ "Apache-2.0" ]
101
3222ce2c0079566a28043e22380eb4ab6ad14389
https://github.com/jxhe/unify-parameter-efficient-tuning/tree/3222ce2c0079566a28043e22380eb4ab6ad14389
L_2nd
import torch import torch.nn as nn class L_2nd(nn.Module): def __init__(self, beta): super(L_2nd, self).__init__() self.beta = beta def forward(self, y_pred, y_true): b = torch.ones_like(y_true) b[y_true != 0] = self.beta x = ((y_true - y_pred) * b) ** 2 t = t...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
ZagHe568/graph_embedding
L_2nd
false
18,169
[ "MIT" ]
4
2a6f8214ce4b30b51eb9f1904b64fe782876f010
https://github.com/ZagHe568/graph_embedding/tree/2a6f8214ce4b30b51eb9f1904b64fe782876f010
Biaffine
import torch import torch.nn as nn class Biaffine(nn.Module): """ Biaffine layer for first-order scoring :cite:`dozat-etal-2017-biaffine`. This function has a tensor of weights :math:`W` and bias terms if needed. The score :math:`s(x, y)` of the vector pair :math:`(x, y)` is computed as :math:`x^T W ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
yzhangcs/parser
Biaffine
false
16,783
[ "MIT" ]
439
3abebde1c9fe0bf2e99adce845aaf2a04b194f8a
https://github.com/yzhangcs/parser/tree/3abebde1c9fe0bf2e99adce845aaf2a04b194f8a
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....
isspek/Cross-Lingual-Cyberbullying
Attention
false
6,900
[ "MIT" ]
1
710c136b9233f0be87af72e43e25722e73158c52
https://github.com/isspek/Cross-Lingual-Cyberbullying/tree/710c136b9233f0be87af72e43e25722e73158c52
VNLinear
# 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 import torch import torch.nn.paral...
shiyani21/vnn
VNLinear
false
4,313
[ "MIT" ]
0
921be51d6651ff32bff895f4da99ef83d50900da
https://github.com/shiyani21/vnn/tree/921be51d6651ff32bff895f4da99ef83d50900da
ResNetV2
# 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....
HodaEb/ViT-pytorch
ResNetV2
false
3,009
[ "MIT" ]
0
2643740b1d846ae666635bb0f5a71bceba208675
https://github.com/HodaEb/ViT-pytorch/tree/2643740b1d846ae666635bb0f5a71bceba208675
DecoderLayer
import math import torch import torch.nn.functional as F import torch.nn as nn def attention(q, k, v, d_k, mask=None, dropout=None): scores = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(d_k) if mask is not None: mask = mask.unsqueeze(1) scores = scores.masked_fill(mask == 0, -1000000000.0...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
macg0406/Transformer
DecoderLayer
false
12,763
[ "Apache-2.0" ]
0
8c747a6e9f108c63ecc600bf14cde6827b438172
https://github.com/macg0406/Transformer/tree/8c747a6e9f108c63ecc600bf14cde6827b438172
SEModule
import torch import torch.nn as nn class SEModule(nn.Module): def __init__(self, channels, reduction): super(SEModule, self).__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) self.fc1 = nn.Conv2d(channels, channels // reduction, kernel_size=1, padding=0) self.relu = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Danish-VSL/deep-person-reid
SEModule
false
13,566
[ "MIT" ]
244
2e3a4b6706b84c77203f9905683b917ab0871b93
https://github.com/Danish-VSL/deep-person-reid/tree/2e3a4b6706b84c77203f9905683b917ab0871b93
FocalLossBinary
# 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...
ZhongYingMatrix/nnUNet
FocalLossBinary
false
12,030
[ "Apache-2.0" ]
0
c3f028e79d4d5c3f2eb58396ffd0ae54048c132b
https://github.com/ZhongYingMatrix/nnUNet/tree/c3f028e79d4d5c3f2eb58396ffd0ae54048c132b
LayerNorm32
import torch import torch.nn as nn class LayerNorm32(nn.LayerNorm): def forward(self, x): return super().forward(x.float().transpose(1, 2)).type(x.dtype ).transpose(1, 2) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {'normalized_shape': 4}...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
AranKomat/Diff-DALLE
LayerNorm32
false
13,289
[ "MIT" ]
53
9418e98e97b599c5c65f16ee168fedf76a29095f
https://github.com/AranKomat/Diff-DALLE/tree/9418e98e97b599c5c65f16ee168fedf76a29095f
LinearTextualHead
import torch import torch.nn as nn from typing import Optional class TextualHead(nn.Module): """ Base class for all textual heads. All child classes can simply inherit from :class:`~torch.nn.Module`, however this is kept here for uniform type annotations. Parameters ---------- visual_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...
funnyzhou/REFERS
LinearTextualHead
false
15,376
[ "MIT" ]
46
392eddf13cbf3c3a7dc0bf8bfffd108ca4a65a19
https://github.com/funnyzhou/REFERS/tree/392eddf13cbf3c3a7dc0bf8bfffd108ca4a65a19
cha_loss
import torch import torch.nn as nn import torch.optim import torch.cuda class cha_loss(nn.Module): def __init__(self, eps=0.001): super(cha_loss, self).__init__() self.eps = eps return def forward(self, inp, target): diff = torch.abs(inp - target) ** 2 + self.eps ** 2 ...
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...
Weepingchestnut/OVSR
cha_loss
false
1,203
[ "Apache-2.0" ]
0
11554a3b1072d50a8c88cf59b4b986df1fda73f9
https://github.com/Weepingchestnut/OVSR/tree/11554a3b1072d50a8c88cf59b4b986df1fda73f9
Critic
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim import torch.autograd class Critic(nn.Module): def __init__(self, input_size): super(Critic, self).__init__() self.fc1 = nn.Linear(input_size, 128) self.fc2 = nn.Linear(128, 256) self.fc3 = nn.Li...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
ChangQingAAS/Deep-Reinforcement-Learning
Critic
false
234
[ "MIT" ]
0
3bc1381c632b1730a48e63e972aea62086c4287c
https://github.com/ChangQingAAS/Deep-Reinforcement-Learning/tree/3bc1381c632b1730a48e63e972aea62086c4287c
BCELoss2d
import torch import torch.nn as nn import torch.backends.cudnn import torch.utils.data class BCELoss2d(nn.Module): """ Binary Cross Entropy loss function """ def __init__(self): super(BCELoss2d, self).__init__() self.bce_loss = nn.BCEWithLogitsLoss() def forward(self, logits, lab...
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...
jayden-chua/image-mask
BCELoss2d
false
3,689
[ "MIT" ]
0
ce2c6a32bf13df582e7b57e506d58518258be292
https://github.com/jayden-chua/image-mask/tree/ce2c6a32bf13df582e7b57e506d58518258be292
PixelNorm
import torch import torch.nn as nn class PixelNorm(nn.Module): def __init__(self): super().__init__() def forward(self, input): return input * torch.rsqrt(torch.mean(input ** 2, dim=1, keepdim= True) + 1e-08) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_ini...
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_...
AsianZeus/Diverse-Facial-Edit
PixelNorm
false
9,401
[ "Apache-2.0" ]
0
3d4b1b41546a08a1fa3cb164ade33e319806b12b
https://github.com/AsianZeus/Diverse-Facial-Edit/tree/3d4b1b41546a08a1fa3cb164ade33e319806b12b
Conv
import torch import torch.utils.data from torch import nn class Conv(nn.Module): def __init__(self, inp_dim, out_dim, kernel_size=3, stride=1, bn=False, relu=True): super(Conv, self).__init__() self.inp_dim = inp_dim self.conv = nn.Conv2d(inp_dim, out_dim, kernel_size, stride, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.utils.data from ...
dmetehan/associative-embedding
Conv
false
3,483
[ "BSD-3-Clause" ]
0
a2c2e86e622cd97feec621fcfd34c3f97934e388
https://github.com/dmetehan/associative-embedding/tree/a2c2e86e622cd97feec621fcfd34c3f97934e388
eca_layer
# 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 assert_size_stride = torch._C._dynamo.g...
purbayankar/PyTorch-Zero-Shot-Super-Resolution
eca_layer
false
12,941
[ "MIT" ]
0
434fe5e84e166eef1f8c03880fc83c7e8749c49c
https://github.com/purbayankar/PyTorch-Zero-Shot-Super-Resolution/tree/434fe5e84e166eef1f8c03880fc83c7e8749c49c
ClsHead
import torch import torch.nn as nn import torch.nn.functional as F class ClsHead(nn.Module): """ Class orientation Args: params(dict): super parameters for build Class network """ def __init__(self, in_channels, class_dim, **kwargs): super(ClsHead, self).__init__() self.tr...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
BHD233/PaddleOCR2Pytorch
ClsHead
false
13,358
[ "Apache-2.0" ]
364
f114069b3e2669c6adf0adf9596756205f184c9c
https://github.com/BHD233/PaddleOCR2Pytorch/tree/f114069b3e2669c6adf0adf9596756205f184c9c
SimpleNotModule
# 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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
briancoutinho/glow
SimpleNotModule
false
12,571
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
RpowFloat
import torch class RpowFloat(torch.nn.Module): def __init__(self): super(RpowFloat, self).__init__() def forward(self, x): return 2.0 ** x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
NVIDIA-AI-IOT-private/torch2trt
RpowFloat
false
10,535
[ "MIT" ]
0
953d60039e0c81e90eea467c3df2e6e3f7040242
https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242
TOP1_max
# 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 ...
hungthanhpham94/GRU4REC-pytorch
TOP1_max
false
15,553
[ "Apache-2.0" ]
184
666b84264c4afae757fe55c6997dcf0a4da1d44e
https://github.com/hungthanhpham94/GRU4REC-pytorch/tree/666b84264c4afae757fe55c6997dcf0a4da1d44e
GANLossDiscriminator
import torch import torch.nn as nn import torch.nn.functional as F class GANLossDiscriminator(nn.Module): """ This class implements the standard discriminator GAN loss proposed in: https://papers.nips.cc/paper/2014/file/5ca3e9b122f61f8f06494c97b1afccf3-Paper.pdf """ def __init__(self) ->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 libdevice, math as tl_math import torc...
ChristophReich1996/Mode_Collapse
GANLossDiscriminator
false
7,920
[ "MIT" ]
14
937ee8bf96510fbf4070fc7e14b78276ab036b8c
https://github.com/ChristophReich1996/Mode_Collapse/tree/937ee8bf96510fbf4070fc7e14b78276ab036b8c
DownsampleBlock
import torch from torch import nn class DownsampleBlock(nn.Module): def __init__(self, in_channels, out_channels): super(DownsampleBlock, self).__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=2, stride=2) self.actv = nn.PReLU(out_channels) def forw...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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...
XaviGurrola/RDUNet
DownsampleBlock
false
9,646
[ "MIT" ]
0
549fc88c6faef1b310773944fc3988e22030d94d
https://github.com/XaviGurrola/RDUNet/tree/549fc88c6faef1b310773944fc3988e22030d94d
GatedConv1d
import torch import torch.nn as nn import torch.nn class GatedConv1d(nn.Module): def __init__(self, input_channels, output_channels, kernel_size, stride, padding=0, dilation=1, activation=None): super(GatedConv1d, self).__init__() self.activation = activation self.sigmoid = nn.Sig...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 assert_size_stride = torch._C._dynamo.guar...
EmilSkaaning/DeepStruc
GatedConv1d
false
8,047
[ "Apache-2.0" ]
11
4de0233caba11523b8f5deead53e1c70c05b346b
https://github.com/EmilSkaaning/DeepStruc/tree/4de0233caba11523b8f5deead53e1c70c05b346b
PrimaryCaps
import torch import torch.nn as nn def squash(x, dim=2): v_length_sq = x.pow(2).sum(dim=dim, keepdim=True) v_length = torch.sqrt(v_length_sq) scaling_factor = v_length_sq / (1 + v_length_sq) / v_length return x * scaling_factor class PrimaryCaps(nn.Module): """ PrimaryCaps layers. """ ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
spikefairway/CapsNet-PyTorch
PrimaryCaps
false
4,381
[ "MIT" ]
0
76aaabaad01283333a5f73a564cb1461449b4449
https://github.com/spikefairway/CapsNet-PyTorch/tree/76aaabaad01283333a5f73a564cb1461449b4449
sum_squared_error
import torch from torch.nn.modules.loss import _Loss class sum_squared_error(_Loss): """ Definition: sum_squared_error = 1/2 * nn.MSELoss(reduction = 'sum') The backward is defined as: input-target """ def __init__(self, size_average=None, reduce=None, reduction='sum'): super(sum_squared_...
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.nn.modules....
ZerojumpLine/Denoise
sum_squared_error
false
18,164
[ "MIT" ]
4
09182b07f451d85448ce3c7a53fc69144f91384e
https://github.com/ZerojumpLine/Denoise/tree/09182b07f451d85448ce3c7a53fc69144f91384e
Mnist_CNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
harrydrippin/tutorials
Mnist_CNN
false
12,491
[ "BSD-3-Clause" ]
0
a8def2dfd44b4b8e22c36a3e4470f37b59ebedfb
https://github.com/harrydrippin/tutorials/tree/a8def2dfd44b4b8e22c36a3e4470f37b59ebedfb
TorchMulScalar
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.parallel from torch.nn.quantized.modules import FloatFunctional assert_size_stride = torch._C._dynamo....
a1004123217/pytorch-mobile
TorchMulScalar
false
1,326
[ "MIT" ]
0
97974af3259a2073efbc334d57841efbd3eaadfb
https://github.com/a1004123217/pytorch-mobile/tree/97974af3259a2073efbc334d57841efbd3eaadfb
GroupedChannelNorm
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.utils.data import torch import torch.nn as nn assert_size_stride =...
bronemos/contrastive-unpaired-translation-focal
GroupedChannelNorm
false
3,246
[ "BSD-3-Clause" ]
0
50b9008d08a86439ede081a910d02df5da8e32df
https://github.com/bronemos/contrastive-unpaired-translation-focal/tree/50b9008d08a86439ede081a910d02df5da8e32df
biLinearModel
# 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.distributed import torch import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
BoonthichaSaejia/ThaiSum
biLinearModel
false
7,820
[ "Apache-2.0" ]
23
fdb99eab23e60a933acf4e84836f53ddf05b7c8b
https://github.com/BoonthichaSaejia/ThaiSum/tree/fdb99eab23e60a933acf4e84836f53ddf05b7c8b
IoU
# 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...
ChristophReich1996/Cell-DETR
IoU
false
13,490
[ "MIT" ]
55
4d0c3a2d3ffd19184c8443e5b3a6dccc053c77ea
https://github.com/ChristophReich1996/Cell-DETR/tree/4d0c3a2d3ffd19184c8443e5b3a6dccc053c77ea
WeightedSoftDiceLoss
import torch import torch.nn.functional as F import torch.nn as nn import torch.backends.cudnn import torch.utils.data class WeightedSoftDiceLoss(nn.Module): def __init__(self): super(WeightedSoftDiceLoss, self).__init__() def forward(self, logits, labels, weights): probs = F.sigmoid(logits)...
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.backends.cudnn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride em...
jayden-chua/image-mask
WeightedSoftDiceLoss
false
3,694
[ "MIT" ]
0
ce2c6a32bf13df582e7b57e506d58518258be292
https://github.com/jayden-chua/image-mask/tree/ce2c6a32bf13df582e7b57e506d58518258be292
FlowHead
# 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...
phonhay103/DocTr
FlowHead
false
7,472
[ "MIT" ]
1
f052703976e2558633027907af48ecb1dc7718ff
https://github.com/phonhay103/DocTr/tree/f052703976e2558633027907af48ecb1dc7718ff
ModulatedConv2d
from torch.autograd import Function import math import torch from torch import nn import torch.nn.functional as F def make_kernel(k): k = torch.tensor(k, dtype=torch.float32) if k.ndim == 1: k = k[None, :] * k[:, None] k /= k.sum() return k def upfirdn2d(input, kernel, up=1, down=1, pad=(0, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.autograd...
johnberg1/psp_s
ModulatedConv2d
false
12,627
[ "Apache-2.0", "BSD-2-Clause", "MIT" ]
0
717f4c448a4e7537cf4b74067d454c7644609ca3
https://github.com/johnberg1/psp_s/tree/717f4c448a4e7537cf4b74067d454c7644609ca3
DIAYNActionModel
import torch import torch.nn as nn class DIAYNActionModel(nn.Module): """The model that computes one score per action""" def __init__(self, n_observations, n_actions, n_hidden, n_policies): super().__init__() self.linear = nn.Linear(n_observations, n_hidden) self.linear2 = nn.Linear(n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Purple-PI/rlstructures
DIAYNActionModel
false
14,260
[ "MIT" ]
281
9b201b083715bbda2f3534b010c84e11dfc0a1c7
https://github.com/Purple-PI/rlstructures/tree/9b201b083715bbda2f3534b010c84e11dfc0a1c7
Classifier
import torch import torch.nn as nn class Classifier(nn.Module): def __init__(self, in_dim, num_classes): super(Classifier, self).__init__() self.classifier = nn.Linear(in_dim, num_classes) self.avgpool = nn.AdaptiveAvgPool2d(output_size=1) def forward(self, x): x = self.avgpo...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
JDAI-CV/LIO
Classifier
false
13,855
[ "Apache-2.0" ]
105
7bcd4d5e2990db5c8a7ec6ecc76a23c2e913e523
https://github.com/JDAI-CV/LIO/tree/7bcd4d5e2990db5c8a7ec6ecc76a23c2e913e523
SegmentationTestModel
# 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.nn import Module import torch.nn as nn from typing import Any from to...
ethanwhite/torchgeo
SegmentationTestModel
false
15,316
[ "MIT" ]
678
cb20e1abfd9213f9ee7700df972385db13568642
https://github.com/ethanwhite/torchgeo/tree/cb20e1abfd9213f9ee7700df972385db13568642
EqualConvTranspose2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math from torch import nn assert_size_stride = torch._C._dynamo.guards.as...
xh-liu-tech/CIPS-3D
EqualConvTranspose2d
false
11,108
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
TensorClampOptionMin
# 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...
PogChamper/torch2trt
TensorClampOptionMin
false
14,218
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
ModelRegressionAdt2Gex
import torch import torch.utils.data import torch.nn.functional as F import torch.nn as nn class Swish(torch.autograd.Function): @staticmethod def forward(ctx, i): result = i * sigmoid(i) ctx.save_for_backward(i) return result @staticmethod def backward(ctx, grad_output): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.utils....
Permoment-95/neurips2021_multimodal_topmethods
ModelRegressionAdt2Gex
false
9,475
[ "MIT" ]
0
017bc23b366a80ba9b1c2a47ea6c44124f77a7ca
https://github.com/Permoment-95/neurips2021_multimodal_topmethods/tree/017bc23b366a80ba9b1c2a47ea6c44124f77a7ca
UpsampleConvLayer
# 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....
ThomasRanvier/cnn_style_transfer
UpsampleConvLayer
false
1,139
[ "MIT" ]
0
90b6c76c20263c22f4e45184d572284726ecbd7b
https://github.com/ThomasRanvier/cnn_style_transfer/tree/90b6c76c20263c22f4e45184d572284726ecbd7b
ImageProcessingModuleAlt
# 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_...
bentrevett/task-oriented-language-grounding
ImageProcessingModuleAlt
false
6,334
[ "MIT" ]
1
812a7bc21ee622030eb0594c576c7d60dc630148
https://github.com/bentrevett/task-oriented-language-grounding/tree/812a7bc21ee622030eb0594c576c7d60dc630148
Attention
import torch import torch.nn.functional as F import torch.nn as nn def dispatcher(dispatch_fn): def decorated(key, *args): if callable(key): return key if key is None: key = 'none' return dispatch_fn(key, *args) return decorated def spectral_norm(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 import triton_helpers from torch._inductor.runtime....
derwind/dmfont
Attention
false
15,176
[ "MIT" ]
95
17a91a9cc1917d2485eaa8e92b68245578920c76
https://github.com/derwind/dmfont/tree/17a91a9cc1917d2485eaa8e92b68245578920c76
QNet
import torch import torch.nn as nn from torch.nn.init import kaiming_uniform_ from torch.nn.init import uniform_ import torch.nn.functional as F def mini_weight_init(m): if m.__class__.__name__ == 'Linear': m.weight.data.copy_(uniform_(m.weight.data, -0.003, 0.003)) m.bias.data.fill_(0) def weig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 to...
ven-kyoshiro/PILCO-1
QNet
false
10,966
[ "MIT" ]
0
61c4ef18a6bbecbeb6a10784a7925d31f46dd23b
https://github.com/ven-kyoshiro/PILCO-1/tree/61c4ef18a6bbecbeb6a10784a7925d31f46dd23b
MaxMarginCriterion
import torch import torch.nn as nn class MaxMarginCriterion(nn.Module): def __init__(self, visual_rank_weight, lang_rank_weight, margin): super(MaxMarginCriterion, self).__init__() self.visual_rank = visual_rank_weight > 0 self.lang_rank = lang_rank_weight > 0 self.visual_rank_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 from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
TheShadow29/MAttNet
MaxMarginCriterion
false
11,926
[ "MIT" ]
0
2fe44667bc9254daef8be77bb4c896f10c2f665b
https://github.com/TheShadow29/MAttNet/tree/2fe44667bc9254daef8be77bb4c896f10c2f665b
SNRNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math fr...
DavidRuhe/simple-variational-diffusion-models
SNRNetwork
false
17,253
[ "MIT" ]
4
a32355bf052a8f08e9c1919080588d0b22c8de4e
https://github.com/DavidRuhe/simple-variational-diffusion-models/tree/a32355bf052a8f08e9c1919080588d0b22c8de4e
FastStyle
import torch from torch import nn from torch.nn import functional as F def reflect_padding(x, f, s, half=False): if half: denom = 2 else: denom = 1 _, _, h, w = x.shape pad_w = w * (s / denom - 1) + f - s pad_h = h * (s / denom - 1) + f - s if pad_w % 2 == 1: pad_l = in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
RicCu/NeuralStyle
FastStyle
false
5,809
[ "MIT" ]
1
97dc6aec6b2072a9a187276e047aea885566e1be
https://github.com/RicCu/NeuralStyle/tree/97dc6aec6b2072a9a187276e047aea885566e1be
ContrastiveLoss
import torch import torch.nn.functional as F class ContrastiveLoss(torch.nn.Module): """ Contrastive loss function. Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf Modified from: https://hackernoon.com/facial-similarity-with-siamese-networks-in-pytorch-9642aa9db2f7 """...
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 assert_size_stride = torch._...
QTIM-Lab/SiameseChange
ContrastiveLoss
false
8,654
[ "MIT" ]
14
a58fe2a93487b3e164f1d7e0b27f5a3321bc2672
https://github.com/QTIM-Lab/SiameseChange/tree/a58fe2a93487b3e164f1d7e0b27f5a3321bc2672
RelevanceVector
# 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...
seqam-lab/rfvae
RelevanceVector
false
4,289
[ "MIT" ]
0
07089e2cca6d51f305731750c2c67b83a42df12a
https://github.com/seqam-lab/rfvae/tree/07089e2cca6d51f305731750c2c67b83a42df12a
ConvRelu
# 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...
sudonull1/Crack-Segmentation
ConvRelu
false
4,387
[ "MIT" ]
0
640f86839ce5d79b48916b176caf8ad83c7355ae
https://github.com/sudonull1/Crack-Segmentation/tree/640f86839ce5d79b48916b176caf8ad83c7355ae
ELUPlus
import torch import torch.nn as nn import torch.utils.data class ELUPlus(nn.Module): def __init__(self): super().__init__() self.elu = nn.ELU() def forward(self, x): return self.elu(x) + 1.0 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 import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dy...
AWehenkel/UMNN
ELUPlus
false
13,239
[ "BSD-3-Clause" ]
69
f93cb36040783dd60e14e0eda927899d3919825c
https://github.com/AWehenkel/UMNN/tree/f93cb36040783dd60e14e0eda927899d3919825c
AffineChannelwise
import torch from torch import nn class AffineChannelwise(nn.Module): def __init__(self, num_channels): super().__init__() self.num_channels = num_channels self.register_parameter('weight', nn.Parameter(torch.ones( num_channels))) self.register_parameter('bias', nn.Par...
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...
dniku/dl-norms
AffineChannelwise
false
6,585
[ "MIT" ]
1
0f1eef942bd318ac988ec7dfa9caea300d17e82a
https://github.com/dniku/dl-norms/tree/0f1eef942bd318ac988ec7dfa9caea300d17e82a
SourceContextGate
# 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 ...
AngusGLChen/qg
SourceContextGate
false
4,869
[ "MIT" ]
1
3ebc5b94348a4c313829a6c71705fbc9dadd8181
https://github.com/AngusGLChen/qg/tree/3ebc5b94348a4c313829a6c71705fbc9dadd8181
down_shifted_conv2d
import torch import torch.nn as nn from torch.nn.utils import weight_norm as wn def down_shift(x, pad=None): xs = [int(y) for y in x.size()] x = x[:, :, :xs[2] - 1, :] pad = nn.ZeroPad2d((0, 0, 1, 0)) if pad is None else pad return pad(x) class down_shifted_conv2d(nn.Module): def __init__(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 ...
VahidZee/PixelCnnPP
down_shifted_conv2d
false
2,947
[ "MIT" ]
0
b0d7bffb3cc18263e55d7851f60f5682ba09e5c2
https://github.com/VahidZee/PixelCnnPP/tree/b0d7bffb3cc18263e55d7851f60f5682ba09e5c2
GCN_classifier
# 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....
TTomatoZhang/GHGCN
GCN_classifier
false
3,132
[ "Apache-2.0" ]
0
09a07ff9e29e5889b912ca5feff74bb9308eda55
https://github.com/TTomatoZhang/GHGCN/tree/09a07ff9e29e5889b912ca5feff74bb9308eda55
D_DownBlock
import torch from torchvision.transforms import * class ConvBlock(torch.nn.Module): def __init__(self, input_size, output_size, kernel_size=3, stride=1, padding=1, bias=True, activation='prelu', norm=None): super(ConvBlock, self).__init__() self.conv = torch.nn.Conv2d(input_size, output_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 torchvision.transforms import * assert_size_stride = torch._C._dynamo.guard...
EvgeneyZ/RBPN
D_DownBlock
false
9,490
[ "MIT" ]
0
acfe636cc48a4fbfea78f934a251c32e53367659
https://github.com/EvgeneyZ/RBPN/tree/acfe636cc48a4fbfea78f934a251c32e53367659
PlanarNormalizingFlow
import torch import torch.nn.functional as F import torch.nn as nn class PlanarNormalizingFlow(nn.Module): """ Planar normalizing flow [Rezende & Mohamed 2015]. Provides a tighter bound on the ELBO by giving more expressive power to the approximate distribution, such as by introducing covariance b...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.gu...
NightmareNyx/semi-supervised-pytorch
PlanarNormalizingFlow
false
2,701
[ "MIT" ]
0
43bb86bc6757345bd7a4eb37d6948ee62a268f7e
https://github.com/NightmareNyx/semi-supervised-pytorch/tree/43bb86bc6757345bd7a4eb37d6948ee62a268f7e
ResBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
mdornseif/fastface
ResBlock
false
16,029
[ "MIT" ]
72
72772db1fae4af17e829cd5479c4848fe5eb8948
https://github.com/mdornseif/fastface/tree/72772db1fae4af17e829cd5479c4848fe5eb8948
MseCriterion
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * assert_siz...
posuer/mt-dnn
MseCriterion
false
12,907
[ "MIT" ]
0
5106083238654777838aaab5d1111b3b05c4ce04
https://github.com/posuer/mt-dnn/tree/5106083238654777838aaab5d1111b3b05c4ce04
Actor
import torch import torch.nn as nn import torch.nn.functional as F class Actor(nn.Module): def __init__(self, num_state, num_action): super(Actor, self).__init__() self.num_state = num_state self.num_action = num_action self.fc1 = nn.Linear(self.num_state, 512) self.action...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
cugzj/Adaptive-B
Actor
false
6,519
[ "Apache-2.0" ]
1
cebc965b1dbad93332ae371bfef8640259d940c4
https://github.com/cugzj/Adaptive-B/tree/cebc965b1dbad93332ae371bfef8640259d940c4
MLP
from torch.nn import Module import torch from torch.nn import Linear from torch.nn import Sigmoid from torch.nn.init import xavier_uniform_ class MLP(Module): """ Defines the NN model - in this case, there are 3 hidden layers, 13 inputs (defined by data) in the 1st, 10 inputs in the second, and 8 in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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 import Linear from torch.nn import Sig...
jfmalloy1/UltraMarathon_Prediction
MLP
false
3,724
[ "MIT" ]
0
8eef7bd2860ce255994d32a0150c09b3b655cee7
https://github.com/jfmalloy1/UltraMarathon_Prediction/tree/8eef7bd2860ce255994d32a0150c09b3b655cee7
TransposedConvLayer
# 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.optim import * imp...
EvilPerfectionist/ssl_e2vid
TransposedConvLayer
false
8,078
[ "MIT" ]
24
84f7c7e59875f134e97c14ec423f396725e04be7
https://github.com/EvilPerfectionist/ssl_e2vid/tree/84f7c7e59875f134e97c14ec423f396725e04be7
BatchLinear
import torch from torch import nn from collections import OrderedDict class MetaModule(nn.Module): """ Base class for PyTorch meta-learning modules. These modules accept an additional argument `params` in their `forward` method. Notes ----- Objects inherited from `MetaModule` are fully compat...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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...
aneesh-dandime/siren
BatchLinear
false
12,085
[ "MIT" ]
0
7bc652e32d66c5792d24e8df2fffa565157679bd
https://github.com/aneesh-dandime/siren/tree/7bc652e32d66c5792d24e8df2fffa565157679bd
CustomGruCell
# 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 ...
Rahul-160/PySyft
CustomGruCell
false
17,829
[ "Apache-2.0" ]
7
182627db2369d6f93aa0667f5ea2abee5b878d58
https://github.com/Rahul-160/PySyft/tree/182627db2369d6f93aa0667f5ea2abee5b878d58
Ternary
import torch from torch import nn class Ternary(nn.Module): """ Ternarize the input activations to -1, 0, 1. """ def __init__(self, left=-0.25, right=0.25): super().__init__() self.left = left self.right = right def forward(self, input): input = input.clone() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
C-SUNSHINE/TOQ-Nets-PyTorch-Release
Ternary
false
17,137
[ "MIT" ]
6
05e06bf633fb3c6b610dda9a5126ecd7af1db02f
https://github.com/C-SUNSHINE/TOQ-Nets-PyTorch-Release/tree/05e06bf633fb3c6b610dda9a5126ecd7af1db02f
MLP
import torch class MLP(torch.nn.Module): def __init__(self, dim, drop=0.3): super().__init__() self.fc_1 = torch.nn.Linear(dim, 80) self.fc_2 = torch.nn.Linear(80, 10) self.fc_3 = torch.nn.Linear(10, 1) self.act = torch.nn.ReLU() self.dropout = torch.nn.Dropout(p=d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
IDSC-io/vre-tgn
MLP
false
9,144
[ "Apache-2.0" ]
0
46e8327e3befe67003874fa70b384a511523f8f7
https://github.com/IDSC-io/vre-tgn/tree/46e8327e3befe67003874fa70b384a511523f8f7
SAP
import torch import torch.nn as nn class SelfAttentionPooling(nn.Module): """ Implementation of SelfAttentionPooling Original Paper: Self-Attention Encoding and Pooling for Speaker Recognition https://arxiv.org/pdf/2008.01077v1.pdf """ def __init__(self, input_dim): super(SelfAttenti...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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
SAP
false
2,000
[ "MIT" ]
0
6531904e9621a778978b9cfef3ba9f582e56639a
https://github.com/AyushExel/s3prl/tree/6531904e9621a778978b9cfef3ba9f582e56639a
HorizontalMaxPool2d
# 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...
Qidian213/NAIC2019
HorizontalMaxPool2d
false
940
[ "MIT" ]
0
23e05a8a096168ccfa4d1743467fdf78ffcaabba
https://github.com/Qidian213/NAIC2019/tree/23e05a8a096168ccfa4d1743467fdf78ffcaabba
ZReLU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
HMS-CardiacMR/MyoMapNet-Myocardial-Parametric-Mapping
ZReLU
false
17,443
[ "MIT" ]
4
1e2dee8d6d1f97722eba91618462537faf9efba7
https://github.com/HMS-CardiacMR/MyoMapNet-Myocardial-Parametric-Mapping/tree/1e2dee8d6d1f97722eba91618462537faf9efba7
HSigmoid
import torch import torch.nn as nn import torch.nn.functional import torch.nn.parallel import torch.utils.data.distributed class HSigmoid(nn.Module): """ Applies the Hard-Sigmoid function element-wise. `"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_ Examples: >>> m = Mish()...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn.functional import torch.nn.parallel import torch.ut...
doansangg/CGAN-PyTorch
HSigmoid
false
6,580
[ "Apache-2.0" ]
1
941f5bd75102bed7f2eccd7feb9af8e6134af0e4
https://github.com/doansangg/CGAN-PyTorch/tree/941f5bd75102bed7f2eccd7feb9af8e6134af0e4
MyUpsample2
# 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...
Chenyang-Lu/road-completion
MyUpsample2
false
246
[ "MIT" ]
0
115ca232922d3c48ead324299664a9a71348d2fe
https://github.com/Chenyang-Lu/road-completion/tree/115ca232922d3c48ead324299664a9a71348d2fe
SimSiamLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn import ...
Yif-Yang/DSSL
SimSiamLoss
false
18,167
[ "MIT" ]
8
79a000450cfe66836089ecd5e2467863cc702e1c
https://github.com/Yif-Yang/DSSL/tree/79a000450cfe66836089ecd5e2467863cc702e1c
ClippedValueFunctionLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module import torch.utils.data import torch.nn.functional import tor...
ppvalluri09/annotated_deep_learning_paper_implementations
ClippedValueFunctionLoss
false
11,065
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
UpBlock
import torch from torchvision.transforms import * class ConvBlock(torch.nn.Module): def __init__(self, input_size, output_size, kernel_size=3, stride=1, padding=1, bias=True, activation='prelu', norm=None): super(ConvBlock, self).__init__() self.conv = torch.nn.Conv2d(input_size, output_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 torchvision.transforms import * assert_size_stride = torch._C._dynamo.guard...
DengZeshuai/DBPN-Pytorch
UpBlock
false
2,572
[ "MIT" ]
0
a90d241a1c4b07830c6d812ad8389d13e8cf05d1
https://github.com/DengZeshuai/DBPN-Pytorch/tree/a90d241a1c4b07830c6d812ad8389d13e8cf05d1
GeLU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards....
aditya10/vilbert-multi-task
GeLU
false
9,726
[ "MIT" ]
0
dda8c16187ac6cc4f6266a823fbde528f65af720
https://github.com/aditya10/vilbert-multi-task/tree/dda8c16187ac6cc4f6266a823fbde528f65af720
AppendClsToken
import torch import torch.nn as nn from functools import partial import torch.utils.cpp_extension class AppendClsToken(nn.Module): def __init__(self, embed_dim, init_func=partial(nn.init.normal_, std=0.02) ): super().__init__() self.cls_token = nn.Parameter(torch.zeros(1, 1, embed_dim)) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from functools import partial import torch.utils.cpp_extension assert_size_stride = torch._C._dynamo.guards.assert_siz...
STomoya/animeface
AppendClsToken
false
14,364
[ "MIT" ]
61
37b3cd26097d7874559d4c152e41e5712b7a1a42
https://github.com/STomoya/animeface/tree/37b3cd26097d7874559d4c152e41e5712b7a1a42
RewardCriterion
import torch import torch.nn as nn from torch.autograd import * def to_contiguous(tensor): if tensor.is_contiguous(): return tensor else: return tensor.contiguous() class RewardCriterion(nn.Module): def __init__(self): super(RewardCriterion, self).__init__() def forward(sel...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.autograd import * assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
chagmgang/object_relation_transformer
RewardCriterion
false
6,412
[ "MIT" ]
1
04b88514f97232c12b576720e4b82226751c3c48
https://github.com/chagmgang/object_relation_transformer/tree/04b88514f97232c12b576720e4b82226751c3c48
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 import torch.nn as nn import torch.utils.data import torch.nn.parallel assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty...
Manojbhat09/Sane-annotation-shape-complete
Swish
false
17,694
[ "Apache-2.0" ]
9
03b298b2c0a187be979ff31ad2a39238b72a6d78
https://github.com/Manojbhat09/Sane-annotation-shape-complete/tree/03b298b2c0a187be979ff31ad2a39238b72a6d78
EncoderBlock
import torch from torch import nn import torch.nn.functional as F class MlpBlock(nn.Module): def __init__(self, in_dim, mlp_dim, out_dim, dropout_rate=0.1): super(MlpBlock, self).__init__() self.fc1 = nn.Linear(in_dim, mlp_dim) self.fc2 = nn.Linear(mlp_dim, out_dim) self.act = nn....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Graeme22/VisionTransformer-Pytorch
EncoderBlock
false
17,337
[ "Apache-2.0" ]
5
4e8abecf27e92dffd8d00f3d9b5ad4a21079cd0e
https://github.com/Graeme22/VisionTransformer-Pytorch/tree/4e8abecf27e92dffd8d00f3d9b5ad4a21079cd0e
P2SActivationLayer
import torch import torch.nn as torch_nn from torch.nn import Parameter import torch.utils class P2SActivationLayer(torch_nn.Module): """ Output layer that produces cos heta between activation vector x and class vector w_j in_dim: dimension of input feature vectors output_dim: dimension of output ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
eurecom-asp/raw-pc-darts-anti-spoofing
P2SActivationLayer
false
6,663
[ "MIT" ]
1
f2dcb5a8fc0cb811328a341a9bd90ffb292adaa1
https://github.com/eurecom-asp/raw-pc-darts-anti-spoofing/tree/f2dcb5a8fc0cb811328a341a9bd90ffb292adaa1
silog_loss
import torch import torch.nn as nn import torch.utils.data.distributed class silog_loss(nn.Module): def __init__(self, variance_focus): super(silog_loss, self).__init__() self.variance_focus = variance_focus def forward(self, depth_est, depth_gt, mask): d = torch.log(depth_est[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.triton_helpers import libdevice, math as tl_math import torch.nn as nn import torch.utils.data.distributed asse...
syKevinPeng/TransDepth
silog_loss
false
16,530
[ "MIT" ]
118
2282039da7bc0812e19a27b2d73a25bdef97d739
https://github.com/syKevinPeng/TransDepth/tree/2282039da7bc0812e19a27b2d73a25bdef97d739
MaxPoolPad
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn.init assert_size_stride = torch._C._dynamo.guards.a...
MichoelSnow/data_science
MaxPoolPad
false
9,868
[ "MIT" ]
0
7f6c054624268308ec4126a601c9fa8bc5de157c
https://github.com/MichoelSnow/data_science/tree/7f6c054624268308ec4126a601c9fa8bc5de157c
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
microsoft/vision-longformer
FocalLoss
false
16,052
[ "MIT" ]
169
c9ce386de3e633bb3c805368d118356fbd696487
https://github.com/microsoft/vision-longformer/tree/c9ce386de3e633bb3c805368d118356fbd696487
enhance_net_nopool
# 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....
alisonwqq/Zero-DCE_extension
enhance_net_nopool
false
14,810
[ "MIT" ]
97
6b59b36cbe2983e216789583d837bdc88d3e5cf8
https://github.com/alisonwqq/Zero-DCE_extension/tree/6b59b36cbe2983e216789583d837bdc88d3e5cf8
GAT
import torch import torch.nn.functional as F import torch.nn as nn class GraphAttentionLayer(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(GraphAttentionLayer, self).__init__(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
StellaAthena/Graph-Universal-Attack
GAT
false
11,943
[ "MIT" ]
0
38c85d54df0aca22a06731a8dff8bcf2f5bc8004
https://github.com/StellaAthena/Graph-Universal-Attack/tree/38c85d54df0aca22a06731a8dff8bcf2f5bc8004
PoseNetFeat
# 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 ...
JiazeWang/6-PACK
PoseNetFeat
false
11,555
[ "MIT" ]
0
bce910213cfbf89b4ed7b59ff6c70a59a7c19b99
https://github.com/JiazeWang/6-PACK/tree/bce910213cfbf89b4ed7b59ff6c70a59a7c19b99
Attention
import math import torch import torch.nn.functional as F import torch.fx import torch.utils.data def restricted_softmax(src, dim: 'int'=-1, margin: 'float'=0.0): src_max = torch.clamp(src.max(dim=dim, keepdim=True)[0], min=0.0) out = (src - src_max).exp() out = out / (out.sum(dim=dim, keepdim=True) + (mar...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
JinheonBaek/pytorch_geometric
Attention
false
17,508
[ "MIT" ]
4
dfd32d08a3d8191d6290e53458d4eda515d04fd6
https://github.com/JinheonBaek/pytorch_geometric/tree/dfd32d08a3d8191d6290e53458d4eda515d04fd6
PolicyNetwork
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal class PolicyNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size, init_w=0.003, log_std_min=-20, log_std_max=2): super(PolicyNetwork, self).__init__() self.log_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 to...
FTC-8856/SAC
PolicyNetwork
false
9,047
[ "MIT" ]
0
98898d2c4b2ae99b74a8b5a6934d5d3cb91fe5f4
https://github.com/FTC-8856/SAC/tree/98898d2c4b2ae99b74a8b5a6934d5d3cb91fe5f4
DW_PW_projection
# 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...
YexuZhou/TimeSeriesClassification_Transformer
DW_PW_projection
false
6,015
[ "MIT" ]
1
c20e00cfac4cfdb849e57e14c184f7d424257409
https://github.com/YexuZhou/TimeSeriesClassification_Transformer/tree/c20e00cfac4cfdb849e57e14c184f7d424257409