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
Encoder_attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class Encoder_attention(nn.Module): def __init__(self, n_h): super(Encoder_attention, self).__init__() self.linear = nn.Linear(n_h, 1) self.softmax = nn.Softmax(dim=1) def forward(self, x): """Output: X """ x1 = self.linear(x).squeez...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
CrowdDynamicsLab/InfoMotif
Encoder_attention
false
17,177
[ "BSD-3-Clause" ]
7
cca1ffa14cc94408a5c4c50b7b1707c608e3bc9b
https://github.com/CrowdDynamicsLab/InfoMotif/tree/cca1ffa14cc94408a5c4c50b7b1707c608e3bc9b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, n_h): super().__init__() self.linear = nn.Linear(n_h, 1) self.softmax = nn.Softmax(dim=1) def forward(self, x): """Output: X """ x1 = self.linear(x).squeeze() weights = self.softmax(...
DQN_xy3
# 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 import torch.utils.data class DQN_xy3(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation """ def __init__(self): super(DQN_xy3, self).__init__() self.fc1 = nn.Linear(4, 10) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
CoAxLab/azad
DQN_xy3
false
17,178
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation """ def __init__(self): super().__init__() self.fc1 = nn.Linear(4, 10) self.fc2 = ...
BPR
# 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 BPR(torch.nn.Module): def __init__(self): super(BPR, self).__init__() self._sigmoid = torch.nn.Sigmoid() def forward(self, pos, neg): loss = torch.log(self._sigmoid(pos.double() - neg.double())) return -loss.mean() def get_inputs(): return [torch.rand...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._...
DanielMorales9/FactorizationPyTorch
BPR
false
17,179
[ "MIT" ]
4
50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
https://github.com/DanielMorales9/FactorizationPyTorch/tree/50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() self._sigmoid = torch.nn.Sigmoid() def forward(self, pos, neg): loss = torch.log(self._sigmoid(pos.double() - neg.double())) return -loss.mean() def get_inputs(): return [torch.rand([4, 4,...
UpsampleConvLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.nn.functional as f import torch.nn.parallel class UpsampleConvLayer(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, activation='relu', norm=None): super(UpsampleConvLayer, self).__init__() bias = Fa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
DA4EVENT/home
UpsampleConvLayer
false
17,180
[ "MIT" ]
5
18cc93a795ce132e05b886aa34565a102915b1c6
https://github.com/DA4EVENT/home/tree/18cc93a795ce132e05b886aa34565a102915b1c6
import torch from torch import nn import torch.nn.functional as f import torch.nn.parallel class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, activation='relu', norm=None): super().__init__() bias = False if norm == 'BN' else True ...
DeepTable3
# 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 import torch.utils.data class DeepTable3(nn.Module): """A deep differentialable 'Table' for learning one-hot input and output. """ def __init__(self, in_channels, out_channels, num_hidden1=200, num_hidden2=100): super(Deep...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
CoAxLab/azad
DeepTable3
false
17,181
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): """A deep differentialable 'Table' for learning one-hot input and output. """ def __init__(self, in_channels, out_channels, num_hidden1=200, num_hidden2=100): super().__init_...
BinaryPrimitivesSomethingElse
# 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 def apply_last_dim(model, x): size = list(x.size()) y = model(x.contiguous().view(-1, size[-1])) size[-1] = y.size(-1) y = y.view(torch.Size(size)) return y def get_int_dim_index(name): if isinstance(name, int): return name name_list ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math from torch import nn assert_size_stride = torch._C._dynamo.guards.a...
C-SUNSHINE/TOQ-Nets-PyTorch-Release
BinaryPrimitivesSomethingElse
false
17,182
[ "MIT" ]
6
05e06bf633fb3c6b610dda9a5126ecd7af1db02f
https://github.com/C-SUNSHINE/TOQ-Nets-PyTorch-Release/tree/05e06bf633fb3c6b610dda9a5126ecd7af1db02f
import math import torch from torch import nn def apply_last_dim(model, x): size = list(x.size()) y = model(x.contiguous().view(-1, size[-1])) size[-1] = y.size(-1) y = y.view(torch.Size(size)) return y def get_int_dim_index(name): if isinstance(name, int): return name name_list ...
DQN_xy2
# 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 import torch.utils.data class DQN_xy2(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation """ def __init__(self): super(DQN_xy2, self).__init__() self.fc1 = nn.Linear(4, 100) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
CoAxLab/azad
DQN_xy2
false
17,183
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation """ def __init__(self): super().__init__() self.fc1 = nn.Linear(4, 100) self.fc2 =...
MMDLoss
# 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 import torch.nn.parallel def gaussian_kernel(source, target, kernel_mul=2.0, kernel_num=5, fix_sigma =None): n_samples = int(source.size()[0]) + int(target.size()[0]) total = torch.cat([source, target], dim=0) total0 = total.unsqueeze(0).expand(int(total.size(0)), int...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn import torch.nn.parallel assert_size_stride = torch....
DA4EVENT/home
MMDLoss
false
17,184
[ "MIT" ]
5
18cc93a795ce132e05b886aa34565a102915b1c6
https://github.com/DA4EVENT/home/tree/18cc93a795ce132e05b886aa34565a102915b1c6
import torch from torch import nn import torch.nn.parallel def gaussian_kernel(source, target, kernel_mul=2.0, kernel_num=5, fix_sigma =None): n_samples = int(source.size()[0]) + int(target.size()[0]) total = torch.cat([source, target], dim=0) total0 = total.unsqueeze(0).expand(int(total.size(0)), int...
TransposedConvLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.nn.parallel class TransposedConvLayer(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, activation='relu', norm=None): super(TransposedConvLayer, self).__init__() bias = False if norm == 'BN' else Tru...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
DA4EVENT/home
TransposedConvLayer
false
17,185
[ "MIT" ]
5
18cc93a795ce132e05b886aa34565a102915b1c6
https://github.com/DA4EVENT/home/tree/18cc93a795ce132e05b886aa34565a102915b1c6
import torch from torch import nn import torch.nn.parallel class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, activation='relu', norm=None): super().__init__() bias = False if norm == 'BN' else True self.transposed_conv2d = nn.C...
ConvLayer
# 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.parallel class ConvLayer(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, activation='relu', norm=None): super(ConvLayer, self).__init__() bias = False if norm == 'BN' else True self.conv2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
DA4EVENT/home
ConvLayer
false
17,186
[ "MIT" ]
5
18cc93a795ce132e05b886aa34565a102915b1c6
https://github.com/DA4EVENT/home/tree/18cc93a795ce132e05b886aa34565a102915b1c6
import torch from torch import nn import torch.nn.parallel class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, activation='relu', norm=None): super().__init__() bias = False if norm == 'BN' else True self.conv2d = nn.Conv2d(in_ch...
DQN_xy4
# 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 import torch.utils.data class DQN_xy4(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation """ def __init__(self): super(DQN_xy4, self).__init__() self.fc1 = nn.Linear(4, 100) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
CoAxLab/azad
DQN_xy4
false
17,187
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation """ def __init__(self): super().__init__() self.fc1 = nn.Linear(4, 100) self.fc2 =...
DQN_hot5
# 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 import torch.utils.data class DQN_hot5(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation Params ------ m, n: int Board size num_actions: int Number of action-valu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
CoAxLab/azad
DQN_hot5
false
17,188
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation Params ------ m, n: int Board size num_actions: int Number of action-value t...
DQN_xy5
# 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 import torch.utils.data class DQN_xy5(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation Params ------ m, n: int Board size num_actions: int Number of action-value...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
CoAxLab/azad
DQN_xy5
false
17,189
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): """ A MLP for DQN learning. Note: Uses a one hot board representation Params ------ m, n: int Board size num_actions: int Number of action-value t...
DQN_xy1
# 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 import torch.utils.data class DQN_xy1(nn.Module): """ A MLP for DQN learning. Note: Uses a (x,y) coordinate board/action representation. """ def __init__(self): super(DQN_xy1, self).__init__() self.fc1 = nn....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
CoAxLab/azad
DQN_xy1
false
17,190
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): """ A MLP for DQN learning. Note: Uses a (x,y) coordinate board/action representation. """ def __init__(self): super().__init__() self.fc1 = nn.Linear(4, 15) ...
down
# 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 functional as F import torch.nn.parallel class down(nn.Module): """ A class for creating neural network blocks containing layers: Average Pooling --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class to create a...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.nn.parallel assert_size_stride = torch._C._dyn...
DA4EVENT/home
down
false
17,191
[ "MIT" ]
5
18cc93a795ce132e05b886aa34565a102915b1c6
https://github.com/DA4EVENT/home/tree/18cc93a795ce132e05b886aa34565a102915b1c6
import torch from torch import nn from torch.nn import functional as F import torch.nn.parallel class Model(nn.Module): """ A class for creating neural network blocks containing layers: Average Pooling --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class to create ...
MaskUpdate
# 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.parameter import Parameter class MaskUpdate(nn.Module): def __init__(self, alpha): super(MaskUpdate, self).__init__() self.updateFunc = nn.ReLU(False) self.alpha = Parameter(torch.tensor(alpha, dtype=torch.float32)) def forward(self, 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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
DLwbm123/LBAM_inpainting
MaskUpdate
false
17,192
[ "MIT" ]
7
c809c3cedf09cda7c175e930c7834ac39d8f526f
https://github.com/DLwbm123/LBAM_inpainting/tree/c809c3cedf09cda7c175e930c7834ac39d8f526f
import torch from torch import nn from torch.nn.parameter import Parameter class Model(nn.Module): def __init__(self, alpha): super().__init__() self.updateFunc = nn.ReLU(False) self.alpha = Parameter(torch.tensor(alpha, dtype=torch.float32)) def forward(self, inputMaskMap): ...
ResidualBlock
# 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.parallel class ResidualBlock(nn.Module): def __init__(self, in_channels, out_channels, stride=1, downsample=None, norm=None): super(ResidualBlock, self).__init__() bias = False if norm == 'BN' else True self.conv1 = nn.Conv2d(in_ch...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
DA4EVENT/home
ResidualBlock
false
17,193
[ "MIT" ]
5
18cc93a795ce132e05b886aa34565a102915b1c6
https://github.com/DA4EVENT/home/tree/18cc93a795ce132e05b886aa34565a102915b1c6
import torch from torch import nn import torch.nn.parallel class Model(nn.Module): def __init__(self, in_channels, out_channels, stride=1, downsample=None, norm=None): super().__init__() bias = False if norm == 'BN' else True self.conv1 = nn.Conv2d(in_channels, out_channels, kerne...
DQN_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.functional as F import torch.nn as nn import torch.utils.data class DQN_mlp(nn.Module): """Layers for a Deep Q Network, based on a simple MLP.""" def __init__(self, m, n, num_actions, num_hidden1=1000, num_hidden2=2000): super(DQN_mlp, self).__init__() self.m = m ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
CoAxLab/azad
DQN_mlp
false
17,194
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): """Layers for a Deep Q Network, based on a simple MLP.""" def __init__(self, m, n, num_actions, num_hidden1=1000, num_hidden2=2000): super().__init__() self.m = m self.n ...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class Attention(nn.Module): def __init__(self, n_h): super(Attention, self).__init__() self.linear = nn.Linear(n_h * 2, 1) self.softmax = nn.Softmax(dim=2) def forward(self, x): curr_node = x[:, :, 0, :].unsqueeze(2).expand_as(x) sta...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
CrowdDynamicsLab/InfoMotif
Attention
false
17,195
[ "BSD-3-Clause" ]
7
cca1ffa14cc94408a5c4c50b7b1707c608e3bc9b
https://github.com/CrowdDynamicsLab/InfoMotif/tree/cca1ffa14cc94408a5c4c50b7b1707c608e3bc9b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, n_h): super().__init__() self.linear = nn.Linear(n_h * 2, 1) self.softmax = nn.Softmax(dim=2) def forward(self, x): curr_node = x[:, :, 0, :].unsqueeze(2).expand_as(x) stacked_x = torch.cat(...
MCDO
# 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 MCDO(nn.Module): def __init__(self, in_dim, out_dim, n_layers=1, hid_dim=50, p=0.05): super().__init__() self.n_layers = n_layers self.linear_in = nn.Linear(in_dim, hid_dim) nn.init.normal_(self.linear_in.weight, std=1 / (4 * hid_dim) ** 0.5...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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...
Daniil-Selikhanovych/bnn-vi
MCDO
false
17,196
[ "MIT" ]
3
6788edc1438c66609abca249e33a81da7a0ff1a2
https://github.com/Daniil-Selikhanovych/bnn-vi/tree/6788edc1438c66609abca249e33a81da7a0ff1a2
import torch from torch import nn class Model(nn.Module): def __init__(self, in_dim, out_dim, n_layers=1, hid_dim=50, p=0.05): super().__init__() self.n_layers = n_layers self.linear_in = nn.Linear(in_dim, hid_dim) nn.init.normal_(self.linear_in.weight, std=1 / (4 * hid_dim) ** 0....
GaussActivation
# 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.parameter import Parameter class GaussActivation(nn.Module): def __init__(self, a, mu, sigma1, sigma2): super(GaussActivation, self).__init__() self.a = Parameter(torch.tensor(a, dtype=torch.float32)) self.mu = Parameter(torch.tensor(mu, dty...
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 f...
DLwbm123/LBAM_inpainting
GaussActivation
false
17,197
[ "MIT" ]
7
c809c3cedf09cda7c175e930c7834ac39d8f526f
https://github.com/DLwbm123/LBAM_inpainting/tree/c809c3cedf09cda7c175e930c7834ac39d8f526f
import torch from torch import nn from torch.nn.parameter import Parameter class Model(nn.Module): def __init__(self, a, mu, sigma1, sigma2): super().__init__() self.a = Parameter(torch.tensor(a, dtype=torch.float32)) self.mu = Parameter(torch.tensor(mu, dtype=torch.float32)) self...
FactorizationMachine
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch import FloatTensor from torch.nn import Parameter class SecondOrderInteraction(Module): """ Factorized parameters for the Second Order Interactions Parameters ---------- n_features: int Length of the input vector. n_factors: int, opt...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module from torch import FloatTensor from torch.nn import P...
DanielMorales9/FactorizationPyTorch
FactorizationMachine
false
17,198
[ "MIT" ]
4
50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
https://github.com/DanielMorales9/FactorizationPyTorch/tree/50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
from torch.nn import Module import torch from torch import FloatTensor from torch.nn import Parameter class SecondOrderInteraction(Module): """ Factorized parameters for the Second Order Interactions Parameters ---------- n_features: int Length of the input vector. n_factors: int, opt...
GEGLU
# 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 GEGLU(nn.Module): def forward(self, x): x, gate = x.chunk(2, dim=-1) return F.gelu(gate) * x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
DannielSilva/MMBERT
GEGLU
false
17,199
[ "MIT" ]
4
2c9069b59b66b8f3fec6de2e68ec42b489a3a437
https://github.com/DannielSilva/MMBERT/tree/2c9069b59b66b8f3fec6de2e68ec42b489a3a437
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def forward(self, x): x, gate = x.chunk(2, dim=-1) return F.gelu(gate) * x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SecondOrderInteraction
# 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 import Parameter class SecondOrderInteraction(Module): """ Factorized parameters for the Second Order Interactions Parameters ---------- n_features: int Length of the input vector. n_factors: int, optional Number of factor...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module from torch.nn import Parameter assert_size_stride = ...
DanielMorales9/FactorizationPyTorch
SecondOrderInteraction
false
17,200
[ "MIT" ]
4
50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
https://github.com/DanielMorales9/FactorizationPyTorch/tree/50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
from torch.nn import Module import torch from torch.nn import Parameter class Model(Module): """ Factorized parameters for the Second Order Interactions Parameters ---------- n_features: int Length of the input vector. n_factors: int, optional Number of factors of the factoriz...
GatedConv2d
# 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.data class GatedConv2d(nn.Module): def __init__(self, input_channels, output_channels, kernel_size, stride, padding, dilation=1, activation=None): super(GatedConv2d, self).__init__() self.activation = activation self.sigmoid = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dyn...
Daulbaev/IRDM
GatedConv2d
false
17,201
[ "MIT" ]
10
4bb60191ac0072e4349ca47092675d06b39a979a
https://github.com/Daulbaev/IRDM/tree/4bb60191ac0072e4349ca47092675d06b39a979a
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, input_channels, output_channels, kernel_size, stride, padding, dilation=1, activation=None): super().__init__() self.activation = activation self.sigmoid = nn.Sigmoid() se...
SERF
# 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 SERF(nn.Module): def __init__(self, thresh=50): super().__init__() self.thresh = thresh None def forward(self, x): return self.serf_log1pexp(x) def serf(self, x): return x * torch.erf(torch.log(1 + torch.exp(x))) def ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
DannielSilva/MMBERT
SERF
false
17,202
[ "MIT" ]
4
2c9069b59b66b8f3fec6de2e68ec42b489a3a437
https://github.com/DannielSilva/MMBERT/tree/2c9069b59b66b8f3fec6de2e68ec42b489a3a437
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, thresh=50): super().__init__() self.thresh = thresh None def forward(self, x): return self.serf_log1pexp(x) def serf(self, x): return x * torch.erf(torch.log(1 + torch.exp(x))) def...
BCEWithLogitsWithClassWeightLoss
# 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 Tensor from typing import NoReturn from torch import nn class BCEWithLogitsWithClassWeightLoss(nn.BCEWithLogitsLoss): """ finished, checked, """ __name__ = 'BCEWithLogitsWithClassWeightsLoss' def __init__(self, class_weight: 'Tensor') ->NoReturn: """ finished, c...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
DeepPSP/torch_ecg
BCEWithLogitsWithClassWeightLoss
false
17,203
[ "MIT" ]
9
6db5ffb063d0e8fb4ce97029a0d184a658f43a37
https://github.com/DeepPSP/torch_ecg/tree/6db5ffb063d0e8fb4ce97029a0d184a658f43a37
import torch from torch import Tensor from typing import NoReturn from torch import nn class Model(nn.BCEWithLogitsLoss): """ finished, checked, """ __name__ = 'BCEWithLogitsWithClassWeightsLoss' def __init__(self, class_weight: 'Tensor') ->NoReturn: """ finished, checked, Parameters...
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.functional as F import torch.nn as nn import torch.utils.data def create_all_possible_moves(m, n): """Create all moves on a (m,n) board.""" moves = [] for i in range(m): for j in range(n): moves.append((i, j)) return list(set(moves)) class MLP(nn.Modu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
CoAxLab/azad
MLP
false
17,204
[ "MIT" ]
6
d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data def create_all_possible_moves(m, n): """Create all moves on a (m,n) board.""" moves = [] for i in range(m): for j in range(n): moves.append((i, j)) return list(set(moves)) class Model(nn.Mo...
PatchEmbedding
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class PatchEmbedding(nn.Module): def __init__(self, image_size, patch_size, embed_dim, channels): super().__init__() self.image_size = image_size if image_size[0] % patch_size != 0 or image_size[1] % patch_size != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Curli-quan/fewshot-select
PatchEmbedding
false
17,205
[ "Apache-2.0" ]
7
34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe
https://github.com/Curli-quan/fewshot-select/tree/34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, image_size, patch_size, embed_dim, channels): super().__init__() self.image_size = image_size if image_size[0] % patch_size != 0 or image_size[1] % patch_size != 0: raise ValueError( ...
h_swish
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class h_swish(nn.Module): def __init__(self, inplace=True): super(h_swish, self).__init__() self.inplace = inplace def forward(self, x): out = F.relu6(x + 3.0, inplace=self.inplace) / 6.0 return out * x def ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
DandelionLau/NetworkCollections
h_swish
false
17,206
[ "Apache-2.0" ]
8
29e5cd2091f7085b3241209ed9447f2baadbce41
https://github.com/DandelionLau/NetworkCollections/tree/29e5cd2091f7085b3241209ed9447f2baadbce41
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, inplace=True): super().__init__() self.inplace = inplace def forward(self, x): out = F.relu6(x + 3.0, inplace=self.inplace) / 6.0 return out * x def get_inputs(): ...
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.functional as F from torch import nn class Net1(nn.Module): def __init__(self): super(Net1, self).__init__() self.conv1 = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=0) self.pool1 = nn.MaxPool2d(kernel_size=3, stride=2) self.conv2 = nn.Conv2d(64,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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...
DPBayes/DP-cross-silo-federated-learning
Net1
false
17,207
[ "Apache-2.0" ]
8
6707db703de5fae48c06116ae8ceee0685c9615d
https://github.com/DPBayes/DP-cross-silo-federated-learning/tree/6707db703de5fae48c06116ae8ceee0685c9615d
import torch import torch.nn.functional as F from torch import nn class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=0) self.pool1 = nn.MaxPool2d(kernel_size=3, stride=2) self.conv2 = nn.Conv2d(64, 64, kern...
Upsample
# 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 import torch.utils.data.distributed import torch._utils class Upsample(nn.Module): def __init__(self, stride=2): super(Upsample, self).__init__() self.stride = stride def forward(self, x): stride = self.stride assert ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch._utils assert_size_stride = torch._C._dynamo....
DatatangAILAB/SuanFaShiXun04
Upsample
false
17,209
[ "Apache-2.0" ]
5
f478e40dd84240ac71cbb54e6bacf9ff556fbb3e
https://github.com/DatatangAILAB/SuanFaShiXun04/tree/f478e40dd84240ac71cbb54e6bacf9ff556fbb3e
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch._utils class Model(nn.Module): def __init__(self, stride=2): super().__init__() self.stride = stride def forward(self, x): stride = self.stride assert x.data.dim() == 4...
PatchEmbed
# 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 PatchEmbed(nn.Module): """ Image to Patch Embedding """ def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768): super().__init__() num_patches = img_size // patch_size * (img_size // patch_size) self.img_size = img_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.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Curli-quan/fewshot-select
PatchEmbed
false
17,210
[ "Apache-2.0" ]
7
34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe
https://github.com/Curli-quan/fewshot-select/tree/34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe
import torch import torch.nn as nn class Model(nn.Module): """ Image to Patch Embedding """ def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768): super().__init__() num_patches = img_size // patch_size * (img_size // patch_size) self.img_size = img_size ...
ExtResNetBlock
# 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.nn import functional as F import torch.nn as nn def padding(im, patch_size, fill_value=0): H, W = im.size(2), im.size(3) pad_h, pad_w = 0, 0 if H % patch_size > 0: pad_h = patch_size - H % patch_size if W % patch_size > 0: pad_w = patch_size - W % patch_size ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn impor...
Curli-quan/fewshot-select
ExtResNetBlock
false
17,211
[ "Apache-2.0" ]
7
34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe
https://github.com/Curli-quan/fewshot-select/tree/34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe
import torch from torch.nn import functional as F import torch.nn as nn def padding(im, patch_size, fill_value=0): H, W = im.size(2), im.size(3) pad_h, pad_w = 0, 0 if H % patch_size > 0: pad_h = patch_size - H % patch_size if W % patch_size > 0: pad_w = patch_size - W % patch_size ...
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 class HardSwish(nn.Module): def __init__(self, inplace=False): super(HardSwish, self).__init__() self.act = nn.ReLU6(inplace) """forward""" def forward(self, x): return x * self.act(x + 3) / 6 def get_inputs(): return [torch.rand([4, 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._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
DetectionBLWX/WSDDN.pytorch
HardSwish
false
17,212
[ "MIT" ]
7
05020d9d0445af90ba0af3f095aa12b18e3da7d2
https://github.com/DetectionBLWX/WSDDN.pytorch/tree/05020d9d0445af90ba0af3f095aa12b18e3da7d2
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, inplace=False): super().__init__() self.act = nn.ReLU6(inplace) """forward""" def forward(self, x): return x * self.act(x + 3) / 6 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_ini...
ReverseMaskConv
# 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.parameter import Parameter def weights_init(init_type='gaussian'): def init_fun(m): classname = m.__class__.__name__ if (classname.find('Conv') == 0 or classname.find('Linear') == 0 ) and hasattr(m, 'weight'): if ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
DLwbm123/LBAM_inpainting
ReverseMaskConv
false
17,213
[ "MIT" ]
7
c809c3cedf09cda7c175e930c7834ac39d8f526f
https://github.com/DLwbm123/LBAM_inpainting/tree/c809c3cedf09cda7c175e930c7834ac39d8f526f
import math import torch from torch import nn from torch.nn.parameter import Parameter def weights_init(init_type='gaussian'): def init_fun(m): classname = m.__class__.__name__ if (classname.find('Conv') == 0 or classname.find('Linear') == 0 ) and hasattr(m, 'weight'): if ...
ReOrgLayer
# 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 import torch.utils.data.distributed import torch._utils class ReOrgLayer(nn.Module): def __init__(self, stride=2): super(ReOrgLayer, self).__init__() self.stride = stride def forward(self, x): assert x.data.dim() == 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 import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch._utils assert_size_stride = torch._C._dynamo....
DatatangAILAB/SuanFaShiXun04
ReOrgLayer
false
17,214
[ "Apache-2.0" ]
5
f478e40dd84240ac71cbb54e6bacf9ff556fbb3e
https://github.com/DatatangAILAB/SuanFaShiXun04/tree/f478e40dd84240ac71cbb54e6bacf9ff556fbb3e
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch._utils class Model(nn.Module): def __init__(self, stride=2): super().__init__() self.stride = stride def forward(self, x): assert x.data.dim() == 4 B, C, H, W = x.data....
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.functional as F import torch.nn as nn class Net(nn.Module): def __init__(self, x_d, w_d, out_d, hidden_d1=256, hidden_d2=512, hidden_d3=256, is_discrete_input=False, is_discrete_output=False, embedding_dim=None): super().__init__() self._x_d = x_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 import torch.nn as nn assert_...
DataCanvasIO/YLearn
Net
false
17,215
[ "Apache-2.0" ]
3
d65b5afb83deed154c710de9096317165d95014a
https://github.com/DataCanvasIO/YLearn/tree/d65b5afb83deed154c710de9096317165d95014a
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, x_d, w_d, out_d, hidden_d1=256, hidden_d2=512, hidden_d3=256, is_discrete_input=False, is_discrete_output=False, embedding_dim=None): super().__init__() self._x_d = x_d ...
HardSigmoid
# 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 HardSigmoid(nn.Module): def __init__(self, bias=1.0, divisor=2.0, min_value=0.0, max_value=1.0): super(HardSigmoid, self).__init__() assert divisor != 0, 'divisor is not allowed to be equal to zero' self.bias = bias self.divisor = divisor ...
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...
DetectionBLWX/WSDDN.pytorch
HardSigmoid
false
17,216
[ "MIT" ]
7
05020d9d0445af90ba0af3f095aa12b18e3da7d2
https://github.com/DetectionBLWX/WSDDN.pytorch/tree/05020d9d0445af90ba0af3f095aa12b18e3da7d2
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, bias=1.0, divisor=2.0, min_value=0.0, max_value=1.0): super().__init__() assert divisor != 0, 'divisor is not allowed to be equal to zero' self.bias = bias self.divisor = divisor self.min_value =...
MaxPoolStride1
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.functional as F import torch._utils class MaxPoolStride1(nn.Module): def __init__(self, kernel_size): super(MaxPoolStride1, self).__init__() self.kernel_size = kernel_size self.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 import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import ...
DatatangAILAB/SuanFaShiXun04
MaxPoolStride1
false
17,217
[ "Apache-2.0" ]
5
f478e40dd84240ac71cbb54e6bacf9ff556fbb3e
https://github.com/DatatangAILAB/SuanFaShiXun04/tree/f478e40dd84240ac71cbb54e6bacf9ff556fbb3e
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.functional as F import torch._utils class Model(nn.Module): def __init__(self, kernel_size): super().__init__() self.kernel_size = kernel_size self.pad = kernel_size - 1 def...
SamePadConv2d
# 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 SamePadConv2d(nn.Conv2d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, dilation=1, groups=1, bias=True): super(SamePadConv2d, self).__init__(in_channels, out_channels, kernel_size, stride,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
DandelionLau/NetworkCollections
SamePadConv2d
false
17,218
[ "Apache-2.0" ]
8
29e5cd2091f7085b3241209ed9447f2baadbce41
https://github.com/DandelionLau/NetworkCollections/tree/29e5cd2091f7085b3241209ed9447f2baadbce41
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Conv2d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, dilation=1, groups=1, bias=True): super().__init__(in_channels, out_channels, kernel_size, stride, 0, dilation, groups, bias)...
NormedLinear
# 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 import torch.nn as nn import torch.nn.functional as F from torch.nn import Parameter class NormedLinear(nn.Module): def __init__(self, in_features, out_features): super(NormedLinear, self).__init__() self.weight = Parameter(torch.Tensor(in_feature...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Data-Designer/Feature-Space-Augmentation-for-Long-Tailed-Data
NormedLinear
false
17,219
[ "MIT" ]
9
ac6bced6269d6ebaa3fc0935603d905a7f11a6fa
https://github.com/Data-Designer/Feature-Space-Augmentation-for-Long-Tailed-Data/tree/ac6bced6269d6ebaa3fc0935603d905a7f11a6fa
import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Parameter class Model(nn.Module): def __init__(self, in_features, out_features): super().__init__() self.weight = Parameter(torch.Tensor(in_features, out_features)) ...
L
# 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 def drop_none(**kwargs): r = {k: v for k, v in kwargs.items() if v is not None} return r class L(nn.Module): def __init__(self, num_linear, input_features, output_features, dtype= None, device=None): super().__init__() options = dro...
import torch from torch._inductor.select_algorithm import extern_kernels import 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.a...
DataCanvasIO/YLearn
L
false
17,220
[ "Apache-2.0" ]
3
d65b5afb83deed154c710de9096317165d95014a
https://github.com/DataCanvasIO/YLearn/tree/d65b5afb83deed154c710de9096317165d95014a
import math import torch import torch.nn as nn def drop_none(**kwargs): r = {k: v for k, v in kwargs.items() if v is not None} return r class Model(nn.Module): def __init__(self, num_linear, input_features, output_features, dtype= None, device=None): super().__init__() options =...
Downsample
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class Downsample(nn.Module): def __init__(self, dim): super().__init__() self.conv = nn.Conv2d(dim, dim, 3, 2, 1) def forward(self, x): return self.conv(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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...
DavidRuhe/simple-variational-diffusion-models
Downsample
false
17,221
[ "MIT" ]
4
a32355bf052a8f08e9c1919080588d0b22c8de4e
https://github.com/DavidRuhe/simple-variational-diffusion-models/tree/a32355bf052a8f08e9c1919080588d0b22c8de4e
import torch from torch import nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.conv = nn.Conv2d(dim, dim, 3, 2, 1) def forward(self, x): return self.conv(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [4]
Upsample
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class Upsample(nn.Module): def __init__(self, dim): super().__init__() self.conv = nn.ConvTranspose2d(dim, dim, 4, 2, 1) def forward(self, x): return self.conv(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
DavidRuhe/simple-variational-diffusion-models
Upsample
false
17,222
[ "MIT" ]
4
a32355bf052a8f08e9c1919080588d0b22c8de4e
https://github.com/DavidRuhe/simple-variational-diffusion-models/tree/a32355bf052a8f08e9c1919080588d0b22c8de4e
import torch from torch import nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.conv = nn.ConvTranspose2d(dim, dim, 4, 2, 1) def forward(self, x): return self.conv(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): ret...
SqueezeExcitate
# 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 SqueezeExcitate(nn.Module): def __init__(self, in_channels, se_size, activation=None): super(SqueezeExcitate, self).__init__() self.dim_reduce = nn.Conv2d(in_channels=in_channels, out_channels= se_size, kernel_siz...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
Dogy06/COVID-Efficientnet-Pytorch-1
SqueezeExcitate
false
17,223
[ "MIT" ]
4
3c1f7d9513abe59783152efca28dc886bf4afc2f
https://github.com/Dogy06/COVID-Efficientnet-Pytorch-1/tree/3c1f7d9513abe59783152efca28dc886bf4afc2f
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_channels, se_size, activation=None): super().__init__() self.dim_reduce = nn.Conv2d(in_channels=in_channels, out_channels= se_size, kernel_size=1) self.dim_restore =...
LabelSmoothingCrossEntropyBCE
# 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 LabelSmoothingCrossEntropyBCE(nn.Module): def __init__(self, smoothing=0.1): super(LabelSmoothingCrossEntropyBCE, self).__init__() assert smoothing < 1.0 self.smoothing = smoothing self.confidence = 1.0 - smo...
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...
Diyago/Graph-clasification-by-computer-vision
LabelSmoothingCrossEntropyBCE
false
17,224
[ "Apache-2.0" ]
9
703c44b98f9875d7a7b6db1c2b96372e11e256d6
https://github.com/Diyago/Graph-clasification-by-computer-vision/tree/703c44b98f9875d7a7b6db1c2b96372e11e256d6
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, smoothing=0.1): super().__init__() assert smoothing < 1.0 self.smoothing = smoothing self.confidence = 1.0 - smoothing def forward(self, x, target): target = ...
PositiveLinear
# 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 PositiveLinear(nn.Module): def __init__(self, in_features: 'int', out_features: 'int') ->None: super().__init__() self.weight = nn.Parameter(torch.randn(in_features, out_features)) self.bias = nn.Parameter(torch.zeros(out_features)) self.sof...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math fr...
DavidRuhe/simple-variational-diffusion-models
PositiveLinear
false
17,225
[ "MIT" ]
4
a32355bf052a8f08e9c1919080588d0b22c8de4e
https://github.com/DavidRuhe/simple-variational-diffusion-models/tree/a32355bf052a8f08e9c1919080588d0b22c8de4e
import torch from torch import nn class Model(nn.Module): def __init__(self, in_features: 'int', out_features: 'int') ->None: super().__init__() self.weight = nn.Parameter(torch.randn(in_features, out_features)) self.bias = nn.Parameter(torch.zeros(out_features)) self.softplus = n...
Residual_Covolution
# 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 Residual_Covolution(nn.Module): def __init__(self, icol, ocol, num_classes): super(Residual_Covolution, self).__init__() self.conv1 = nn.Conv2d(icol, ocol, kernel_size=3, stride=1, padding =12, dilation=12, bias=True) self.conv2 = nn.Co...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Dayan-Guan/SVMin
Residual_Covolution
false
17,227
[ "MIT" ]
6
d72b21f65958b1fda0abdbb60bd78d01e9d9cc8f
https://github.com/Dayan-Guan/SVMin/tree/d72b21f65958b1fda0abdbb60bd78d01e9d9cc8f
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, icol, ocol, num_classes): super().__init__() self.conv1 = nn.Conv2d(icol, ocol, kernel_size=3, stride=1, padding =12, dilation=12, bias=True) self.conv2 = nn.Conv2d(ocol, num_classes, kernel_size=3, ...
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 class GroupNorm(nn.Module): def __init__(self, num_features, num_groups=32, eps=1e-05): super(GroupNorm, self).__init__() self.weight = nn.Parameter(torch.ones(1, num_features, 1, 1)) self.bias = nn.Parameter(torch.zeros(1, num_features, 1, 1)) s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
E-Dreamer-LQ/Astronomical_Target_Detection
GroupNorm
false
17,228
[ "MIT" ]
6
0c2d6c2e516ff1efa28d44582442123c3a03f079
https://github.com/E-Dreamer-LQ/Astronomical_Target_Detection/tree/0c2d6c2e516ff1efa28d44582442123c3a03f079
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_features, num_groups=32, eps=1e-05): super().__init__() self.weight = nn.Parameter(torch.ones(1, num_features, 1, 1)) self.bias = nn.Parameter(torch.zeros(1, num_features, 1, 1)) self.num_groups = nu...
FCUDown
# 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 functools import partial class FCUDown(nn.Module): """ CNN feature maps -> Transformer patch embeddings """ def __init__(self, inplanes, outplanes, dw_stride, act_layer=nn.GELU, norm_layer=partial(nn.LayerNorm, eps=1e-06)): super(FCUDown, self).__in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
Curli-quan/fewshot-select
FCUDown
false
17,229
[ "Apache-2.0" ]
7
34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe
https://github.com/Curli-quan/fewshot-select/tree/34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe
import torch import torch.nn as nn from functools import partial class Model(nn.Module): """ CNN feature maps -> Transformer patch embeddings """ def __init__(self, inplanes, outplanes, dw_stride, act_layer=nn.GELU, norm_layer=partial(nn.LayerNorm, eps=1e-06)): super().__init__() ...
LINEAR_LOGSOFTMAX
# 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 LINEAR_LOGSOFTMAX(nn.Module): def __init__(self, input_dim, nclass): super(LINEAR_LOGSOFTMAX, self).__init__() self.fc = nn.Linear(input_dim, nclass) self.logic = nn.LogSoftmax(dim=1) self.lossfunction = nn.NLLLoss() def forward(self, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Drkun/Lifelong-Zero-Shot-Learning
LINEAR_LOGSOFTMAX
false
17,231
[ "Apache-2.0" ]
9
5cea07c25e14aed1c544c83863f4733a8213ddb0
https://github.com/Drkun/Lifelong-Zero-Shot-Learning/tree/5cea07c25e14aed1c544c83863f4733a8213ddb0
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_dim, nclass): super().__init__() self.fc = nn.Linear(input_dim, nclass) self.logic = nn.LogSoftmax(dim=1) self.lossfunction = nn.NLLLoss() def forward(self, x): o = self.logic(self.fc(...
GroupBatchnorm2d
# 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 GroupBatchnorm2d(nn.Module): def __init__(self, c_num, group_num=16, eps=1e-10): super(GroupBatchnorm2d, self).__init__() self.group_num = group_num self.gamma = nn.Parameter(torch.ones(c_num, 1, 1)) self.beta = nn.Parameter(torch.zeros(c_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 assert_size_stride = torch._C._dynamo.guards.assert_size_...
E-Dreamer-LQ/Astronomical_Target_Detection
GroupBatchnorm2d
false
17,232
[ "MIT" ]
6
0c2d6c2e516ff1efa28d44582442123c3a03f079
https://github.com/E-Dreamer-LQ/Astronomical_Target_Detection/tree/0c2d6c2e516ff1efa28d44582442123c3a03f079
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, c_num, group_num=16, eps=1e-10): super().__init__() self.group_num = group_num self.gamma = nn.Parameter(torch.ones(c_num, 1, 1)) self.beta = nn.Parameter(torch.zeros(c_num, 1, 1)) self.eps = eps...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): """ Applies an attention mechanism on the output features from the decoder. .. math:: \\begin{array}{ll} x = context*output \\\\ attn = exp(x_i) / sum_j exp(x_j) \\\\ ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
EVASHINJI/Seq2Seq-PyTorch
Attention
false
17,233
[ "Apache-2.0" ]
4
d53f8d7c240bd7c16ebd1475384774bd064b4b03
https://github.com/EVASHINJI/Seq2Seq-PyTorch/tree/d53f8d7c240bd7c16ebd1475384774bd064b4b03
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Applies an attention mechanism on the output features from the decoder. .. math:: \\begin{array}{ll} x = context*output \\\\ attn = exp(x_i) / sum_j exp(x_j) \\\\ ...
InstanceNormalization
# 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 InstanceNormalization(torch.nn.Module): """InstanceNormalization Improves convergence of neural-style. ref: https://arxiv.org/pdf/1607.08022.pdf """ def __init__(self, dim, eps=1e-09): super(InstanceNormalization, self).__init__() self.scal...
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_...
E-Dreamer-LQ/Astronomical_Target_Detection
InstanceNormalization
false
17,234
[ "MIT" ]
6
0c2d6c2e516ff1efa28d44582442123c3a03f079
https://github.com/E-Dreamer-LQ/Astronomical_Target_Detection/tree/0c2d6c2e516ff1efa28d44582442123c3a03f079
import torch import torch.nn as nn class Model(torch.nn.Module): """InstanceNormalization Improves convergence of neural-style. ref: https://arxiv.org/pdf/1607.08022.pdf """ def __init__(self, dim, eps=1e-09): super().__init__() self.scale = nn.Parameter(torch.FloatTensor(dim)) ...
ConvLSTMCls
# 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 ConvLSTMCls(nn.Module): def __init__(self, in_channels, out_channels): """ Convolutional LSTM block for generation network Args: - in_channels: Int. Number of channels of the input of Conv2D - out_channels: Int. Number of channels ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
DveloperY0115/torch-gqn
ConvLSTMCls
false
17,235
[ "Apache-2.0" ]
3
3d1be9d73522e3d52f15076e0e9cb485dcab638b
https://github.com/DveloperY0115/torch-gqn/tree/3d1be9d73522e3d52f15076e0e9cb485dcab638b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channels, out_channels): """ Convolutional LSTM block for generation network Args: - in_channels: Int. Number of channels of the input of Conv2D - out_channels: Int. Number of channels of the...
FiLMSIREN
# 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 FiLMSIREN(nn.Module): def __init__(self, in_features: 'int', out_features: 'int', omega_0: 'float'=30.0, is_first: 'bool'=False, bias: 'bool'=True): super().__init__() self.in_features = in_features self.out_features = out_featur...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import math f...
EasternJournalist/pi-GAN
FiLMSIREN
false
17,236
[ "MIT" ]
4
3d57611e1c8fca2f3cd00fde1989ec1f9dd94d55
https://github.com/EasternJournalist/pi-GAN/tree/3d57611e1c8fca2f3cd00fde1989ec1f9dd94d55
import math import torch from torch import nn class Model(nn.Module): def __init__(self, in_features: 'int', out_features: 'int', omega_0: 'float'=30.0, is_first: 'bool'=False, bias: 'bool'=True): super().__init__() self.in_features = in_features self.out_features = out_features ...
IOUloss
# 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 IOUloss(nn.Module): def __init__(self, reduction='none', loss_type='iou'): super(IOUloss, self).__init__() self.reduction = reduction self.loss_type = loss_type def forward(self, pred, target): assert pred.shape[0] == target.shape[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 from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
DerryHub/ByteTrack-attack
IOUloss
false
17,237
[ "MIT" ]
6
f237894c7985863c0830401933ebd89ca92bde96
https://github.com/DerryHub/ByteTrack-attack/tree/f237894c7985863c0830401933ebd89ca92bde96
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, reduction='none', loss_type='iou'): super().__init__() self.reduction = reduction self.loss_type = loss_type def forward(self, pred, target): assert pred.shape[0] == target.shape[0] pred = p...
NetEnd
# 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 NetEnd(nn.Module): def __init__(self, num_classes: 'int'): super(NetEnd, self).__init__() self.num_classes = num_classes self.fc_net1 = nn.Conv2d(21, self.num_classes, kernel_size=1, stride=1) assert self.num_classes > 0, 'The number of cla...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
EadCat/Road-Extraction
NetEnd
false
17,238
[ "MIT" ]
4
9d4831b6c3a5ef07676cbe1c79b03045fda427ea
https://github.com/EadCat/Road-Extraction/tree/9d4831b6c3a5ef07676cbe1c79b03045fda427ea
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_classes: 'int'): super().__init__() self.num_classes = num_classes self.fc_net1 = nn.Conv2d(21, self.num_classes, kernel_size=1, stride=1) assert self.num_classes > 0, 'The number of classes must be ...
IN_self
# 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 IN_self(nn.Module): def __init__(self, num_features): super(IN_self, self).__init__() self.num_features = num_features self.gamma = nn.Parameter(torch.Tensor(1, num_features, 1, 1), requires_grad=True) self.beta = nn.Parameter(t...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
EkdeepSLubana/BeyondBatchNorm
IN_self
false
17,239
[ "MIT" ]
10
2ab1626a1ebfdfe55f0a4bc6ac24c8bbdd4e0196
https://github.com/EkdeepSLubana/BeyondBatchNorm/tree/2ab1626a1ebfdfe55f0a4bc6ac24c8bbdd4e0196
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_features): super().__init__() self.num_features = num_features self.gamma = nn.Parameter(torch.Tensor(1, num_features, 1, 1), requires_grad=True) self.beta = nn.Parameter(torch.Tensor(1, ...
LN_self
# 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 LN_self(nn.Module): def __init__(self, num_features): super().__init__() shape = 1, num_features, 1, 1 self.gamma = nn.Parameter(torch.ones(shape)) self.beta = nn.Parameter(torch.zeros(shape)) def forward(self, X, eps=1e-05): v...
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_...
EkdeepSLubana/BeyondBatchNorm
LN_self
false
17,240
[ "MIT" ]
10
2ab1626a1ebfdfe55f0a4bc6ac24c8bbdd4e0196
https://github.com/EkdeepSLubana/BeyondBatchNorm/tree/2ab1626a1ebfdfe55f0a4bc6ac24c8bbdd4e0196
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_features): super().__init__() shape = 1, num_features, 1, 1 self.gamma = nn.Parameter(torch.ones(shape)) self.beta = nn.Parameter(torch.zeros(shape)) def forward(self, X, eps=1e-05): var...
TLU
# 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 TLU(nn.Module): def __init__(self, num_features): """max(y, tau) = max(y - tau, 0) + tau = ReLU(y - tau) + tau""" super(TLU, self).__init__() self.num_features = num_features self.tau = nn.Parameter(torch.Tensor(1, num_features, 1, 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
EkdeepSLubana/BeyondBatchNorm
TLU
false
17,241
[ "MIT" ]
10
2ab1626a1ebfdfe55f0a4bc6ac24c8bbdd4e0196
https://github.com/EkdeepSLubana/BeyondBatchNorm/tree/2ab1626a1ebfdfe55f0a4bc6ac24c8bbdd4e0196
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_features): """max(y, tau) = max(y - tau, 0) + tau = ReLU(y - tau) + tau""" super().__init__() self.num_features = num_features self.tau = nn.Parameter(torch.Tensor(1, num_features, 1, 1), ...
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(Net, self).__init__() self.lin1 = nn.Linear(4, 50) self.lin2 = nn.Linear(50, 50) self.out = nn.Linear(50, 3) def forward(self, x): x = F.relu(self.lin1(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_...
Elli1993/custom_net_on_movidius
Net
false
17,242
[ "MIT" ]
9
cd7ed784e6d38fe696c1ae1ff0e5a31d1b52c7dc
https://github.com/Elli1993/custom_net_on_movidius/tree/cd7ed784e6d38fe696c1ae1ff0e5a31d1b52c7dc
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.lin1 = nn.Linear(4, 50) self.lin2 = nn.Linear(50, 50) self.out = nn.Linear(50, 3) def forward(self, x): x = F.relu(self.lin1(x)) ...
CoughNet
# 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 CoughNet(torch.nn.Module): def __init__(self, input_size): super(CoughNet, self).__init__() self.l1 = torch.nn.Linear(input_size, 512) self.l2 = torch.nn.Linear(512, 256) self.l3 = torch.nn.Linear(256, 128) self.l4 = torch.nn.Linear(128, 64) self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
DerWaldi/COVID-19-Cough-Classification
CoughNet
false
17,243
[ "MIT" ]
7
40f85133b0b8973c088dc2730c592af1b89b29b7
https://github.com/DerWaldi/COVID-19-Cough-Classification/tree/40f85133b0b8973c088dc2730c592af1b89b29b7
import torch class Model(torch.nn.Module): def __init__(self, input_size): super().__init__() self.l1 = torch.nn.Linear(input_size, 512) self.l2 = torch.nn.Linear(512, 256) self.l3 = torch.nn.Linear(256, 128) self.l4 = torch.nn.Linear(128, 64) self.l5 = torch.nn.Li...
FRN_self
# 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 FRN_self(nn.Module): def __init__(self, num_features, eps=1e-05, is_eps_learnable=True): super(FRN_self, self).__init__() self.num_features = num_features self.init_eps = eps self.is_eps_learnable = is_eps_learnable self.gamma = nn....
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...
EkdeepSLubana/BeyondBatchNorm
FRN_self
false
17,244
[ "MIT" ]
10
2ab1626a1ebfdfe55f0a4bc6ac24c8bbdd4e0196
https://github.com/EkdeepSLubana/BeyondBatchNorm/tree/2ab1626a1ebfdfe55f0a4bc6ac24c8bbdd4e0196
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_features, eps=1e-05, is_eps_learnable=True): super().__init__() self.num_features = num_features self.init_eps = eps self.is_eps_learnable = is_eps_learnable self.gamma = nn.Parameter(torch.T...
custom_embedding
# 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 def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
EpiSci/SoCRATES
custom_embedding
false
17,245
[ "MIT" ]
6
901a896c5a765e3cb56f290188cde71c8707192d
https://github.com/EpiSci/SoCRATES/tree/901a896c5a765e3cb56f290188cde71c8707192d
import torch import torch.nn as nn import torch.nn.functional as F def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) ...
ClassifierEnd
# 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 ClassifierEnd(nn.Module): def __init__(self, num_classes: 'int'): super(ClassifierEnd, self).__init__() self.num_classes = num_classes self.fc_net1 = nn.Conv2d(21, self.num_classes, kernel_size=1, stride=1) self.fc_net2 = nn.Conv2d(self.num...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
EadCat/Road-Extraction
ClassifierEnd
false
17,246
[ "MIT" ]
4
9d4831b6c3a5ef07676cbe1c79b03045fda427ea
https://github.com/EadCat/Road-Extraction/tree/9d4831b6c3a5ef07676cbe1c79b03045fda427ea
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_classes: 'int'): super().__init__() self.num_classes = num_classes self.fc_net1 = nn.Conv2d(21, self.num_classes, kernel_size=1, stride=1) self.fc_net2 = nn.Conv2d(self.num_classes, self.num_classes,...
CoordConv2D
# 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 CoordConv2D(nn.Module): def __init__(self, in_channels: 'int', out_channels: 'int', kernel_size: 'int'=3, stride: 'int'=1, padding: 'int'=1, with_r: 'bool'=False): super().__init__() self.in_channel = in_channels self.with_r = with_r ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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...
EasternJournalist/pi-GAN
CoordConv2D
false
17,247
[ "MIT" ]
4
3d57611e1c8fca2f3cd00fde1989ec1f9dd94d55
https://github.com/EasternJournalist/pi-GAN/tree/3d57611e1c8fca2f3cd00fde1989ec1f9dd94d55
import torch from torch import nn class Model(nn.Module): def __init__(self, in_channels: 'int', out_channels: 'int', kernel_size: 'int'=3, stride: 'int'=1, padding: 'int'=1, with_r: 'bool'=False): super().__init__() self.in_channel = in_channels self.with_r = with_r self....
DoubleSymLayer
# 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 copy import math import torch import torch.nn as nn def normalInit(dims): """ Essentially, PyTorch's init.xavier_normal_ but clamped :param K: tensor to be initialized/overwritten :return: initialized tensor on the device in the nn.Parameter wrapper """ K = torch.zeros(dims) fan_in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import copy import math impor...
EmoryMLIP/DynamicBlocks
DoubleSymLayer
false
17,248
[ "MIT" ]
9
52acc9fbc1a2640c6ac8922fa18105279ccaea97
https://github.com/EmoryMLIP/DynamicBlocks/tree/52acc9fbc1a2640c6ac8922fa18105279ccaea97
import copy import math import torch import torch.nn as nn def normalInit(dims): """ Essentially, PyTorch's init.xavier_normal_ but clamped :param K: tensor to be initialized/overwritten :return: initialized tensor on the device in the nn.Parameter wrapper """ K = torch.zeros(dims) fan_in...
MolDQN
# 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 MolDQN(nn.Module): def __init__(self, input_length, output_length): super(MolDQN, self).__init__() self.linear_1 = nn.Linear(input_length, 1024) self.linear_2 = nn.Linear(1024, 512) self.linear_3 = nn.Linear(512, 128) self.linear_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_...
EXJUSTICE/MolDQN-pytorch
MolDQN
false
17,249
[ "MIT" ]
4
86828f898461e9f7722ac8a1e0b9fede2c45afe0
https://github.com/EXJUSTICE/MolDQN-pytorch/tree/86828f898461e9f7722ac8a1e0b9fede2c45afe0
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_length, output_length): super().__init__() self.linear_1 = nn.Linear(input_length, 1024) self.linear_2 = nn.Linear(1024, 512) self.linear_3 = nn.Linear(512, 128) self.linear_4 = nn.Linear(1...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) except: pass clas...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
EpiSci/SoCRATES
Attention
false
17,250
[ "MIT" ]
6
901a896c5a765e3cb56f290188cde71c8707192d
https://github.com/EpiSci/SoCRATES/tree/901a896c5a765e3cb56f290188cde71c8707192d
import torch import torch.nn as nn def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) except: pass clas...
LinearAttention
# 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 LinearAttention(nn.Module): def __init__(self, dim, heads=4, dim_head=32): super().__init__() self.heads = heads self.dim_head = dim_head self.hidden_dim = dim_head * heads self.to_qkv = nn.Conv2d(dim, self.hidden_dim * 3, 1, bias=Fa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
DavidRuhe/simple-variational-diffusion-models
LinearAttention
false
17,251
[ "MIT" ]
4
a32355bf052a8f08e9c1919080588d0b22c8de4e
https://github.com/DavidRuhe/simple-variational-diffusion-models/tree/a32355bf052a8f08e9c1919080588d0b22c8de4e
import torch from torch import nn class Model(nn.Module): def __init__(self, dim, heads=4, dim_head=32): super().__init__() self.heads = heads self.dim_head = dim_head self.hidden_dim = dim_head * heads self.to_qkv = nn.Conv2d(dim, self.hidden_dim * 3, 1, bias=False) ...
EltwiseSubEmbed
# 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 EltwiseSubEmbed(nn.Module): def __init__(self, nonlinearity='square', use_batch_norm=False, use_classifier=False, num_features=0, num_classes=0): super(EltwiseSubEmbed, self).__init__() self.nonlinearity = nonlinearity if nonlinearity is not...
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...
Event0511/curling-reid
EltwiseSubEmbed
false
17,252
[ "Apache-2.0" ]
3
1494d0faeed951e495573c694362f001df5bf6fd
https://github.com/Event0511/curling-reid/tree/1494d0faeed951e495573c694362f001df5bf6fd
import torch from torch import nn class Model(nn.Module): def __init__(self, nonlinearity='square', use_batch_norm=False, use_classifier=False, num_features=0, num_classes=0): super().__init__() self.nonlinearity = nonlinearity if nonlinearity is not None and nonlinearity not in [...
SNRNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class PositiveLinear(nn.Module): def __init__(self, in_features: 'int', out_features: 'int') ->None: super().__init__() self.weight = nn.Parameter(torch.randn(in_features, out_features)) self.bias = nn.Parameter(torch.zeros(out_features)) self.sof...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math fr...
DavidRuhe/simple-variational-diffusion-models
SNRNetwork
false
17,253
[ "MIT" ]
4
a32355bf052a8f08e9c1919080588d0b22c8de4e
https://github.com/DavidRuhe/simple-variational-diffusion-models/tree/a32355bf052a8f08e9c1919080588d0b22c8de4e
import torch from torch import nn class PositiveLinear(nn.Module): def __init__(self, in_features: 'int', out_features: 'int') ->None: super().__init__() self.weight = nn.Parameter(torch.randn(in_features, out_features)) self.bias = nn.Parameter(torch.zeros(out_features)) self.sof...
EmbeddingLayer
# 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 def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
EpiSci/SoCRATES
EmbeddingLayer
false
17,254
[ "MIT" ]
6
901a896c5a765e3cb56f290188cde71c8707192d
https://github.com/EpiSci/SoCRATES/tree/901a896c5a765e3cb56f290188cde71c8707192d
import torch import torch.nn as nn import torch.nn.functional as F def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) ...
FakeReLUM
# 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 FakeReLU(torch.autograd.Function): @staticmethod def forward(ctx, input): return input.clamp(min=0) @staticmethod def backward(ctx, grad_output): return grad_output class FakeReLUM(nn.Module): def forward(self, x...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guard...
Ethos-lab/robust-representation-matching
FakeReLUM
false
17,255
[ "MIT" ]
3
80d98f11846468c31278146583b9ef4750190211
https://github.com/Ethos-lab/robust-representation-matching/tree/80d98f11846468c31278146583b9ef4750190211
import torch import torch.nn as nn import torch.utils.data class FakeReLU(torch.autograd.Function): @staticmethod def forward(ctx, input): return input.clamp(min=0) @staticmethod def backward(ctx, grad_output): return grad_output class Model(nn.Module): def forward(self, x): ...
ConditionalBatchNorm
# 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 ConditionalBatchNorm(torch.nn.Module): def __init__(self, no, z_dim): super().__init__() self.no = no self.bn = torch.nn.InstanceNorm2d(no, affine=False) self.condition = torch.nn.Linear(z_dim, 2 * no) def forward(self, x, z): cond = self.condition(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
ElementAI/beyond-trivial-explanations
ConditionalBatchNorm
false
17,256
[ "Apache-2.0" ]
3
c517d7bdbab68b6a26f74cee4d15e948b3b47238
https://github.com/ElementAI/beyond-trivial-explanations/tree/c517d7bdbab68b6a26f74cee4d15e948b3b47238
import torch class Model(torch.nn.Module): def __init__(self, no, z_dim): super().__init__() self.no = no self.bn = torch.nn.InstanceNorm2d(no, affine=False) self.condition = torch.nn.Linear(z_dim, 2 * no) def forward(self, x, z): cond = self.condition(z).view(-1, 2 *...
mlp_layer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
EpiSci/SoCRATES
mlp_layer
false
17,257
[ "MIT" ]
6
901a896c5a765e3cb56f290188cde71c8707192d
https://github.com/EpiSci/SoCRATES/tree/901a896c5a765e3cb56f290188cde71c8707192d
import torch import torch.nn as nn import torch.nn.functional as F def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) ...
MultVAE_encoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.sparse import torch.nn as nn class MultVAE_encoder(nn.Module): def __init__(self, item_dim: 'int', hidden_dim=600, latent_dim=200, n_hidden_layers=1, dropout=0.5, nonlinearity=nn.Tanh): super(MultVAE_encoder, self).__init__() self.item_dim = item_dim self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.sparse...
EricHe98/sad_final_project
MultVAE_encoder
false
17,258
[ "MIT" ]
3
4b2b57e44f939840eede6f134493c5f8d809b1a7
https://github.com/EricHe98/sad_final_project/tree/4b2b57e44f939840eede6f134493c5f8d809b1a7
import torch import torch.sparse import torch.nn as nn class Model(nn.Module): def __init__(self, item_dim: 'int', hidden_dim=600, latent_dim=200, n_hidden_layers=1, dropout=0.5, nonlinearity=nn.Tanh): super().__init__() self.item_dim = item_dim self.latent_dim = latent_dim ...
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 numpy as np import torch.utils.data import torch.nn as nn class VAE(nn.Module): def __init__(self, input_size, latent_size): super(VAE, self).__init__() self.latent_size = latent_size self.input_size = input_size self.mu_layer = nn.Linear(self.input_size, self....
import torch from torch import device from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math...
ErikHumphrey/sustain-seq2seq
VAE
false
17,259
[ "Apache-2.0" ]
4
c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
https://github.com/ErikHumphrey/sustain-seq2seq/tree/c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
import torch import numpy as np import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self, input_size, latent_size): super().__init__() self.latent_size = latent_size self.input_size = input_size self.mu_layer = nn.Linear(self.input_size, self.latent_...
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 class MLP(torch.nn.Module): def __init__(self, ni, no, nhidden, nlayers): super().__init__() self.nlayers = nlayers for i in range(nlayers): if i == 0: setattr(self, 'linear%d' % i, torch.nn.Linear(ni, nhidden, bias=False)) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
ElementAI/beyond-trivial-explanations
MLP
false
17,260
[ "Apache-2.0" ]
3
c517d7bdbab68b6a26f74cee4d15e948b3b47238
https://github.com/ElementAI/beyond-trivial-explanations/tree/c517d7bdbab68b6a26f74cee4d15e948b3b47238
import torch class Model(torch.nn.Module): def __init__(self, ni, no, nhidden, nlayers): super().__init__() self.nlayers = nlayers for i in range(nlayers): if i == 0: setattr(self, 'linear%d' % i, torch.nn.Linear(ni, nhidden, bias=False)) ...
merge_layer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
EpiSci/SoCRATES
merge_layer
false
17,261
[ "MIT" ]
6
901a896c5a765e3cb56f290188cde71c8707192d
https://github.com/EpiSci/SoCRATES/tree/901a896c5a765e3cb56f290188cde71c8707192d
import torch import torch.nn as nn import torch.nn.functional as F def weight_init(m): if isinstance(m, nn.Linear): size = m.weight.size() size[0] size[1] variance = 0.001 m.weight.data.normal_(0.0, variance) try: m.bias.data.normal_(0.0, 0.0001) ...
PreactDoubleLayer
# 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 copy import math import torch import torch.nn as nn def normalInit(dims): """ Essentially, PyTorch's init.xavier_normal_ but clamped :param K: tensor to be initialized/overwritten :return: initialized tensor on the device in the nn.Parameter wrapper """ K = torch.zeros(dims) fan_in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import copy import math impor...
EmoryMLIP/DynamicBlocks
PreactDoubleLayer
false
17,262
[ "MIT" ]
9
52acc9fbc1a2640c6ac8922fa18105279ccaea97
https://github.com/EmoryMLIP/DynamicBlocks/tree/52acc9fbc1a2640c6ac8922fa18105279ccaea97
import copy import math import torch import torch.nn as nn def normalInit(dims): """ Essentially, PyTorch's init.xavier_normal_ but clamped :param K: tensor to be initialized/overwritten :return: initialized tensor on the device in the nn.Parameter wrapper """ K = torch.zeros(dims) fan_in...
conv_head_pooling
# 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 conv_head_pooling(nn.Module): def __init__(self, in_feature, out_feature, stride, padding_mode='zeros'): super(conv_head_pooling, self).__init__() self.conv = nn.Conv2d(in_feature, out_feature, kernel_size=stride + 1, padding=stride // 2, strid...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
Equationliu/GA-Attack
conv_head_pooling
false
17,263
[ "MIT" ]
8
b0280674a211f6451774ec6b1d4cee2fc19a4de6
https://github.com/Equationliu/GA-Attack/tree/b0280674a211f6451774ec6b1d4cee2fc19a4de6
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_feature, out_feature, stride, padding_mode='zeros'): super().__init__() self.conv = nn.Conv2d(in_feature, out_feature, kernel_size=stride + 1, padding=stride // 2, stride=stride, padding_mode= ...
Denoise_NormalizeLayer
# 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 Denoise_NormalizeLayer(nn.Module): def __init__(self): super(Denoise_NormalizeLayer, self).__init__() def forward(self, inputs: 'torch.tensor'): permute_RGBtoBGR = [2, 1, 0] inputs = inputs[:, permute_RGBtoBGR, :, :] out = inputs / 0.5...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Equationliu/GA-Attack
Denoise_NormalizeLayer
false
17,264
[ "MIT" ]
8
b0280674a211f6451774ec6b1d4cee2fc19a4de6
https://github.com/Equationliu/GA-Attack/tree/b0280674a211f6451774ec6b1d4cee2fc19a4de6
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, inputs: 'torch.tensor'): permute_RGBtoBGR = [2, 1, 0] inputs = inputs[:, permute_RGBtoBGR, :, :] out = inputs / 0.5 - 1 return out def get_inputs(): ...
CEL
# 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 CEL(nn.Module): def __init__(self): super(CEL, self).__init__() None self.eps = 1e-06 def forward(self, pred, target): pred = pred.sigmoid() intersection = pred * target numerator = (pred - intersection).sum() + (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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
Farzanehkaji/MINet
CEL
false
17,265
[ "MIT" ]
9
cc2852cb2b3b20208f5edf38ec6952363a9b04a7
https://github.com/Farzanehkaji/MINet/tree/cc2852cb2b3b20208f5edf38ec6952363a9b04a7
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() None self.eps = 1e-06 def forward(self, pred, target): pred = pred.sigmoid() intersection = pred * target numerator = (pred - intersection).sum() + (target - inter...
Conv2d
# 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 functional as F class Conv2d(nn.Conv2d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True): super(Conv2d, self).__init__(in_channels, out_channels, kernel_size, stride...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Farzanehkaji/MINet
Conv2d
false
17,266
[ "MIT" ]
9
cc2852cb2b3b20208f5edf38ec6952363a9b04a7
https://github.com/Farzanehkaji/MINet/tree/cc2852cb2b3b20208f5edf38ec6952363a9b04a7
import torch from torch import nn from torch.nn import functional as F class Model(nn.Conv2d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True): super().__init__(in_channels, out_channels, kernel_size, stride, padding, di...
ChannelPool
# 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 ChannelPool(nn.Module): def forward(self, x): return torch.cat((torch.max(x, 1)[0].unsqueeze(1), torch.mean(x, 1) .unsqueeze(1)), dim=1) 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...
FVL2020/2DImage_BMI_estimation
ChannelPool
false
17,267
[ "MIT" ]
4
3ae8469c3c86aac1afd09b3ba1716ecd94f5ec3f
https://github.com/FVL2020/2DImage_BMI_estimation/tree/3ae8469c3c86aac1afd09b3ba1716ecd94f5ec3f
import torch import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.cat((torch.max(x, 1)[0].unsqueeze(1), torch.mean(x, 1) .unsqueeze(1)), dim=1) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
ScaleToModel
# 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.cuda from torch import linalg as linalg class ScaleToModel(nn.Module): """ This class acts as an adapter module that scales pixel values from the test run domain to the model domain. """ def __init__(self, model_value_range, test_value_range): "...
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.cuda from torch import linalg as linalg assert_size_stride = torch._C._dynamo.guards.assert_size_stride e...
Flunzmas/vp-suite
ScaleToModel
false
17,268
[ "MIT" ]
3
391570121b5bd9e3fd23aca9a0945a63c4173a24
https://github.com/Flunzmas/vp-suite/tree/391570121b5bd9e3fd23aca9a0945a63c4173a24
import torch import torch.nn as nn import torch.cuda from torch import linalg as linalg class Model(nn.Module): """ This class acts as an adapter module that scales pixel values from the test run domain to the model domain. """ def __init__(self, model_value_range, test_value_range): """ ...
MultVae
# 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.sparse import torch.nn as nn class MultVAE_encoder(nn.Module): def __init__(self, item_dim: 'int', hidden_dim=600, latent_dim=200, n_hidden_layers=1, dropout=0.5, nonlinearity=nn.Tanh): super(MultVAE_encoder, self).__init__() self.item_dim = item_dim self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
EricHe98/sad_final_project
MultVae
false
17,269
[ "MIT" ]
3
4b2b57e44f939840eede6f134493c5f8d809b1a7
https://github.com/EricHe98/sad_final_project/tree/4b2b57e44f939840eede6f134493c5f8d809b1a7
import torch import torch.sparse import torch.nn as nn class MultVAE_encoder(nn.Module): def __init__(self, item_dim: 'int', hidden_dim=600, latent_dim=200, n_hidden_layers=1, dropout=0.5, nonlinearity=nn.Tanh): super().__init__() self.item_dim = item_dim self.latent_dim = latent_...
CrossEntropyLoss
# 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 CrossEntropyLoss(nn.Module): """ cross entropy loss """ def __init__(self): super().__init__() def forward(self, logits, labels): return F.cross_entropy(logits, labels, reduction='none') def get_inputs(): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
Equationliu/GA-Attack
CrossEntropyLoss
false
17,270
[ "MIT" ]
8
b0280674a211f6451774ec6b1d4cee2fc19a4de6
https://github.com/Equationliu/GA-Attack/tree/b0280674a211f6451774ec6b1d4cee2fc19a4de6
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ cross entropy loss """ def __init__(self): super().__init__() def forward(self, logits, labels): return F.cross_entropy(logits, labels, reduction='none') def get_inputs(): return ...
MultiHeadAttn
# 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 class MultiHeadAttn(nn.Module): def __init__(self, d_model, n_head, dropout=0.1, scale=False): super().__init__() assert d_model % n_head == 0 self.n_head = n_head self.qkv_linear = nn.Linear(d_model, 3 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
EmanuelaBoros/stacked-ner
MultiHeadAttn
false
17,271
[ "MIT" ]
4
b57e4fcf777a5ad2519ffa7223364e383975bf7d
https://github.com/EmanuelaBoros/stacked-ner/tree/b57e4fcf777a5ad2519ffa7223364e383975bf7d
import math import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, d_model, n_head, dropout=0.1, scale=False): super().__init__() assert d_model % n_head == 0 self.n_head = n_head self.qkv_linear = nn.Linear(d_model, 3 * d_mode...
KLLoss
# 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 KLLoss(nn.Module): def __init__(self, size_average=False): super().__init__() self.size_average = size_average def forward(self, mu, logvar): loss = 0.5 * (mu.pow(2) + logvar.exp() - logvar - 1) if self.size_ave...
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 ...
ForrestPi/VAEGAN
KLLoss
false
17,272
[ "MIT" ]
8
c2cfeedcc2dcfad6258468611536d9a8222eb8a3
https://github.com/ForrestPi/VAEGAN/tree/c2cfeedcc2dcfad6258468611536d9a8222eb8a3
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, size_average=False): super().__init__() self.size_average = size_average def forward(self, mu, logvar): loss = 0.5 * (mu.pow(2) + logvar.exp() - logvar - 1) if self.size_aver...
AttentionHead
# 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.utils.data import torch.nn as nn class AttentionHead(nn.Module): def __init__(self, d_model, d_k, d_v, device): super(AttentionHead, self).__init__() self.dk = math.sqrt(d_k) self.query_layer = nn.Linear(d_model, d_k) self.key_layer = nn.Linea...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ErikHumphrey/sustain-seq2seq
AttentionHead
false
17,273
[ "Apache-2.0" ]
4
c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
https://github.com/ErikHumphrey/sustain-seq2seq/tree/c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
import math import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self, d_model, d_k, d_v, device): super().__init__() self.dk = math.sqrt(d_k) self.query_layer = nn.Linear(d_model, d_k) self.key_layer = nn.Linear(d_model, d_k) sel...
AdditiveAttention
# 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.nn as nn class AdditiveAttention(nn.Module): def __init__(self, enc_hidden_dim, dec_hidden_dim): super(AdditiveAttention, self).__init__() self.attention_w1 = nn.Linear(enc_hidden_dim, enc_hidden_dim) self.attention_w2 = nn.Linear(dec_hidd...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ErikHumphrey/sustain-seq2seq
AdditiveAttention
false
17,274
[ "Apache-2.0" ]
4
c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
https://github.com/ErikHumphrey/sustain-seq2seq/tree/c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self, enc_hidden_dim, dec_hidden_dim): super().__init__() self.attention_w1 = nn.Linear(enc_hidden_dim, enc_hidden_dim) self.attention_w2 = nn.Linear(dec_hidden_dim, enc_hidden_dim) sel...
SimpleLoss
# 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 SimpleLoss(torch.nn.Module): def forward(self, output, target): return output / target def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
FranciscoShi/piepline
SimpleLoss
false
17,276
[ "MIT" ]
5
6105788339fc18bab39ea07625b5fd26ad687254
https://github.com/FranciscoShi/piepline/tree/6105788339fc18bab39ea07625b5fd26ad687254
import torch class Model(torch.nn.Module): def forward(self, output, target): return output / target def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
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 import torch.optim import torch.autograd import torch.nn import torch.nn.init class ScaledDotProductAttention(nn.Module): def __init__(self, d_model, attention_dropout=0.1): super(ScaledDotProductAttention, self).__init__() self.temper = d_model ** 0.5 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....
FilippoC/-deep-syntactic-dependency-parsing-release
ScaledDotProductAttention
false
17,277
[ "MIT" ]
4
30e2571ea930c2fd81559f5a2a971e3738cc6d39
https://github.com/FilippoC/-deep-syntactic-dependency-parsing-release/tree/30e2571ea930c2fd81559f5a2a971e3738cc6d39
import torch import torch.nn as nn import torch.optim import torch.autograd import torch.nn import torch.nn.init class Model(nn.Module): def __init__(self, d_model, attention_dropout=0.1): super().__init__() self.temper = d_model ** 0.5 self.dropout = nn.Dropout(attention_dropout) ...
ConcatELU
# 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 ConcatELU(nn.Module): """ Activation function that applies ELU in both direction (inverted and plain). Allows non-linearity while providing strong gradients for any input (important for final convolution) """ def forward(sel...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
GBATZOLIS/CAFLOW
ConcatELU
false
17,278
[ "MIT" ]
6
ea33f84c424bd8e46999be59cd5d52bd8f0a3a77
https://github.com/GBATZOLIS/CAFLOW/tree/ea33f84c424bd8e46999be59cd5d52bd8f0a3a77
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Activation function that applies ELU in both direction (inverted and plain). Allows non-linearity while providing strong gradients for any input (important for final convolution) """ def forward(self, x...
HDRLoss
# 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 HDRLoss(nn.Module): def __init__(self): super().__init__() def forward(self, out_img, ref_img): return torch.mean((out_img - ref_img) ** 2) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
Galaxies99/NHDRRNet-pytorch
HDRLoss
false
17,279
[ "MIT" ]
10
b20aae987e586a6cf9c9c52fc07b0884ce6fdf37
https://github.com/Galaxies99/NHDRRNet-pytorch/tree/b20aae987e586a6cf9c9c52fc07b0884ce6fdf37
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, out_img, ref_img): return torch.mean((out_img - ref_img) ** 2) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): ...
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 import torch.optim import torch.autograd import torch.nn import torch.nn.init class LayerNorm(nn.Module): def __init__(self, dim, mean=0.0, std=1.0, fixed=False, eps=1e-06, ball =False): super(LayerNorm, self).__init__() self.eps = eps self.ball ...
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.optim import torch.autograd import torch.nn ...
FilippoC/-deep-syntactic-dependency-parsing-release
LayerNorm
false
17,280
[ "MIT" ]
4
30e2571ea930c2fd81559f5a2a971e3738cc6d39
https://github.com/FilippoC/-deep-syntactic-dependency-parsing-release/tree/30e2571ea930c2fd81559f5a2a971e3738cc6d39
import torch import torch.nn as nn import torch.optim import torch.autograd import torch.nn import torch.nn.init class Model(nn.Module): def __init__(self, dim, mean=0.0, std=1.0, fixed=False, eps=1e-06, ball =False): super().__init__() self.eps = eps self.ball = ball if f...