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
PixelNorm
# 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 PixelNorm(nn.Module): def __init__(self): super().__init__() def forward(self, input): return input / torch.sqrt(torch.mean(input ** 2, dim=1, keepdim= True) + 1e-08) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_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.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
AaltoVision/balanced-pioneer
PixelNorm
false
16,870
[ "MIT" ]
5
51f58080fd2db3159de3e1ccb47f38e03220faf0
https://github.com/AaltoVision/balanced-pioneer/tree/51f58080fd2db3159de3e1ccb47f38e03220faf0
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, input): return input / torch.sqrt(torch.mean(input ** 2, dim=1, keepdim= True) + 1e-08) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inpu...
EmbeddingModule
# 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 class EmbeddingModule(nn.Module): def __init__(self, in_channels, desc_channels): super(EmbeddingModule, self).__init__() self.pool = nn.AdaptiveAvgPool2d((1, 1)) self.fc = nn.Linear(in_channels, desc_channels) def forward(self, x): x = self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
ActiveVisionLab/LaLaLoc
EmbeddingModule
false
16,872
[ "MIT" ]
5
21a0da94fbe7ef6cce3d34c6a5f47cc09d072f45
https://github.com/ActiveVisionLab/LaLaLoc/tree/21a0da94fbe7ef6cce3d34c6a5f47cc09d072f45
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channels, desc_channels): super().__init__() self.pool = nn.AdaptiveAvgPool2d((1, 1)) self.fc = nn.Linear(in_channels, desc_channels) def forward(self, x): x = self.pool(x) x = torch.flat...
DiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn def flatten_channels(inputs, targets, channel_dim): """ Helper function to flatten inputs and targets for each channel E.g., (1, 3, 10, 256, 256) --> (3, 655360) Parameters ---------- inputs: torch.Tensor U-net output targets: torch.Tensor ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
AbigailMcGovern/iterseg
DiceLoss
false
16,873
[ "BSD-3-Clause" ]
4
d23af04c52c8d1711a474a58060abea664a82637
https://github.com/AbigailMcGovern/iterseg/tree/d23af04c52c8d1711a474a58060abea664a82637
import torch import torch.nn as nn def flatten_channels(inputs, targets, channel_dim): """ Helper function to flatten inputs and targets for each channel E.g., (1, 3, 10, 256, 256) --> (3, 655360) Parameters ---------- inputs: torch.Tensor U-net output targets: torch.Tensor ...
QNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn class QNetwork(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, seed, fc1_units=64, fc2_units=64): """Initialize parameters and build model. Params ====== state_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
AlexS28/SABER
QNetwork
false
16,874
[ "BSD-3-Clause" ]
4
91f74319a41f473b8e8f9eff6b7d9b604b94c7da
https://github.com/AlexS28/SABER/tree/91f74319a41f473b8e8f9eff6b7d9b604b94c7da
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, seed, fc1_units=64, fc2_units=64): """Initialize parameters and build model. Params ====== state_size ...
Capsule_conv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn def Squash(x): l2norm = x.norm(dim=-1, keepdim=True) unit_v = x / l2norm squashed_v = l2norm.pow(2) / (1 + l2norm.pow(2)) x = unit_v * squashed_v return x class Capsule_conv(nn.Module): def __init__(self, in_channels, out_channels, cap_dim): super(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
AahanSingh/Capsule-Networks
Capsule_conv
false
16,875
[ "MIT" ]
5
798014b6ff5fe27abdc64d3af364fb7681f292fc
https://github.com/AahanSingh/Capsule-Networks/tree/798014b6ff5fe27abdc64d3af364fb7681f292fc
import torch import torch.nn as nn def Squash(x): l2norm = x.norm(dim=-1, keepdim=True) unit_v = x / l2norm squashed_v = l2norm.pow(2) / (1 + l2norm.pow(2)) x = unit_v * squashed_v return x class Model(nn.Module): def __init__(self, in_channels, out_channels, cap_dim): super().__ini...
DuelingMLP
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class DuelingMLP(nn.Module): def __init__(self, state_size, num_actions): super().__init__() self.linear = nn.Linear(state_size, 256) self.value_head = nn.Linear(256, 1) self.advantage_head = nn.Linear(256, num_act...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
AlexHermansson/hindsight-experience-replay
DuelingMLP
false
16,876
[ "MIT" ]
5
65468d523bb803123d7aab9bb83abc7a3d5db3c8
https://github.com/AlexHermansson/hindsight-experience-replay/tree/65468d523bb803123d7aab9bb83abc7a3d5db3c8
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_size, num_actions): super().__init__() self.linear = nn.Linear(state_size, 256) self.value_head = nn.Linear(256, 1) self.advantage_head = nn.Linear(256, num_actions)...
NMFNet
# 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 numpy.random import uniform from numpy.linalg import pinv class NMFNet(nn.Module): """NMF implemented as a neural network""" def __init__(self, X_height, k): """Params X_height: TODO INSERT DESC HERE k: TODO INSERT DESC HERE """ ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Aaron09/torchfactor
NMFNet
false
16,877
[ "MIT" ]
5
66782a183c583e3056e2c40d8d95568f4abb9537
https://github.com/Aaron09/torchfactor/tree/66782a183c583e3056e2c40d8d95568f4abb9537
import torch import torch.nn as nn from numpy.random import uniform from numpy.linalg import pinv class Model(nn.Module): """NMF implemented as a neural network""" def __init__(self, X_height, k): """Params X_height: TODO INSERT DESC HERE k: TODO INSERT DESC HERE """ s...
PolicyNet
# 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 PolicyNet(nn.Module): def __init__(self): super(PolicyNet, self).__init__() self.fc1 = nn.Linear(4, 24) self.fc2 = nn.Linear(24, 36) self.fc3 = nn.Linear(36, 1) def forward(self, x): x = F.relu(s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Alfo5123/ConcreteDropout
PolicyNet
false
16,878
[ "MIT" ]
7
c442871553e20a2de078c0fbac7fa52302d50abf
https://github.com/Alfo5123/ConcreteDropout/tree/c442871553e20a2de078c0fbac7fa52302d50abf
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(4, 24) self.fc2 = nn.Linear(24, 36) self.fc3 = nn.Linear(36, 1) def forward(self, x): x = F.relu(self.fc1(x)) ...
Conv2dSame
# 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.utils.data import torch.utils.data.distributed from torch import nn import torch.nn.functional as F from typing import Optional from typing import Tuple import torch.nn.parallel import torch.optim def _calc_same_pad(input_: 'int', kernel: 'int', stride: 'int', dilation: 'int' ): """c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.utils.data.distributed from torch import nn...
Adlik/zen_nas
Conv2dSame
false
16,879
[ "Apache-2.0" ]
7
d820d5c7d5bbb6fd66a76d5f16513647d6ea7a57
https://github.com/Adlik/zen_nas/tree/d820d5c7d5bbb6fd66a76d5f16513647d6ea7a57
import torch import torch.utils.data import torch.utils.data.distributed from torch import nn import torch.nn.functional as F from typing import Optional from typing import Tuple import torch.nn.parallel import torch.optim def _calc_same_pad(input_: 'int', kernel: 'int', stride: 'int', dilation: 'int' ): """c...
TokenEmbedding
# 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 class TokenEmbedding(nn.Module): def __init__(self, c_in, d_model): super(TokenEmbedding, self).__init__() padding = 1 if torch.__version__ >= '1.5.0' else 2 self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_model, kernel_size=3, pa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
AdamLohSg/GTA
TokenEmbedding
false
16,882
[ "Apache-2.0" ]
8
bf6a745a6e28e365466e76360a15ca10ce61e009
https://github.com/AdamLohSg/GTA/tree/bf6a745a6e28e365466e76360a15ca10ce61e009
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, c_in, d_model): super().__init__() padding = 1 if torch.__version__ >= '1.5.0' else 2 self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_model, kernel_size=3, padding=padding, padding_mode='...
FactorizedReduce
# 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.utils class FactorizedReduce(nn.Module): def __init__(self, C_in, C_out, affine=True): super(FactorizedReduce, self).__init__() assert C_out % 2 == 0 self.relu = nn.ReLU(inplace=False) self.conv_1 = nn.Conv3d(C_in, C_out // 2, 1, str...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
Alison-brie/AutoReg
FactorizedReduce
false
16,883
[ "MIT" ]
10
a23d45a6f7c6e47f61430e1565dda316452a4418
https://github.com/Alison-brie/AutoReg/tree/a23d45a6f7c6e47f61430e1565dda316452a4418
import torch import torch.nn as nn import torch.utils class Model(nn.Module): def __init__(self, C_in, C_out, affine=True): super().__init__() assert C_out % 2 == 0 self.relu = nn.ReLU(inplace=False) self.conv_1 = nn.Conv3d(C_in, C_out // 2, 1, stride=2, padding=0, bia...
TransitionUp
# 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 center_crop(layer, max_height, max_width): _, _, h, w = layer.size() xy1 = (w - max_width) // 2 xy2 = (h - max_height) // 2 return layer[:, :, xy2:xy2 + max_height, xy1:xy1 + max_width] class TransitionUp(nn.Module): def __init__(self, in_channels, out_cha...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
Alfo5123/ConcreteDropout
TransitionUp
false
16,885
[ "MIT" ]
7
c442871553e20a2de078c0fbac7fa52302d50abf
https://github.com/Alfo5123/ConcreteDropout/tree/c442871553e20a2de078c0fbac7fa52302d50abf
import torch import torch.nn as nn def center_crop(layer, max_height, max_width): _, _, h, w = layer.size() xy1 = (w - max_width) // 2 xy2 = (h - max_height) // 2 return layer[:, :, xy2:xy2 + max_height, xy1:xy1 + max_width] class Model(nn.Module): def __init__(self, in_channels, out_channels):...
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 as nn class PositionwiseFeedForward(nn.Module): """Implements FFN equation.""" def __init__(self, d_model, d_ff, dropout=0.1): super(PositionwiseFeedForward, self).__init__() self.w_1 = nn.Linear(d_model, d_ff) self.w_2 = nn.Linear(d_ff, d_model) 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 import torch.nn as ...
Aminah92/saint
PositionwiseFeedForward
false
16,886
[ "MIT" ]
7
e18f5d5d093dce458c7d427eed4a375021c05bb9
https://github.com/Aminah92/saint/tree/e18f5d5d093dce458c7d427eed4a375021c05bb9
import torch import torch.nn as nn class Model(nn.Module): """Implements FFN equation.""" def __init__(self, d_model, d_ff, dropout=0.1): super().__init__() self.w_1 = nn.Linear(d_model, d_ff) self.w_2 = nn.Linear(d_ff, d_model) self.dropout = nn.Dropout(dropout) self....
FF
# 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 FF(nn.Module): """ Feed-forward in a transformer layer. """ def __init__(self, input_size, hidden_size): super().__init__() self.lin_1 = nn.Linear(input_size, hidden_size) self.lin_2 = nn.Linear(hidden_size, input_size) self.relu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
Altair-inc/behaviour-seq-transformer
FF
false
16,887
[ "MIT" ]
10
74185eb5588b1e57a936de9901313dddcc10acf4
https://github.com/Altair-inc/behaviour-seq-transformer/tree/74185eb5588b1e57a936de9901313dddcc10acf4
import torch from torch import nn class Model(nn.Module): """ Feed-forward in a transformer layer. """ def __init__(self, input_size, hidden_size): super().__init__() self.lin_1 = nn.Linear(input_size, hidden_size) self.lin_2 = nn.Linear(hidden_size, input_size) self.r...
AdaptiveAvgPool
# 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 uuid import torch.utils.data import torch.utils.data.distributed from torch import nn import torch.nn.parallel import torch.optim def _get_right_parentheses_index_(struct_str): """get the position of the first right parenthese in string""" left_paren_count = 0 for index, single_char in...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import uuid import torch.utils.data import torch.utils.data.distributed from torch import nn import torch.nn.parallel import torch.optim ass...
Adlik/zen_nas
AdaptiveAvgPool
false
16,888
[ "Apache-2.0" ]
7
d820d5c7d5bbb6fd66a76d5f16513647d6ea7a57
https://github.com/Adlik/zen_nas/tree/d820d5c7d5bbb6fd66a76d5f16513647d6ea7a57
import torch import uuid import torch.utils.data import torch.utils.data.distributed from torch import nn import torch.nn.parallel import torch.optim def _get_right_parentheses_index_(struct_str): """get the position of the first right parenthese in string""" left_paren_count = 0 for index, single_char in...
Mish
# 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 Mish(nn.Module): @staticmethod def forward(x): return x * F.softplus(x).tanh() def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.gu...
Aditya239233/MDP
Mish
false
16,889
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): @staticmethod def forward(x): return x * F.softplus(x).tanh() def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
LayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class LayerNorm(nn.Module): """Construct a layernorm module (See citation for details).""" def __init__(self, features, eps=1e-06): super(LayerNorm, self).__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(fe...
import torch import triton import triton.language 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_...
Aminah92/saint
LayerNorm
false
16,890
[ "MIT" ]
7
e18f5d5d093dce458c7d427eed4a375021c05bb9
https://github.com/Aminah92/saint/tree/e18f5d5d093dce458c7d427eed4a375021c05bb9
import torch import torch.nn as nn class Model(nn.Module): """Construct a layernorm module (See citation for details).""" def __init__(self, features, eps=1e-06): super().__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(features)) se...
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...
import math import torch from torch import nn import torch.nn.functional as F from torch.nn.parameter import Parameter import torch.nn.parallel import torch.optim from math import * class GraphConvolution(nn.Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __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 import triton_helpers import math from torch import...
Alvin-Zeng/GCM
GCN
false
16,891
[ "BSD-3-Clause" ]
6
521de2a290ace289cdc5935195d0284f717504c3
https://github.com/Alvin-Zeng/GCM/tree/521de2a290ace289cdc5935195d0284f717504c3
import math import torch from torch import nn import torch.nn.functional as F from torch.nn.parameter import Parameter import torch.nn.parallel import torch.optim from math import * class GraphConvolution(nn.Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __init__(s...
TemporalEmbedding
# 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 class FixedEmbedding(nn.Module): def __init__(self, c_in, d_model): super(FixedEmbedding, self).__init__() w = torch.zeros(c_in, d_model).float() w.require_grad = False position = torch.arange(0, c_in).float().unsqueeze(1) div...
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 math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guar...
AdamLohSg/GTA
TemporalEmbedding
false
16,892
[ "Apache-2.0" ]
8
bf6a745a6e28e365466e76360a15ca10ce61e009
https://github.com/AdamLohSg/GTA/tree/bf6a745a6e28e365466e76360a15ca10ce61e009
import math import torch import torch.nn as nn class FixedEmbedding(nn.Module): def __init__(self, c_in, d_model): super().__init__() w = torch.zeros(c_in, d_model).float() w.require_grad = False position = torch.arange(0, c_in).float().unsqueeze(1) div_term = (torch.arang...
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...
Aditya239233/MDP
Hardswish
false
16,893
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
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 []
MDN
# 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.nn.modules import Module from torch.nn.modules import Linear class MDN(Module): def __init__(self, input_size, num_mixtures): super(MDN, self).__init__() self.input_size = input_size self.num_mixtures = num_mixtures self.paramete...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
AnesBenmerzoug/Handwriting-Model
MDN
false
16,894
[ "MIT" ]
7
925a8d43174cccd58e01d41fdc513343df09d000
https://github.com/AnesBenmerzoug/Handwriting-Model/tree/925a8d43174cccd58e01d41fdc513343df09d000
from torch.nn import Module import torch from torch.nn.modules import Module from torch.nn.modules import Linear class Model(Module): def __init__(self, input_size, num_mixtures): super().__init__() self.input_size = input_size self.num_mixtures = num_mixtures self.parameter_layer...
MetaAconC
# 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 class MetaAconC(nn.Module): """ ACON activation (activate or not). MetaAconC: (p1*x-p2*x) * sigmoid(beta*(p1*x-p2*x)) + p2*x, beta is generated by a small network according to "Activate or Not: Learning Customized Activation" <https://arxiv.org/pdf/2009.04759.pdf>. "...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
Aditya239233/MDP
MetaAconC
false
16,895
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
import torch import torch.nn as nn class Model(nn.Module): """ ACON activation (activate or not). MetaAconC: (p1*x-p2*x) * sigmoid(beta*(p1*x-p2*x)) + p2*x, beta is generated by a small network according to "Activate or Not: Learning Customized Activation" <https://arxiv.org/pdf/2009.04759.pdf>. """ ...
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().__init__() self.aap = nn.AdaptiveAvgPool2d(1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Aditya239233/MDP
Classify
false
16,896
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
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) ...
FirstKernelTensorTrain
# 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 import torch.nn.functional as F class FirstKernelTensorTrain(nn.Module): def __init__(self, m, r_j): super(FirstKernelTensorTrain, self).__init__() self.fc1 = nn.Linear(m, r_j, bias=False) self.m = m self.r_j = r_j def forward(self, tensor): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
AndresOtero/TensorDecompositionMachineLearning
FirstKernelTensorTrain
false
16,897
[ "MIT" ]
3
455f16b405ec9d031999b0ebf9c5a68d3c20b233
https://github.com/AndresOtero/TensorDecompositionMachineLearning/tree/455f16b405ec9d031999b0ebf9c5a68d3c20b233
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, m, r_j): super().__init__() self.fc1 = nn.Linear(m, r_j, bias=False) self.m = m self.r_j = r_j def forward(self, tensor): transformed_tensor = self.fc1(tensor)...
TemporalBlock
# 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.utils import weight_norm class TemporalBlock(nn.Module): def __init__(self, n_inputs, n_outputs, kernel_size=3, stride=1, dilation=1, padding=1, dropout=0.2): super(TemporalBlock, self).__init__() self.conv1 = weight_norm(nn.Conv1d(n_inputs...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
AdamLohSg/GTA
TemporalBlock
false
16,898
[ "Apache-2.0" ]
8
bf6a745a6e28e365466e76360a15ca10ce61e009
https://github.com/AdamLohSg/GTA/tree/bf6a745a6e28e365466e76360a15ca10ce61e009
import torch import torch.nn as nn from torch.nn.utils import weight_norm class Model(nn.Module): def __init__(self, n_inputs, n_outputs, kernel_size=3, stride=1, dilation=1, padding=1, dropout=0.2): super().__init__() self.conv1 = weight_norm(nn.Conv1d(n_inputs, n_outputs, kernel_size, ...
AdaptiveAvgMaxPool2d
# 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 import torch._utils import torch.optim def adaptive_avgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_max = F.adaptive_max_pool2d(x, output_size) return 0.5 * (x_avg + x_max) class ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import tor...
Alicegaz/torchok
AdaptiveAvgMaxPool2d
false
16,899
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim def adaptive_avgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_max = F.adaptive_max_pool2d(x, output_size) return 0.5 * (x_avg + x_max) class ...
AconC
# 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 class AconC(nn.Module): """ ACON activation (activate or not). AconC: (p1*x-p2*x) * sigmoid(beta*(p1*x-p2*x)) + p2*x, beta is a learnable parameter according to "Activate or Not: Learning Customized Activation" <https://arxiv.org/pdf/2009.04759.pdf>. """ def __i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Aditya239233/MDP
AconC
false
16,900
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
import torch import torch.nn as nn class Model(nn.Module): """ ACON activation (activate or not). AconC: (p1*x-p2*x) * sigmoid(beta*(p1*x-p2*x)) + p2*x, beta is a learnable parameter according to "Activate or Not: Learning Customized Activation" <https://arxiv.org/pdf/2009.04759.pdf>. """ def __i...
Conv2dSameExport
# 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.utils.data import torch.utils.data.distributed from torch import nn import torch.nn.functional as F import torch.nn.parallel import torch.optim def _calc_same_pad(input_: 'int', kernel: 'int', stride: 'int', dilation: 'int' ): """calculate same padding""" return max((-(input_ // ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.utils.data.distributed from torch import nn...
Adlik/zen_nas
Conv2dSameExport
false
16,901
[ "Apache-2.0" ]
7
d820d5c7d5bbb6fd66a76d5f16513647d6ea7a57
https://github.com/Adlik/zen_nas/tree/d820d5c7d5bbb6fd66a76d5f16513647d6ea7a57
import torch import torch.utils.data import torch.utils.data.distributed from torch import nn import torch.nn.functional as F import torch.nn.parallel import torch.optim def _calc_same_pad(input_: 'int', kernel: 'int', stride: 'int', dilation: 'int' ): """calculate same padding""" return max((-(input_ // ...
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...
Aditya239233/MDP
BCEBlurWithLogitsLoss
false
16,902
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
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...
Lookahead
# 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 Lookahead(nn.Module): def __init__(self, n_features, context): super(Lookahead, self).__init__() assert context > 0 self.context = context self.n_features = n_features self.pad = 0, self.context - 1 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Anwarvic/RasaChatbot-with-ASR-and-TTS
Lookahead
false
16,903
[ "MIT" ]
7
57009f55d1ac8e4b347e81d9b8e33a08b4fd5618
https://github.com/Anwarvic/RasaChatbot-with-ASR-and-TTS/tree/57009f55d1ac8e4b347e81d9b8e33a08b4fd5618
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, n_features, context): super().__init__() assert context > 0 self.context = context self.n_features = n_features self.pad = 0, self.context - 1 self.conv = ...
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().__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 forw...
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...
Aditya239233/MDP
Sum
false
16,904
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
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...
TTKernel
# 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 import torch.nn.functional as F class TTKernel(nn.Module): def __init__(self, r_i, m, r_j): super(TTKernel, self).__init__() self.fc1 = nn.Bilinear(r_i, m, r_j, bias=False) def forward(self, input_tensor_1, input_tensor_2): tensor_transformed = self....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
AndresOtero/TensorDecompositionMachineLearning
TTKernel
false
16,905
[ "MIT" ]
3
455f16b405ec9d031999b0ebf9c5a68d3c20b233
https://github.com/AndresOtero/TensorDecompositionMachineLearning/tree/455f16b405ec9d031999b0ebf9c5a68d3c20b233
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, r_i, m, r_j): super().__init__() self.fc1 = nn.Bilinear(r_i, m, r_j, bias=False) def forward(self, input_tensor_1, input_tensor_2): tensor_transformed = self.fc1(input_tensor_...
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): b, c, h, w = x.size() s = self.gain x = x.view(b, 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...
Aditya239233/MDP
Expand
false
16,906
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
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): b, c, h, w = x.size() s = self.gain x = x.view(b, s, s, c // s ** 2, h, w) x = x.permute(0, 3, 4, 1, 5, 2).contiguo...
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): b, c, h, w = x.size() s = self.gain x = x.view(b, 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...
Aditya239233/MDP
Contract
false
16,907
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
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): b, c, h, w = x.size() s = self.gain x = x.view(b, c, h // s, s, w // s, s) x = x.permute(0, 3, 5, 1, 2, 4).contiguo...
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 class GlobalAvgPool2d(nn.Module): def __init__(self): """Global average pooling over the input's spatial dimensions""" super(GlobalAvgPool2d, self).__init__() def forward(self, inputs): in_size = inputs.size() return inputs.view((in_size[0],...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Anikily/CDinkNet
GlobalAvgPool2d
false
16,908
[ "MIT" ]
4
490736855475a51bb2984412e88ac7d50d817a3c
https://github.com/Anikily/CDinkNet/tree/490736855475a51bb2984412e88ac7d50d817a3c
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): """Global average pooling over the input's spatial dimensions""" super().__init__() def forward(self, inputs): in_size = inputs.size() return inputs.view((in_size[0], in_size[1], -1)).mean(dim=2) ...
SiLU
# 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 SiLU(nn.Module): @staticmethod def forward(x): return x * torch.sigmoid(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Aditya239233/MDP
SiLU
false
16,909
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
import torch import torch.nn as nn class Model(nn.Module): @staticmethod def forward(x): return x * torch.sigmoid(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
QAConvSDSLayer
# 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 class QAConvSDSLayer(nn.Module): """Conv SDS layer for qa output""" def __init__(self, input_size: 'int', hidden_dim: 'int'): """ Args: input_size (int): max sequence lengths hidden_dim (int): backbones's hidden dimension """ ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Amber-Chaeeunk/Open-Domain-Question-Answering
QAConvSDSLayer
false
16,910
[ "MIT" ]
5
725e369a4409c54bf11bcfb9db53865d8fc1f935
https://github.com/Amber-Chaeeunk/Open-Domain-Question-Answering/tree/725e369a4409c54bf11bcfb9db53865d8fc1f935
import torch import torch.nn as nn class Model(nn.Module): """Conv SDS layer for qa output""" def __init__(self, input_size: 'int', hidden_dim: 'int'): """ Args: input_size (int): max sequence lengths hidden_dim (int): backbones's hidden dimension """ s...
FeatureMap
# 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 import torch.nn.functional as F class FeatureMap(nn.Module): def __init__(self, n, m, amount_of_division, batch_size): super(FeatureMap, self).__init__() self.m = m self.n = n self.amount_of_division = amount_of_division self.batch_size = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
AndresOtero/TensorDecompositionMachineLearning
FeatureMap
false
16,911
[ "MIT" ]
3
455f16b405ec9d031999b0ebf9c5a68d3c20b233
https://github.com/AndresOtero/TensorDecompositionMachineLearning/tree/455f16b405ec9d031999b0ebf9c5a68d3c20b233
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, n, m, amount_of_division, batch_size): super().__init__() self.m = m self.n = n self.amount_of_division = amount_of_division self.batch_size = batch_size se...
KernelSharedTensorTrain
# 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 from torch.nn import Parameter class KernelSharedTensorTrain(nn.Module): def __init__(self, first_rank, m, second_rank, init_value): super(KernelSharedTensorTrain, self).__init__() self.first_rank = first_rank self.m = m self.second_rank = second_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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 from torch.nn import Parameter assert_size_stride = torch._...
AndresOtero/TensorDecompositionMachineLearning
KernelSharedTensorTrain
false
16,912
[ "MIT" ]
3
455f16b405ec9d031999b0ebf9c5a68d3c20b233
https://github.com/AndresOtero/TensorDecompositionMachineLearning/tree/455f16b405ec9d031999b0ebf9c5a68d3c20b233
import torch from torch import nn from torch.nn import Parameter class Model(nn.Module): def __init__(self, first_rank, m, second_rank, init_value): super().__init__() self.first_rank = first_rank self.m = m self.second_rank = second_rank self.weight = Parameter(torch.rand...
KernelTensorRingWithCategoryAndState
# 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 from torch import nn from torch.nn import Parameter class KernelTensorRingWithCategoryAndState(nn.Module): def __init__(self, amount_of_categories, first_rank, m, second_rank): super(KernelTensorRingWithCategoryAndState, self).__init__() self.first_rank = first_rank ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math from torch import nn from torch.nn import Parameter assert_size_stri...
AndresOtero/TensorDecompositionMachineLearning
KernelTensorRingWithCategoryAndState
false
16,913
[ "MIT" ]
3
455f16b405ec9d031999b0ebf9c5a68d3c20b233
https://github.com/AndresOtero/TensorDecompositionMachineLearning/tree/455f16b405ec9d031999b0ebf9c5a68d3c20b233
import math import torch from torch import nn from torch.nn import Parameter class Model(nn.Module): def __init__(self, amount_of_categories, first_rank, m, second_rank): super().__init__() self.first_rank = first_rank self.m = m self.second_rank = second_rank self.weight ...
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 class SEModule(nn.Module): def __init__(self, planes, compress_rate): super(SEModule, self).__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) self.conv1 = nn.Conv2d(planes, planes // compress_rate, kernel_size =1, stride=1, padding=0, bias=T...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
Andyeyeye/MTANet
SEModule
false
16,914
[ "MIT" ]
8
65f5c356b18400bd1d1b80cffa1ec9f8c6570d2a
https://github.com/Andyeyeye/MTANet/tree/65f5c356b18400bd1d1b80cffa1ec9f8c6570d2a
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, planes, compress_rate): super().__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) self.conv1 = nn.Conv2d(planes, planes // compress_rate, kernel_size =1, stride=1, padding=0, bias=True) self...
SpatialAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class SpatialAttention(nn.Module): def __init__(self, kernel_size=7): super(SpatialAttention, self).__init__() assert kernel_size in (3, 7), 'kernel size must be 3 or 7' padding = 3 if kernel_size == 7 else 1 self.conv1 = nn.Conv2d(2, 1, kernel_s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Andyeyeye/MTANet
SpatialAttention
false
16,915
[ "MIT" ]
8
65f5c356b18400bd1d1b80cffa1ec9f8c6570d2a
https://github.com/Andyeyeye/MTANet/tree/65f5c356b18400bd1d1b80cffa1ec9f8c6570d2a
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, kernel_size=7): super().__init__() assert kernel_size in (3, 7), 'kernel size must be 3 or 7' padding = 3 if kernel_size == 7 else 1 self.conv1 = nn.Conv2d(2, 1, kernel_size, padding=padding, bias=False)...
Net1
# 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 Net1(nn.Module): def __init__(self): super(Net1, self).__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = nn.Linear(16 * 5 * 5, 120) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
AndreaCeccarelli/gpu-monitor
Net1
false
16,916
[ "MIT" ]
4
aad4dc88387a69235e9c370cb08da1f16ba4aa96
https://github.com/AndreaCeccarelli/gpu-monitor/tree/aad4dc88387a69235e9c370cb08da1f16ba4aa96
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = nn.Linear(16 * 5 * 5, 120) s...
CoreKernelTensorRing
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch from torch import nn from torch.nn import Parameter class CoreKernelTensorRing(nn.Module): def __init__(self, first_rank, m, second_rank): super(CoreKernelTensorRing, self).__init__() self.first_rank = first_rank self.m = m self.second_rank = second_rank ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math from torch import nn from torch.nn import Parameter assert_size_stri...
AndresOtero/TensorDecompositionMachineLearning
CoreKernelTensorRing
false
16,917
[ "MIT" ]
3
455f16b405ec9d031999b0ebf9c5a68d3c20b233
https://github.com/AndresOtero/TensorDecompositionMachineLearning/tree/455f16b405ec9d031999b0ebf9c5a68d3c20b233
import math import torch from torch import nn from torch.nn import Parameter class Model(nn.Module): def __init__(self, first_rank, m, second_rank): super().__init__() self.first_rank = first_rank self.m = m self.second_rank = second_rank self.weight = Parameter(torch.rand...
FastAdaptiveAvgPool2d
# 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.parallel import torch._utils import torch.optim class FastAdaptiveAvgPool2d(nn.Module): def __init__(self, flatten=False): super(FastAdaptiveAvgPool2d, self).__init__() self.flatten = flatten def forward(self, x): return x.mean((2, 3...
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._utils import torch.optim assert_size_stride = torch._C._dynamo.guards.assert_si...
Alicegaz/torchok
FastAdaptiveAvgPool2d
false
16,918
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.parallel import torch._utils import torch.optim class Model(nn.Module): def __init__(self, flatten=False): super().__init__() self.flatten = flatten def forward(self, x): return x.mean((2, 3)) if self.flatten else x.mean((2, 3), keep...
BCEWithLogitsLoss
# 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 import torch._utils import torch.optim class BCEWithLogitsLoss(nn.BCEWithLogitsLoss): def __init__(self, weight=None, reduction='mean', pos_weight=None, ignore_all_zeros=False): if pos_weight is not None: ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
Alicegaz/torchok
BCEWithLogitsLoss
false
16,919
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim class Model(nn.BCEWithLogitsLoss): def __init__(self, weight=None, reduction='mean', pos_weight=None, ignore_all_zeros=False): if pos_weight is not None: ...
TransformerLayer
# 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 class TransformerLayer(nn.Module): def __init__(self, c, num_heads): super().__init__() self.q = nn.Linear(c, c, bias=False) self.k = nn.Linear(c, c, bias=False) self.v = nn.Linear(c, c, bias=False) self.ma = nn.MultiheadAttention(embed_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....
Aditya239233/MDP
TransformerLayer
false
16,920
[ "MIT" ]
4
87491e1d67e547c11f4bdd5d784d120473429eae
https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, c, num_heads): super().__init__() self.q = nn.Linear(c, c, bias=False) self.k = nn.Linear(c, c, bias=False) self.v = nn.Linear(c, c, bias=False) self.ma = nn.MultiheadAttention(embed_dim=c, num_h...
L1_Charbonnier_loss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class L1_Charbonnier_loss(nn.Module): """L1 Charbonnierloss.""" def __init__(self): super(L1_Charbonnier_loss, self).__init__() self.eps = 1e-06 def forward(self, X, Y): diff = torch.add(X, -Y) error = torch.sqrt(...
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 import...
AnonymityCode/FastLFnet
L1_Charbonnier_loss
false
16,921
[ "MIT" ]
8
cc4c1d9620fef5e75798f40084729d8d7fdd5a9a
https://github.com/AnonymityCode/FastLFnet/tree/cc4c1d9620fef5e75798f40084729d8d7fdd5a9a
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """L1 Charbonnierloss.""" def __init__(self): super().__init__() self.eps = 1e-06 def forward(self, X, Y): diff = torch.add(X, -Y) error = torch.sqrt(diff * diff + self.eps) loss = ...
AsymmetricMultiLabelLoss
# 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.parallel import torch._utils import torch.optim class AsymmetricMultiLabelLoss(nn.Module): def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): super(AsymmetricMultiLabelLoss, 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, math as tl_math import torc...
Alicegaz/torchok
AsymmetricMultiLabelLoss
false
16,922
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.parallel import torch._utils import torch.optim class Model(nn.Module): def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): super().__init__() self.gamma_neg = gamma_neg self.ga...
AdaptiveCatAvgMaxPool2d
# 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 import torch._utils import torch.optim def adaptive_catavgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_max = F.adaptive_max_pool2d(x, output_size) return torch.cat((x_avg, x_max), 1...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import tor...
Alicegaz/torchok
AdaptiveCatAvgMaxPool2d
false
16,923
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim def adaptive_catavgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_max = F.adaptive_max_pool2d(x, output_size) return torch.cat((x_avg, x_max), 1...
GAT
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class GraphAttentionLayer(nn.Module): def __init__(self, in_feature, out_feature, dropout, alpha, concat=True): super(GraphAttentionLayer, self).__init__() self.dropout = dropout self.in_feature = in_feature self.o...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Alienge/Graph-Network
GAT
false
16,924
[ "MIT" ]
3
559cccb6af4e6ca50c44fd51cac8df5713f255bf
https://github.com/Alienge/Graph-Network/tree/559cccb6af4e6ca50c44fd51cac8df5713f255bf
import torch import torch.nn as nn import torch.nn.functional as F class GraphAttentionLayer(nn.Module): def __init__(self, in_feature, out_feature, dropout, alpha, concat=True): super().__init__() self.dropout = dropout self.in_feature = in_feature self.out_feature = out_feature ...
HardMish
# 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.parallel import torch._utils import torch.optim def hard_mish(x, inplace: 'bool'=False): """ Hard Mish Experimental, based on notes by Mish author Diganta Misra at https://github.com/digantamisra98/H-Mish/blob/0da20d4bc58e696b6803f2523c58d3c8a82782d0/RE...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn.parallel import torch._utils import torch.optim ass...
Alicegaz/torchok
HardMish
false
16,925
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.parallel import torch._utils import torch.optim def hard_mish(x, inplace: 'bool'=False): """ Hard Mish Experimental, based on notes by Mish author Diganta Misra at https://github.com/digantamisra98/H-Mish/blob/0da20d4bc58e696b6803f2523c58d3c8a82782d0/RE...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim class FocalLoss(nn.Module): def __init__(self, gamma=2, alpha=None, autobalance=False, ignore_index =-100, eps=1e-12, reduction='mean', normalized=False, reduced_thre...
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...
Alicegaz/torchok
FocalLoss
false
16,926
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim class Model(nn.Module): def __init__(self, gamma=2, alpha=None, autobalance=False, ignore_index =-100, eps=1e-12, reduction='mean', normalized=False, reduced_threshol...
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 math import torch from torch import nn class GELU(nn.Module): def forward(self, x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class PositionwiseFeedForward(nn.Module): """Implements FFN equation.""" def __init__(self, d_mod...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
Annelise2019/DeepLearning_Project
PositionwiseFeedForward
false
16,927
[ "MIT" ]
4
f63dcc266a5d9c33c118cabe8145f46f8e35945b
https://github.com/Annelise2019/DeepLearning_Project/tree/f63dcc266a5d9c33c118cabe8145f46f8e35945b
import math import torch from torch import nn class GELU(nn.Module): def forward(self, x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class Model(nn.Module): """Implements FFN equation.""" def __init__(self, d_model, d_ff, dropout=...
GeM
# 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 import torch._utils import torch.optim class GeM(nn.Module): def __init__(self, p=3): super(GeM, self).__init__() self.p = p self.eps = 1e-06 def forward(self, x): return self.gem(x, p...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import...
Alicegaz/torchok
GeM
false
16,928
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim class Model(nn.Module): def __init__(self, p=3): super().__init__() self.p = p self.eps = 1e-06 def forward(self, x): return self.gem(x, p=self.p...
CecaModule
# 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.nn.parallel import torch._utils import torch.optim class CecaModule(nn.Module): """Constructs a circular ECA module. ECA module where the conv uses circular padding rather than zero padding. Unlike the spatial 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 import math import torch.nn as nn import torch.nn.parallel import torch._utils i...
Alicegaz/torchok
CecaModule
false
16,929
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim class Model(nn.Module): """Constructs a circular ECA module. ECA module where the conv uses circular padding rather than zero padding. Unlike the spatial dimensio...
GELU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim class GELU(nn.Module): """Applies the Gaussian Error Linear Units function (w/ dummy inplace arg) """ def __init__(self, inplace: 'bool'=False): super(GELU, self).__i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.parallel import torch._utils import torch...
Alicegaz/torchok
GELU
false
16,930
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim class Model(nn.Module): """Applies the Gaussian Error Linear Units function (w/ dummy inplace arg) """ def __init__(self, inplace: 'bool'=False): super().__init__() ...
EcaModule
# 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.parallel import torch._utils import torch.optim class EcaModule(nn.Module): """Constructs an ECA module. Args: channels: Number of channels of the input feature map for use in adaptive kernel sizes for actual calculations acco...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn import torch.nn.parallel import torch._utils i...
Alicegaz/torchok
EcaModule
false
16,931
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import math import torch import torch.nn as nn import torch.nn.parallel import torch._utils import torch.optim class Model(nn.Module): """Constructs an ECA module. Args: channels: Number of channels of the input feature map for use in adaptive kernel sizes for actual calculations accordin...
ConvNorm
# 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.multiprocessing class ConvNorm(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=None, dilation=1, bias=True, w_init_gain='linear'): super(ConvNorm, self).__init__() if padding is None: assert kernel_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 import torch.multiprocessing assert_size_stride = torch._C._dynamo.guards.assert...
AppleHolic/FastSpeech2
ConvNorm
false
16,932
[ "MIT" ]
8
8f6969edd0c86c05b1dd70a0b7841bd86505455e
https://github.com/AppleHolic/FastSpeech2/tree/8f6969edd0c86c05b1dd70a0b7841bd86505455e
import torch import torch.multiprocessing class Model(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=None, dilation=1, bias=True, w_init_gain='linear'): super().__init__() if padding is None: assert kernel_size % 2 == 1 ...
Fire
# 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 class Fire(nn.Module): def __init__(self, inplanes, squeeze_planes, expand1x1_planes, expand3x3_planes, dilation=1): super(Fire, self).__init__() self.inplanes = inplanes self.squeeze = nn.Conv2d(inplanes, squeeze_planes, kernel_size=1) s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Anikily/CDinkNet
Fire
false
16,933
[ "MIT" ]
4
490736855475a51bb2984412e88ac7d50d817a3c
https://github.com/Anikily/CDinkNet/tree/490736855475a51bb2984412e88ac7d50d817a3c
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, inplanes, squeeze_planes, expand1x1_planes, expand3x3_planes, dilation=1): super().__init__() self.inplanes = inplanes self.squeeze = nn.Conv2d(inplanes, squeeze_planes, kernel_size=1) self.squee...
GroupNormAct
# 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.nn.parallel import torch._utils import torch.optim def swish(x, inplace: 'bool'=False): """Swish - Described in: https://arxiv.org/abs/1710.05941 """ return x.mul_(x.sigmoid()) if inplace else x.mul(x.sigmoid()) def is_expor...
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 import...
Alicegaz/torchok
GroupNormAct
false
16,934
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim def swish(x, inplace: 'bool'=False): """Swish - Described in: https://arxiv.org/abs/1710.05941 """ return x.mul_(x.sigmoid()) if inplace else x.mul(x.sigmoid()) def is_expor...
GroupNorm
# 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.nn.parallel import torch._utils import torch.optim def num_groups(group_size, channels): if not group_size: return 1 else: assert channels % group_size == 0 return channels // group_size class GroupNorm(n...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.parallel import torch._utils import torch...
Alicegaz/torchok
GroupNorm
false
16,935
[ "Apache-2.0" ]
8
7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
https://github.com/Alicegaz/torchok/tree/7b8f95df466a25b1ad8ee93bed1a3c7516440cf4
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch._utils import torch.optim def num_groups(group_size, channels): if not group_size: return 1 else: assert channels % group_size == 0 return channels // group_size class Model(nn.Gr...
HingeMarginLoss
# 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 HingeMarginLoss(nn.Module): """ 计算hinge loss 接口 """ def __init__(self): super(HingeMarginLoss, self).__init__() def forward(self, t, tr, delt=None, size_average=False): """ 计算hingle loss """ if delt is 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
Aurelius84/SPWE
HingeMarginLoss
false
16,936
[ "MIT" ]
9
5f9fc5495e879b5272c118271a69c5adad4ba260
https://github.com/Aurelius84/SPWE/tree/5f9fc5495e879b5272c118271a69c5adad4ba260
import torch import torch.nn as nn class Model(nn.Module): """ 计算hinge loss 接口 """ def __init__(self): super().__init__() def forward(self, t, tr, delt=None, size_average=False): """ 计算hingle loss """ if delt is None: loss = torch.clamp(1 - t +...
Conv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.multiprocessing class Conv(nn.Module): """ Convolution Module """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0, dilation=1, bias=True, w_init='linear'): """ :param in_channels: dimension of inp...
import torch from torch._inductor.select_algorithm import extern_kernels import 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.multiprocessing assert_size_stride = torch._C...
AppleHolic/FastSpeech2
Conv
false
16,937
[ "MIT" ]
8
8f6969edd0c86c05b1dd70a0b7841bd86505455e
https://github.com/AppleHolic/FastSpeech2/tree/8f6969edd0c86c05b1dd70a0b7841bd86505455e
import torch import torch.nn as nn import torch.multiprocessing class Model(nn.Module): """ Convolution Module """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0, dilation=1, bias=True, w_init='linear'): """ :param in_channels: dimension of in...
L1_Gradient_loss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class L1_Charbonnier_loss(nn.Module): """L1 Charbonnierloss.""" def __init__(self): super(L1_Charbonnier_loss, self).__init__() self.eps = 1e-06 def forward(self, X, Y): diff = torch.add(X, -Y) error = torch.sqrt(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dy...
AnonymityCode/FastLFnet
L1_Gradient_loss
false
16,938
[ "MIT" ]
8
cc4c1d9620fef5e75798f40084729d8d7fdd5a9a
https://github.com/AnonymityCode/FastLFnet/tree/cc4c1d9620fef5e75798f40084729d8d7fdd5a9a
import torch import torch.nn as nn import torch.utils.data class L1_Charbonnier_loss(nn.Module): """L1 Charbonnierloss.""" def __init__(self): super().__init__() self.eps = 1e-06 def forward(self, X, Y): diff = torch.add(X, -Y) error = torch.sqrt(diff * diff + self.eps) ...
Aggregate
# 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.utils.data class Aggregate(nn.Module): """Pooling layer based on sum or average with optional masking. Args: axis (int): axis along which pooling is done. mean (bool, optional): if True, use average instead for sum pooling. keepdim (bool...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
Avinashpathapati/gnn_molecule
Aggregate
false
16,939
[ "MIT" ]
3
84b5e92902c638694b872c42d010676bcd3d7658
https://github.com/Avinashpathapati/gnn_molecule/tree/84b5e92902c638694b872c42d010676bcd3d7658
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """Pooling layer based on sum or average with optional masking. Args: axis (int): axis along which pooling is done. mean (bool, optional): if True, use average instead for sum pooling. keepdim (bool, op...
QueryAttentionAggregator
# 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 import torch.utils.data from torch import nn import torch from torch.nn import functional as F class QueryAttentionAggregator(nn.Module): def __init__(self, input_dim): super(QueryAttentionAggregator, self).__init__() self.query = nn.Linear(input_dim, input_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....
Arnaud15/CS236_Deep_Generative_Processes
QueryAttentionAggregator
false
16,940
[ "MIT" ]
6
179c995c4f596c19441c5e844f2ed07d954324e3
https://github.com/Arnaud15/CS236_Deep_Generative_Processes/tree/179c995c4f596c19441c5e844f2ed07d954324e3
import torch import numpy as np import torch.utils.data from torch import nn import torch from torch.nn import functional as F class Model(nn.Module): def __init__(self, input_dim): super().__init__() self.query = nn.Linear(input_dim, input_dim) self.vector = nn.Parameter(torch.zeros(inpu...
SpectrogramMasker
# 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 SpectrogramMasker(nn.Module): def __init__(self, win_length: 'int'=400, hop_length: 'int'=200): super().__init__() self.win_length = win_length self.conv = nn.Conv1d(1, 1, self.win_length, stride=hop_length, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
AppleHolic/2020AIChallengeSpeechRecognition
SpectrogramMasker
false
16,941
[ "MIT" ]
9
62002f036a4bb4ab23f7bdba73f19e97e0ac7087
https://github.com/AppleHolic/2020AIChallengeSpeechRecognition/tree/62002f036a4bb4ab23f7bdba73f19e97e0ac7087
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, win_length: 'int'=400, hop_length: 'int'=200): super().__init__() self.win_length = win_length self.conv = nn.Conv1d(1, 1, self.win_length, stride=hop_length, padding=...
MLP
# 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 class FullyConnectedBlock(nn.Module): def __init__(self, width, bn=False): super().__init__() self.linear = nn.Linear(width, width, bias=not bn) self.bn = bn if bn: self.bn_layer = nn.BatchNorm1d(width) self.relu = 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 import torch.nn as nn assert_...
Arjung27/DeepThinking
MLP
false
16,942
[ "MIT" ]
6
13a2ce534bcb0b9379a22fffef52d975d650adb2
https://github.com/Arjung27/DeepThinking/tree/13a2ce534bcb0b9379a22fffef52d975d650adb2
import torch import torch.nn as nn class FullyConnectedBlock(nn.Module): def __init__(self, width, bn=False): super().__init__() self.linear = nn.Linear(width, width, bias=not bn) self.bn = bn if bn: self.bn_layer = nn.BatchNorm1d(width) self.relu = nn.ReLU() ...
BehlerAngular
# 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.utils.data class BehlerAngular(nn.Module): """ Compute Behler type angular contribution of the angle spanned by three atoms: :math:`2^{(1-\\zeta)} (1 + \\lambda \\cos( {\\theta}_{ijk} ) )^\\zeta` Sets of zetas with lambdas of -1 and +1 are generated au...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
Avinashpathapati/gnn_molecule
BehlerAngular
false
16,943
[ "MIT" ]
3
84b5e92902c638694b872c42d010676bcd3d7658
https://github.com/Avinashpathapati/gnn_molecule/tree/84b5e92902c638694b872c42d010676bcd3d7658
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """ Compute Behler type angular contribution of the angle spanned by three atoms: :math:`2^{(1-\\zeta)} (1 + \\lambda \\cos( {\\theta}_{ijk} ) )^\\zeta` Sets of zetas with lambdas of -1 and +1 are generated automatica...
VectorAttentionAggregator
# 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 import torch.utils.data from torch import nn import torch from torch.nn import functional as F class VectorAttentionAggregator(nn.Module): def __init__(self, input_dim): super(VectorAttentionAggregator, self).__init__() self.vector = nn.Parameter(torch.zeros(input_...
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.utils.dat...
Arnaud15/CS236_Deep_Generative_Processes
VectorAttentionAggregator
false
16,944
[ "MIT" ]
6
179c995c4f596c19441c5e844f2ed07d954324e3
https://github.com/Arnaud15/CS236_Deep_Generative_Processes/tree/179c995c4f596c19441c5e844f2ed07d954324e3
import torch import numpy as np import torch.utils.data from torch import nn import torch from torch.nn import functional as F class Model(nn.Module): def __init__(self, input_dim): super().__init__() self.vector = nn.Parameter(torch.zeros(input_dim)) self.input_dim = input_dim def f...
SimpleCNN
# 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 SimpleCNN(nn.Module): def __init__(self): super(SimpleCNN, self).__init__() self.fc1 = nn.Linear(28 * 28, 500) self.fc2 = nn.Linear(500, 256) self.fc3 = nn.Linear(256, 10) def forward(self, x): x...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
AnweshCR7/just-some-crypto-fun
SimpleCNN
false
16,945
[ "MIT" ]
4
e614cd9f46e355272aec37df7a7cc90a589c993a
https://github.com/AnweshCR7/just-some-crypto-fun/tree/e614cd9f46e355272aec37df7a7cc90a589c993a
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(28 * 28, 500) self.fc2 = nn.Linear(500, 256) self.fc3 = nn.Linear(256, 10) def forward(self, x): x = x.view(-1, 28 * ...
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 numpy as np import torch.nn as nn import torch.multiprocessing class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature): super().__init__() self.temperature = temperature self.softmax = nn.Softmax(dim=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....
AppleHolic/FastSpeech2
ScaledDotProductAttention
false
16,946
[ "MIT" ]
8
8f6969edd0c86c05b1dd70a0b7841bd86505455e
https://github.com/AppleHolic/FastSpeech2/tree/8f6969edd0c86c05b1dd70a0b7841bd86505455e
import torch import numpy as np import torch.nn as nn import torch.multiprocessing class Model(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature): super().__init__() self.temperature = temperature self.softmax = nn.Softmax(dim=2) def forward(self, q,...
Attention
# 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.functional as F import torch.utils.data def restricted_softmax(src, dim=-1, margin=0): src_max = torch.clamp(src.max(dim=dim, keepdim=True)[0], min=0) out = (src - src_max).exp() out = out / (out.sum(dim=dim, keepdim=True) + (margin - src_max).exp()) return out...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Avinashpathapati/gnn_molecule
Attention
false
16,947
[ "MIT" ]
3
84b5e92902c638694b872c42d010676bcd3d7658
https://github.com/Avinashpathapati/gnn_molecule/tree/84b5e92902c638694b872c42d010676bcd3d7658
import math import torch import torch.nn.functional as F import torch.utils.data def restricted_softmax(src, dim=-1, margin=0): src_max = torch.clamp(src.max(dim=dim, keepdim=True)[0], min=0) out = (src - src_max).exp() out = out / (out.sum(dim=dim, keepdim=True) + (margin - src_max).exp()) return out...
filtered_softmax
# 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 filtered_softmax(nn.Module): def __init__(self): super(filtered_softmax, self).__init__() def forward(self, x, label): x = torch.softmax(x, dim=1) x = x * label return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.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._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
AutumnCrocus/shadow_sim
filtered_softmax
false
16,948
[ "MIT" ]
6
79ad13ff9bd7131c82f269af32a3970f3e4bf2ca
https://github.com/AutumnCrocus/shadow_sim/tree/79ad13ff9bd7131c82f269af32a3970f3e4bf2ca
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x, label): x = torch.softmax(x, dim=1) x = x * label return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init...
ChanNorm
# 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 ChanNorm(nn.Module): def __init__(self, dim, eps=1e-05): super().__init__() self.eps = eps self.g = nn.Parameter(torch.ones(1, dim, 1, 1)) self.b = nn.Parameter(torch.zeros(1, dim, 1, 1)) def forward(self, x): std = torch.var(x,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Asha-Gutlapalli/StyleGAN2-Art
ChanNorm
false
16,949
[ "MIT" ]
4
5a8a8ad61183e82abafe587d755a7fbce28aa8f0
https://github.com/Asha-Gutlapalli/StyleGAN2-Art/tree/5a8a8ad61183e82abafe587d755a7fbce28aa8f0
import torch from torch import nn class Model(nn.Module): def __init__(self, dim, eps=1e-05): super().__init__() self.eps = eps self.g = nn.Parameter(torch.ones(1, dim, 1, 1)) self.b = nn.Parameter(torch.zeros(1, dim, 1, 1)) def forward(self, x): std = torch.var(x, di...
EqualLinear
# 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 import torch.nn.functional as F class EqualLinear(nn.Module): def __init__(self, in_dim, out_dim, lr_mul=1, bias=True): super().__init__() self.weight = nn.Parameter(torch.randn(out_dim, in_dim)) if bias: self.bias = nn.Parameter(torch.zeros(o...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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...
Asha-Gutlapalli/StyleGAN2-Art
EqualLinear
false
16,950
[ "MIT" ]
4
5a8a8ad61183e82abafe587d755a7fbce28aa8f0
https://github.com/Asha-Gutlapalli/StyleGAN2-Art/tree/5a8a8ad61183e82abafe587d755a7fbce28aa8f0
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_dim, out_dim, lr_mul=1, bias=True): super().__init__() self.weight = nn.Parameter(torch.randn(out_dim, in_dim)) if bias: self.bias = nn.Parameter(torch.zeros(out_dim...
MAB
# 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 import torch.nn as nn class MAB(nn.Module): def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False): super(MAB, self).__init__() self.dim_V = dim_V self.num_heads = num_heads self.fc_q = nn.Linear(dim_Q, dim_V) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
AntonValk/BagGraph-Graph-MIL
MAB
false
16,951
[ "MIT" ]
8
1447b52b32995cf6c71e731dd1261104cd66ced0
https://github.com/AntonValk/BagGraph-Graph-MIL/tree/1447b52b32995cf6c71e731dd1261104cd66ced0
import math import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False): super().__init__() self.dim_V = dim_V self.num_heads = num_heads self.fc_q = nn.Linear(dim_Q, dim_V) self.fc...
MaskedSoftmax
# 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 as th from torch import nn import torch.nn.functional as F class MaskedSoftmax(nn.Module): def __init__(self, dim): super(MaskedSoftmax, self).__init__() self.dim = dim def forward(self, logit, mask=None): if mask is None: dist = F.softmax(logit ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn a...
Artisan-Lab/SMTimer
MaskedSoftmax
false
16,952
[ "MIT" ]
5
8e0bbb854afd360dcc61d6b098c4ae8931bae14c
https://github.com/Artisan-Lab/SMTimer/tree/8e0bbb854afd360dcc61d6b098c4ae8931bae14c
import torch import torch as th from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, dim): super().__init__() self.dim = dim def forward(self, logit, mask=None): if mask is None: dist = F.softmax(logit - th.max(logit, dim=self.di...
NegativeLearningLoss
# 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.backends.cudnn import torch.utils import torch.distributed class NegativeLearningLoss(nn.Module): def __init__(self, threshold=0.05): super(NegativeLearningLoss, self).__init__() self.threshold = threshold def forward(self, predict): ma...
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 ...
BIT-DA/RIPU
NegativeLearningLoss
false
16,953
[ "MIT" ]
9
125edf112c9ded1e7497aedb2a092331824df100
https://github.com/BIT-DA/RIPU/tree/125edf112c9ded1e7497aedb2a092331824df100
import torch import torch.nn as nn import torch.backends.cudnn import torch.utils import torch.distributed class Model(nn.Module): def __init__(self, threshold=0.05): super().__init__() self.threshold = threshold def forward(self, predict): mask = (predict < self.threshold).detach() ...
SSWELoss
# 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 HingeMarginLoss(nn.Module): """ 计算hinge loss 接口 """ def __init__(self): super(HingeMarginLoss, self).__init__() def forward(self, t, tr, delt=None, size_average=False): """ 计算hingle loss """ if delt is 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
Aurelius84/SPWE
SSWELoss
false
16,954
[ "MIT" ]
9
5f9fc5495e879b5272c118271a69c5adad4ba260
https://github.com/Aurelius84/SPWE/tree/5f9fc5495e879b5272c118271a69c5adad4ba260
import torch import torch.nn as nn class HingeMarginLoss(nn.Module): """ 计算hinge loss 接口 """ def __init__(self): super().__init__() def forward(self, t, tr, delt=None, size_average=False): """ 计算hingle loss """ if delt is None: loss = torch.cla...
PMA
# 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 import torch.nn as nn class MAB(nn.Module): def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False): super(MAB, self).__init__() self.dim_V = dim_V self.num_heads = num_heads self.fc_q = nn.Linear(dim_Q, dim_V) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
AntonValk/BagGraph-Graph-MIL
PMA
false
16,955
[ "MIT" ]
8
1447b52b32995cf6c71e731dd1261104cd66ced0
https://github.com/AntonValk/BagGraph-Graph-MIL/tree/1447b52b32995cf6c71e731dd1261104cd66ced0
import math import torch import torch.nn.functional as F import torch.nn as nn class MAB(nn.Module): def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False): super().__init__() self.dim_V = dim_V self.num_heads = num_heads self.fc_q = nn.Linear(dim_Q, dim_V) self.fc_k...
ScaleLayer
# 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 class ScaleLayer(nn.Module): def __init__(self, init_value=0.001): super(ScaleLayer, self).__init__() self.scale = nn.Parameter(torch.FloatTensor([init_value])) def forward(self, input): None return input * self.scale 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Anurag14/STar-framework
ScaleLayer
false
16,956
[ "MIT" ]
4
6670499c681fce8d76aae1d1910bc849ec5f56ea
https://github.com/Anurag14/STar-framework/tree/6670499c681fce8d76aae1d1910bc849ec5f56ea
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, init_value=0.001): super().__init__() self.scale = nn.Parameter(torch.FloatTensor([init_value])) def forward(self, input): None return input * self.scale def get_inputs(): return [torch.rand([...
ISAB
# 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 import torch.nn as nn class MAB(nn.Module): def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False): super(MAB, self).__init__() self.dim_V = dim_V self.num_heads = num_heads self.fc_q = nn.Linear(dim_Q, dim_V) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
AntonValk/BagGraph-Graph-MIL
ISAB
false
16,957
[ "MIT" ]
8
1447b52b32995cf6c71e731dd1261104cd66ced0
https://github.com/AntonValk/BagGraph-Graph-MIL/tree/1447b52b32995cf6c71e731dd1261104cd66ced0
import math import torch import torch.nn.functional as F import torch.nn as nn class MAB(nn.Module): def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False): super().__init__() self.dim_V = dim_V self.num_heads = num_heads self.fc_q = nn.Linear(dim_Q, dim_V) self.fc_k...
OutConv
# 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 class OutConv(nn.Module): def __init__(self, in_channels, out_channels): super(OutConv, self).__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1) def forward(self, x): return self.conv(x) def get_inputs(): return [torch....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
AyoubOuddah/SAR_River_Segmentation_Pytorch-Unet
OutConv
false
16,958
[ "MIT" ]
10
e7da2414d6158a5f6358df92ded273a1a016cb91
https://github.com/AyoubOuddah/SAR_River_Segmentation_Pytorch-Unet/tree/e7da2414d6158a5f6358df92ded273a1a016cb91
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channels, out_channels): super().__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1) def forward(self, x): return self.conv(x) def get_inputs(): return [torch.rand([4, 4, 4, ...
ResNet
# 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 ResNet(nn.Module): def __init__(self, n_in, n_out): super(ResNet, self).__init__() self.fc1 = nn.Linear(n_in, n_out) self.fc2 = nn.Linear(n_in, n_out) def forward(self, x): h1 = F.relu(self.fc1(x)) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
AutumnCrocus/shadow_sim
ResNet
false
16,959
[ "MIT" ]
6
79ad13ff9bd7131c82f269af32a3970f3e4bf2ca
https://github.com/AutumnCrocus/shadow_sim/tree/79ad13ff9bd7131c82f269af32a3970f3e4bf2ca
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, n_in, n_out): super().__init__() self.fc1 = nn.Linear(n_in, n_out) self.fc2 = nn.Linear(n_in, n_out) def forward(self, x): h1 = F.relu(self.fc1(x)) h2 = F.rel...
SAB
# 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 import torch.nn as nn class MAB(nn.Module): def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False): super(MAB, self).__init__() self.dim_V = dim_V self.num_heads = num_heads self.fc_q = nn.Linear(dim_Q, dim_V) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
AntonValk/BagGraph-Graph-MIL
SAB
false
16,960
[ "MIT" ]
8
1447b52b32995cf6c71e731dd1261104cd66ced0
https://github.com/AntonValk/BagGraph-Graph-MIL/tree/1447b52b32995cf6c71e731dd1261104cd66ced0
import math import torch import torch.nn.functional as F import torch.nn as nn class MAB(nn.Module): def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False): super().__init__() self.dim_V = dim_V self.num_heads = num_heads self.fc_q = nn.Linear(dim_Q, dim_V) self.fc_k...
MinibatchStdDev
# 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 as th import torch.nn.parallel import torch.utils.data class MinibatchStdDev(th.nn.Module): """ Minibatch standard deviation layer for the discriminator """ def __init__(self): """ derived class constructor """ super(MinibatchStdDev, self).__i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch as th import torch.nn.parallel import torch.utils.data assert_size...
AshwinRJ/Face-Generation-from-Speech
MinibatchStdDev
false
16,961
[ "MIT" ]
4
6d8afe8a61185bfe67cd5fd19c7f993630f481b4
https://github.com/AshwinRJ/Face-Generation-from-Speech/tree/6d8afe8a61185bfe67cd5fd19c7f993630f481b4
import torch import torch as th import torch.nn.parallel import torch.utils.data class Model(th.nn.Module): """ Minibatch standard deviation layer for the discriminator """ def __init__(self): """ derived class constructor """ super().__init__() def forward(self, ...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class FocalLoss(nn.Module): """https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/78109""" def __init__(self, gamma=2): super().__init__() self.gamma = gamma def forward(self, logit, target): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
AutuanLiu/PyTorch-ML
FocalLoss
false
16,962
[ "MIT" ]
9
884c7723843d9ffb4da09d95eb97886b2cc38f28
https://github.com/AutuanLiu/PyTorch-ML/tree/884c7723843d9ffb4da09d95eb97886b2cc38f28
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/78109""" def __init__(self, gamma=2): super().__init__() self.gamma = gamma def forward(self, logit, target): ...
BernoulliLayer
# 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 abc import torch class ProbabilisticLayer(torch.nn.Module, metaclass=abc.ABCMeta): """Probabilistic layer to be used by the encoder/decoder of a Variational AutoEncoder. """ @abc.abstractmethod def forward(self, inputs): """Compute the parameters of the distribution conditioned 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 import abc assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty...
BUTSpeechFIT/beer
BernoulliLayer
false
16,963
[ "MIT" ]
6
43fb9027a859db28d2f2f8709260ca2ce9501e25
https://github.com/BUTSpeechFIT/beer/tree/43fb9027a859db28d2f2f8709260ca2ce9501e25
import abc import torch class ProbabilisticLayer(torch.nn.Module, metaclass=abc.ABCMeta): """Probabilistic layer to be used by the encoder/decoder of a Variational AutoEncoder. """ @abc.abstractmethod def forward(self, inputs): """Compute the parameters of the distribution conditioned on...
TransposeLayer
# 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 TransposeLayer(torch.nn.Module): """Transpose the input.""" def forward(self, data): return data.t().contiguous() def get_inputs(): return [torch.rand([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...
BUTSpeechFIT/beer
TransposeLayer
false
16,964
[ "MIT" ]
6
43fb9027a859db28d2f2f8709260ca2ce9501e25
https://github.com/BUTSpeechFIT/beer/tree/43fb9027a859db28d2f2f8709260ca2ce9501e25
import torch class Model(torch.nn.Module): """Transpose the input.""" def forward(self, data): return data.t().contiguous() def get_inputs(): return [torch.rand([4, 4])] def get_init_inputs(): return []
PixelwiseNorm
# 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 as th import torch.nn.parallel import torch.utils.data class PixelwiseNorm(th.nn.Module): def __init__(self): super(PixelwiseNorm, self).__init__() def forward(self, x, alpha=1e-08): """ forward pass of the module :param x: input activations volume ...
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 as th import torch.nn.parallel import torch.utils.data assert_size...
AshwinRJ/Face-Generation-from-Speech
PixelwiseNorm
false
16,965
[ "MIT" ]
4
6d8afe8a61185bfe67cd5fd19c7f993630f481b4
https://github.com/AshwinRJ/Face-Generation-from-Speech/tree/6d8afe8a61185bfe67cd5fd19c7f993630f481b4
import torch import torch as th import torch.nn.parallel import torch.utils.data class Model(th.nn.Module): def __init__(self): super().__init__() def forward(self, x, alpha=1e-08): """ forward pass of the module :param x: input activations volume :param alpha: small ...
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 as nn class ScaledDotProductAttention(nn.Module): """Scaled dot-product attention mechanism.""" def __init__(self, temperature, attention_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attention_dropout) s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
AutuanLiu/PyTorch-ML
ScaledDotProductAttention
false
16,966
[ "MIT" ]
9
884c7723843d9ffb4da09d95eb97886b2cc38f28
https://github.com/AutuanLiu/PyTorch-ML/tree/884c7723843d9ffb4da09d95eb97886b2cc38f28
import torch import torch.nn as nn class Model(nn.Module): """Scaled dot-product attention mechanism.""" def __init__(self, temperature, attention_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attention_dropout) self.softmax = nn.Sof...
ResidualNetworkSegment
# 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 ResidualNetworkSegment(nn.Module): """Modified ResidualNetworkSegment model class""" def __init__(self, block, num_blocks, width, depth): super(ResidualNetworkSegment, self).__init__() assert (depth - 4 ) % 4...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
Arjung27/DeepThinking
ResidualNetworkSegment
false
16,967
[ "MIT" ]
6
13a2ce534bcb0b9379a22fffef52d975d650adb2
https://github.com/Arjung27/DeepThinking/tree/13a2ce534bcb0b9379a22fffef52d975d650adb2
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Modified ResidualNetworkSegment model class""" def __init__(self, block, num_blocks, width, depth): super().__init__() assert (depth - 4 ) % 4 == 0, 'Depth not compatible with recurrent a...
ProductFusion
# 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 ProductFusion(nn.Module): def __init__(self): super(ProductFusion, self).__init__() def forward(self, seq_features, img_features, **kwargs): return seq_features * img_features def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
Asichurter/MalFusionFSL
ProductFusion
false
16,969
[ "MIT" ]
4
713bf64cc07a3489f42941fd2299837075575ac0
https://github.com/Asichurter/MalFusionFSL/tree/713bf64cc07a3489f42941fd2299837075575ac0
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, seq_features, img_features, **kwargs): return seq_features * img_features def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inpu...
SpatialPurity
# 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.backends.cudnn import torch.utils import torch.distributed class SpatialPurity(nn.Module): def __init__(self, in_channels=19, padding_mode='zeros', size=3): super(SpatialPurity, self).__init__() assert size % 2 == 1, 'error size' self.conv =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
BIT-DA/RIPU
SpatialPurity
false
16,970
[ "MIT" ]
9
125edf112c9ded1e7497aedb2a092331824df100
https://github.com/BIT-DA/RIPU/tree/125edf112c9ded1e7497aedb2a092331824df100
import torch import torch.nn as nn import torch.backends.cudnn import torch.utils import torch.distributed class Model(nn.Module): def __init__(self, in_channels=19, padding_mode='zeros', size=3): super().__init__() assert size % 2 == 1, 'error size' self.conv = nn.Conv2d(in_channels=in_c...
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 F class Net(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 1, 1) self.conv2 = nn.Conv2d(1, 1, 1) def forward(self, x): return self.conv2(F.relu(self.conv1(x))) def get_inputs(): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
AutuanLiu/PyTorch-ML
Net
false
16,971
[ "MIT" ]
9
884c7723843d9ffb4da09d95eb97886b2cc38f28
https://github.com/AutuanLiu/PyTorch-ML/tree/884c7723843d9ffb4da09d95eb97886b2cc38f28
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 1, 1) self.conv2 = nn.Conv2d(1, 1, 1) def forward(self, x): return self.conv2(F.relu(self.conv1(x))) def get_inputs():...
ResidualFeedFowardBlock
# 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 ResidualFeedFowardBlock(torch.nn.Module): """Block of two feed-forward layer with a reisdual connection: f(W1^T x + b1) f(W2^T h1 + b2 ) h2 + x x ------------------> h1 --------------------> h2 ----------> y | ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride ...
BUTSpeechFIT/beer
ResidualFeedFowardBlock
false
16,972
[ "MIT" ]
6
43fb9027a859db28d2f2f8709260ca2ce9501e25
https://github.com/BUTSpeechFIT/beer/tree/43fb9027a859db28d2f2f8709260ca2ce9501e25
import torch class Model(torch.nn.Module): """Block of two feed-forward layer with a reisdual connection: f(W1^T x + b1) f(W2^T h1 + b2 ) h2 + x x ------------------> h1 --------------------> h2 ----------> y | ^ ...
VAE
# 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 VAE(nn.Module): """VAE 定义""" def __init__(self): super(VAE, self).__init__() self.fc1 = nn.Linear(784, 400) self.fc21 = nn.Linear(400, 20) self.fc22 = nn.Linear(400, 20) self.fc3 = nn.Linear(20, 4...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
AutuanLiu/PyTorch-ML
VAE
false
16,973
[ "MIT" ]
9
884c7723843d9ffb4da09d95eb97886b2cc38f28
https://github.com/AutuanLiu/PyTorch-ML/tree/884c7723843d9ffb4da09d95eb97886b2cc38f28
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """VAE 定义""" def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 400) self.fc21 = nn.Linear(400, 20) self.fc22 = nn.Linear(400, 20) self.fc3 = nn.Linear(20, 400) ...
NormalIsotropicCovarianceLayer
# 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 abc import math import torch class ProbabilisticLayer(torch.nn.Module, metaclass=abc.ABCMeta): """Probabilistic layer to be used by the encoder/decoder of a Variational AutoEncoder. """ @abc.abstractmethod def forward(self, inputs): """Compute the parameters of the distribution co...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
BUTSpeechFIT/beer
NormalIsotropicCovarianceLayer
false
16,974
[ "MIT" ]
6
43fb9027a859db28d2f2f8709260ca2ce9501e25
https://github.com/BUTSpeechFIT/beer/tree/43fb9027a859db28d2f2f8709260ca2ce9501e25
import abc import math import torch class ProbabilisticLayer(torch.nn.Module, metaclass=abc.ABCMeta): """Probabilistic layer to be used by the encoder/decoder of a Variational AutoEncoder. """ @abc.abstractmethod def forward(self, inputs): """Compute the parameters of the distribution co...