entry_point
stringlengths
1
65
original_triton_code
stringlengths
4.5k
619k
python_code
stringlengths
208
60.9k
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
pytorch_code
stringlengths
200
4.05k
LayerScaleBlock
# 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 torch.nn as nn def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). This is the same as the DropConnect impl I created for EfficientNet, etc networks, however, the original name is...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
yifanc96/yifanc-DL
LayerScaleBlock
false
11,101
[ "MIT" ]
0
25d56cec776fb151c8f6bcbd997bca94f07f3597
https://github.com/yifanc96/yifanc-DL/tree/25d56cec776fb151c8f6bcbd997bca94f07f3597
import torch import torch.nn as nn def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). This is the same as the DropConnect impl I created for EfficientNet, etc networks, however, the original name is...
LinearScale
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn class LinearScale(nn.Module): def __init__(self, scale, bias): super(LinearScale, self).__init__() self.scale_v = scale self.bias_v = bias pass def forward(self, x): out = x * self.scale_v + self.bias_v return out def __r...
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...
xh-liu-tech/CIPS-3D
LinearScale
false
11,102
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
import torch from torch import nn class Model(nn.Module): def __init__(self, scale, bias): super().__init__() self.scale_v = scale self.bias_v = bias pass def forward(self, x): out = x * self.scale_v + self.bias_v return out def __repr__(self): re...
FiLMLayer
# 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 import nn class FiLMLayer(nn.Module): def __init__(self, input_dim, hidden_dim): super().__init__() self.layer = nn.Linear(input_dim, hidden_dim) def forward(self, x, freq, phase_shift): x = self.layer(x) freq = freq.unsqueeze(1).expand_as(x) p...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 im...
xh-liu-tech/CIPS-3D
FiLMLayer
false
11,103
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
import torch from torch import nn class Model(nn.Module): def __init__(self, input_dim, hidden_dim): super().__init__() self.layer = nn.Linear(input_dim, hidden_dim) def forward(self, x, freq, phase_shift): x = self.layer(x) freq = freq.unsqueeze(1).expand_as(x) phase...
MyDilateBlur
# 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 math import torch import torch.nn as nn import torch.nn.functional as F class MyDilateBlur(nn.Module): def __init__(self, kernel_size=7, channels=3, sigma=0.8): super(MyDilateBlur, self).__init__() self.kernel_size = kernel_size self.channels = channels x_cord = torch.arang...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math import torch.nn a...
williamyang1991/DeepPS
MyDilateBlur
false
11,104
[ "MIT" ]
0
f3eb6ba4b0f2ef068361a4bbbd3d6c2c2f6726b4
https://github.com/williamyang1991/DeepPS/tree/f3eb6ba4b0f2ef068361a4bbbd3d6c2c2f6726b4
import math import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, kernel_size=7, channels=3, sigma=0.8): super().__init__() self.kernel_size = kernel_size self.channels = channels x_cord = torch.arange(self.kernel_size + 0.0)...
CoordFC
# 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 numpy as np from torch import nn class SinActivation(nn.Module): def __init__(self): super(SinActivation, self).__init__() def forward(self, x): return torch.sin(x) class CoordFC(nn.Module): def __init__(self, input_dim, hidden_dim): super().__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy ...
xh-liu-tech/CIPS-3D
CoordFC
false
11,105
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
import torch import numpy as np from torch import nn class SinActivation(nn.Module): def __init__(self): super().__init__() def forward(self, x): return torch.sin(x) class Model(nn.Module): def __init__(self, input_dim, hidden_dim): super().__init__() self.layer = nn.L...
GlobalAveragePooling
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn class GlobalAveragePooling(nn.Module): def __init__(self): super().__init__() def forward(self, x): return x.mean([2, 3]) 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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
xh-liu-tech/CIPS-3D
GlobalAveragePooling
false
11,106
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): return x.mean([2, 3]) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
FiLMLayerEqualFC
# 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 math import torch import torch.nn.functional as F from torch import nn class EqualLinear(nn.Module): def __init__(self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1.0, activation=None): """ :param in_dim: :param out_dim: :param bias: :param bias_init: :param lr_mu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 math i...
xh-liu-tech/CIPS-3D
FiLMLayerEqualFC
false
11,107
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
import math import torch import torch.nn.functional as F from torch import nn class EqualLinear(nn.Module): def __init__(self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1.0, activation=None): """ :param in_dim: :param out_dim: :param bias: :param bias_init: :param lr_mu...
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 math import torch import torch.nn.functional as F from torch import nn class EqualConvTranspose2d(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, stride=1, padding=0, bias=True): super().__init__() self.weight = nn.Parameter(torch.randn(in_channel, out_channel,...
import torch from torch._inductor.select_algorithm import extern_kernels import 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
import math import torch import torch.nn.functional as F from torch import nn class Model(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, stride=1, padding=0, bias=True): super().__init__() self.weight = nn.Parameter(torch.randn(in_channel, out_channel, ke...
CLNLayer
# 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 torch.nn.functional as F from torch import nn class CLN(nn.Module): def __init__(self, in_dim, use_style_fc=False, style_dim=None, which_linear=nn.Linear, spectral_norm=False, eps=1e-05, **kwargs): super(CLN, self).__init__() self.in_dim = in_dim self.use_style...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn.fun...
xh-liu-tech/CIPS-3D
CLNLayer
false
11,109
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
import torch import torch.nn.functional as F from torch import nn class CLN(nn.Module): def __init__(self, in_dim, use_style_fc=False, style_dim=None, which_linear=nn.Linear, spectral_norm=False, eps=1e-05, **kwargs): super().__init__() self.in_dim = in_dim self.use_style_fc = use...
CoordConvSinAct
# 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 import nn class SinAct(nn.Module): def __init__(self): super(SinAct, self).__init__() def forward(self, x): return torch.sin(x) class CoordConvSinAct(nn.Module): """ Source: https://github.com/mkocabas/CoordConv-pytorch/blob/master/CoordConv.py """ def ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch im...
xh-liu-tech/CIPS-3D
CoordConvSinAct
false
11,110
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
import torch from torch import nn class SinAct(nn.Module): def __init__(self): super().__init__() def forward(self, x): return torch.sin(x) class Model(nn.Module): """ Source: https://github.com/mkocabas/CoordConv-pytorch/blob/master/CoordConv.py """ def __init__(self, in_chan...
FiLMLayer_PreSin
# 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 numpy as np from torch import nn class FiLMLayer_PreSin(nn.Module): def __init__(self, in_dim, out_dim, style_dim, use_style_fc=True, which_linear=nn.Linear, **kwargs): super(FiLMLayer_PreSin, self).__init__() self.in_dim = in_dim self.out_dim = out_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.triton_helpers import math as tl_math import numpy ...
xh-liu-tech/CIPS-3D
FiLMLayer_PreSin
false
11,113
[ "MIT" ]
0
8910dfcf19bb86aab2287d652ae4e3666806b511
https://github.com/xh-liu-tech/CIPS-3D/tree/8910dfcf19bb86aab2287d652ae4e3666806b511
import torch import numpy as np from torch import nn class Model(nn.Module): def __init__(self, in_dim, out_dim, style_dim, use_style_fc=True, which_linear=nn.Linear, **kwargs): super().__init__() self.in_dim = in_dim self.out_dim = out_dim self.style_dim = style_dim ...
SmallMnistNoDropout
# 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 torch.nn as nn import torch.nn import torch.utils.data import torch.utils.tensorboard._pytorch_graph class SmallMnistNoDropout(nn.Module): def __init__(self): super(SmallMnistNoDropout, self).__init__() self.conv1 = nn.Conv2d(1, 10, kernel_size=5) self.relu1 = nn.ReLU(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
quic-akhobare/aimet
SmallMnistNoDropout
false
11,114
[ "BSD-3-Clause" ]
0
1811a0ef58a75d103e173731b436876ee5dc4c49
https://github.com/quic-akhobare/aimet/tree/1811a0ef58a75d103e173731b436876ee5dc4c49
import torch import torch.nn as nn import torch.nn import torch.utils.data import torch.utils.tensorboard._pytorch_graph class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 10, kernel_size=5) self.relu1 = nn.ReLU() self.conv2 = nn.Conv2d(10, 20...
SmallMnistNoDropoutWithPassThrough
# 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 torch.nn as nn import torch.nn import torch.utils.data import torch.utils.tensorboard._pytorch_graph class PassThroughOp(torch.nn.Module): """ This is a pass-through op, used for purpose of making an op a no-op """ def forward(self, inputx): return inputx class SmallMnis...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
quic-akhobare/aimet
SmallMnistNoDropoutWithPassThrough
false
11,115
[ "BSD-3-Clause" ]
0
1811a0ef58a75d103e173731b436876ee5dc4c49
https://github.com/quic-akhobare/aimet/tree/1811a0ef58a75d103e173731b436876ee5dc4c49
import torch import torch.nn as nn import torch.nn import torch.utils.data import torch.utils.tensorboard._pytorch_graph class PassThroughOp(torch.nn.Module): """ This is a pass-through op, used for purpose of making an op a no-op """ def forward(self, inputx): return inputx class Model(nn....
TransposedConvModel
# 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 torch.cuda import torch.nn import torch.utils.data import torch.fx import torch.utils.tensorboard._pytorch_graph class TransposedConvModel(torch.nn.Module): def __init__(self): super(TransposedConvModel, self).__init__() self.conv1 = torch.nn.ConvTranspose2d(10, 10, 3) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.cuda import torc...
mikeseven/aimet
TransposedConvModel
false
11,116
[ "BSD-3-Clause" ]
0
63211a4f259b6457c58dfae1097c70acb93319fe
https://github.com/mikeseven/aimet/tree/63211a4f259b6457c58dfae1097c70acb93319fe
import torch import torch.cuda import torch.nn import torch.utils.data import torch.fx import torch.utils.tensorboard._pytorch_graph class Model(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = torch.nn.ConvTranspose2d(10, 10, 3) self.relu1 = torch.nn.ReLU() s...
Router
# 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...
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Squash(Module): '\n ## Squash\n\n This is **squashing** function from paper, given by equation $(1)$.\n\n $$\\mathbf{v}_j = \x0crac{{\\lVert \\mathbf{s}_j \rVert}^2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ppvalluri09/annotated_deep_learning_paper_implementations
Router
false
11,117
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Squash(Module): '\n ## Squash\n\n This is **squashing** function from paper, given by equation $(1)$.\n\n $$\\mathbf{v}_j = \x0crac{{\\lVert \\mathbf{s}_j \rVert}^2...
DotRole
# 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...
from _paritybench_helpers import _mock_config import torch import torch as th import torch.nn as nn class DotRole(nn.Module): def __init__(self, args): super(DotRole, self).__init__() self.args = args self.n_actions = args.n_actions self.q_fc = nn.Linear(args.rnn_hidden_dim, args....
import torch from torch._inductor.select_algorithm import extern_kernels import 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 as th import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
NagisaZj/RODE
DotRole
false
11,118
[ "Apache-2.0" ]
0
f7f6831fee58a7910e1d7c3a8ae19cef82ab8d03
https://github.com/NagisaZj/RODE/tree/f7f6831fee58a7910e1d7c3a8ae19cef82ab8d03
from _paritybench_helpers import _mock_config import torch import torch as th import torch.nn as nn class Model(nn.Module): def __init__(self, args): super().__init__() self.args = args self.n_actions = args.n_actions self.q_fc = nn.Linear(args.rnn_hidden_dim, args.action_latent_d...
TwoLinearsModel
# 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 torch.cuda from torch import nn import torch.nn import torch.utils.data import torch.fx import torch.utils.tensorboard._pytorch_graph class TwoLinearsModel(nn.Module): def __init__(self, per_sample_shape: 'list', hidden_size: 'int', output_size: 'int'): super(TwoLinearsModel, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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.cuda from torch ...
mikeseven/aimet
TwoLinearsModel
false
11,119
[ "BSD-3-Clause" ]
0
63211a4f259b6457c58dfae1097c70acb93319fe
https://github.com/mikeseven/aimet/tree/63211a4f259b6457c58dfae1097c70acb93319fe
import torch import torch.cuda from torch import nn import torch.nn import torch.utils.data import torch.fx import torch.utils.tensorboard._pytorch_graph class Model(nn.Module): def __init__(self, per_sample_shape: 'list', hidden_size: 'int', output_size: 'int'): super().__init__() assert...
BertPredictionHeadTransform
# 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...
from _paritybench_helpers import _mock_config import math import torch from torch import nn def gelu(x): """Gaussian Error Linear Unitという活性化関数です。 LeLUが0でカクっと不連続なので、そこを連続になるように滑らかにした形のLeLUです。 """ return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0))) class BertLayerNorm(nn.Module): def __init__(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math from to...
Cyndi-Tokyotech/Fin_Text_Analysis_ML
BertPredictionHeadTransform
false
11,120
[ "MIT" ]
0
7f9b6c1ea78f8e6f32c003b2de32809722df88d4
https://github.com/Cyndi-Tokyotech/Fin_Text_Analysis_ML/tree/7f9b6c1ea78f8e6f32c003b2de32809722df88d4
from _paritybench_helpers import _mock_config import math import torch from torch import nn def gelu(x): """Gaussian Error Linear Unitという活性化関数です。 LeLUが0でカクっと不連続なので、そこを連続になるように滑らかにした形のLeLUです。 """ return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0))) class BertLayerNorm(nn.Module): def __init__(...
ActorNetwork
# 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 torch as T import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Normal class ActorNetwork(nn.Module): def __init__(self, alpha, input_dims, fc1_dims, fc2_dims, max_action, n_actions): super(ActorNetwork, 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 import torch as T import torc...
MonteyMontey/deep-reinforcement-learning-sandbox
ActorNetwork
false
11,121
[ "MIT" ]
0
0e93760a994b6af54f0a665f5bc4f9d5ffd45c0a
https://github.com/MonteyMontey/deep-reinforcement-learning-sandbox/tree/0e93760a994b6af54f0a665f5bc4f9d5ffd45c0a
import torch import torch as T import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Normal class Model(nn.Module): def __init__(self, alpha, input_dims, fc1_dims, fc2_dims, max_action, n_actions): super().__init__() self.input_d...
BertCoAttention
# 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...
from _paritybench_helpers import _mock_config import math import torch from torch import nn class BertCoAttention(nn.Module): def __init__(self, config): super(BertCoAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
KDD2022-MSCMT/MSCMT
BertCoAttention
false
11,122
[ "MIT" ]
0
6a3e1e6230aa519a57345f6dbb0731b3ed6fe1ce
https://github.com/KDD2022-MSCMT/MSCMT/tree/6a3e1e6230aa519a57345f6dbb0731b3ed6fe1ce
from _paritybench_helpers import _mock_config import math import torch from torch import nn class Model(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidden size (%d) is not a ...
MaskedTransformerEncoderLayer
# 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...
from torch.nn import Module import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Linear from torch.nn import Dropout from torch.nn import LayerNorm from torch.nn import Identity def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) pe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
yifanc96/yifanc-DL
MaskedTransformerEncoderLayer
false
11,123
[ "MIT" ]
0
25d56cec776fb151c8f6bcbd997bca94f07f3597
https://github.com/yifanc96/yifanc-DL/tree/25d56cec776fb151c8f6bcbd997bca94f07f3597
from torch.nn import Module import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Linear from torch.nn import Dropout from torch.nn import LayerNorm from torch.nn import Identity def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) pe...
_TestNetStrided
# 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 torch.cuda import torch.nn.functional as F import torch.nn import torch.utils.data import torch.fx import torch.utils.tensorboard._pytorch_graph class _TestNetStrided(torch.nn.Module): def __init__(self): super(_TestNetStrided, self).__init__() self.conv1 = torch.nn.Conv2d(1, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mikeseven/aimet
_TestNetStrided
false
11,124
[ "BSD-3-Clause" ]
0
63211a4f259b6457c58dfae1097c70acb93319fe
https://github.com/mikeseven/aimet/tree/63211a4f259b6457c58dfae1097c70acb93319fe
import torch import torch.cuda import torch.nn.functional as F import torch.nn import torch.utils.data import torch.fx import torch.utils.tensorboard._pytorch_graph class Model(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = torch.nn.Conv2d(1, 20, kernel_size=5) self...
DotSelector
# 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...
from _paritybench_helpers import _mock_config import torch import torch as th from torch.distributions import Categorical import torch.nn as nn import torch.nn.functional as F class DotSelector(nn.Module): def __init__(self, input_shape, args): super(DotSelector, self).__init__() self.args = args...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch as th from torch...
NagisaZj/RODE
DotSelector
false
11,125
[ "Apache-2.0" ]
0
f7f6831fee58a7910e1d7c3a8ae19cef82ab8d03
https://github.com/NagisaZj/RODE/tree/f7f6831fee58a7910e1d7c3a8ae19cef82ab8d03
from _paritybench_helpers import _mock_config import torch import torch as th from torch.distributions import Categorical import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_shape, args): super().__init__() self.args = args self.epsilon_s...
Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch class Net(torch.nn.Module): def __init__(self, configs): super(Net, self).__init__() self.fc1 = torch.nn.Linear(configs['input_size'], configs[ 'hidden_size']) self.fc1_activate = torch.nn.ReLU() self.fc2 = tor...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Lovestarni/Reinforcement-learning-with-tensorflow
Net
false
11,126
[ "MIT" ]
0
822a4ae812b044687c11138ef9c9db1e1190f98c
https://github.com/Lovestarni/Reinforcement-learning-with-tensorflow/tree/822a4ae812b044687c11138ef9c9db1e1190f98c
from _paritybench_helpers import _mock_config import torch class Model(torch.nn.Module): def __init__(self, configs): super().__init__() self.fc1 = torch.nn.Linear(configs['input_size'], configs[ 'hidden_size']) self.fc1_activate = torch.nn.ReLU() self.fc2 = torch.nn.L...
MemoryUpdater
# 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...
from _paritybench_helpers import _mock_config import math import torch from torch import nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Sy-Zhang/recurrent-transformer
MemoryUpdater
false
11,127
[ "MIT" ]
0
f66ba49a2c9ec42759d3d00d497b49ffe39e18de
https://github.com/Sy-Zhang/recurrent-transformer/tree/f66ba49a2c9ec42759d3d00d497b49ffe39e18de
from _paritybench_helpers import _mock_config import math import torch from torch import nn class BertSelfAttention(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidden size (%...
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...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class RobertaClassificationHead(nn.Module): """Head for sentence-level classification tasks.""" def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size * 2, config.hidden_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.triton_helpers import libdevice import torch.nn as ...
claudiosv/CodeBERT
RobertaClassificationHead
false
11,128
[ "MIT" ]
0
a276f5c2d2ea726837002f3d9f840e4bd1baa2aa
https://github.com/claudiosv/CodeBERT/tree/a276f5c2d2ea726837002f3d9f840e4bd1baa2aa
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): """Head for sentence-level classification tasks.""" def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size * 2, config.hidden_size) self.dropout =...
BertAttention
# 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...
from _paritybench_helpers import _mock_config import math import torch from torch import nn class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-12): """Construct a layernorm module in the TF style (epsilon inside the square root). """ super(BertLayerNorm, 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....
Sy-Zhang/recurrent-transformer
BertAttention
false
11,129
[ "MIT" ]
0
f66ba49a2c9ec42759d3d00d497b49ffe39e18de
https://github.com/Sy-Zhang/recurrent-transformer/tree/f66ba49a2c9ec42759d3d00d497b49ffe39e18de
from _paritybench_helpers import _mock_config import math import torch from torch import nn class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-12): """Construct a layernorm module in the TF style (epsilon inside the square root). """ super().__init__() self.wei...
TransformerEncoderLayer_attn
# 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...
from torch.nn import Module import torch import torch.nn as nn from torch.nn import Linear from torch.nn import Dropout from torch.nn import LayerNorm from torch.nn import Identity def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) per sample (when applied in main p...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
yifanc96/yifanc-DL
TransformerEncoderLayer_attn
false
11,130
[ "MIT" ]
0
25d56cec776fb151c8f6bcbd997bca94f07f3597
https://github.com/yifanc96/yifanc-DL/tree/25d56cec776fb151c8f6bcbd997bca94f07f3597
from torch.nn import Module import torch import torch.nn as nn from torch.nn import Linear from torch.nn import Dropout from torch.nn import LayerNorm from torch.nn import Identity def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) per sample (when applied in main p...
BertOutput
# 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...
from _paritybench_helpers import _mock_config import torch from torch import nn class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-12): """Construct a layernorm module in the TF style (epsilon inside the square root). """ super(BertLayerNorm, self).__init__() 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.triton_helpers import libdevice from torch import n...
Sy-Zhang/recurrent-transformer
BertOutput
false
11,132
[ "MIT" ]
0
f66ba49a2c9ec42759d3d00d497b49ffe39e18de
https://github.com/Sy-Zhang/recurrent-transformer/tree/f66ba49a2c9ec42759d3d00d497b49ffe39e18de
from _paritybench_helpers import _mock_config import torch from torch import nn class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-12): """Construct a layernorm module in the TF style (epsilon inside the square root). """ super().__init__() self.weight = nn.Par...
CNNCOVID19
# 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...
from _paritybench_helpers import _mock_config import torch import torch.nn.functional as F import torch.nn as nn class CNNCOVID19(nn.Module): def __init__(self, args): super(CNNCOVID19, self).__init__() self.conv1 = nn.Conv2d(in_channels=3, out_channels=8, kernel_size=3) self.fc1 = nn.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....
NaiboWang/HFL-CS6203-NaiboShiqi
CNNCOVID19
false
11,133
[ "MIT" ]
0
4bab35a20f1ec1229b0011c952d93c341579c402
https://github.com/NaiboWang/HFL-CS6203-NaiboShiqi/tree/4bab35a20f1ec1229b0011c952d93c341579c402
from _paritybench_helpers import _mock_config import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, args): super().__init__() self.conv1 = nn.Conv2d(in_channels=3, out_channels=8, kernel_size=3) self.fc1 = nn.Linear(in_features=8 * 3...
CNNCifar
# 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...
from _paritybench_helpers import _mock_config import torch import torch.nn.functional as nn_fnx from torch import nn class CNNCifar(nn.Module): def __init__(self, args): super(CNNCifar, self).__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = 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....
amanapte/Federated-Learning-PyTorch
CNNCifar
false
11,134
[ "MIT" ]
0
ef48ed1457ba7deb53811e8e2a767f65bf82ae94
https://github.com/amanapte/Federated-Learning-PyTorch/tree/ef48ed1457ba7deb53811e8e2a767f65bf82ae94
from _paritybench_helpers import _mock_config import torch import torch.nn.functional as nn_fnx from torch import nn class Model(nn.Module): def __init__(self, args): super().__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5)...
BertOutAttention
# 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...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertOutAttention(nn.Module): def __init__(self, config, ctx_dim=None): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chanhee-luke/Recurrent-VLN-BERT
BertOutAttention
false
11,135
[ "MIT" ]
0
31db5e02efb0a4685df22949ac4643a9e37ed26a
https://github.com/chanhee-luke/Recurrent-VLN-BERT/tree/31db5e02efb0a4685df22949ac4643a9e37ed26a
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config, ctx_dim=None): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidden size...
BertPredictionHeadTransform
# 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...
from _paritybench_helpers import _mock_config import math import torch from torch import nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT"s gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math from to...
Sy-Zhang/recurrent-transformer
BertPredictionHeadTransform
false
11,136
[ "MIT" ]
0
f66ba49a2c9ec42759d3d00d497b49ffe39e18de
https://github.com/Sy-Zhang/recurrent-transformer/tree/f66ba49a2c9ec42759d3d00d497b49ffe39e18de
from _paritybench_helpers import _mock_config import math import torch from torch import nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT"s gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math....
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...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import * class Attention(nn.Module): def __init__(self, opt): super(Attention, self).__init__() self.rnn_size = opt.rnn_size self.att_hid_size = opt.att_hid...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Zhendong-Wang/arsm_image_captioning
Attention
false
11,137
[ "MIT" ]
0
2282b76ab03b53952269d94d6c4b19ab98636ca5
https://github.com/Zhendong-Wang/arsm_image_captioning/tree/2282b76ab03b53952269d94d6c4b19ab98636ca5
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import * class Model(nn.Module): def __init__(self, opt): super().__init__() self.rnn_size = opt.rnn_size self.att_hid_size = opt.att_hid_size self....
BertTextPooler
# 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...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class BertTextPooler(nn.Module): def __init__(self, config): super(BertTextPooler, self).__init__() self.dense = nn.Linear(config.hidden_size, config.bi_hidden_size) self.activation = nn.ReLU() def forwa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
aditya10/vilbert-multi-task
BertTextPooler
false
11,138
[ "MIT" ]
0
dda8c16187ac6cc4f6266a823fbde528f65af720
https://github.com/aditya10/vilbert-multi-task/tree/dda8c16187ac6cc4f6266a823fbde528f65af720
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.bi_hidden_size) self.activation = nn.ReLU() def forward(self, hidden_states): ...
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...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class RobertaClassificationHead(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.dropout = nn.Dropout(config.hidden_dropout_prob) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
burakisikli/Contra-OOD
RobertaClassificationHead
false
11,139
[ "MIT" ]
0
0affc280a8db54940c66d822efb2a8722cafdf52
https://github.com/burakisikli/Contra-OOD/tree/0affc280a8db54940c66d822efb2a8722cafdf52
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.dropout = nn.Dropout(config.hidden_dropout_prob) self.out_pro...
BertSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Neo9061/amazon-sagemaker-examples
BertSelfAttention
false
11,140
[ "Apache-2.0" ]
0
da58c2950286a2e40bd53a5d5135b1e23fd79e63
https://github.com/Neo9061/amazon-sagemaker-examples/tree/da58c2950286a2e40bd53a5d5135b1e23fd79e63
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class Model(nn.Module): def __init__(self, config): super().__init__() ...
BertSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch from torch import nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Sy-Zhang/recurrent-transformer
BertSelfAttention
false
11,141
[ "MIT" ]
0
f66ba49a2c9ec42759d3d00d497b49ffe39e18de
https://github.com/Sy-Zhang/recurrent-transformer/tree/f66ba49a2c9ec42759d3d00d497b49ffe39e18de
from _paritybench_helpers import _mock_config import math import torch from torch import nn class Model(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidden size (%d) is not a ...
_Transition
# 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...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed from torchvision.transforms import * class _Transition(nn.Module): def __init__(self, in_channels, args): super(_Transit...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed from torchvisi...
HelenR6/robustness-1
_Transition
false
11,142
[ "Apache-2.0" ]
0
5527250df02195dff37628a9d76ae7d76c3c51d1
https://github.com/HelenR6/robustness-1/tree/5527250df02195dff37628a9d76ae7d76c3c51d1
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed from torchvision.transforms import * class Model(nn.Module): def __init__(self, in_channels, args): super().__init__() ...
EmbedNet
# 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...
from _paritybench_helpers import _mock_config import torch from torchvision.transforms import functional as F import torch.utils.data from torch import nn import torch.nn.functional as F class EmbedNet(nn.Module): def __init__(self, cfg): super(EmbedNet, self).__init__() self.embed_conv1 = nn.Con...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
ZJU-lishuang/mega.pytorch
EmbedNet
false
11,143
[ "BSD-2-Clause" ]
0
d655e51084d0cbeaf8ab46f63491191dfe3a1ab9
https://github.com/ZJU-lishuang/mega.pytorch/tree/d655e51084d0cbeaf8ab46f63491191dfe3a1ab9
from _paritybench_helpers import _mock_config import torch from torchvision.transforms import functional as F import torch.utils.data from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, cfg): super().__init__() self.embed_conv1 = nn.Conv2d(1024, 512, ke...
VGGBase
# 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 torchvision from torch import nn import torch.nn.functional as F from itertools import product as product import torch.optim import torch.utils.data def decimate(tensor, m): """ Decimate a tensor by a factor 'm', i.e. downsample by keeping every 'm'th value. This is used when we conve...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 torchvision from torch...
mosevg/ssd
VGGBase
false
11,144
[ "MIT" ]
0
8fd9f6cc376c027427531bcf475188ae43c4b2d6
https://github.com/mosevg/ssd/tree/8fd9f6cc376c027427531bcf475188ae43c4b2d6
import torch import torchvision from torch import nn import torch.nn.functional as F from itertools import product as product import torch.optim import torch.utils.data def decimate(tensor, m): """ Decimate a tensor by a factor 'm', i.e. downsample by keeping every 'm'th value. This is used when we conve...
SSD300
# 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 torchvision from torch import nn import torch.nn.functional as F from math import sqrt from itertools import product as product import torch.optim import torch.utils.data def decimate(tensor, m): """ Decimate a tensor by a factor 'm', i.e. downsample by keeping every 'm'th value. This...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
mosevg/ssd
SSD300
false
11,145
[ "MIT" ]
0
8fd9f6cc376c027427531bcf475188ae43c4b2d6
https://github.com/mosevg/ssd/tree/8fd9f6cc376c027427531bcf475188ae43c4b2d6
import torch import torchvision from torch import nn import torch.nn.functional as F from math import sqrt from itertools import product as product import torch.optim import torch.utils.data def decimate(tensor, m): """ Decimate a tensor by a factor 'm', i.e. downsample by keeping every 'm'th value. This...
Model
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn.functional from torch.nn.parameter import Parameter from torch.nn.modules import Module import torch.nn.parallel import torch.utils.data import torch.optim import torch.utils.data.distributed from torch.nn import Parameter from torch.nn import Module class Mode...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module import torch.nn.functional from torch.nn.parameter import Parameter from torch.nn.modules import Module import t...
DeanChan/apex
Model
false
11,146
[ "BSD-3-Clause" ]
0
a03267e5e1209f559a6671da56c479a216f418d1
https://github.com/DeanChan/apex/tree/a03267e5e1209f559a6671da56c479a216f418d1
from torch.nn import Module import torch import torch.nn.functional from torch.nn.parameter import Parameter from torch.nn.modules import Module import torch.nn.parallel import torch.utils.data import torch.optim import torch.utils.data.distributed from torch.nn import Parameter from torch.nn import Module class Mode...
Normalize
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn class Normalize(nn.Module): def __init__(self, power=2): super(Normalize, self).__init__() self.power = power def forward(self, x): norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power) out = x.div(norm) return out def...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Alan-Paul/ECN
Normalize
false
11,147
[ "Apache-2.0" ]
0
5e9a9081ff0c1e36cc0381df3ce9038a79a537e9
https://github.com/Alan-Paul/ECN/tree/5e9a9081ff0c1e36cc0381df3ce9038a79a537e9
import torch from torch import nn class Model(nn.Module): def __init__(self, power=2): super().__init__() self.power = power def forward(self, x): norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power) out = x.div(norm) return out def get_inputs(): ...
GlobalAvgPool2d
# 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 torch.nn as nn import torch.nn.functional as F class GlobalAvgPool2d(nn.Module): def __init__(self): super(GlobalAvgPool2d, self).__init__() def forward(self, x): N = x.data.size(0) C = x.data.size(1) H = x.data.size(2) W = x.data.size(3) x...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Abdul-Mukit/ssp_with_hand_tracking
GlobalAvgPool2d
false
11,148
[ "MIT" ]
0
04429ac9789283694a9176b94f70ab4e5a8c0727
https://github.com/Abdul-Mukit/ssp_with_hand_tracking/tree/04429ac9789283694a9176b94f70ab4e5a8c0727
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): N = x.data.size(0) C = x.data.size(1) H = x.data.size(2) W = x.data.size(3) x = F.avg_pool2d(x, (H, W)) ...
velocity_adding_neuron
# 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 torch.nn as nn class velocity_adding_neuron(nn.Module): def __init__(self, weight): super(velocity_adding_neuron, self).__init__() self.w = weight self.nl = nn.Tanh() def forward(self, x): return self.nl(self.w * x) def get_inputs(): return [torch.ra...
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_...
AgamChopra/simulation-in-a-box
velocity_adding_neuron
false
11,149
[ "MIT" ]
0
2a346a2fc83d79e542b64f1bd45c338d27a1934d
https://github.com/AgamChopra/simulation-in-a-box/tree/2a346a2fc83d79e542b64f1bd45c338d27a1934d
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, weight): super().__init__() self.w = weight self.nl = nn.Tanh() def forward(self, x): return self.nl(self.w * x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): ...
Sum
# 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 torch.nn as nn class Sum(nn.Module): def __init__(self, n, weight=False): super(Sum, self).__init__() self.weight = weight self.iter = range(n - 1) if weight: self.w = nn.Parameter(-torch.arange(1.0, n) / 2, requires_grad=True ) ...
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...
Alex-Beh/hand_tracking
Sum
false
11,150
[ "Apache-2.0" ]
0
40ac39e10ed5815d9400d6a87149015ad6ab9686
https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, n, weight=False): super().__init__() self.weight = weight self.iter = range(n - 1) if weight: self.w = nn.Parameter(-torch.arange(1.0, n) / 2, requires_grad=True ) def fo...
BCEBlurWithLogitsLoss
# 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 torch.nn as nn class BCEBlurWithLogitsLoss(nn.Module): def __init__(self, alpha=0.05): super(BCEBlurWithLogitsLoss, self).__init__() self.loss_fcn = nn.BCEWithLogitsLoss(reduction='none') self.alpha = alpha def forward(self, pred, true): loss = self.loss_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 libdevice, math as tl_math import torc...
Alex-Beh/hand_tracking
BCEBlurWithLogitsLoss
false
11,151
[ "Apache-2.0" ]
0
40ac39e10ed5815d9400d6a87149015ad6ab9686
https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, alpha=0.05): super().__init__() self.loss_fcn = nn.BCEWithLogitsLoss(reduction='none') self.alpha = alpha def forward(self, pred, true): loss = self.loss_fcn(pred, true) pred = torch.sigmoid...
Relu
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from torch.nn import Module import torch class Relu(Module): def forward(self, inp): return inp.clamp_min(0.0) - 0.5 def bwd(self, out, inp): inp.g = (inp > 0).float() * out.g 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 import triton_helpers from torch.nn import Module assert_size_stride = torch._C._dynamo.guards.assert_size_stri...
Akramz/Impractical-DL
Relu
false
11,152
[ "MIT" ]
0
ff909e369fb765c0857800925e39c433057ae8ac
https://github.com/Akramz/Impractical-DL/tree/ff909e369fb765c0857800925e39c433057ae8ac
from torch.nn import Module import torch class Model(Module): def forward(self, inp): return inp.clamp_min(0.0) - 0.5 def bwd(self, out, inp): inp.g = (inp > 0).float() * out.g def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Mse
# 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...
from torch.nn import Module import torch class Mse(Module): def forward(self, inp, targ): return (inp.squeeze() - targ).pow(2).mean() def bwd(self, out, inp, targ): inp.g = 2 * (inp.squeeze() - targ).unsqueeze(-1) / targ.shape[0] def get_inputs(): return [torch.rand([4, 4, 4, 4]), torc...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module assert_size_stride = torch._C._dynamo.guards.assert_size_stri...
Akramz/Impractical-DL
Mse
false
11,153
[ "MIT" ]
0
ff909e369fb765c0857800925e39c433057ae8ac
https://github.com/Akramz/Impractical-DL/tree/ff909e369fb765c0857800925e39c433057ae8ac
from torch.nn import Module import torch class Model(Module): def forward(self, inp, targ): return (inp.squeeze() - targ).pow(2).mean() def bwd(self, out, inp, targ): inp.g = 2 * (inp.squeeze() - targ).unsqueeze(-1) / targ.shape[0] def get_inputs(): return [torch.rand([4, 4, 4, 4]), to...
pheramon_output_neuron
# 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 torch.nn as nn class pheramon_output_neuron(nn.Module): def __init__(self, weight): super(pheramon_output_neuron, self).__init__() self.w = weight self.nl = nn.Sigmoid() def forward(self, x): return self.nl(self.w * x) def get_inputs(): return [torch...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
AgamChopra/simulation-in-a-box
pheramon_output_neuron
false
11,154
[ "MIT" ]
0
2a346a2fc83d79e542b64f1bd45c338d27a1934d
https://github.com/AgamChopra/simulation-in-a-box/tree/2a346a2fc83d79e542b64f1bd45c338d27a1934d
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, weight): super().__init__() self.w = weight self.nl = nn.Sigmoid() def forward(self, x): return self.nl(self.w * x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
MaxPoolStride1
# 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 torch.nn as nn import torch.nn.functional as F class MaxPoolStride1(nn.Module): def __init__(self): super(MaxPoolStride1, self).__init__() def forward(self, x): x = F.max_pool2d(F.pad(x, (0, 1, 0, 1), mode='replicate'), 2, stride=1) return x def get_inputs(): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
Abdul-Mukit/ssp_with_hand_tracking
MaxPoolStride1
false
11,155
[ "MIT" ]
0
04429ac9789283694a9176b94f70ab4e5a8c0727
https://github.com/Abdul-Mukit/ssp_with_hand_tracking/tree/04429ac9789283694a9176b94f70ab4e5a8c0727
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): x = F.max_pool2d(F.pad(x, (0, 1, 0, 1), mode='replicate'), 2, stride=1) return x def get_inputs(): return [torch.rand([4, 4, 4...
GeM
# 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 torch.nn as nn from torch.nn.parameter import Parameter def gem(x, p=3, eps=1e-06): return nn.functional.avg_pool2d(x.clamp(min=eps).pow(p), (x.size(-2), x .size(-1))).pow(1.0 / p) class GeM(nn.Module): def __init__(self, p=3, eps=1e-06): super(GeM, self).__init__() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn from t...
AlessandroRigoli/project_vg
GeM
false
11,156
[ "MIT" ]
0
cb1323bee60cdb4108fe0aab68791321c7974832
https://github.com/AlessandroRigoli/project_vg/tree/cb1323bee60cdb4108fe0aab68791321c7974832
import torch import torch.nn as nn from torch.nn.parameter import Parameter def gem(x, p=3, eps=1e-06): return nn.functional.avg_pool2d(x.clamp(min=eps).pow(p), (x.size(-2), x .size(-1))).pow(1.0 / p) class Model(nn.Module): def __init__(self, p=3, eps=1e-06): super().__init__() sel...
Expand
# 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 torch.nn as nn class Expand(nn.Module): def __init__(self, gain=2): super().__init__() self.gain = gain def forward(self, x): N, C, H, W = x.size() s = self.gain x = x.view(N, s, s, C // s ** 2, H, W) x = x.permute(0, 3, 4, 1, 5, 2).contigu...
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...
Alex-Beh/hand_tracking
Expand
false
11,157
[ "Apache-2.0" ]
0
40ac39e10ed5815d9400d6a87149015ad6ab9686
https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, gain=2): super().__init__() self.gain = gain def forward(self, x): N, C, H, W = x.size() s = self.gain x = x.view(N, s, s, C // s ** 2, H, W) x = x.permute(0, 3, 4, 1, 5, 2).contiguo...
SigmoidFocalClassificationLoss
# 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 torch.nn as nn class SigmoidFocalClassificationLoss(nn.Module): """ Sigmoid focal cross entropy loss. """ def __init__(self, gamma: 'float'=2.0, alpha: 'float'=0.25): """ Args: gamma: Weighting parameter to balance loss for hard and easy examples. ...
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...
AhmedMoamen62/OpenPCDet
SigmoidFocalClassificationLoss
false
11,158
[ "Apache-2.0" ]
0
4d61d099819f40096f795def2c012990d03711cd
https://github.com/AhmedMoamen62/OpenPCDet/tree/4d61d099819f40096f795def2c012990d03711cd
import torch import torch.nn as nn class Model(nn.Module): """ Sigmoid focal cross entropy loss. """ def __init__(self, gamma: 'float'=2.0, alpha: 'float'=0.25): """ Args: gamma: Weighting parameter to balance loss for hard and easy examples. alpha: Weighting p...
Classify
# 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 torch.nn as 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 Classify(nn.Module): def __init__(self, c1, c2, k=1, s=1, p=None, g=1): super(Classify, self).__init__() self.aap = nn.AdaptiveAvgP...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
Alex-Beh/hand_tracking
Classify
false
11,159
[ "Apache-2.0" ]
0
40ac39e10ed5815d9400d6a87149015ad6ab9686
https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686
import torch import torch.nn as 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 Model(nn.Module): def __init__(self, c1, c2, k=1, s=1, p=None, g=1): super().__init__() self.aap = nn.AdaptiveAvgPool2d(1) ...
L2Norm
# 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 torch.nn as nn from math import sqrt as sqrt from itertools import product as product import torch.nn.init as init class L2Norm(nn.Module): def __init__(self, n_channels, scale): super(L2Norm, self).__init__() self.n_channels = n_channels self.gamma = scale or None ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn from math import sqrt as sqrt from itertools import produ...
AbhiprayaDash/models
L2Norm
false
11,160
[ "Apache-2.0" ]
0
ed679a701ccb5891ca4a02f9379c636c50cb9209
https://github.com/AbhiprayaDash/models/tree/ed679a701ccb5891ca4a02f9379c636c50cb9209
import torch import torch.nn as nn from math import sqrt as sqrt from itertools import product as product import torch.nn.init as init class Model(nn.Module): def __init__(self, n_channels, scale): super().__init__() self.n_channels = n_channels self.gamma = scale or None self.eps...
Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as functional class Net(nn.Module): def __init__(self): super().__init__() self.layer1 = nn.Linear(28 ** 2, 64) self.layer2 = nn.Linear(64, 10) def forward(self, x): x = x.view(-1, 28 ** 2) x = self.layer1(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
AlexTaguchi/ml-tutorial
Net
false
11,161
[ "MIT" ]
0
5b2693cd1648a72e9bcd6cee1223eedadba4b837
https://github.com/AlexTaguchi/ml-tutorial/tree/5b2693cd1648a72e9bcd6cee1223eedadba4b837
import torch import torch.nn as nn import torch.nn.functional as functional class Model(nn.Module): def __init__(self): super().__init__() self.layer1 = nn.Linear(28 ** 2, 64) self.layer2 = nn.Linear(64, 10) def forward(self, x): x = x.view(-1, 28 ** 2) x = self.layer...
Hardswish
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class Hardswish(nn.Module): @staticmethod def forward(x): return x * F.hardtanh(x + 3, 0.0, 6.0) / 6.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 import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
Alex-Beh/hand_tracking
Hardswish
false
11,162
[ "Apache-2.0" ]
0
40ac39e10ed5815d9400d6a87149015ad6ab9686
https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): @staticmethod def forward(x): return x * F.hardtanh(x + 3, 0.0, 6.0) / 6.0 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Contract
# 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 torch.nn as nn class Contract(nn.Module): def __init__(self, gain=2): super().__init__() self.gain = gain def forward(self, x): N, C, H, W = x.size() s = self.gain x = x.view(N, C, H // s, s, W // s, s) x = x.permute(0, 3, 5, 1, 2, 4).conti...
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...
Alex-Beh/hand_tracking
Contract
false
11,163
[ "Apache-2.0" ]
0
40ac39e10ed5815d9400d6a87149015ad6ab9686
https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, gain=2): super().__init__() self.gain = gain def forward(self, x): N, C, H, W = x.size() s = self.gain x = x.view(N, C, H // s, s, W // s, s) x = x.permute(0, 3, 5, 1, 2, 4).contiguo...
ShuffleBlock
# 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 torch.nn as nn class ShuffleBlock(nn.Module): def __init__(self, groups=2): super(ShuffleBlock, self).__init__() self.groups = groups def forward(self, x): """Channel shuffle: [N,C,H,W] -> [N,g,C/g,H,W] -> [N,C/g,g,H,w] -> [N,C,H,W]""" N, C, H, W = x.size(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
AlexHoffman9/HAET-2021-competition-baseline-code
ShuffleBlock
false
11,164
[ "MIT" ]
0
1d71c94c68c9903854eceda6caf07442930caa44
https://github.com/AlexHoffman9/HAET-2021-competition-baseline-code/tree/1d71c94c68c9903854eceda6caf07442930caa44
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, groups=2): super().__init__() self.groups = groups def forward(self, x): """Channel shuffle: [N,C,H,W] -> [N,g,C/g,H,W] -> [N,C/g,g,H,w] -> [N,C,H,W]""" N, C, H, W = x.size() g = self.groups...
WeightedCrossEntropyLoss
# 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 torch.nn as nn import torch.nn.functional as F class WeightedCrossEntropyLoss(nn.Module): """ Transform input to fit the fomation of PyTorch offical cross entropy loss with anchor-wise weighting. """ def __init__(self): super(WeightedCrossEntropyLoss, self).__init__() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
AhmedMoamen62/OpenPCDet
WeightedCrossEntropyLoss
false
11,165
[ "Apache-2.0" ]
0
4d61d099819f40096f795def2c012990d03711cd
https://github.com/AhmedMoamen62/OpenPCDet/tree/4d61d099819f40096f795def2c012990d03711cd
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Transform input to fit the fomation of PyTorch offical cross entropy loss with anchor-wise weighting. """ def __init__(self): super().__init__() def forward(self, input: 'torch.Tensor', tar...
MemoryEfficientMish
# 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 torch.nn as nn import torch.nn.functional as F class MemoryEfficientMish(nn.Module): class F(torch.autograd.Function): @staticmethod def forward(ctx, x): ctx.save_for_backward(x) return x.mul(torch.tanh(F.softplus(x))) @staticmethod d...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torch.nn as nn import torch.nn.functional as F assert_s...
Alex-Beh/hand_tracking
MemoryEfficientMish
false
11,166
[ "Apache-2.0" ]
0
40ac39e10ed5815d9400d6a87149015ad6ab9686
https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): class F(torch.autograd.Function): @staticmethod def forward(ctx, x): ctx.save_for_backward(x) return x.mul(torch.tanh(F.softplus(x))) @staticmethod def backward(ct...
ConvAutoencoder
# 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 import nn class ConvAutoencoder(nn.Module): def __init__(self, enc_dim=10, channels=1, strides=1): super().__init__() self.conv1 = nn.Conv1d(channels, enc_dim, 7, strides, padding=0) self.dropout = nn.Dropout(0.2) self.t_conv1 = nn.ConvTranspose1d(enc_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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
AlexMetsai/pytorch-time-series-autoencoder
ConvAutoencoder
false
11,167
[ "MIT" ]
0
460e364edcb7c7a84d2e544a22cd48f51cdda4aa
https://github.com/AlexMetsai/pytorch-time-series-autoencoder/tree/460e364edcb7c7a84d2e544a22cd48f51cdda4aa
import torch from torch import nn class Model(nn.Module): def __init__(self, enc_dim=10, channels=1, strides=1): super().__init__() self.conv1 = nn.Conv1d(channels, enc_dim, 7, strides, padding=0) self.dropout = nn.Dropout(0.2) self.t_conv1 = nn.ConvTranspose1d(enc_dim, 1, 7, stri...
L2Norm
# 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 torch.nn as nn import torch.nn.functional as F class L2Norm(nn.Module): def __init__(self, dim=1): super().__init__() self.dim = dim def forward(self, x): return F.normalize(x, p=2, dim=self.dim) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
AlessandroRigoli/project_vg
L2Norm
false
11,168
[ "MIT" ]
0
cb1323bee60cdb4108fe0aab68791321c7974832
https://github.com/AlessandroRigoli/project_vg/tree/cb1323bee60cdb4108fe0aab68791321c7974832
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, dim=1): super().__init__() self.dim = dim def forward(self, x): return F.normalize(x, p=2, dim=self.dim) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_i...
MemoryEfficientSwish
# 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 torch.nn as nn class MemoryEfficientSwish(nn.Module): class F(torch.autograd.Function): @staticmethod def forward(ctx, x): ctx.save_for_backward(x) return x * torch.sigmoid(x) @staticmethod def backward(ctx, grad_output): ...
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...
Alex-Beh/hand_tracking
MemoryEfficientSwish
false
11,169
[ "Apache-2.0" ]
0
40ac39e10ed5815d9400d6a87149015ad6ab9686
https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686
import torch import torch.nn as nn class Model(nn.Module): class F(torch.autograd.Function): @staticmethod def forward(ctx, x): ctx.save_for_backward(x) return x * torch.sigmoid(x) @staticmethod def backward(ctx, grad_output): x = ctx.saved_t...
PositionwiseFeedForward
# 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 torch.nn.functional as F import torch.nn as nn class PositionwiseFeedForward(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1 = nn.Linear(d_in, d_hid) self.w_2 = nn.Linear(d_hid, d_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....
AbubakrHassan/attention-is-all-you-need-pytorch
PositionwiseFeedForward
false
11,170
[ "MIT" ]
0
2bf9a477dea6271b082556069f3665ffed2745cd
https://github.com/AbubakrHassan/attention-is-all-you-need-pytorch/tree/2bf9a477dea6271b082556069f3665ffed2745cd
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1 = nn.Linear(d_in, d_hid) self.w_2 = nn.Linear(d_hid, d_in) self.layer_no...
RSoftmax
# 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 torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization class RSoftmax(nn.Module): """Radix Softmax module in ``SplitAttentionConv2d``. Args: radix (int): Radix of input. groups (int): Groups of input. """ def __init__(self, radix...
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 ...
AlexanderDokuchaev/mmsegmentation
RSoftmax
false
11,171
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization class Model(nn.Module): """Radix Softmax module in ``SplitAttentionConv2d``. Args: radix (int): Radix of input. groups (int): Groups of input. """ def __init__(self, radix, g...
Conv2dDynamicSamePadding
# 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 math import torch import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization class Conv2dDynamicSamePadding(nn.Conv2d): """2D Convolutions like TensorFlow, for a dynamic image size. The padding is operated in forward function by calculating dynamically. """ ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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._C import torch.serialization assert_size_str...
AlexanderDokuchaev/mmsegmentation
Conv2dDynamicSamePadding
false
11,172
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import math import torch import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization class Model(nn.Conv2d): """2D Convolutions like TensorFlow, for a dynamic image size. The padding is operated in forward function by calculating dynamically. """ def __init__(s...
orientation_neuron
# 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 torch.nn as nn class orientation_neuron(nn.Module): def __init__(self, weight): super(orientation_neuron, self).__init__() self.w = weight self.nl = nn.Sigmoid() def forward(self, x): return self.nl(self.w * x) * 360.0 def get_inputs(): return [torch...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
AgamChopra/simulation-in-a-box
orientation_neuron
false
11,173
[ "MIT" ]
0
2a346a2fc83d79e542b64f1bd45c338d27a1934d
https://github.com/AgamChopra/simulation-in-a-box/tree/2a346a2fc83d79e542b64f1bd45c338d27a1934d
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, weight): super().__init__() self.w = weight self.nl = nn.Sigmoid() def forward(self, x): return self.nl(self.w * x) * 360.0 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_i...
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 import nn class Attention(nn.Module): """ Attention Network. """ def __init__(self, encoder_dim, decoder_dim, attention_dim): """ :param encoder_dim: feature size of encoded images :param decoder_dim: size of decoder's RNN :param attention_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....
AlexMeinke/serverless-hosting-of-image-captioning
Attention
false
11,174
[ "MIT" ]
0
2b539561ac600e6a502ac4ecb25948a50e26cc54
https://github.com/AlexMeinke/serverless-hosting-of-image-captioning/tree/2b539561ac600e6a502ac4ecb25948a50e26cc54
import torch from torch import nn class Model(nn.Module): """ Attention Network. """ def __init__(self, encoder_dim, decoder_dim, attention_dim): """ :param encoder_dim: feature size of encoded images :param decoder_dim: size of decoder's RNN :param attention_dim: size...
GLU
# 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 torch.nn as nn import torch.nn.functional as F import torch.nn.parallel class GLU(nn.Module): def __init__(self): super(GLU, self).__init__() def forward(self, x): nc = x.size(1) assert nc % 2 == 0, 'channels dont divide 2!' nc = int(nc / 2) 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 import torch.nn as nn import torch.nn.parallel assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C...
Abrantex/finegan
GLU
false
11,175
[ "BSD-2-Clause" ]
0
0d60105fd81abaa945cebb2232dbed703fe319f0
https://github.com/Abrantex/finegan/tree/0d60105fd81abaa945cebb2232dbed703fe319f0
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): nc = x.size(1) assert nc % 2 == 0, 'channels dont divide 2!' nc = int(nc / 2) return x[:, :...
PPMConcat
# 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 torch.nn as nn import torch._C import torch.serialization class PPMConcat(nn.ModuleList): """Pyramid Pooling Module that only concat the features of each layer. Args: pool_scales (tuple[int]): Pooling scales used in Pooling Pyramid Module. """ def __init__(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 import torch._C import torch.serialization assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strid...
AlexanderDokuchaev/mmsegmentation
PPMConcat
false
11,176
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import torch.nn as nn import torch._C import torch.serialization class Model(nn.ModuleList): """Pyramid Pooling Module that only concat the features of each layer. Args: pool_scales (tuple[int]): Pooling scales used in Pooling Pyramid Module. """ def __init__(self, p...
SE
# 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 torch.nn as nn import torch.nn.functional as F class SE(nn.Module): """Squeeze-and-Excitation block.""" def __init__(self, in_planes, se_planes): super(SE, self).__init__() self.se1 = nn.Conv2d(in_planes, se_planes, kernel_size=1, bias=True) self.se2 = nn.Conv2d(se...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
AlexHoffman9/HAET-2021-competition-baseline-code
SE
false
11,177
[ "MIT" ]
0
1d71c94c68c9903854eceda6caf07442930caa44
https://github.com/AlexHoffman9/HAET-2021-competition-baseline-code/tree/1d71c94c68c9903854eceda6caf07442930caa44
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Squeeze-and-Excitation block.""" def __init__(self, in_planes, se_planes): super().__init__() self.se1 = nn.Conv2d(in_planes, se_planes, kernel_size=1, bias=True) self.se2 = nn.Conv2d(se_plan...
Network
# 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 class Network(torch.nn.Module): def __init__(self): super(Network, self).__init__() self.conv1 = torch.nn.Conv2d(1, 64, kernel_size=5) self.conv2 = torch.nn.Conv2d(64, 512, kernel_size=5) self.fc1 = torch.nn.Linear(2048, 256) self.fc2 = torch.nn.Linear(256, 12...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
AbrahamAcosta/leaves_cnn
Network
false
11,178
[ "MIT" ]
0
e6be28ef696dc427aa50c7d4581a29a05d1e7a94
https://github.com/AbrahamAcosta/leaves_cnn/tree/e6be28ef696dc427aa50c7d4581a29a05d1e7a94
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = torch.nn.Conv2d(1, 64, kernel_size=5) self.conv2 = torch.nn.Conv2d(64, 512, kernel_size=5) self.fc1 = torch.nn.Linear(2048, 256) self.fc2 = torch.nn.Linear(256, 128) self...
TD3Critic
# 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 torch.nn as nn import torch.nn.functional as F class TD3Critic(nn.Module): def __init__(self, state_dim, action_dim): super(TD3Critic, self).__init__() self.l1 = nn.Linear(state_dim + action_dim, 256) self.l2 = nn.Linear(256, 256) self.l3 = nn.Linear(256, 1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
AkiraHero/rlll
TD3Critic
false
11,179
[ "MIT" ]
0
f86e1105600629d29b8dca7a7483e7dcb8253056
https://github.com/AkiraHero/rlll/tree/f86e1105600629d29b8dca7a7483e7dcb8253056
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim): super().__init__() self.l1 = nn.Linear(state_dim + action_dim, 256) self.l2 = nn.Linear(256, 256) self.l3 = nn.Linear(256, 1) self.l4 = nn....
TD3Actor
# 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 torch.nn as nn import torch.nn.functional as F class TD3Actor(nn.Module): def __init__(self, state_dim, action_dim, max_action): super(TD3Actor, self).__init__() self.l1 = nn.Linear(state_dim, 256) self.l2 = nn.Linear(256, 256) self.l3 = nn.Linear(256, action_d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
AkiraHero/rlll
TD3Actor
false
11,180
[ "MIT" ]
0
f86e1105600629d29b8dca7a7483e7dcb8253056
https://github.com/AkiraHero/rlll/tree/f86e1105600629d29b8dca7a7483e7dcb8253056
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim, max_action): super().__init__() self.l1 = nn.Linear(state_dim, 256) self.l2 = nn.Linear(256, 256) self.l3 = nn.Linear(256, action_dim) self....
InputInjection
# 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 torch.nn as nn import torch._C import torch.serialization class InputInjection(nn.Module): def __init__(self, ratio): super().__init__() self.pool = nn.ModuleList() for i in range(0, ratio): self.pool.append(nn.AvgPool2d(3, stride=2, padding=1)) def fo...
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._C import torch.serialization assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strid...
AlexanderDokuchaev/mmsegmentation
InputInjection
false
11,181
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import torch.nn as nn import torch._C import torch.serialization class Model(nn.Module): def __init__(self, ratio): super().__init__() self.pool = nn.ModuleList() for i in range(0, ratio): self.pool.append(nn.AvgPool2d(3, stride=2, padding=1)) def forward(sel...
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 import torch.nn.functional as F import torch.nn as nn 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....
AbubakrHassan/attention-is-all-you-need-pytorch
EncoderLayer
false
11,182
[ "MIT" ]
0
2bf9a477dea6271b082556069f3665ffed2745cd
https://github.com/AbubakrHassan/attention-is-all-you-need-pytorch/tree/2bf9a477dea6271b082556069f3665ffed2745cd
import torch import torch.nn.functional as F import torch.nn as nn 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...
ExampleBackbone
# 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 torch.nn as nn import torch._C import torch.serialization class ExampleBackbone(nn.Module): def __init__(self): super(ExampleBackbone, self).__init__() self.conv = nn.Conv2d(3, 3, 3) def init_weights(self, pretrained=None): pass 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 import torch.nn as nn import torch._C import torch.serialization assert_size_str...
AlexanderDokuchaev/mmsegmentation
ExampleBackbone
false
11,183
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import torch.nn as nn import torch._C import torch.serialization class Model(nn.Module): def __init__(self): super().__init__() self.conv = nn.Conv2d(3, 3, 3) def init_weights(self, pretrained=None): pass def forward(self, x): return [self.conv(x)] def get...
DecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn 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....
AbubakrHassan/attention-is-all-you-need-pytorch
DecoderLayer
false
11,184
[ "MIT" ]
0
2bf9a477dea6271b082556069f3665ffed2745cd
https://github.com/AbubakrHassan/attention-is-all-you-need-pytorch/tree/2bf9a477dea6271b082556069f3665ffed2745cd
import torch import torch.nn.functional as F import torch.nn as nn 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...
UpSample
# 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 torch.nn as nn import torch._C import torch.serialization class UpSample(nn.Module): def __init__(self, n_chan, factor=2): super(UpSample, self).__init__() out_chan = n_chan * factor * factor self.proj = nn.Conv2d(n_chan, out_chan, 1, 1, 0) self.up = nn.PixelSh...
import torch from torch._inductor.select_algorithm import extern_kernels import 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._C import torch.serialization assert_size_str...
AlexanderDokuchaev/mmsegmentation
UpSample
false
11,185
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import torch.nn as nn import torch._C import torch.serialization class Model(nn.Module): def __init__(self, n_chan, factor=2): super().__init__() out_chan = n_chan * factor * factor self.proj = nn.Conv2d(n_chan, out_chan, 1, 1, 0) self.up = nn.PixelShuffle(factor) ...
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 def _iou(pred, target, size_average=True): b = pred.shape[0] IoU = 0.0 for i in range(0, b): Iand1 = torch.sum(target[i, :, :, :] * pred[i, :, :, :]) Ior1 = torch.sum(target[i, :, :, :]) + torch.sum(pred[i, :, :, :] ) - Iand1 IoU1 = Iand1 / Ior1 IoU...
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...
AlvinWen428/BASNet
IOU
false
11,186
[ "MIT" ]
0
2af21e0333204b8adcb9565b33a0bf72f5471db5
https://github.com/AlvinWen428/BASNet/tree/2af21e0333204b8adcb9565b33a0bf72f5471db5
import torch def _iou(pred, target, size_average=True): b = pred.shape[0] IoU = 0.0 for i in range(0, b): Iand1 = torch.sum(target[i, :, :, :] * pred[i, :, :, :]) Ior1 = torch.sum(target[i, :, :, :]) + torch.sum(pred[i, :, :, :] ) - Iand1 IoU1 = Iand1 / Ior1 IoU...
AngularPWConv
# 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 torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization def normalize(x, dim, p=2, eps=1e-12): if torch.onnx.is_in_onnx_export(): return OnnxLpNormalization.apply(x, dim, p, eps) else: return F.normalize(x, dim=dim, p=p, eps=eps) class On...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
AlexanderDokuchaev/mmsegmentation
AngularPWConv
false
11,187
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization def normalize(x, dim, p=2, eps=1e-12): if torch.onnx.is_in_onnx_export(): return OnnxLpNormalization.apply(x, dim, p, eps) else: return F.normalize(x, dim=dim, p=p, eps=eps) class On...
EdgeGateFree
# 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 torch.nn as nn from torch.nn import Parameter class EdgeGateFree(nn.Module): """ Calculate gates for each edge in message passing. The gates are free parameters. Note: This will make the parameters depend on the number of edges, which will limit the model to work on...
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.nn import Parameter assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = to...
AnchoretY/botnet-detection
EdgeGateFree
false
11,188
[ "MIT" ]
0
e2066ff314f1ea2ccbf4c10ddff819f344a2b715
https://github.com/AnchoretY/botnet-detection/tree/e2066ff314f1ea2ccbf4c10ddff819f344a2b715
import torch import torch.nn as nn from torch.nn import Parameter class Model(nn.Module): """ Calculate gates for each edge in message passing. The gates are free parameters. Note: This will make the parameters depend on the number of edges, which will limit the model to work only on g...
Encoding
# 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 torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization class Encoding(nn.Module): """Encoding Layer: a learnable residual encoder. Input is of shape (batch_size, channels, height, width). Output is of shape (batch_size, num_codes, channels). Ar...
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 ...
AlexanderDokuchaev/mmsegmentation
Encoding
false
11,189
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization class Model(nn.Module): """Encoding Layer: a learnable residual encoder. Input is of shape (batch_size, channels, height, width). Output is of shape (batch_size, num_codes, channels). Args:...
DiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import 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...
AlexanderDokuchaev/mmsegmentation
DiceLoss
false
11,190
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
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", "...
PSPModule
# 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 torch.nn as nn import torch._C import torch.serialization class PSPModule(nn.Module): """Reference: https://github.com/MendelXu/ANN """ methods = {'max': nn.AdaptiveMaxPool2d, 'avg': nn.AdaptiveAvgPool2d} def __init__(self, sizes=(1, 3, 6, 8), method='max'): super().__init...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch._C import torch.serialization assert_size_stride = tor...
AlexanderDokuchaev/mmsegmentation
PSPModule
false
11,191
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import torch.nn as nn import torch._C import torch.serialization class Model(nn.Module): """Reference: https://github.com/MendelXu/ANN """ methods = {'max': nn.AdaptiveMaxPool2d, 'avg': nn.AdaptiveAvgPool2d} def __init__(self, sizes=(1, 3, 6, 8), method='max'): super().__init__()...
Model
# 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 class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x: 'torch.Tensor', y: 'torch.Tensor'): return x * y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
Archermmt/tvm
Model
false
11,192
[ "Apache-2.0" ]
0
8b900cec1a9c3cb453e159db4d497ebeb26ed289
https://github.com/Archermmt/tvm/tree/8b900cec1a9c3cb453e159db4d497ebeb26ed289
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x: 'torch.Tensor', y: 'torch.Tensor'): return x * y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
UpsamplingBilinear
# 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 torch.nn as nn from torch.quantization import QuantStub from torch.quantization import DeQuantStub class UpsamplingBilinear(nn.Module): def __init__(self): super().__init__() self.quant = QuantStub() self.dequant = DeQuantStub() def forward(self, x): x = s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn from torch.quantization import QuantStub from torch.quantization im...
Archermmt/tvm
UpsamplingBilinear
false
11,193
[ "Apache-2.0" ]
0
8b900cec1a9c3cb453e159db4d497ebeb26ed289
https://github.com/Archermmt/tvm/tree/8b900cec1a9c3cb453e159db4d497ebeb26ed289
import torch import torch.nn as nn from torch.quantization import QuantStub from torch.quantization import DeQuantStub class Model(nn.Module): def __init__(self): super().__init__() self.quant = QuantStub() self.dequant = DeQuantStub() def forward(self, x): x = self.quant(x) ...
Hswish
# 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 torch.nn as nn from torch.quantization import QuantStub from torch.quantization import DeQuantStub class Hswish(nn.Module): def __init__(self, add_stub=False): super().__init__() self.quant = QuantStub() self.dequant = DeQuantStub() self.add_stub = add_stub ...
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 from torch.quantization import QuantStub from torch.quantization im...
Archermmt/tvm
Hswish
false
11,194
[ "Apache-2.0" ]
0
8b900cec1a9c3cb453e159db4d497ebeb26ed289
https://github.com/Archermmt/tvm/tree/8b900cec1a9c3cb453e159db4d497ebeb26ed289
import torch import torch.nn as nn from torch.quantization import QuantStub from torch.quantization import DeQuantStub class Model(nn.Module): def __init__(self, add_stub=False): super().__init__() self.quant = QuantStub() self.dequant = DeQuantStub() self.add_stub = add_stub ...
SEModule
# 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 torch.nn as nn import torch.nn.functional as F class SEModule(nn.Module): def __init__(self, planes, compress_rate): super(SEModule, self).__init__() self.conv1 = nn.Conv2d(planes, planes // compress_rate, kernel_size =1, stride=1, bias=True) self.conv2 = 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_...
AlexTintin/Face_Recognition_CV_Project
SEModule
false
11,195
[ "MIT" ]
0
6becb159dd3d8f547d617983bd422e3f2a9fb52e
https://github.com/AlexTintin/Face_Recognition_CV_Project/tree/6becb159dd3d8f547d617983bd422e3f2a9fb52e
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, planes, compress_rate): super().__init__() self.conv1 = nn.Conv2d(planes, planes // compress_rate, kernel_size =1, stride=1, bias=True) self.conv2 = nn.Conv2d(planes /...
GCN
# 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...
from torch.nn import Module import math import torch from torch.nn.parameter import Parameter from torch.nn.modules.module import Module import torch.nn as nn import torch.nn.functional as F class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __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....
AlexHeffner/pygcn
GCN
false
11,196
[ "MIT" ]
0
514f4329209a3bf9c75beba97af42d2c1bf8c129
https://github.com/AlexHeffner/pygcn/tree/514f4329209a3bf9c75beba97af42d2c1bf8c129
from torch.nn import Module import math import torch from torch.nn.parameter import Parameter from torch.nn.modules.module import Module import torch.nn as nn import torch.nn.functional as F class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __in...
TverskyLoss
# 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 numpy as np import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization def get_class_weight(class_weight): """Get class weight for loss function. Args: class_weight (list[float] | str | None): If class_weight is a str, take it as a...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import numpy as np imp...
AlexanderDokuchaev/mmsegmentation
TverskyLoss
false
11,197
[ "Apache-2.0" ]
0
0c443ee370cce6227661b802184072174c4e3f64
https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization def get_class_weight(class_weight): """Get class weight for loss function. Args: class_weight (list[float] | str | None): If class_weight is a str, take it as a...
ScaledDotProductAttention
# 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 torch.nn.functional as F import torch.nn as nn 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....
AbubakrHassan/attention-is-all-you-need-pytorch
ScaledDotProductAttention
false
11,198
[ "MIT" ]
0
2bf9a477dea6271b082556069f3665ffed2745cd
https://github.com/AbubakrHassan/attention-is-all-you-need-pytorch/tree/2bf9a477dea6271b082556069f3665ffed2745cd
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attn_dropout) def forward...
ResNeXtBottleneck
# 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 torch.nn as nn import torch.nn.functional as F class ResNeXtBottleneck(nn.Module): def __init__(self, in_channels=256, out_channels=256, stride=1, cardinality=32, dilate=1): super(ResNeXtBottleneck, self).__init__() D = out_channels // 2 self.out_channels = out...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
AlexWang000/AlacGAN
ResNeXtBottleneck
false
11,199
[ "MIT" ]
0
3b9df7c25c3e95b7727b00fa789cab0cf7d46266
https://github.com/AlexWang000/AlacGAN/tree/3b9df7c25c3e95b7727b00fa789cab0cf7d46266
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_channels=256, out_channels=256, stride=1, cardinality=32, dilate=1): super().__init__() D = out_channels // 2 self.out_channels = out_channels self.conv_reduce ...
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 import torch.nn.functional as F import torch.nn as nn 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....
AbubakrHassan/attention-is-all-you-need-pytorch
MultiHeadAttention
false
11,200
[ "MIT" ]
0
2bf9a477dea6271b082556069f3665ffed2745cd
https://github.com/AbubakrHassan/attention-is-all-you-need-pytorch/tree/2bf9a477dea6271b082556069f3665ffed2745cd
import torch import torch.nn.functional as F import torch.nn as nn 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...
MulScalarNegative
# 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 torch.nn as nn from torch.quantization import QuantStub from torch.quantization import DeQuantStub class MulScalarNegative(nn.Module): def __init__(self): super().__init__() self.float_op = nn.quantized.FloatFunctional() self.quant = QuantStub() self.dequant = ...
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.quantization import QuantStub from torch.quantization import DeQuantStub assert_size_stride = torch._C._dyn...
Archermmt/tvm
MulScalarNegative
false
11,201
[ "Apache-2.0" ]
0
8b900cec1a9c3cb453e159db4d497ebeb26ed289
https://github.com/Archermmt/tvm/tree/8b900cec1a9c3cb453e159db4d497ebeb26ed289
import torch import torch.nn as nn from torch.quantization import QuantStub from torch.quantization import DeQuantStub class Model(nn.Module): def __init__(self): super().__init__() self.float_op = nn.quantized.FloatFunctional() self.quant = QuantStub() self.dequant = DeQuantStub(...
AvgConsensus
# 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 torch.nn as nn class AvgConsensus(nn.Module): """Average consensus module. Args: dim (int): Decide which dim consensus function to apply. Default: 1. """ def __init__(self, dim=1): super().__init__() self.dim = dim def forward(self, x): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Alexis-Fab/mmaction2
AvgConsensus
false
11,202
[ "Apache-2.0" ]
0
6f76bb465a7164f907318cf58f77fc3d613f8f0f
https://github.com/Alexis-Fab/mmaction2/tree/6f76bb465a7164f907318cf58f77fc3d613f8f0f
import torch import torch.nn as nn class Model(nn.Module): """Average consensus module. Args: dim (int): Decide which dim consensus function to apply. Default: 1. """ def __init__(self, dim=1): super().__init__() self.dim = dim def forward(self, x): "...
Hsigmoid
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from torch.quantization import QuantStub from torch.quantization import DeQuantStub class Hsigmoid(nn.Module): def __init__(self, add_stub=False): super().__init__() self.quant = QuantStub() self.dequant = DeQuantStub() self.add_stub = add_stub ...
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 from torch.quantization import QuantStub from torch.quantization im...
Archermmt/tvm
Hsigmoid
false
11,203
[ "Apache-2.0" ]
0
8b900cec1a9c3cb453e159db4d497ebeb26ed289
https://github.com/Archermmt/tvm/tree/8b900cec1a9c3cb453e159db4d497ebeb26ed289
import torch import torch.nn as nn from torch.quantization import QuantStub from torch.quantization import DeQuantStub class Model(nn.Module): def __init__(self, add_stub=False): super().__init__() self.quant = QuantStub() self.dequant = DeQuantStub() self.add_stub = add_stub ...