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
ParityPonderGRU
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch import nn from typing import Tuple import torch.utils.data import torch.nn.functional import torch.autograd class ParityPonderGRU(Module): """ ## PonderNet with GRU for Parity Task This is a simple model that uses a [GRU Cell](https://pytorch.org/docs/s...
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.nn import Module from torch import nn import...
mcx/annotated_deep_learning_paper_implementations
ParityPonderGRU
false
7,233
[ "MIT" ]
1
f169f3a71dd2d36eb28ad31062d3475efa367b88
https://github.com/mcx/annotated_deep_learning_paper_implementations/tree/f169f3a71dd2d36eb28ad31062d3475efa367b88
from torch.nn import Module import torch from torch import nn from typing import Tuple import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ ## PonderNet with GRU for Parity Task This is a simple model that uses a [GRU Cell](https://pytorch.org/docs/stable/gene...
equalized_linear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn.init import normal import torch.utils.data def _calculate_fan_in_and_fan_out(tensor): dimensions = tensor.ndimension() if dimensions < 2: raise ValueError( 'Fan in and fan out can not be computed for tensor with less than 2 dimensions' ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.nn.init import normal import torch.utils.data a...
mingo-x/pggan-pytorch
equalized_linear
false
7,234
[ "MIT" ]
1
a1dde73cd4df52476fe7c948d81fa9caea8070a5
https://github.com/mingo-x/pggan-pytorch/tree/a1dde73cd4df52476fe7c948d81fa9caea8070a5
import torch import torch.nn as nn from torch.nn.init import normal import torch.utils.data def _calculate_fan_in_and_fan_out(tensor): dimensions = tensor.ndimension() if dimensions < 2: raise ValueError( 'Fan in and fan out can not be computed for tensor with less than 2 dimensions' ...
ConvBlock
# 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 Conv3x3(nn.Module): """Layer to pad and convolve input """ def __init__(self, in_channels, out_channels, use_refl=True): super(Conv3x3, self).__init__() if use_refl: self.pad = nn.ReflectionPad2d(1) else: self.pad = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
minjabenho/image2pcl
ConvBlock
false
7,235
[ "Apache-2.0" ]
1
7e696ee48edae30814d32f32e605ad6cf8bf702c
https://github.com/minjabenho/image2pcl/tree/7e696ee48edae30814d32f32e605ad6cf8bf702c
import torch import torch.nn as nn class Conv3x3(nn.Module): """Layer to pad and convolve input """ def __init__(self, in_channels, out_channels, use_refl=True): super().__init__() if use_refl: self.pad = nn.ReflectionPad2d(1) else: self.pad = nn.ZeroPad2d(...
Project3D
# 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 Project3D(nn.Module): """Layer which projects 3D points into a camera with intrinsics K and at position T """ def __init__(self, batch_size, height, width, eps=1e-07): super(Project3D, self).__init__() self.batch_size = batch_size self.heig...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
minjabenho/image2pcl
Project3D
false
7,236
[ "Apache-2.0" ]
1
7e696ee48edae30814d32f32e605ad6cf8bf702c
https://github.com/minjabenho/image2pcl/tree/7e696ee48edae30814d32f32e605ad6cf8bf702c
import torch import torch.nn as nn class Model(nn.Module): """Layer which projects 3D points into a camera with intrinsics K and at position T """ def __init__(self, batch_size, height, width, eps=1e-07): super().__init__() self.batch_size = batch_size self.height = height ...
SelfAttnLayer
# 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 get_activation_fn(activation): if activation == 'relu': return F.relu elif activation == 'gelu': return F.gelu raise RuntimeError('activation should be relu/gelu, not {}'.format( activation)) class Transformer...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
mensudza/C-Tran
SelfAttnLayer
false
7,237
[ "MIT" ]
1
4895ccb0e675ae2dcd2b619a9e47f30707062668
https://github.com/mensudza/C-Tran/tree/4895ccb0e675ae2dcd2b619a9e47f30707062668
import torch import torch.nn as nn import torch.nn.functional as F def get_activation_fn(activation): if activation == 'relu': return F.relu elif activation == 'gelu': return F.gelu raise RuntimeError('activation should be relu/gelu, not {}'.format( activation)) class Transformer...
depthwise_separable_conv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class depthwise_separable_conv(torch.nn.Module): def __init__(self, nin, nout, kernel_size, padding): super(depthwise_separable_conv, self).__init__() self.depthwise = nn.Conv2d(nin, nin, kernel_size=kernel_size, padding=padding, groups=nin) ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
mirayyuce/Neural-Architecture-Search
depthwise_separable_conv
false
7,238
[ "BSD-3-Clause" ]
1
e294816c85200f4301376c8b355634c6cca81816
https://github.com/mirayyuce/Neural-Architecture-Search/tree/e294816c85200f4301376c8b355634c6cca81816
import torch import torch.nn as nn class Model(torch.nn.Module): def __init__(self, nin, nout, kernel_size, padding): super().__init__() self.depthwise = nn.Conv2d(nin, nin, kernel_size=kernel_size, padding=padding, groups=nin) self.pointwise = nn.Conv2d(nin, nout, kernel_size...
BertPredictionHeadTransform
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
minjoong507/Image-Captioning-Transformer
BertPredictionHeadTransform
false
7,239
[ "MIT" ]
1
813060f0bb656e336154173f11e99a80362c8c2a
https://github.com/minjoong507/Image-Captioning-Transformer/tree/813060f0bb656e336154173f11e99a80362c8c2a
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math...
Router
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Squash(Module): '\n ## Squash\n\n This is **squashing** function from paper, given by equation $(1)$.\n\n $$\\mathbf{v}_j = \x0crac{{\\lVert \\mathbf{s}_j \rVert}^2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mcx/annotated_deep_learning_paper_implementations
Router
false
7,240
[ "MIT" ]
1
f169f3a71dd2d36eb28ad31062d3475efa367b88
https://github.com/mcx/annotated_deep_learning_paper_implementations/tree/f169f3a71dd2d36eb28ad31062d3475efa367b88
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Squash(Module): '\n ## Squash\n\n This is **squashing** function from paper, given by equation $(1)$.\n\n $$\\mathbf{v}_j = \x0crac{{\\lVert \\mathbf{s}_j \rVert}^2...
Pointer
# 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 mask_logits(target, mask): mask = mask.type(torch.float32) return target * mask + (1 - mask) * -1e+30 class Initialized_Conv1d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0, groups=1, relu=False, 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
mirbostani/QA-KD-AL
Pointer
false
7,241
[ "MIT" ]
1
0ec8756ee06ae2a204a5e9110503bc697e9108fb
https://github.com/mirbostani/QA-KD-AL/tree/0ec8756ee06ae2a204a5e9110503bc697e9108fb
import torch import torch.nn as nn def mask_logits(target, mask): mask = mask.type(torch.float32) return target * mask + (1 - mask) * -1e+30 class Initialized_Conv1d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0, groups=1, relu=False, bias=False): ...
SSIM
# 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 SSIM(nn.Module): """Layer to compute the SSIM loss between a pair of images """ def __init__(self): super(SSIM, self).__init__() self.mu_x_pool = nn.AvgPool2d(3, 1) self.mu_y_pool = nn.AvgPool2d(3, 1) self.sig_x_pool = nn.AvgPool2d(...
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 ...
minjabenho/image2pcl
SSIM
false
7,242
[ "Apache-2.0" ]
1
7e696ee48edae30814d32f32e605ad6cf8bf702c
https://github.com/minjabenho/image2pcl/tree/7e696ee48edae30814d32f32e605ad6cf8bf702c
import torch import torch.nn as nn class Model(nn.Module): """Layer to compute the SSIM loss between a pair of images """ def __init__(self): super().__init__() self.mu_x_pool = nn.AvgPool2d(3, 1) self.mu_y_pool = nn.AvgPool2d(3, 1) self.sig_x_pool = nn.AvgPool2d(3, 1) ...
dream_loss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class dream_loss(torch.nn.Module): def __init__(self): super(dream_loss, self).__init__() def forward(self, yhat, y): diff = torch.sum(yhat - y) return diff def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): r...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
mkelcb/knet
dream_loss
false
7,244
[ "MIT" ]
1
f0e75f526c8bcdc6969052328b2b1b9cd6767cd8
https://github.com/mkelcb/knet/tree/f0e75f526c8bcdc6969052328b2b1b9cd6767cd8
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, yhat, y): diff = torch.sum(yhat - y) return diff def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
BertSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
minjoong507/Image-Captioning-Transformer
BertSelfAttention
false
7,247
[ "MIT" ]
1
813060f0bb656e336154173f11e99a80362c8c2a
https://github.com/minjoong507/Image-Captioning-Transformer/tree/813060f0bb656e336154173f11e99a80362c8c2a
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidden size (%d) is not a...
BertLMPredictionHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
minjoong507/Image-Captioning-Transformer
BertLMPredictionHead
false
7,248
[ "MIT" ]
1
813060f0bb656e336154173f11e99a80362c8c2a
https://github.com/minjoong507/Image-Captioning-Transformer/tree/813060f0bb656e336154173f11e99a80362c8c2a
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math...
CAT_TokenEmbedding
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class CAT_TokenEmbedding(nn.Module): def __init__(self, c_in=1, d_feature=10): super(CAT_TokenEmbedding, self).__init__() padding = 1 if torch.__version__ >= '1.5.0' else 2 self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
mkmysk123456789/Informer2020
CAT_TokenEmbedding
false
7,250
[ "Apache-2.0" ]
1
ad4b895169a17db580aab6d2c09fd07e06c9b6fa
https://github.com/mkmysk123456789/Informer2020/tree/ad4b895169a17db580aab6d2c09fd07e06c9b6fa
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, c_in=1, d_feature=10): super().__init__() padding = 1 if torch.__version__ >= '1.5.0' else 2 self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_feature, kernel_size=3, padding=padding, paddi...
BertAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
minjoong507/Image-Captioning-Transformer
BertAttention
false
7,252
[ "MIT" ]
1
813060f0bb656e336154173f11e99a80362c8c2a
https://github.com/minjoong507/Image-Captioning-Transformer/tree/813060f0bb656e336154173f11e99a80362c8c2a
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidden size (...
BoundSoftmaxImpl
# 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 BoundSoftmaxImpl(nn.Module): def __init__(self, axis): super().__init__() self.axis = axis def forward(self, x): max_x = torch.max(x, dim=self.axis).values assert self.axis == int(self.axis) x = torch.exp(x - max_x.unsqueeze(se...
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 ...
mnmueller/auto_LiRPA
BoundSoftmaxImpl
false
7,253
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, axis): super().__init__() self.axis = axis def forward(self, x): max_x = torch.max(x, dim=self.axis).values assert self.axis == int(self.axis) x = torch.exp(x - max_x.unsqueeze(self.axis)) ...
CAT_TemporalEmbedding
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import math import torch import torch.nn as nn class CAT_FixedEmbedding(nn.Module): def __init__(self, c_in, d_model): super(CAT_FixedEmbedding, self).__init__() w = torch.zeros(c_in, d_model).float() w.require_grad = False position = torch.arange(0, c_in).float().unsqueeze(1) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guar...
mkmysk123456789/Informer2020
CAT_TemporalEmbedding
false
7,254
[ "Apache-2.0" ]
1
ad4b895169a17db580aab6d2c09fd07e06c9b6fa
https://github.com/mkmysk123456789/Informer2020/tree/ad4b895169a17db580aab6d2c09fd07e06c9b6fa
import math import torch import torch.nn as nn class CAT_FixedEmbedding(nn.Module): def __init__(self, c_in, d_model): super().__init__() w = torch.zeros(c_in, d_model).float() w.require_grad = False position = torch.arange(0, c_in).float().unsqueeze(1) div_term = (torch.a...
CQAttention
# 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 mask_logits(target, mask): mask = mask.type(torch.float32) return target * mask + (1 - mask) * -1e+30 class CQAttention(nn.Module): def __init__(self, d_model, dropout=0.1): super().__init__() w4C = torch.empty(d_mod...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mirbostani/QA-KD-AL
CQAttention
false
7,255
[ "MIT" ]
1
0ec8756ee06ae2a204a5e9110503bc697e9108fb
https://github.com/mirbostani/QA-KD-AL/tree/0ec8756ee06ae2a204a5e9110503bc697e9108fb
import torch import torch.nn as nn import torch.nn.functional as F def mask_logits(target, mask): mask = mask.type(torch.float32) return target * mask + (1 - mask) * -1e+30 class Model(nn.Module): def __init__(self, d_model, dropout=0.1): super().__init__() w4C = torch.empty(d_model, 1)...
Transition
# 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 Transition(nn.Module): def __init__(self, in_planes, out_planes): super(Transition, self).__init__() self.conv = nn.Conv2d(in_planes, out_planes, kernel_size=1, bias=True) def forward(self, x): out = self.conv(F...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mnmueller/auto_LiRPA
Transition
false
7,256
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_planes, out_planes): super().__init__() self.conv = nn.Conv2d(in_planes, out_planes, kernel_size=1, bias=True) def forward(self, x): out = self.conv(F.relu(x)) out...
mlp_2layer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class mlp_2layer(nn.Module): def __init__(self, in_ch, in_dim, width=1): super(mlp_2layer, self).__init__() self.fc1 = nn.Linear(in_ch * in_dim * in_dim, 256 * width) self.fc2 = nn.Linear(256 * width, 10) def forward(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mnmueller/auto_LiRPA
mlp_2layer
false
7,257
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_ch, in_dim, width=1): super().__init__() self.fc1 = nn.Linear(in_ch * in_dim * in_dim, 256 * width) self.fc2 = nn.Linear(256 * width, 10) def forward(self, x): x =...
BertLayerNormNoVar
# 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 BertLayerNormNoVar(nn.Module): def __init__(self, hidden_size, eps=1e-12): super(BertLayerNormNoVar, self).__init__() self.weight = nn.Parameter(torch.ones(hidden_size)) self.bias = nn.Parameter(torch.zeros(hidden_size)) self.variance_epsil...
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...
mnmueller/auto_LiRPA
BertLayerNormNoVar
false
7,258
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, hidden_size, eps=1e-12): super().__init__() self.weight = nn.Parameter(torch.ones(hidden_size)) self.bias = nn.Parameter(torch.zeros(hidden_size)) self.variance_epsilon = eps def forward(self, x): ...
mlp_5layer
# 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 mlp_5layer(nn.Module): def __init__(self, in_ch, in_dim, width=1): super(mlp_5layer, self).__init__() self.fc1 = nn.Linear(in_ch * in_dim * in_dim, 256 * width) self.fc2 = nn.Linear(256 * width, 256 * width) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mnmueller/auto_LiRPA
mlp_5layer
false
7,259
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_ch, in_dim, width=1): super().__init__() self.fc1 = nn.Linear(in_ch * in_dim * in_dim, 256 * width) self.fc2 = nn.Linear(256 * width, 256 * width) self.fc3 = nn.Linear(...
mlp_3layer
# 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 mlp_3layer(nn.Module): def __init__(self, in_ch, in_dim, width=1): super(mlp_3layer, self).__init__() self.fc1 = nn.Linear(in_ch * in_dim * in_dim, 256 * width) self.fc2 = nn.Linear(256 * width, 128 * width) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mnmueller/auto_LiRPA
mlp_3layer
false
7,261
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_ch, in_dim, width=1): super().__init__() self.fc1 = nn.Linear(in_ch * in_dim * in_dim, 256 * width) self.fc2 = nn.Linear(256 * width, 128 * width) self.fc3 = nn.Linear(...
AdaptiveInstanceNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from math import sqrt def equal_lr(module, name='weight'): EqualLR.apply(module, name) return module class EqualLR: def __init__(self, name): self.name = name def compute_weight(self, module): weight = getattr(module, self.name + '_orig') ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
mmhnoaccount/DeepChroma_128
AdaptiveInstanceNorm
false
7,262
[ "MIT" ]
1
337ec961bfc4ee44f48cb84e624c293ee2805b62
https://github.com/mmhnoaccount/DeepChroma_128/tree/337ec961bfc4ee44f48cb84e624c293ee2805b62
import torch import torch.nn as nn from math import sqrt def equal_lr(module, name='weight'): EqualLR.apply(module, name) return module class EqualLR: def __init__(self, name): self.name = name def compute_weight(self, module): weight = getattr(module, self.name + '_orig') ...
cnn_4layer
# 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 cnn_4layer(nn.Module): def __init__(self, in_ch, in_dim, width=2, linear_size=256): super(cnn_4layer, self).__init__() self.conv1 = nn.Conv2d(in_ch, 4 * width, 4, stride=2, padding=1) self.conv2 = nn.Conv2d(4 * width...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mnmueller/auto_LiRPA
cnn_4layer
false
7,263
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_ch, in_dim, width=2, linear_size=256): super().__init__() self.conv1 = nn.Conv2d(in_ch, 4 * width, 4, stride=2, padding=1) self.conv2 = nn.Conv2d(4 * width, 8 * width, 4, strid...
cnn_4layer_LeakyRelu
# 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 cnn_4layer_LeakyRelu(nn.Module): def __init__(self, in_ch, in_dim, width=2, linear_size=256, alpha=0.1): super(cnn_4layer_LeakyRelu, self).__init__() self.conv1 = nn.Conv2d(in_ch, 4 * width, 4, stride=2, padding=1) s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
mnmueller/auto_LiRPA
cnn_4layer_LeakyRelu
false
7,264
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_ch, in_dim, width=2, linear_size=256, alpha=0.1): super().__init__() self.conv1 = nn.Conv2d(in_ch, 4 * width, 4, stride=2, padding=1) self.conv2 = nn.Conv2d(4 * width, 8 * widt...
Net2
# 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 Net2(nn.Module): """ Net2 is a more complex network consisting of two hidden layers with 400 and 300 neurons """ hidden1 = 400 hidden2 = 300 def __init__(self, input_size): super(Net2, self).__init__() self.fc1 = nn.Linear(input_size...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
moritzschaefer/pavooc
Net2
false
7,265
[ "MIT" ]
1
735f5455f9a95a5734436a24e2aa92cf600c91af
https://github.com/moritzschaefer/pavooc/tree/735f5455f9a95a5734436a24e2aa92cf600c91af
import torch from torch import nn class Model(nn.Module): """ Net2 is a more complex network consisting of two hidden layers with 400 and 300 neurons """ hidden1 = 400 hidden2 = 300 def __init__(self, input_size): super().__init__() self.fc1 = nn.Linear(input_size, self.hi...
Debugnetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn from torch.nn import init class conv(nn.Module): """ n*n conv with relu """ def __init__(self, in_dim, out_dim, kernal_size, stride, padding): super(conv, self).__init__() self.con_layer = nn.Conv2d(in_di...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn from to...
H-Liu1997/Pytorch_Pose_Estimation_Framework
Debugnetwork
false
7,266
[ "MIT" ]
1
06616b3459ff639f8486e6ea4f93922597788b2a
https://github.com/H-Liu1997/Pytorch_Pose_Estimation_Framework/tree/06616b3459ff639f8486e6ea4f93922597788b2a
from _paritybench_helpers import _mock_config import torch import torch.nn as nn from torch.nn import init class conv(nn.Module): """ n*n conv with relu """ def __init__(self, in_dim, out_dim, kernal_size, stride, padding): super().__init__() self.con_layer = nn.Conv2d(in_dim, out_dim...
NeuralNet
# 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 NeuralNet(nn.Module): def __init__(self, num_input_nodes, num_hidden_nodes, output_dimension): super(NeuralNet, self).__init__() self.input_linear = nn.Linear(num_input_nodes, num_hidden_nodes) self.output_linear = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mohiitgupta/named-entity-recognition-nlp-purdue
NeuralNet
false
7,267
[ "MIT" ]
1
68232bbd5d17f3e3989e5df37175cdc670896608
https://github.com/mohiitgupta/named-entity-recognition-nlp-purdue/tree/68232bbd5d17f3e3989e5df37175cdc670896608
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_input_nodes, num_hidden_nodes, output_dimension): super().__init__() self.input_linear = nn.Linear(num_input_nodes, num_hidden_nodes) self.output_linear = nn.Linear(num_hidden...
LoRALayer
# 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 import torch.utils.data class LoRALayer(nn.Module): def __init__(self, n_in, n_out=None, adapter_dim=16, adapter_alpha=32): super(LoRALayer, self).__init__() if not n_out: n_out = n_in self.adapter_dim = adapter_dim ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.nn.parallel import torch.utils.data assert_siz...
mojishoki/LoRA
LoRALayer
false
7,268
[ "MIT" ]
1
556225e776b4e2c5f77d332db15f0c712c13fe0e
https://github.com/mojishoki/LoRA/tree/556225e776b4e2c5f77d332db15f0c712c13fe0e
import torch from torch import nn import torch.nn.parallel import torch.utils.data class Model(nn.Module): def __init__(self, n_in, n_out=None, adapter_dim=16, adapter_alpha=32): super().__init__() if not n_out: n_out = n_in self.adapter_dim = adapter_dim self.adapter_...
NetVLAD
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np from torch import nn import torch.nn.functional as F class NetVLAD(nn.Module): """NetVLAD layer implementation""" def __init__(self, dim, num_clusters=64): """ Args: dim : int Dimension of descriptors num_clusters : int ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
lulor/project_vg
NetVLAD
false
7,269
[ "MIT" ]
1
27b0c3b3038c5a666dde516a0a265ae8ddf2059f
https://github.com/lulor/project_vg/tree/27b0c3b3038c5a666dde516a0a265ae8ddf2059f
import torch import numpy as np from torch import nn import torch.nn.functional as F class Model(nn.Module): """NetVLAD layer implementation""" def __init__(self, dim, num_clusters=64): """ Args: dim : int Dimension of descriptors num_clusters : int ...
DuelingNet
# 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 DuelingNet(nn.Module): def __init__(self, n_in, n_mid, n_out): super(DuelingNet, self).__init__() self.fc1 = nn.Linear(n_in, n_mid) self.fc2 = nn.Linear(n_mid, n_mid) self.fc3_adv = nn.Linear(n_mid, n_out) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
moriaki3193/Torch26
DuelingNet
false
7,271
[ "MIT" ]
1
fb75f6b6bb07c63fedb03fad7b647837eb40db2e
https://github.com/moriaki3193/Torch26/tree/fb75f6b6bb07c63fedb03fad7b647837eb40db2e
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, n_in, n_mid, n_out): super().__init__() self.fc1 = nn.Linear(n_in, n_mid) self.fc2 = nn.Linear(n_mid, n_mid) self.fc3_adv = nn.Linear(n_mid, n_out) self.fc3_val = n...
AveragePooling
# 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 AveragePooling(nn.Module): def __init__(self): super(AveragePooling, self).__init__() """ (item, subitem) can be (word, characters), or (sentence, words) x: num_items x max_subitem_size x input_size x_mask: num_items x max_subitem_size retu...
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...
mpandeydev/SDnetmod
AveragePooling
false
7,272
[ "MIT" ]
1
c8cdf6150e3cd28330359a7d81df236729522a69
https://github.com/mpandeydev/SDnetmod/tree/c8cdf6150e3cd28330359a7d81df236729522a69
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() """ (item, subitem) can be (word, characters), or (sentence, words) x: num_items x max_subitem_size x input_size x_mask: num_items x max_subitem_size return num_items x input_size ...
SinenetComponent
# 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 SinenetComponent(torch.nn.Module): def __init__(self, time_len, i): super().__init__() self.time_len = time_len self.i = i self.t_wav = 1.0 / 16000 self.log_f_mean = 5.02654 self.log_f_std = 0.373288 self.a = torch.nn.Parameter(torch.Tens...
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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_str...
moquan/22_Nov_2018
SinenetComponent
false
7,273
[ "MIT" ]
1
eaa81bf5050d74612fe1322abcdb26a0a919e976
https://github.com/moquan/22_Nov_2018/tree/eaa81bf5050d74612fe1322abcdb26a0a919e976
import torch class Model(torch.nn.Module): def __init__(self, time_len, i): super().__init__() self.time_len = time_len self.i = i self.t_wav = 1.0 / 16000 self.log_f_mean = 5.02654 self.log_f_std = 0.373288 self.a = torch.nn.Parameter(torch.Tensor(1)) ...
Net3
# 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 Net3(nn.Module): """ Net3 is a neural network consisting of four hidden layers with sizes 400, 300, 300 and 70 """ layer_sizes = [400, 300, 300, 70] hidden1 = 400 hidden2 = 300 hidden3 = 300 hidden4 = 70 def __init__(self, input_size): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
moritzschaefer/pavooc
Net3
false
7,274
[ "MIT" ]
1
735f5455f9a95a5734436a24e2aa92cf600c91af
https://github.com/moritzschaefer/pavooc/tree/735f5455f9a95a5734436a24e2aa92cf600c91af
import torch from torch import nn class Model(nn.Module): """ Net3 is a neural network consisting of four hidden layers with sizes 400, 300, 300 and 70 """ layer_sizes = [400, 300, 300, 70] hidden1 = 400 hidden2 = 300 hidden3 = 300 hidden4 = 70 def __init__(self, input_size): ...
MaxPooling
# 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 MaxPooling(nn.Module): def __init__(self): super(MaxPooling, self).__init__() self.MIN = -1000000.0 """ (item, subitem) can be (word, characters), or (sentence, words) x: num_items x max_subitem_size x input_size x_mask: num_items x max_...
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...
mpandeydev/SDnetmod
MaxPooling
false
7,275
[ "MIT" ]
1
c8cdf6150e3cd28330359a7d81df236729522a69
https://github.com/mpandeydev/SDnetmod/tree/c8cdf6150e3cd28330359a7d81df236729522a69
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.MIN = -1000000.0 """ (item, subitem) can be (word, characters), or (sentence, words) x: num_items x max_subitem_size x input_size x_mask: num_items x max_subitem_size ret...
Actor
# 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 Actor(torch.nn.Module): def __init__(self, numObs, numActions): super(Actor, self).__init__() self.actor_input = nn.Linear(numObs, 32) self.actor_fc1 = nn.Linear(32, 32) self.actor_output = nn.Linear(32, numA...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mpgussert/fundamentalRL
Actor
false
7,276
[ "MIT" ]
1
4f45436226e0823c21cac316dec8bbf1df697467
https://github.com/mpgussert/fundamentalRL/tree/4f45436226e0823c21cac316dec8bbf1df697467
import torch import torch.nn.functional as F import torch.nn as nn class Model(torch.nn.Module): def __init__(self, numObs, numActions): super().__init__() self.actor_input = nn.Linear(numObs, 32) self.actor_fc1 = nn.Linear(32, 32) self.actor_output = nn.Linear(32, numActions) ...
Agent
# 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 Agent(torch.nn.Module): def __init__(self, numObs, numActions): super(Agent, self).__init__() self.critic_input = nn.Linear(numObs, 32) self.critic_fc1 = nn.Linear(32, 32) self.critic_output = nn.Linear(32, 1...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
mpgussert/fundamentalRL
Agent
false
7,277
[ "MIT" ]
1
4f45436226e0823c21cac316dec8bbf1df697467
https://github.com/mpgussert/fundamentalRL/tree/4f45436226e0823c21cac316dec8bbf1df697467
import torch import torch.nn.functional as F import torch.nn as nn class Model(torch.nn.Module): def __init__(self, numObs, numActions): super().__init__() self.critic_input = nn.Linear(numObs, 32) self.critic_fc1 = nn.Linear(32, 32) self.critic_output = nn.Linear(32, 1) s...
cnn_7layer_alt
# 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 cnn_7layer_alt(nn.Module): def __init__(self, in_ch, in_dim, width=2, linear_size=128): super(cnn_7layer_alt, self).__init__() self.conv1 = nn.Conv2d(in_ch, 4 * width, 3, stride=1, padding=1) self.conv2 = nn.Conv2d(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_...
mnmueller/auto_LiRPA
cnn_7layer_alt
false
7,278
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_ch, in_dim, width=2, linear_size=128): super().__init__() self.conv1 = nn.Conv2d(in_ch, 4 * width, 3, stride=1, padding=1) self.conv2 = nn.Conv2d(4 * width, 4 * width, 4, strid...
Inception
# 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 BasicConv2d(nn.Module): def __init__(self, in_planes, out_planes, kernel_size, stride=1, padding=0, output_relu=True): super(BasicConv2d, self).__init__() self.conv = nn.Conv2d(in_planes, out_planes, kernel_size= kernel_size, stride=str...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
moh2236945/pytorch_classification
Inception
false
7,279
[ "MIT" ]
1
8816f08af327e06208b348a78d9c63c133b6a628
https://github.com/moh2236945/pytorch_classification/tree/8816f08af327e06208b348a78d9c63c133b6a628
import torch import torch.nn as nn class BasicConv2d(nn.Module): def __init__(self, in_planes, out_planes, kernel_size, stride=1, padding=0, output_relu=True): super().__init__() self.conv = nn.Conv2d(in_planes, out_planes, kernel_size= kernel_size, stride=stride, padding=padd...
SharedAgent
# 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 SharedAgent(torch.nn.Module): """ A simple two headed / chimera Actor Critic agent. The actor and critic share the body of the network. It is argued that this is because "good" actions correlate to visiting states with "larg...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mpgussert/fundamentalRL
SharedAgent
false
7,280
[ "MIT" ]
1
4f45436226e0823c21cac316dec8bbf1df697467
https://github.com/mpgussert/fundamentalRL/tree/4f45436226e0823c21cac316dec8bbf1df697467
import torch import torch.nn.functional as F import torch.nn as nn class Model(torch.nn.Module): """ A simple two headed / chimera Actor Critic agent. The actor and critic share the body of the network. It is argued that this is because "good" actions correlate to visiting states with "large" val...
BoundNot
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from _paritybench_helpers import _mock_config import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn import MSELoss def isnan(x): if isinstance(x, Patches): return False return torch.isnan(x).any() class Perturbation: def __init__(self): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import numpy as np import torch.nn as nn import torch.nn.functional as F assert_size_stride = torch._C._dynamo.guards.assert_siz...
mnmueller/auto_LiRPA
BoundNot
false
7,281
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
from _paritybench_helpers import _mock_config import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn import MSELoss def isnan(x): if isinstance(x, Patches): return False return torch.isnan(x).any() class Perturbation: def __init__(self): ...
Net5
# 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.init import kaiming_normal from torch.nn.init import normal def weights_init(m): if isinstance(m, (nn.Conv1d, nn.Linear)): kaiming_normal(m.weight.data) try: kaiming_normal(m.bias.data) except ValueError: normal(m.bias...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 from tor...
moritzschaefer/pavooc
Net5
false
7,282
[ "MIT" ]
1
735f5455f9a95a5734436a24e2aa92cf600c91af
https://github.com/moritzschaefer/pavooc/tree/735f5455f9a95a5734436a24e2aa92cf600c91af
import torch from torch import nn from torch.nn.init import kaiming_normal from torch.nn.init import normal def weights_init(m): if isinstance(m, (nn.Conv1d, nn.Linear)): kaiming_normal(m.weight.data) try: kaiming_normal(m.bias.data) except ValueError: normal(m.bias...
Net4
# 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.init import kaiming_normal from torch.nn.init import normal def weights_init(m): if isinstance(m, (nn.Conv1d, nn.Linear)): kaiming_normal(m.weight.data) try: kaiming_normal(m.bias.data) except ValueError: normal(m.bias...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 from tor...
moritzschaefer/pavooc
Net4
false
7,283
[ "MIT" ]
1
735f5455f9a95a5734436a24e2aa92cf600c91af
https://github.com/moritzschaefer/pavooc/tree/735f5455f9a95a5734436a24e2aa92cf600c91af
import torch from torch import nn from torch.nn.init import kaiming_normal from torch.nn.init import normal def weights_init(m): if isinstance(m, (nn.Conv1d, nn.Linear)): kaiming_normal(m.weight.data) try: kaiming_normal(m.bias.data) except ValueError: normal(m.bias...
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
# 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 import torch.onnx class NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency(torch .nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency , self).__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
mrshu/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
false
7,284
[ "MIT" ]
1
335edaa2c485ba0dec877bf4cdbd652e2d5d105c
https://github.com/mrshu/onnxruntime/tree/335edaa2c485ba0dec877bf4cdbd652e2d5d105c
import torch import torch.nn import torch.onnx class Model(torch .nn.Module): def __init__(self, input_size, hidden_size, num_classes): super().__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size) self.fc2 = torch.nn.Linear(input_size, hidden_size) self.relu1 = torch...
NIN
# 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 string import torch import numpy as np import torch.utils.data import torch import torch.nn as nn def _einsum(a, b, c, x, y): einsum_str = '{},{}->{}'.format(''.join(a), ''.join(b), ''.join(c)) return torch.einsum(einsum_str, x, y) def contract_inner(x, y): """tensordot(x, y, 1).""" x_chars =...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 string import numpy as np import torch.utils.data import torch import tor...
mrjavoman/Image-Super-Resolution-via-Iterative-Refinement
NIN
false
7,285
[ "Apache-2.0" ]
1
2eb11d972e8e024c3b1d7a84f90895e329b5b408
https://github.com/mrjavoman/Image-Super-Resolution-via-Iterative-Refinement/tree/2eb11d972e8e024c3b1d7a84f90895e329b5b408
import string import torch import numpy as np import torch.utils.data import torch import torch.nn as nn def _einsum(a, b, c, x, y): einsum_str = '{},{}->{}'.format(''.join(a), ''.join(b), ''.join(c)) return torch.einsum(einsum_str, x, y) def contract_inner(x, y): """tensordot(x, y, 1).""" x_chars =...
NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency
# 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 import torch.onnx class NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency(torch. nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency, self).__init__() s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
mrshu/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency
false
7,286
[ "MIT" ]
1
335edaa2c485ba0dec877bf4cdbd652e2d5d105c
https://github.com/mrshu/onnxruntime/tree/335edaa2c485ba0dec877bf4cdbd652e2d5d105c
import torch import torch.nn import torch.onnx class Model(torch. nn.Module): def __init__(self, input_size, hidden_size, num_classes): super().__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size) self.relu = torch.nn.ReLU() self.fc2 = torch.nn.Linear(hidden_size, nu...
BoundReciprocal
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from _paritybench_helpers import _mock_config import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn import MSELoss def isnan(x): if isinstance(x, Patches): return False return torch.isnan(x).any() class Perturbation: def __init__(self): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import numpy as np import torch.nn as nn import torch.nn.functional as F assert_size_stride = torch._C._dynamo.guards.assert_siz...
mnmueller/auto_LiRPA
BoundReciprocal
false
7,287
[ "BSD-3-Clause" ]
1
55cb270b0b99f07b74541d55706c69fbb9daff66
https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66
from _paritybench_helpers import _mock_config import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn import MSELoss def isnan(x): if isinstance(x, Patches): return False return torch.isnan(x).any() class Perturbation: def __init__(self): ...
WeightL1Loss
# 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 WeightL1Loss(nn.Module): def __init__(self): super(WeightL1Loss, self).__init__() def forward(self, pred_loc, label_loc, loss_weight): b, _, sh, sw = pred_loc.size() pred_loc = pred_loc.view(b, 4, -1, sh, sw) diff = (pred_loc - label_l...
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 ...
mshmoon/siamrpn-lightweight
WeightL1Loss
false
7,288
[ "MIT" ]
1
f6527e34c9eaaeb45817b12babd78ee73b1c7525
https://github.com/mshmoon/siamrpn-lightweight/tree/f6527e34c9eaaeb45817b12babd78ee73b1c7525
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, pred_loc, label_loc, loss_weight): b, _, sh, sw = pred_loc.size() pred_loc = pred_loc.view(b, 4, -1, sh, sw) diff = (pred_loc - label_loc).abs() diff = ...
Corr
# 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 Corr(nn.Module): def __init__(self): super(Corr, self).__init__() def forward(self, x, kernel): batch = kernel.size(0) channel = kernel.size(1) x = x.view(1, batch * channel, x.size(2), x.size(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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
mshmoon/siamrpn-lightweight
Corr
false
7,289
[ "MIT" ]
1
f6527e34c9eaaeb45817b12babd78ee73b1c7525
https://github.com/mshmoon/siamrpn-lightweight/tree/f6527e34c9eaaeb45817b12babd78ee73b1c7525
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x, kernel): batch = kernel.size(0) channel = kernel.size(1) x = x.view(1, batch * channel, x.size(2), x.size(3)) kernel ...
BernoulliLogProb
# 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 import torch.utils.data class BernoulliLogProb(nn.Module): def __init__(self): super().__init__() self.bce_with_logits = nn.BCEWithLogitsLoss(reduction='none') def forward(self, logits, target): return -self.bce_with_logits(logits...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
msunardi/vae_experiment
BernoulliLogProb
false
7,290
[ "MIT" ]
1
e3ce39e586f1189d157e753370a90c07713658b3
https://github.com/msunardi/vae_experiment/tree/e3ce39e586f1189d157e753370a90c07713658b3
import torch import torch.nn as nn import torch.utils import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() self.bce_with_logits = nn.BCEWithLogitsLoss(reduction='none') def forward(self, logits, target): return -self.bce_with_logits(logits, target) ...
LogSoftMax
# 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 LogSoftMax(nn.Module): def __init__(self): super(LogSoftMax, self).__init__() def forward(self, cls): b, a2, h, w = cls.size() cls = cls.view(b, 2, a2 // 2, h, w) cls = cls.permute(0, 2, 3, 4, 1).contigu...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
mshmoon/siamrpn-lightweight
LogSoftMax
false
7,291
[ "MIT" ]
1
f6527e34c9eaaeb45817b12babd78ee73b1c7525
https://github.com/mshmoon/siamrpn-lightweight/tree/f6527e34c9eaaeb45817b12babd78ee73b1c7525
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, cls): b, a2, h, w = cls.size() cls = cls.view(b, 2, a2 // 2, h, w) cls = cls.permute(0, 2, 3, 4, 1).contiguous() cls = F...
DistillLoss
# 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.functional as F class DistillLoss(nn.Module): def __init__(self, temperature, distillation_weight): super().__init__() self.temperature = temperature self.distillation_weight = distillation_weight self.kldiv = nn.KLDivLoss(reductio...
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 ...
mrtunguyen/knowledge_distillation
DistillLoss
false
7,292
[ "MIT" ]
1
dd114e980dbebda6cc247f658eb801ab948ee6ba
https://github.com/mrtunguyen/knowledge_distillation/tree/dd114e980dbebda6cc247f658eb801ab948ee6ba
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, temperature, distillation_weight): super().__init__() self.temperature = temperature self.distillation_weight = distillation_weight self.kldiv = nn.KLDivLoss(reduction='bat...
LinRegModel
# 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 LinRegModel(nn.Module): def __init__(self): super().__init__() self.a = nn.Parameter(torch.randn(1)) self.b = nn.Parameter(torch.randn(1)) def forward(self, x): return self.a * x + self.b def get_inputs(): return [torch.rand([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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
muellerzr/walk-with-deep-learning
LinRegModel
false
7,293
[ "Apache-2.0" ]
1
4adbf26da4885d122ed305eccef3efbb6fb10df5
https://github.com/muellerzr/walk-with-deep-learning/tree/4adbf26da4885d122ed305eccef3efbb6fb10df5
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.a = nn.Parameter(torch.randn(1)) self.b = nn.Parameter(torch.randn(1)) def forward(self, x): return self.a * x + self.b def get_inputs(): return [torch.rand([4, 4, 4, ...
NormalLogProb
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import numpy as np import torch.nn as nn import torch.utils import torch.utils.data class NormalLogProb(nn.Module): def __init__(self): super().__init__() def forward(self, loc, scale, z): var = torch.pow(scale, 2) return -0.5 * torch.log(2 * np.pi * var) - torch.pow(z -...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn import torch.utils import torch.utils.data assert_s...
msunardi/vae_experiment
NormalLogProb
false
7,294
[ "MIT" ]
1
e3ce39e586f1189d157e753370a90c07713658b3
https://github.com/msunardi/vae_experiment/tree/e3ce39e586f1189d157e753370a90c07713658b3
import torch import numpy as np import torch.nn as nn import torch.utils import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() def forward(self, loc, scale, z): var = torch.pow(scale, 2) return -0.5 * torch.log(2 * np.pi * var) - torch.pow(z - loc, 2)...
VGGNet
# 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 VGGNet(nn.Module): def __init__(self): super(VGGNet, self).__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) self.conv2 = nn.Conv2d(32, 32, kernel_size=(3, 3), st...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
miyosuda/oculomotor
VGGNet
false
7,295
[ "Apache-2.0" ]
1
78e7ec61a808d058116c69bff1ea71ecf117c126
https://github.com/miyosuda/oculomotor/tree/78e7ec61a808d058116c69bff1ea71ecf117c126
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) self.conv2 = nn.Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), ...
CNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class CNN(nn.Module): """ CNN for heat shock protein classification """ def __init__(self, model_cfg, in_channels, dropout_rate): super(CNN, self).__init__() self.embedder = model_cfg.embedder if self.emb...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mswzeus/DeeperHSP
CNN
false
7,296
[ "MIT" ]
1
571387f048d3c33fcd78730fdaef57b6c44a27a7
https://github.com/mswzeus/DeeperHSP/tree/571387f048d3c33fcd78730fdaef57b6c44a27a7
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): """ CNN for heat shock protein classification """ def __init__(self, model_cfg, in_channels, dropout_rate): super().__init__() self.embedder = model_cfg.embedder if self.embedder !...
BlendLinear
# 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 BlendLinear(nn.Module): def __init__(self, dim_in, dim_out, layer_type=nn.Linear, **unused_kwargs): super(BlendLinear, self).__init__() self._layer0 = layer_type(dim_in, dim_out) self._layer1 = layer_type(dim_in, dim_out) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dyn...
musyoku/ffjord
BlendLinear
false
7,297
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, dim_in, dim_out, layer_type=nn.Linear, **unused_kwargs): super().__init__() self._layer0 = layer_type(dim_in, dim_out) self._layer1 = layer_type(dim_in, dim_out) def forward(self, t,...
BlendConv2d
# 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 BlendConv2d(nn.Module): def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0, dilation=1, groups=1, bias=True, transpose=False, **unused_kwargs): super(BlendConv2d, self).__init__() module = nn.ConvTranspose2d 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 import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dyn...
musyoku/ffjord
BlendConv2d
false
7,298
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0, dilation=1, groups=1, bias=True, transpose=False, **unused_kwargs): super().__init__() module = nn.ConvTranspose2d if transpose else nn.Conv...
GINPreTransition
# 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 typing import torch.nn as nn class MLP(nn.Module): def __init__(self, input_dim, hidden_sizes: 'typing.Iterable[int]', out_dim, activation_function=nn.Sigmoid(), activation_out=None): super(MLP, self).__init__() i_h_sizes = [input_dim] + hidden_sizes self.mlp =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 typing impor...
mtiezzi/gnn_site
GINPreTransition
false
7,299
[ "BSD-3-Clause" ]
1
79a13603db876ac24e66a152104faa8b76e1d8e7
https://github.com/mtiezzi/gnn_site/tree/79a13603db876ac24e66a152104faa8b76e1d8e7
import torch import typing import torch.nn as nn class MLP(nn.Module): def __init__(self, input_dim, hidden_sizes: 'typing.Iterable[int]', out_dim, activation_function=nn.Sigmoid(), activation_out=None): super().__init__() i_h_sizes = [input_dim] + hidden_sizes self.mlp = nn.Seque...
ConcatSquashLinear
# 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 ConcatSquashLinear(nn.Module): def __init__(self, dim_in, dim_out): super(ConcatSquashLinear, self).__init__() self._layer = nn.Linear(dim_in, dim_out) self._hyper_bias = nn.Linear(1, dim_out, bias=False) self._hyper...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
musyoku/ffjord
ConcatSquashLinear
false
7,300
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, dim_in, dim_out): super().__init__() self._layer = nn.Linear(dim_in, dim_out) self._hyper_bias = nn.Linear(1, dim_out, bias=False) self._hyper_gate = nn.Linear(1, dim_out) de...
ConcatSquashConv2d
# 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 ConcatSquashConv2d(nn.Module): def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0, dilation=1, groups=1, bias=True, transpose=False): super(ConcatSquashConv2d, self).__init__() module = nn.ConvTranspose2d if tr...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dyn...
musyoku/ffjord
ConcatSquashConv2d
false
7,301
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0, dilation=1, groups=1, bias=True, transpose=False): super().__init__() module = nn.ConvTranspose2d if transpose else nn.Conv2d self._...
GatedConv
# 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 GatedConv(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, groups=1): super(GatedConv, self).__init__() self.layer_f = nn.Conv2d(in_channels, out_channels, kernel_size, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dyn...
musyoku/ffjord
GatedConv
false
7,302
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, groups=1): super().__init__() self.layer_f = nn.Conv2d(in_channels, out_channels, kernel_size, stride=stride, padd...
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...
musyoku/ffjord
GatedConv2d
false
7,303
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
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...
GatedConvTranspose
# 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 GatedConvTranspose(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1): super(GatedConvTranspose, self).__init__() self.layer_f = nn.ConvTranspose2d(in_chan...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
musyoku/ffjord
GatedConvTranspose
false
7,304
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1): super().__init__() self.layer_f = nn.ConvTranspose2d(in_channels, out_channels, kerne...
HyperConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data def weights_init(m): classname = m.__class__.__name__ if classname.find('Linear') != -1 or classname.find('Conv') != -1: nn.init.constant_(m.weight, 0) nn.init.normal_(m.bias, 0, 0.01) class HyperConv2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.functional as F import torch.utils.data as...
musyoku/ffjord
HyperConv2d
false
7,305
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data def weights_init(m): classname = m.__class__.__name__ if classname.find('Linear') != -1 or classname.find('Conv') != -1: nn.init.constant_(m.weight, 0) nn.init.normal_(m.bias, 0, 0.01) class Model(nn.M...
BasicBlock
# 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 BasicBlock(nn.Module): expansion = 1 def __init__(self, dim): super(BasicBlock, self).__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=3, padding=1, bias=False) self.bn1 = nn.GroupNorm(2, dim, eps=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 import triton_helpers from torch._inductor.runtime....
musyoku/ffjord
BasicBlock
false
7,306
[ "MIT" ]
1
9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): expansion = 1 def __init__(self, dim): super().__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=3, padding=1, bias=False) self.bn1 = nn.GroupNorm(2, dim, eps=0.0001) self.relu = nn.ReLU(i...
PNTrainingSigmoid
# 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 PNTrainingSigmoid(nn.Module): def __init__(self): super(PNTrainingSigmoid, self).__init__() return def forward(self, output_p, output_n, prior): cost = prior * torch.mean(torch.sigmoid(-output_p)) cost = cost + (1 - prior) * torch.mean(...
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...
mxuq/Imbalance-PU
PNTrainingSigmoid
false
7,307
[ "MIT" ]
1
fd4403b05f98ca6bc8156783e8275888d63f6435
https://github.com/mxuq/Imbalance-PU/tree/fd4403b05f98ca6bc8156783e8275888d63f6435
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() return def forward(self, output_p, output_n, prior): cost = prior * torch.mean(torch.sigmoid(-output_p)) cost = cost + (1 - prior) * torch.mean(torch.sigmoid(output_n)) re...
TwoWordPSDProbe
# 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 Probe(nn.Module): pass class TwoWordPSDProbe(Probe): """ Computes squared L2 distance after projection by a matrix. For a batch of sentences, computes all n^2 pairs of distances for each sentence in the batch. """ def __init__(self, model_dim, probe_...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
muziyongshixin/pytorch_SSRP
TwoWordPSDProbe
false
7,308
[ "MIT" ]
1
e54b3098927ba2ff16bdc8f64f3a2bf46d1f72c5
https://github.com/muziyongshixin/pytorch_SSRP/tree/e54b3098927ba2ff16bdc8f64f3a2bf46d1f72c5
import torch import torch.nn as nn class Probe(nn.Module): pass class Model(Probe): """ Computes squared L2 distance after projection by a matrix. For a batch of sentences, computes all n^2 pairs of distances for each sentence in the batch. """ def __init__(self, model_dim, probe_rank=1024)...
GroupPointWise
# 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 GroupPointWise(nn.Module): def __init__(self, in_dim, n_heads=4, proj_factor=1, target_dim=None): super().__init__() if target_dim is not None: proj_ch = target_dim // proj_factor else: proj_ch = in_dim // proj_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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
nachiket273/VisTrans
GroupPointWise
false
7,309
[ "MIT" ]
1
99129b02f275424ebff900189ec2055f26bb9912
https://github.com/nachiket273/VisTrans/tree/99129b02f275424ebff900189ec2055f26bb9912
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_dim, n_heads=4, proj_factor=1, target_dim=None): super().__init__() if target_dim is not None: proj_ch = target_dim // proj_factor else: proj_ch = in_dim // proj_factor self.w ...
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 math import torch import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): def __init__(self, embed_dim, hidden_dim=None, out_dim=None, n_head=1, score_function='scaled_dot_product', dropout=0): """ Attention Mechanism :param embed_dim: :param hidde...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
n-log-n/ABSA-PyTorch
Attention
false
7,310
[ "MIT" ]
1
27b37e05954940fe37369cc679c080d1d8717362
https://github.com/n-log-n/ABSA-PyTorch/tree/27b37e05954940fe37369cc679c080d1d8717362
import math import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, embed_dim, hidden_dim=None, out_dim=None, n_head=1, score_function='scaled_dot_product', dropout=0): """ Attention Mechanism :param embed_dim: :param hidden_di...
FitnetRegressor
# 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 class FitnetRegressor(torch.nn.Module): def __init__(self, in_feature, out_feature): super(FitnetRegressor, self).__init__() self.in_feature = in_feature self.out_feature = out_feature self.regressor = torch.nn.Conv2d(in_feature, out_fe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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...
naver-ai/cgl_fairness
FitnetRegressor
false
7,311
[ "MIT" ]
1
00d3bec233c9b3e0f88496118abaed8321ca3159
https://github.com/naver-ai/cgl_fairness/tree/00d3bec233c9b3e0f88496118abaed8321ca3159
import torch import torch.nn.functional as F class Model(torch.nn.Module): def __init__(self, in_feature, out_feature): super().__init__() self.in_feature = in_feature self.out_feature = out_feature self.regressor = torch.nn.Conv2d(in_feature, out_feature, 1, bias=False ...
ZeroOneTest
# 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 ZeroOneTest(nn.Module): def __init__(self): super(ZeroOneTest, self).__init__() return def forward(self, output_p, output_n, prior): cost = prior * torch.mean((1 - torch.sign(output_p)) / 2) cost = cost + (1 - prior) * torch.mean((1 + t...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
mxuq/Imbalance-PU
ZeroOneTest
false
7,312
[ "MIT" ]
1
fd4403b05f98ca6bc8156783e8275888d63f6435
https://github.com/mxuq/Imbalance-PU/tree/fd4403b05f98ca6bc8156783e8275888d63f6435
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() return def forward(self, output_p, output_n, prior): cost = prior * torch.mean((1 - torch.sign(output_p)) / 2) cost = cost + (1 - prior) * torch.mean((1 + torch.sign(output_n)) / ...
Landsat2ViirsNet
# 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 Landsat2ViirsNet(nn.Module): def __init__(self, latent_dim=64, init_channels=8, kernel_size=4, image_in_channels=3, image_out_channels=1): super(Landsat2ViirsNet, self).__init__() self.enc1 = nn.Conv2d(in_channel...
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...
mrmauer/detecting_poverty
Landsat2ViirsNet
false
7,313
[ "MIT" ]
1
2c8a28295264674f5bfe06ef1fed6dd8b898b8b5
https://github.com/mrmauer/detecting_poverty/tree/2c8a28295264674f5bfe06ef1fed6dd8b898b8b5
import torch from torch import nn from torch.nn import functional as F class Model(nn.Module): def __init__(self, latent_dim=64, init_channels=8, kernel_size=4, image_in_channels=3, image_out_channels=1): super().__init__() self.enc1 = nn.Conv2d(in_channels=image_in_channels, out_channels...
VertexDirectEmbedder
# 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 from torch import nn def normalize_embeddings(embeddings: 'torch.Tensor', epsilon: 'float'=1e-06 ) ->torch.Tensor: """ Normalize N D-dimensional embedding vectors arranged in a tensor [N, D] Args: embeddings (tensor [N, D]): N D-dimensional embedding vecto...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.utils.data from...
nationaldronesau/detectron2
VertexDirectEmbedder
false
7,314
[ "Apache-2.0" ]
1
6afaee60eb6e0032b5b2edfbec1179f7e7b7b75f
https://github.com/nationaldronesau/detectron2/tree/6afaee60eb6e0032b5b2edfbec1179f7e7b7b75f
import torch import torch.utils.data from torch import nn def normalize_embeddings(embeddings: 'torch.Tensor', epsilon: 'float'=1e-06 ) ->torch.Tensor: """ Normalize N D-dimensional embedding vectors arranged in a tensor [N, D] Args: embeddings (tensor [N, D]): N D-dimensional embedding vecto...
xTanH
# 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 class xTanH(torch.nn.Module): def forward(self, x: 'torch.Tensor'): return x - torch.tanh(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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride...
nayyarv/bayesnets
xTanH
false
7,315
[ "MIT" ]
1
090abd1a0a91c2b9d6d57a182ee5be1f65a22e11
https://github.com/nayyarv/bayesnets/tree/090abd1a0a91c2b9d6d57a182ee5be1f65a22e11
import torch import torch.nn class Model(torch.nn.Module): def forward(self, x: 'torch.Tensor'): return x - torch.tanh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
LRN
# 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 LRN(nn.Module): def __init__(self, local_size=1, alpha=1.0, beta=0.75, ACROSS_CHANNELS= False): super(LRN, self).__init__() self.ACROSS_CHANNELS = ACROSS_CHANNELS if self.ACROSS_CHANNELS: self.average = nn.AvgPool3d(kernel_size=...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
nbswords/Paper-implemention-by-Pytorch
LRN
false
7,316
[ "MIT" ]
1
429514c4f51c41ec7b3013683fb79ad4b4ab4638
https://github.com/nbswords/Paper-implemention-by-Pytorch/tree/429514c4f51c41ec7b3013683fb79ad4b4ab4638
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, local_size=1, alpha=1.0, beta=0.75, ACROSS_CHANNELS= False): super().__init__() self.ACROSS_CHANNELS = ACROSS_CHANNELS if self.ACROSS_CHANNELS: self.average = nn.AvgPool3d(kernel_size=(local_...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F def focal_loss(input_values, gamma=10): """Computes the focal loss""" p = torch.exp(-input_values) loss = (1 - p) ** gamma * input_values return loss.mean() class FocalLoss(nn.Module): def __init__(self, weight=None, gamma=0.5):...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
naver-ai/cgl_fairness
FocalLoss
false
7,317
[ "MIT" ]
1
00d3bec233c9b3e0f88496118abaed8321ca3159
https://github.com/naver-ai/cgl_fairness/tree/00d3bec233c9b3e0f88496118abaed8321ca3159
import torch import torch.nn as nn import torch.nn.functional as F def focal_loss(input_values, gamma=10): """Computes the focal loss""" p = torch.exp(-input_values) loss = (1 - p) ** gamma * input_values return loss.mean() class Model(nn.Module): def __init__(self, weight=None, gamma=0.5): ...
MultiHeadSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.distributed import torch.nn.functional as F import torch.nn as nn class MultiHeadSelfAttention(nn.Module): def __init__(self, config): super(MultiHeadSelfAttention, self).__init__() self.query = nn.Linear(config.h...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
myoons/image-gpt-pytorch
MultiHeadSelfAttention
false
7,318
[ "Apache-2.0" ]
1
d05081250d01ce208796dfb246ea1c9a093237c5
https://github.com/myoons/image-gpt-pytorch/tree/d05081250d01ce208796dfb246ea1c9a093237c5
from _paritybench_helpers import _mock_config import math import torch import torch.distributed import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() self.query = nn.Linear(config.hidden_size, config.hidden_size) self....
Matcher
# 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 class Matcher(nn.Module): """ Matching between a pair of nodes to conduct link prediction. Use multi-head attention as matching model. """ def __init__(self, n_hid): super(Matcher, self).__init__() self.left_linear = nn.Linear...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
nchungvh/pyhgt
Matcher
false
7,319
[ "MIT" ]
1
3cb08ea856ca02aaf1664aa7486024a8742c7567
https://github.com/nchungvh/pyhgt/tree/3cb08ea856ca02aaf1664aa7486024a8742c7567
import math import torch import torch.nn as nn class Model(nn.Module): """ Matching between a pair of nodes to conduct link prediction. Use multi-head attention as matching model. """ def __init__(self, n_hid): super().__init__() self.left_linear = nn.Linear(n_hid, n_hid) ...
Q
# 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 Q(nn.Module): """ Simple fully connected Q function. Also used for skip-Q when concatenating behaviour action and state together. Used for simpler environments such as mountain-car or lunar-lander. """ def __init__(self, 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 import torch.nn as nn import ...
ndangtt/LeadingOnesDAC
Q
false
7,320
[ "Apache-2.0" ]
1
953747d8702f179851d7973c65779a1f830e03a1
https://github.com/ndangtt/LeadingOnesDAC/tree/953747d8702f179851d7973c65779a1f830e03a1
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Simple fully connected Q function. Also used for skip-Q when concatenating behaviour action and state together. Used for simpler environments such as mountain-car or lunar-lander. """ def __init__(self,...
DropoutModel8x8
# 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 func class DropoutModel8x8(nn.Module): def __init__(self, channel): """ Define useful layers Argument: channel: number of channel, or depth or number of different sprite types """ super(DropoutModel8x...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
mwxely/Cross-domain-PCGML-Level-Generator
DropoutModel8x8
false
7,321
[ "MIT" ]
1
baa5d214d6cf22272d144aa6c444a778ac202afe
https://github.com/mwxely/Cross-domain-PCGML-Level-Generator/tree/baa5d214d6cf22272d144aa6c444a778ac202afe
import torch import torch.nn as nn import torch.nn.functional as func class Model(nn.Module): def __init__(self, channel): """ Define useful layers Argument: channel: number of channel, or depth or number of different sprite types """ super().__init__() sel...
Attn
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F from numpy import sqrt class Attn(nn.Module): def __init__(self, hidden_size, batch_first=True): super(Attn, self).__init__() self.hidden_size = hidden_size self.batch_first = batch_first self.weights = nn.Paramete...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
nauhc/biLSTM-many-to-one
Attn
false
7,322
[ "MIT" ]
1
14dab1c75b395c88bdddfe751461af7dc30e1166
https://github.com/nauhc/biLSTM-many-to-one/tree/14dab1c75b395c88bdddfe751461af7dc30e1166
import torch import torch.nn as nn import torch.nn.functional as F from numpy import sqrt class Model(nn.Module): def __init__(self, hidden_size, batch_first=True): super().__init__() self.hidden_size = hidden_size self.batch_first = batch_first self.weights = nn.Parameter(torch.T...
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 from torch import nn import torch.nn.functional as F class VAE(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 400) self.fc21 = nn.Linear(400, 20) self.fc22 = nn.Linear(400, 20) self.fc3 = nn.Linear(20, 400) self.fc4 = nn.L...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
nd1511/argus
VAE
false
7,323
[ "MIT" ]
1
00aaed41ac1321d669ac7060f4d21b24cc3456f0
https://github.com/nd1511/argus/tree/00aaed41ac1321d669ac7060f4d21b24cc3456f0
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 400) self.fc21 = nn.Linear(400, 20) self.fc22 = nn.Linear(400, 20) self.fc3 = nn.Linear(20, 400) self.fc4 = nn...
GCN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import math import torch from torch.nn.parameter import Parameter from torch.nn.modules.module import Module import torch.nn as nn import torch.nn.functional as F class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
negarhdr/PGCN
GCN
false
7,324
[ "MIT" ]
1
5143049afcfadc5ab0173e6083ebbb4fd8c8903d
https://github.com/negarhdr/PGCN/tree/5143049afcfadc5ab0173e6083ebbb4fd8c8903d
from torch.nn import Module import math import torch from torch.nn.parameter import Parameter from torch.nn.modules.module import Module import torch.nn as nn import torch.nn.functional as F class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __in...
Perceptron
# 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 Perceptron(nn.Module): """Implements a 1-layer perceptron.""" def __init__(self, input_dimension, hidden_dimension, output_dimension): super(Perceptron, self).__init__() self._layer1 = nn.Linear(input_dimension, hidden_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_...
negotiatorvivian/SAT-Solver
Perceptron
false
7,325
[ "MIT" ]
1
acbf375ce73103e945aee3e2a225126684a19076
https://github.com/negotiatorvivian/SAT-Solver/tree/acbf375ce73103e945aee3e2a225126684a19076
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Implements a 1-layer perceptron.""" def __init__(self, input_dimension, hidden_dimension, output_dimension): super().__init__() self._layer1 = nn.Linear(input_dimension, hidden_dimension) sel...
PerceptronTanh
# 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 PerceptronTanh(nn.Module): """Implements a 1-layer perceptron with Tanh activaton.""" def __init__(self, input_dimension, hidden_dimension, output_dimension): super(PerceptronTanh, self).__init__() self._layer1 = nn.Line...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
negotiatorvivian/SAT-Solver
PerceptronTanh
false
7,326
[ "MIT" ]
1
acbf375ce73103e945aee3e2a225126684a19076
https://github.com/negotiatorvivian/SAT-Solver/tree/acbf375ce73103e945aee3e2a225126684a19076
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Implements a 1-layer perceptron with Tanh activaton.""" def __init__(self, input_dimension, hidden_dimension, output_dimension): super().__init__() self._layer1 = nn.Linear(input_dimension, hidden_di...
ConfidentMSELoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from torch.nn import Module import torch class ConfidentMSELoss(Module): def __init__(self, threshold=0.96): self.threshold = threshold super().__init__() def forward(self, input, target): n = input.size(0) conf_mask = torch.gt(target, self.threshold).float() input_fl...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module assert_size_stride = torch._C._dynamo.guards.assert_size_stri...
neuropoly/medicaltorch
ConfidentMSELoss
false
7,327
[ "Apache-2.0" ]
1
ac129fe894cb1906285dfe380ba4f0aa3bdec787
https://github.com/neuropoly/medicaltorch/tree/ac129fe894cb1906285dfe380ba4f0aa3bdec787
from torch.nn import Module import torch class Model(Module): def __init__(self, threshold=0.96): self.threshold = threshold super().__init__() def forward(self, input, target): n = input.size(0) conf_mask = torch.gt(target, self.threshold).float() input_flat = input....
Conv2
# 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 class Conv2(nn.Module): """ A convolution layer with the stride of 2. Input: x: (N, 2L+2, in_channels) numeric tensor global_cond: (N, global_cond_channels) numeric tensor Output: y: (N, L, out_channels) numeric te...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
neverix/voice-conv
Conv2
false
7,328
[ "MIT" ]
1
6df0053a59aa26318bdbc096dd312ecc55596ac0
https://github.com/neverix/voice-conv/tree/6df0053a59aa26318bdbc096dd312ecc55596ac0
import math import torch import torch.nn as nn class Model(nn.Module): """ A convolution layer with the stride of 2. Input: x: (N, 2L+2, in_channels) numeric tensor global_cond: (N, global_cond_channels) numeric tensor Output: y: (N, L, out_channels) numeric te...
Attention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): """ Applies an attention mechanism on the query features from the decoder. .. math:: \\begin{array}{ll} x = context*query \\\\ attn_scores = 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....
nguyenxuanhoi2903/SRSF_summarization
Attention
false
7,329
[ "MIT" ]
1
3d19e6b7669e0b22bab533fc637a434f379ed392
https://github.com/nguyenxuanhoi2903/SRSF_summarization/tree/3d19e6b7669e0b22bab533fc637a434f379ed392
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Applies an attention mechanism on the query features from the decoder. .. math:: \\begin{array}{ll} x = context*query \\\\ attn_scores = exp(x_i) / sum_j exp(x_j) \\\\ ...
MinusRbfHSIC
# 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 HSIC(nn.Module): """Base class for the finite sample estimator of Hilbert-Schmidt Independence Criterion (HSIC) ..math:: HSIC (X, Y) := || C_{x, y} ||^2_{HS}, where HSIC (X, Y) = 0 iif X and Y are independent. Empirically, we use the finite sample estimator of HSIC...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
naver-ai/cgl_fairness
MinusRbfHSIC
false
7,330
[ "MIT" ]
1
00d3bec233c9b3e0f88496118abaed8321ca3159
https://github.com/naver-ai/cgl_fairness/tree/00d3bec233c9b3e0f88496118abaed8321ca3159
import torch import torch.nn as nn class HSIC(nn.Module): """Base class for the finite sample estimator of Hilbert-Schmidt Independence Criterion (HSIC) ..math:: HSIC (X, Y) := || C_{x, y} ||^2_{HS}, where HSIC (X, Y) = 0 iif X and Y are independent. Empirically, we use the finite sample estimator of HSIC...
LayerNorm
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class LayerNorm(torch.nn.Module): """ A vanilla implementation of layer normalization https://arxiv.org/pdf/1607.06450.pdf norm_x = (x - mean) / sqrt((x - mean) ^ 2) This does not include the trainable parameters gamma and beta for performance speed. Typically, this is norm_x * gamma...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
netdrones/ml-agents
LayerNorm
false
7,331
[ "Apache-2.0" ]
1
7d7d6f149c92ea2067d7cea364d92c8c3b8db3f4
https://github.com/netdrones/ml-agents/tree/7d7d6f149c92ea2067d7cea364d92c8c3b8db3f4
import torch class Model(torch.nn.Module): """ A vanilla implementation of layer normalization https://arxiv.org/pdf/1607.06450.pdf norm_x = (x - mean) / sqrt((x - mean) ^ 2) This does not include the trainable parameters gamma and beta for performance speed. Typically, this is norm_x * gamma + b...
TokenClassifier
# 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 transformer_weights_init(module, std_init_range=0.02, xavier=True): """ Initialize different weights in Transformer model. Args: module: torch.nn.Module to be initialized std_init_range: standard deviation of normal initializer xavier: if True...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ngxingyu/Domain-Transfer-for-Punctuation-Retrieval
TokenClassifier
false
7,332
[ "Apache-2.0" ]
1
f5aa0ea0946c68aaf7fcf49a5085e6c823766a2f
https://github.com/ngxingyu/Domain-Transfer-for-Punctuation-Retrieval/tree/f5aa0ea0946c68aaf7fcf49a5085e6c823766a2f
import torch import torch.nn as nn def transformer_weights_init(module, std_init_range=0.02, xavier=True): """ Initialize different weights in Transformer model. Args: module: torch.nn.Module to be initialized std_init_range: standard deviation of normal initializer xavier: if True...
MultichannelIamge
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F class ModulatedConv2d(nn.Module): def __init__(self, channels_in, channels_out, style_dim, kernel_size, demodulate=True): super().__init__() self.weight = nn.Parameter(torch.randn(channels_out, channels_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 import math import torch.nn as nn import torch.nn.functional as F assert_size_st...
nhorton04/mobile_styletransfer
MultichannelIamge
false
7,333
[ "Apache-2.0" ]
1
db8b9a61b67fd58b9e4d61457ee58e36800cfbbe
https://github.com/nhorton04/mobile_styletransfer/tree/db8b9a61b67fd58b9e4d61457ee58e36800cfbbe
import math import torch import torch.nn as nn import torch.nn.functional as F class ModulatedConv2d(nn.Module): def __init__(self, channels_in, channels_out, style_dim, kernel_size, demodulate=True): super().__init__() self.weight = nn.Parameter(torch.randn(channels_out, channels_in, ...
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 import torch.utils.data class Net(nn.Module): def __init__(self, input_size, num_classes): super(Net, self).__init__() self.linear1 = nn.Linear(input_size, 128) self.linear2 = nn.Linear(128, 256) self.linear3 = nn....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
nce3xin/spam
Net
false
7,334
[ "MIT" ]
1
908421d5cf2dd103e2a7044bf1c8586aaf5f2ada
https://github.com/nce3xin/spam/tree/908421d5cf2dd103e2a7044bf1c8586aaf5f2ada
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, input_size, num_classes): super().__init__() self.linear1 = nn.Linear(input_size, 128) self.linear2 = nn.Linear(128, 256) self.linear3 = nn.Linear(...
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 import torch.nn as nn class ConvLayer(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride): super(ConvLayer, self).__init__() padding = kernel_size // 2 self.reflection_pad = nn.ReflectionPad2d(padding) self.conv2d = nn.Conv2d(in_channels, ou...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
naver-ai/cgl_fairness
ResidualBlock
false
7,335
[ "MIT" ]
1
00d3bec233c9b3e0f88496118abaed8321ca3159
https://github.com/naver-ai/cgl_fairness/tree/00d3bec233c9b3e0f88496118abaed8321ca3159
import torch import torch.nn as nn class ConvLayer(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride): super().__init__() padding = kernel_size // 2 self.reflection_pad = nn.ReflectionPad2d(padding) self.conv2d = nn.Conv2d(in_channels, out_channels, ker...
PositionGenerator
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class LayerNorm(nn.Module): """Construct a layernorm module (See citation for details).""" def __init__(self, features, eps=1e-06): super(LayerNorm, self).__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(fe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
nigelnnk/MATCh-sensitivity
PositionGenerator
false
7,336
[ "MIT" ]
1
aaf2b924ac98c8c5925bbf431481724d11a102f8
https://github.com/nigelnnk/MATCh-sensitivity/tree/aaf2b924ac98c8c5925bbf431481724d11a102f8
import torch import torch.nn as nn class LayerNorm(nn.Module): """Construct a layernorm module (See citation for details).""" def __init__(self, features, eps=1e-06): super().__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(features)) ...
EdgeFeaturesLayer
# 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 EdgeFeaturesLayer(nn.Module): def __init__(self, d_model, d_edge, h, dropout): super(EdgeFeaturesLayer, self).__init__() assert d_model % h == 0 d_model // h self.linear = nn.Linear(d_edge, 1, bias=False) with torch.no_grad(): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
nigelnnk/MATCh-sensitivity
EdgeFeaturesLayer
false
7,337
[ "MIT" ]
1
aaf2b924ac98c8c5925bbf431481724d11a102f8
https://github.com/nigelnnk/MATCh-sensitivity/tree/aaf2b924ac98c8c5925bbf431481724d11a102f8
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, d_model, d_edge, h, dropout): super().__init__() assert d_model % h == 0 d_model // h self.linear = nn.Linear(d_edge, 1, bias=False) with torch.no_grad(): self.linear.weight.fill_(0.2...
Generator
# 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 class LayerNorm(nn.Module): """Construct a layernorm module (See citation for details).""" def __init__(self, features, eps=1e-06): super(LayerNorm, self).__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(to...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
nigelnnk/MATCh-sensitivity
Generator
false
7,338
[ "MIT" ]
1
aaf2b924ac98c8c5925bbf431481724d11a102f8
https://github.com/nigelnnk/MATCh-sensitivity/tree/aaf2b924ac98c8c5925bbf431481724d11a102f8
import math import torch import torch.nn as nn class LayerNorm(nn.Module): """Construct a layernorm module (See citation for details).""" def __init__(self, features, eps=1e-06): super().__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(featu...
SqueezeNet
# 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 torch import torch.nn as nn import torch.utils.data from torchvision.models.squeezenet import squeezenet1_0 from torchvision.models.squeezenet import squeezenet1_1 import torch.nn.modules.activation class GramMatrix(nn.Module): def forward(self, x): b, c, h, w = x.size() F = 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 copy import torch.nn a...
matherm/ummon3
SqueezeNet
false
7,339
[ "BSD-3-Clause" ]
1
08476d21ce17cc95180525d48202a1690dfc8a08
https://github.com/matherm/ummon3/tree/08476d21ce17cc95180525d48202a1690dfc8a08
import copy import torch import torch.nn as nn import torch.utils.data from torchvision.models.squeezenet import squeezenet1_0 from torchvision.models.squeezenet import squeezenet1_1 import torch.nn.modules.activation class GramMatrix(nn.Module): def forward(self, x): b, c, h, w = x.size() F = x....