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
Network
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Network(nn.Module): def __init__(self, n_feature, n_hidden, n_output): super(Network, self).__init__() self.fc = torch.nn.Linear(n_feature, n_hidden) self.out = torch.nn.Linear(n_hidden, n_output) def forward(se...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
ShiZhuming/ChallengeCup
Network
false
5,818
[ "MIT" ]
1
c422d1e9864e2bc663a3ddb5e3487a04a0525fcc
https://github.com/ShiZhuming/ChallengeCup/tree/c422d1e9864e2bc663a3ddb5e3487a04a0525fcc
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, n_feature, n_hidden, n_output): super().__init__() self.fc = torch.nn.Linear(n_feature, n_hidden) self.out = torch.nn.Linear(n_hidden, n_output) def forward(self, x): ...
SpatialPyramidPooling
# 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 SpatialPyramidPooling(nn.Module): def __init__(self, pool_sizes=[5, 9, 13]): super(SpatialPyramidPooling, self).__init__() self.maxpools = nn.ModuleList([nn.MaxPool2d(pool_size, 1, pool_size // 2) for pool_size in pool_sizes]) def forward(...
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...
SekiroRong/YOLOP
SpatialPyramidPooling
false
5,819
[ "MIT" ]
1
e59628925dfaadfa549790cd0cf1c8a7e1139a2c
https://github.com/SekiroRong/YOLOP/tree/e59628925dfaadfa549790cd0cf1c8a7e1139a2c
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, pool_sizes=[5, 9, 13]): super().__init__() self.maxpools = nn.ModuleList([nn.MaxPool2d(pool_size, 1, pool_size // 2) for pool_size in pool_sizes]) def forward(self, x): features = [maxpool(x) fo...
M
# 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.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed class M(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x, y): y = torch.cat([x, y]) return y def get_in...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed as...
ShuaihuaLu/examples
M
false
5,820
[ "BSD-3-Clause" ]
1
2639cf050493df9d3cbf065d45e6025733add0f4
https://github.com/ShuaihuaLu/examples/tree/2639cf050493df9d3cbf065d45e6025733add0f4
import torch import torch.nn.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x, y): y = torch.cat([x, y]) return y def ge...
SoftDiceLossSquared
# 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 from torch import nn import torch.jit import torch.nn.functional def sum_tensor(inp, axes, keepdim=False): axes = np.unique(axes).astype(int) if keepdim: for ax in axes: inp = inp.sum(int(ax), keepdim=True) else: for ax in sorted(axes, reverse=Tr...
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 numpy as np from torch import nn import torch.jit import torch.nn.functional assert_size_stride = torch._C._dynamo.guards.assert_size...
ShishuaiHu/DCAC
SoftDiceLossSquared
false
5,821
[ "MIT" ]
1
de04d00edde1b38385a8e5aade7541e2c22807e7
https://github.com/ShishuaiHu/DCAC/tree/de04d00edde1b38385a8e5aade7541e2c22807e7
import torch import numpy as np from torch import nn import torch.jit import torch.nn.functional def sum_tensor(inp, axes, keepdim=False): axes = np.unique(axes).astype(int) if keepdim: for ax in axes: inp = inp.sum(int(ax), keepdim=True) else: for ax in sorted(axes, reverse=Tr...
Foo
# 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.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed def add_lowp(a: 'torch.Tensor', b: 'torch.Tensor'): a, b = a.float(), b.float() c = a + b return c.half() def sigmoid_lowp(x: 'torch.Tensor'): x = x....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed as...
ShuaihuaLu/examples
Foo
false
5,822
[ "BSD-3-Clause" ]
1
2639cf050493df9d3cbf065d45e6025733add0f4
https://github.com/ShuaihuaLu/examples/tree/2639cf050493df9d3cbf065d45e6025733add0f4
import torch import torch.nn.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed def add_lowp(a: 'torch.Tensor', b: 'torch.Tensor'): a, b = a.float(), b.float() c = a + b return c.half() def sigmoid_lowp(x: 'torch.Tensor'): x = x....
TripletLoss
# 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 TripletLoss(nn.Module): def __init__(self, margin): super(TripletLoss, self).__init__() self.margin = margin self.relu = nn.ReLU() def forward(self, anchor, positive, negative, size_average=True): cosine_positive = nn.CosineSimilarity(d...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_...
SeungHeonDoh/music_zeroshot_models
TripletLoss
false
5,823
[ "MIT" ]
1
38f80df868da357f3cb30522ad2e2031f0bc184e
https://github.com/SeungHeonDoh/music_zeroshot_models/tree/38f80df868da357f3cb30522ad2e2031f0bc184e
import torch from torch import nn class Model(nn.Module): def __init__(self, margin): super().__init__() self.margin = margin self.relu = nn.ReLU() def forward(self, anchor, positive, negative, size_average=True): cosine_positive = nn.CosineSimilarity(dim=-1)(anchor, positive...
_Enc
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 _NestedEnc(torch.nn.Module): def __init__(self, f): super().__init__() self.f = f def forward(self, x): return self.f(x) class _Enc(torch.nn.Module): def __init__(self): super().__init__() self.e1 = _NestedEnc(torch.nn.Linear(4, 2)) 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
SimonNick/metakbc
_Enc
false
5,825
[ "MIT" ]
1
b502104e00afcb274c673ecd3aaa0415933e745e
https://github.com/SimonNick/metakbc/tree/b502104e00afcb274c673ecd3aaa0415933e745e
import torch class _NestedEnc(torch.nn.Module): def __init__(self, f): super().__init__() self.f = f def forward(self, x): return self.f(x) class Model(torch.nn.Module): def __init__(self): super().__init__() self.e1 = _NestedEnc(torch.nn.Linear(4, 2)) ...
FocalLossBinary
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.nn.functional from functools import partial from torch.nn.modules.loss import _Loss def reduced_focal_loss(outputs: 'torch.Tensor', targets: 'torch.Tensor', threshold: 'float'=0.5, gamma: 'float'=2.0, reduction='mean'): """ Compute...
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...
ShishuaiHu/DCAC
FocalLossBinary
false
5,826
[ "MIT" ]
1
de04d00edde1b38385a8e5aade7541e2c22807e7
https://github.com/ShishuaiHu/DCAC/tree/de04d00edde1b38385a8e5aade7541e2c22807e7
import torch import torch.nn.functional as F import torch.jit import torch.nn.functional from functools import partial from torch.nn.modules.loss import _Loss def reduced_focal_loss(outputs: 'torch.Tensor', targets: 'torch.Tensor', threshold: 'float'=0.5, gamma: 'float'=2.0, reduction='mean'): """ Compute...
GDL
# 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 from torch import nn import torch.jit import torch.nn.functional def sum_tensor(inp, axes, keepdim=False): axes = np.unique(axes).astype(int) if keepdim: for ax in axes: inp = inp.sum(int(ax), keepdim=True) else: for ax in sorted(axes, reverse=Tr...
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 numpy as np from torch import nn import torch.jit import torch.nn.functional assert_size_stride = torch._C._dynamo.guards.assert_size...
ShishuaiHu/DCAC
GDL
false
5,827
[ "MIT" ]
1
de04d00edde1b38385a8e5aade7541e2c22807e7
https://github.com/ShishuaiHu/DCAC/tree/de04d00edde1b38385a8e5aade7541e2c22807e7
import torch import numpy as np from torch import nn import torch.jit import torch.nn.functional def sum_tensor(inp, axes, keepdim=False): axes = np.unique(axes).astype(int) if keepdim: for ax in axes: inp = inp.sum(int(ax), keepdim=True) else: for ax in sorted(axes, reverse=Tr...
TernaryTanh
# 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 TernaryTanh(nn.Module): def __init__(self, beta=2.0, varying_beta=True): super(TernaryTanh, self).__init__() self.beta = beta self.varying_beta = varying_beta def forward(self, x): m = torch.nn.Tanh() if self.beta >= 1.0: ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
SohamMazumder/Federated_Segmentation
TernaryTanh
false
5,828
[ "MIT" ]
1
d4eb681441003ba20f8b251a42a811c8c436f04e
https://github.com/SohamMazumder/Federated_Segmentation/tree/d4eb681441003ba20f8b251a42a811c8c436f04e
import torch from torch import nn class Model(nn.Module): def __init__(self, beta=2.0, varying_beta=True): super().__init__() self.beta = beta self.varying_beta = varying_beta def forward(self, x): m = torch.nn.Tanh() if self.beta >= 1.0: y = m(x * self.be...
DiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn from torch.autograd import Variable def expand_as_one_hot(input, C, ignore_index=None): """ Converts NxDxHxW label image to NxCxDxHxW, where each label is stored in a separate channel :param input: 4D input image (NxDxHxW) :param C: number of channels/labels :para...
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...
SohamMazumder/Federated_Segmentation
DiceLoss
false
5,829
[ "MIT" ]
1
d4eb681441003ba20f8b251a42a811c8c436f04e
https://github.com/SohamMazumder/Federated_Segmentation/tree/d4eb681441003ba20f8b251a42a811c8c436f04e
import torch from torch import nn from torch.autograd import Variable def expand_as_one_hot(input, C, ignore_index=None): """ Converts NxDxHxW label image to NxCxDxHxW, where each label is stored in a separate channel :param input: 4D input image (NxDxHxW) :param C: number of channels/labels :para...
ShallowNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 ShallowNet(nn.Module): def __init__(self, n_features): super(ShallowNet, self).__init__() self.a1 = nn.Linear(n_features, 2) def forward(self, x): return torch.sigmoid(self.a1(x)) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
SkBlaz/KBNR
ShallowNet
false
5,830
[ "MIT" ]
1
4c37fe3fdfa7719572affd617e2dab43a54ba1d5
https://github.com/SkBlaz/KBNR/tree/4c37fe3fdfa7719572affd617e2dab43a54ba1d5
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, n_features): super().__init__() self.a1 = nn.Linear(n_features, 2) def forward(self, x): return torch.sigmoid(self.a1(x)) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): ...
MyElementwiseModule
# 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.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed class MyElementwiseModule(torch.nn.Module): def forward(self, x, y): return x * y + y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed as...
ShuaihuaLu/examples
MyElementwiseModule
false
5,831
[ "BSD-3-Clause" ]
1
2639cf050493df9d3cbf065d45e6025733add0f4
https://github.com/ShuaihuaLu/examples/tree/2639cf050493df9d3cbf065d45e6025733add0f4
import torch import torch.nn.parallel import torch.utils.data import torch.onnx import torch.fx import torch.optim import torch.utils.data.distributed class Model(torch.nn.Module): def forward(self, x, y): return x * y + y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])...
SE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from itertools import chain as chain import torch.utils.data import torch.nn as nn class SwishEfficient(torch.autograd.Function): """Swish activation function: x * sigmoid(x).""" @staticmethod def forward(ctx, x): result = x * torch.sigmoid(x) ctx.save_for_backward(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 from itertools import chain a...
SheldongChen/SlowFast
SE
false
5,832
[ "Apache-2.0" ]
1
298cd1648bcaaafa7d436bf286a2c7f243f36416
https://github.com/SheldongChen/SlowFast/tree/298cd1648bcaaafa7d436bf286a2c7f243f36416
import torch from itertools import chain as chain import torch.utils.data import torch.nn as nn class SwishEfficient(torch.autograd.Function): """Swish activation function: x * sigmoid(x).""" @staticmethod def forward(ctx, x): result = x * torch.sigmoid(x) ctx.save_for_backward(x) ...
GeneralizedDiceLoss
# 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 from torch.autograd import Variable def expand_as_one_hot(input, C, ignore_index=None): """ Converts NxDxHxW label image to NxCxDxHxW, where each label is stored in a separate channel :param input: 4D input image (NxDxHxW) :param C: number of channels/labels :para...
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...
SohamMazumder/Federated_Segmentation
GeneralizedDiceLoss
false
5,833
[ "MIT" ]
1
d4eb681441003ba20f8b251a42a811c8c436f04e
https://github.com/SohamMazumder/Federated_Segmentation/tree/d4eb681441003ba20f8b251a42a811c8c436f04e
import torch from torch import nn from torch.autograd import Variable def expand_as_one_hot(input, C, ignore_index=None): """ Converts NxDxHxW label image to NxCxDxHxW, where each label is stored in a separate channel :param input: 4D input image (NxDxHxW) :param C: number of channels/labels :para...
TwoNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 TwoNet(nn.Module): def __init__(self, n_features, embedding_dim=256): super(TwoNet, self).__init__() self.a1 = nn.Linear(n_features, embedding_dim) self.a2 = nn.Linear(embedding_dim, 2) def forward(self, x): x = torch.relu(self.a1(x)) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
SkBlaz/KBNR
TwoNet
false
5,834
[ "MIT" ]
1
4c37fe3fdfa7719572affd617e2dab43a54ba1d5
https://github.com/SkBlaz/KBNR/tree/4c37fe3fdfa7719572affd617e2dab43a54ba1d5
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, n_features, embedding_dim=256): super().__init__() self.a1 = nn.Linear(n_features, embedding_dim) self.a2 = nn.Linear(embedding_dim, 2) def forward(self, x): x = torch.relu(self.a1(x)) retur...
ConvBnRelu
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class ConvBnRelu(nn.Module): """ A block of convolution, relu, batchnorm """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, pa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SkywalkerAtlas/HRGAN
ConvBnRelu
false
5,835
[ "MIT" ]
1
bf6d58c1f3c6e042c7ea70319a25e3420531d552
https://github.com/SkywalkerAtlas/HRGAN/tree/bf6d58c1f3c6e042c7ea70319a25e3420531d552
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class Model(nn.Module): """ A block of convolution, relu, batchnorm """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding...
GenerativeLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class GenerativeLoss(nn.Module): def __init__(self): super(GenerativeLoss, self).__init__() self.criterion = nn.BCELoss(reduction='mean') def forward(sel...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
SkywalkerAtlas/HRGAN
GenerativeLoss
false
5,836
[ "MIT" ]
1
bf6d58c1f3c6e042c7ea70319a25e3420531d552
https://github.com/SkywalkerAtlas/HRGAN/tree/bf6d58c1f3c6e042c7ea70319a25e3420531d552
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class Model(nn.Module): def __init__(self): super().__init__() self.criterion = nn.BCELoss(reduction='mean') def forward(self, output, target): n...
Encoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.parallel from torch.autograd import Variable class Encoder(nn.Module): def __init__(self, x_dim, h_dim, z_dim): super(Encoder, self).__init__() self.x_dim = x_dim self.h_dim = h_dim self.z_dim = z_dim self.relu = nn.LeakyR...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.parallel from torch.autograd import Variab...
Shimaa1/group_activity_gcn
Encoder
false
5,837
[ "MIT" ]
1
53f86e93eb7a78d537532d48c836ce30cbf7e8d1
https://github.com/Shimaa1/group_activity_gcn/tree/53f86e93eb7a78d537532d48c836ce30cbf7e8d1
import torch import torch.nn as nn import torch.nn.parallel from torch.autograd import Variable class Model(nn.Module): def __init__(self, x_dim, h_dim, z_dim): super().__init__() self.x_dim = x_dim self.h_dim = h_dim self.z_dim = z_dim self.relu = nn.LeakyReLU() s...
ConvTripleBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class ConvBnRelu(nn.Module): """ A block of convolution, relu, batchnorm """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, pa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SkywalkerAtlas/HRGAN
ConvTripleBlock
false
5,838
[ "MIT" ]
1
bf6d58c1f3c6e042c7ea70319a25e3420531d552
https://github.com/SkywalkerAtlas/HRGAN/tree/bf6d58c1f3c6e042c7ea70319a25e3420531d552
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class ConvBnRelu(nn.Module): """ A block of convolution, relu, batchnorm """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, pa...
Residual
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class ConvBnRelu(nn.Module): """ A block of convolution, relu, batchnorm """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, pa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SkywalkerAtlas/HRGAN
Residual
false
5,839
[ "MIT" ]
1
bf6d58c1f3c6e042c7ea70319a25e3420531d552
https://github.com/SkywalkerAtlas/HRGAN/tree/bf6d58c1f3c6e042c7ea70319a25e3420531d552
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class ConvBnRelu(nn.Module): """ A block of convolution, relu, batchnorm """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, pa...
ThreeNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 ThreeNet(nn.Module): def __init__(self, n_features, e1=2048, e2=1024, e3=640, e4=512, e5=216, p=0.4): super(ThreeNet, self).__init__() self.a1 = nn.Linear(n_features, e1) self.a2 = nn.Linear(e1, e2) s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
SkBlaz/KBNR
ThreeNet
false
5,840
[ "MIT" ]
1
4c37fe3fdfa7719572affd617e2dab43a54ba1d5
https://github.com/SkBlaz/KBNR/tree/4c37fe3fdfa7719572affd617e2dab43a54ba1d5
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, n_features, e1=2048, e2=1024, e3=640, e4=512, e5=216, p=0.4): super().__init__() self.a1 = nn.Linear(n_features, e1) self.a2 = nn.Linear(e1, e2) self.a3 = nn.Linea...
AndModule
# 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 class AndModule(nn.Module): def forward(self, attn1, attn2): out = torch.min(attn1, attn2) return out def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn assert_size_stride = torch._C._dynamo.guards.assert...
SpyrosMouselinos/DeltaFormers
AndModule
false
5,841
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn class Model(nn.Module): def forward(self, attn1, attn2): out = torch.min(attn1, attn2) return out def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
FiveNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 FiveNet(nn.Module): def __init__(self, n_features, e1=1024, e2=2048, e3=1024, e4=640, e5= 512, p=0.4): super(FiveNet, self).__init__() self.a1 = nn.Linear(n_features, e2) self.a2 = nn.Linear(e2, e3) s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
SkBlaz/KBNR
FiveNet
false
5,842
[ "MIT" ]
1
4c37fe3fdfa7719572affd617e2dab43a54ba1d5
https://github.com/SkBlaz/KBNR/tree/4c37fe3fdfa7719572affd617e2dab43a54ba1d5
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, n_features, e1=1024, e2=2048, e3=1024, e4=640, e5= 512, p=0.4): super().__init__() self.a1 = nn.Linear(n_features, e2) self.a2 = nn.Linear(e2, e3) self.a3 = nn.Lin...
OrModule
# 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 class OrModule(nn.Module): def forward(self, attn1, attn2): out = torch.max(attn1, attn2) return out def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn assert_size_stride = torch._C._dynamo.guards.assert...
SpyrosMouselinos/DeltaFormers
OrModule
false
5,843
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn class Model(nn.Module): def forward(self, attn1, attn2): out = torch.max(attn1, attn2) return out def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
OneLayerFCBodyWithAction
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 layer_init(layer, w_scale=1.0): nn.init.orthogonal_(layer.weight.data) layer.weight.data.mul_(w_scale) nn.init.constant_(layer.bias.data, 0) return layer class OneLayerFCBodyWithAction(nn.Module): def __init__(self, state_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 import ...
Sohojoe/UdacityDeepRL-Project2
OneLayerFCBodyWithAction
false
5,844
[ "MIT" ]
1
7137eea0b606ea32d00424d23130ff213f03ecf1
https://github.com/Sohojoe/UdacityDeepRL-Project2/tree/7137eea0b606ea32d00424d23130ff213f03ecf1
import torch import torch.nn as nn import torch.nn.functional as F def layer_init(layer, w_scale=1.0): nn.init.orthogonal_(layer.weight.data) layer.weight.data.mul_(w_scale) nn.init.constant_(layer.bias.data, 0) return layer class Model(nn.Module): def __init__(self, state_dim, action_dim, hidd...
QREmbeddingBag
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class QREmbeddingBag(nn.Module): """Computes sums or means over two 'bags' of embeddings, one using the quotient of the indices and the other using the remainder of the indices, witho...
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 numpy as np import torch.nn as nn from torch.nn.parameter import Paramet...
SplitInfinity/dlrm
QREmbeddingBag
false
5,845
[ "MIT" ]
1
726dc9059be94b249d41e9b5a399c991fe687edb
https://github.com/SplitInfinity/dlrm/tree/726dc9059be94b249d41e9b5a399c991fe687edb
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class Model(nn.Module): """Computes sums or means over two 'bags' of embeddings, one using the quotient of the indices and the other using the remainder of the indices, without in...
PreActBlockNoBN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 PreActBlockNoBN(nn.Module): """Pre-activation version of the BasicBlock.""" expansion = 1 def __init__(self, in_planes, planes, stride=1): super(PreActBlockNoBN, self).__init__() self.conv1 = nn.Conv2d(in_planes, pla...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
Spijkervet/Greedy_InfoMax
PreActBlockNoBN
false
5,846
[ "MIT" ]
1
d1784da7995e029d07691ee0977fea49383fb0f8
https://github.com/Spijkervet/Greedy_InfoMax/tree/d1784da7995e029d07691ee0977fea49383fb0f8
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Pre-activation version of the BasicBlock.""" expansion = 1 def __init__(self, in_planes, planes, stride=1): super().__init__() self.conv1 = nn.Conv2d(in_planes, planes, kernel_size=3, stride= ...
SimpleNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.distributions as D class SimpleNet(nn.Module): def __init__(self, s_dim, a_dim): super(SimpleNet, self).__init__() self.s_dim = s_dim self.a_dim = a_dim self.a1 = nn.Linear(s_dim, 100) self.mu ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SpencerLo-CMU/pytorch-rl-suite
SimpleNet
false
5,847
[ "MIT" ]
1
52b215f38cbb4c39a0ccfff48ab8262b1c9ef4a0
https://github.com/SpencerLo-CMU/pytorch-rl-suite/tree/52b215f38cbb4c39a0ccfff48ab8262b1c9ef4a0
import torch import torch.nn as nn import torch.nn.functional as F import torch.distributions as D class Model(nn.Module): def __init__(self, s_dim, a_dim): super().__init__() self.s_dim = s_dim self.a_dim = a_dim self.a1 = nn.Linear(s_dim, 100) self.mu = nn.Linear(100, 1)...
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.utils.data import torch.nn as nn import torch.nn import torch as torch import torch.sparse class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Somefive/cogdl
BertAttention
false
5,848
[ "MIT" ]
1
1c5ab88aafc27529495d0d22f781055619e27cb2
https://github.com/Somefive/cogdl/tree/1c5ab88aafc27529495d0d22f781055619e27cb2
from _paritybench_helpers import _mock_config import math import torch import torch.utils.data import torch.nn as nn import torch.nn import torch as torch import torch.sparse class BertSelfAttention(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_atte...
BertIntermediate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 from torch.nn import Module 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 + t...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn impor...
SpyrosMouselinos/NVLR_solver
BertIntermediate
false
5,849
[ "Apache-2.0" ]
1
7fe12f9eab980ee6959f0b8797aef779b3270c25
https://github.com/SpyrosMouselinos/NVLR_solver/tree/7fe12f9eab980ee6959f0b8797aef779b3270c25
from _paritybench_helpers import _mock_config from torch.nn import Module 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 + t...
QueryModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class QueryModule(nn.Module): def __init__(self, dim): super().__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) self.conv2 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
SpyrosMouselinos/DeltaFormers
QueryModule
false
5,850
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) self.conv2 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) to...
AttentionModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class AttentionModule(nn.Module): def __init__(self, dim): super().__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) self.conv2 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
SpyrosMouselinos/DeltaFormers
AttentionModule
false
5,851
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) self.conv2 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1) se...
ComparisonModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class ComparisonModule(nn.Module): def __init__(self, dim): super().__init__() self.projection = nn.Conv2d(2 * dim, dim, kernel_size=(1, 1), padding=0 ) self.conv1 = nn.Conv2d(dim, dim, kernel_s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
SpyrosMouselinos/DeltaFormers
ComparisonModule
false
5,852
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.projection = nn.Conv2d(2 * dim, dim, kernel_size=(1, 1), padding=0 ) self.conv1 = nn.Conv2d(dim, dim, kernel_size=(3, 3),...
ResBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F class ResBlock(torch.nn.Module): def __init__(self, channels): super(ResBlock, self).__init__() self.channels = channels self.conv1 = torch.nn.Conv2d(channels, channels, kernel_size=(3, 3), padding=1) def forward(self, x): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
StarsStation/DeepLearning
ResBlock
false
5,853
[ "MIT" ]
1
a4c833af93652069f19a8c6f0b1e42cde64bbb79
https://github.com/StarsStation/DeepLearning/tree/a4c833af93652069f19a8c6f0b1e42cde64bbb79
import torch import torch.nn.functional as F class Model(torch.nn.Module): def __init__(self, channels): super().__init__() self.channels = channels self.conv1 = torch.nn.Conv2d(channels, channels, kernel_size=(3, 3), padding=1) def forward(self, x): y = F.relu(se...
TwoLayerFCBodyWithAction
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 layer_init(layer, w_scale=1.0): nn.init.orthogonal_(layer.weight.data) layer.weight.data.mul_(w_scale) nn.init.constant_(layer.bias.data, 0) return layer class TwoLayerFCBodyWithAction(nn.Module): def __init__(self, state_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 import ...
Sohojoe/UdacityDeepRL-Project2
TwoLayerFCBodyWithAction
false
5,854
[ "MIT" ]
1
7137eea0b606ea32d00424d23130ff213f03ecf1
https://github.com/Sohojoe/UdacityDeepRL-Project2/tree/7137eea0b606ea32d00424d23130ff213f03ecf1
import torch import torch.nn as nn import torch.nn.functional as F def layer_init(layer, w_scale=1.0): nn.init.orthogonal_(layer.weight.data) layer.weight.data.mul_(w_scale) nn.init.constant_(layer.bias.data, 0) return layer class Model(nn.Module): def __init__(self, state_dim, action_dim, hidd...
Encoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class Encoder(nn.Module): def __init__(self, input_dim, hidden_dim, latent_dim): super(Encoder, self).__init__() self.FC_input = nn.Linear(input_dim, hidden_dim) self.FC_mean = nn.Linear(hidden_dim, latent_dim) self.FC_var = nn.Linear(hidden_dim,...
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 import triton_helpers from...
StefanNa/dtu_mlops
Encoder
false
5,855
[ "Apache-2.0" ]
1
148f3427f8d090d39d127857be8a37832f800279
https://github.com/StefanNa/dtu_mlops/tree/148f3427f8d090d39d127857be8a37832f800279
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_dim, hidden_dim, latent_dim): super().__init__() self.FC_input = nn.Linear(input_dim, hidden_dim) self.FC_mean = nn.Linear(hidden_dim, latent_dim) self.FC_var = nn.Linear(hidden_dim, latent_dim) ...
CosineClassifier
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 CosineClassifier(nn.Module): def __init__(self, classes, channels=512): super().__init__() self.channels = channels self.cls = nn.Conv2d(channels, classes, 1, bias=False) self.scaler =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
SirRob1997/DomainBed
CosineClassifier
false
5,856
[ "MIT" ]
1
7399a2b0a63df48f4b67755a3f33901223d5c8fb
https://github.com/SirRob1997/DomainBed/tree/7399a2b0a63df48f4b67755a3f33901223d5c8fb
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, classes, channels=512): super().__init__() self.channels = channels self.cls = nn.Conv2d(channels, classes, 1, bias=False) self.scaler = 10.0 ...
ConcatClassifierHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 from torch.nn import Module import torch import torch.nn as nn import torch.nn class ConcatClassifierHead(Module): def __init__(self, config: 'dict'): super(ConcatClassifierHead, self).__init__() self.linear_layer_1 = nn.Linear(config['max_objects_per...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 i...
SpyrosMouselinos/DeltaFormers
ConcatClassifierHead
false
5,857
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
from _paritybench_helpers import _mock_config from torch.nn import Module import torch import torch.nn as nn import torch.nn class Model(Module): def __init__(self, config: 'dict'): super().__init__() self.linear_layer_1 = nn.Linear(config['max_objects_per_scene'] * config['hidden_dim...
RelateModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class RelateModule(nn.Module): def __init__(self, dim): super().__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1, dilation=(1, 1)) self.conv2 = nn.Conv2d(dim, dim, kerne...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
SpyrosMouselinos/DeltaFormers
RelateModule
false
5,858
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.conv1 = nn.Conv2d(dim, dim, kernel_size=(3, 3), padding=1, dilation=(1, 1)) self.conv2 = nn.Conv2d(dim, dim, kernel_size=...
MNIST_CNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class SqueezeLastTwo(nn.Module): """A module which squeezes the last two dimensions, ordinary squeeze can be a problem for batch size 1""" def __init__(self): super(SqueezeLastTwo, self).__init__() def for...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
SirRob1997/DomainBed
MNIST_CNN
false
5,859
[ "MIT" ]
1
7399a2b0a63df48f4b67755a3f33901223d5c8fb
https://github.com/SirRob1997/DomainBed/tree/7399a2b0a63df48f4b67755a3f33901223d5c8fb
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.data class SqueezeLastTwo(nn.Module): """A module which squeezes the last two dimensions, ordinary squeeze can be a problem for batch size 1""" def __init__(self): super().__init__() def forward(self, x): ...
LanguageModelCriterion
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from torch.autograd import * class LanguageModelCriterion(nn.Module): def __init__(self): super(LanguageModelCriterion, self).__init__() def forward(self, input, target, mask): if target.ndim == 3: target = target.reshape(-1, target.shape[2]) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.autograd import * assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
SunZongdi/self-critical.pytorch
LanguageModelCriterion
false
5,861
[ "MIT" ]
1
6cecbeb949e68007b72e84198cf74f9fb288aeda
https://github.com/SunZongdi/self-critical.pytorch/tree/6cecbeb949e68007b72e84198cf74f9fb288aeda
import torch import torch.nn as nn from torch.autograd import * class Model(nn.Module): def __init__(self): super().__init__() def forward(self, input, target, mask): if target.ndim == 3: target = target.reshape(-1, target.shape[2]) mask = mask.reshape(-1, mask.shape[...
RewardCriterion
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from torch.autograd import * class RewardCriterion(nn.Module): def __init__(self): super(RewardCriterion, self).__init__() def forward(self, input, seq, reward): input = input.gather(2, seq.unsqueeze(2)).squeeze(2) input = input.reshape(-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 torch.nn as nn from torch.autograd import * assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
SunZongdi/self-critical.pytorch
RewardCriterion
false
5,862
[ "MIT" ]
1
6cecbeb949e68007b72e84198cf74f9fb288aeda
https://github.com/SunZongdi/self-critical.pytorch/tree/6cecbeb949e68007b72e84198cf74f9fb288aeda
import torch import torch.nn as nn from torch.autograd import * class Model(nn.Module): def __init__(self): super().__init__() def forward(self, input, seq, reward): input = input.gather(2, seq.unsqueeze(2)).squeeze(2) input = input.reshape(-1) reward = reward.reshape(-1) ...
VNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 VNet(nn.Module): def __init__(self, input_size, hidden_size, output_size=1): super(VNet, self).__init__() self.linear1 = nn.Linear(input_size, hidden_size) self.relu1 = nn.ReLU(inplace=True) self.linear2 = nn.Linear(hidden_size, output_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 import torch.nn as nn assert_...
Stranger469/wrench
VNet
false
5,863
[ "Apache-2.0" ]
1
ab717ac26a76649c8fdb946a28dffe7e682c80ba
https://github.com/Stranger469/wrench/tree/ab717ac26a76649c8fdb946a28dffe7e682c80ba
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_size, hidden_size, output_size=1): super().__init__() self.linear1 = nn.Linear(input_size, hidden_size) self.relu1 = nn.ReLU(inplace=True) self.linear2 = nn.Linear(hidden_size, output_size) de...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import * class Attention(nn.Module): def __init__(self, opt): super(Attention, self).__init__() self.rnn_size = opt.rnn_size self.att_hid_size = opt.att_hid...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SunZongdi/self-critical.pytorch
Attention
false
5,864
[ "MIT" ]
1
6cecbeb949e68007b72e84198cf74f9fb288aeda
https://github.com/SunZongdi/self-critical.pytorch/tree/6cecbeb949e68007b72e84198cf74f9fb288aeda
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import * class Model(nn.Module): def __init__(self, opt): super().__init__() self.rnn_size = opt.rnn_size self.att_hid_size = opt.att_hid_size self....
StackedAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class StackedAttention(nn.Module): def __init__(self, input_dim, hidden_dim): super(StackedAttention, self).__init__() self.Wv = nn.Conv2d(input_dim, hidden_dim, kernel_size=(1, 1), padding=(0, 0)) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SpyrosMouselinos/DeltaFormers
StackedAttention
false
5,865
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class Model(nn.Module): def __init__(self, input_dim, hidden_dim): super().__init__() self.Wv = nn.Conv2d(input_dim, hidden_dim, kernel_size=(1, 1), padding=(0, 0)) self.Wu = nn.Linear(input_dim...
CNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class CNN(nn.Module): """ Convolutional Neural Network. """ def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 20, kernel_size=5, stride=1) self.fc1 = nn.Linear(8 * 8 * 20, 64) self.fc2 = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
StanislawSwierc/Ax
CNN
false
5,866
[ "MIT" ]
1
175dff2294af4548ae258105346eeaca22a30197
https://github.com/StanislawSwierc/Ax/tree/175dff2294af4548ae258105346eeaca22a30197
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Convolutional Neural Network. """ def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 20, kernel_size=5, stride=1) self.fc1 = nn.Linear(8 * 8 * 20, 64) self.fc2 ...
BinaryLogisticRegressionLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn def binary_logistic_regression_loss(reg_score, label, threshold=0.5, ratio_range=(1.05, 21), eps=1e-05): """Binary Logistic Regression Loss.""" label = label.view(-1) reg_score = reg_score.contiguous().view(-1) pmask = (label > threshold).float() num_positive...
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 ...
SvipRepetitionCounting/TransRAC
BinaryLogisticRegressionLoss
false
5,867
[ "Apache-2.0" ]
1
eec12553dfa1e2fde6356b0e2703c633d225feb3
https://github.com/SvipRepetitionCounting/TransRAC/tree/eec12553dfa1e2fde6356b0e2703c633d225feb3
import torch import torch.nn as nn def binary_logistic_regression_loss(reg_score, label, threshold=0.5, ratio_range=(1.05, 21), eps=1e-05): """Binary Logistic Regression Loss.""" label = label.view(-1) reg_score = reg_score.contiguous().view(-1) pmask = (label > threshold).float() num_positive...
Autoencoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 Autoencoder(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = torch.nn.Conv2d(1, 8, 3, padding=1) self.conv2 = torch.nn.Conv2d(8, 8, 3, padding=1) self.conv3 = torch.nn.Conv2d(8, 16, 3, padding=1) self.conv4 = torch.nn.Conv2d(16, 16, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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...
SpaceMeerkat/CAE
Autoencoder
false
5,868
[ "MIT" ]
1
8c5e2fbe751810a87ca155d0e3d53797f52fd9ea
https://github.com/SpaceMeerkat/CAE/tree/8c5e2fbe751810a87ca155d0e3d53797f52fd9ea
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = torch.nn.Conv2d(1, 8, 3, padding=1) self.conv2 = torch.nn.Conv2d(8, 8, 3, padding=1) self.conv3 = torch.nn.Conv2d(8, 16, 3, padding=1) self.conv4 = torch.nn.Conv2d(16, 16, 3, pad...
InceptionA
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 InceptionA(torch.nn.Module): def __init__(self, in_channels): super(InceptionA, self).__init__() self.branch1x1 = torch.nn.Conv2d(in_channels, 16, kernel_size=(1, 1)) self.branch_pool = torch.nn.Conv2d(in_channels, 24, kernel_size=(1, 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
StarsStation/DeepLearning
InceptionA
false
5,869
[ "MIT" ]
1
a4c833af93652069f19a8c6f0b1e42cde64bbb79
https://github.com/StarsStation/DeepLearning/tree/a4c833af93652069f19a8c6f0b1e42cde64bbb79
import torch import torch.nn.functional as F class Model(torch.nn.Module): def __init__(self, in_channels): super().__init__() self.branch1x1 = torch.nn.Conv2d(in_channels, 16, kernel_size=(1, 1)) self.branch_pool = torch.nn.Conv2d(in_channels, 24, kernel_size=(1, 1)) self.branch5...
DotProductAttention
# 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 from torch import nn def masked_softmax(X, valid_len): """Perform softmax by filtering out some elements.""" if valid_len is None: return nn.functional.softmax(X, dim=-1) else: shape = X.shape if valid_len.dim() == 1: valid_len = torch.repeat_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....
StevenJokess/d2l-en-read
DotProductAttention
false
5,870
[ "MIT" ]
1
71b0f35971063b9fe5f21319b8072d61c9e5a298
https://github.com/StevenJokess/d2l-en-read/tree/71b0f35971063b9fe5f21319b8072d61c9e5a298
import math import torch from torch import nn def masked_softmax(X, valid_len): """Perform softmax by filtering out some elements.""" if valid_len is None: return nn.functional.softmax(X, dim=-1) else: shape = X.shape if valid_len.dim() == 1: valid_len = torch.repeat_in...
Linear_dynamics
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 class Linear_dynamics(nn.Module): def __init__(self, device='cpu'): super(Linear_dynamics, self).__init__() self.time = nn.Parameter(torch.ones(1) * 0.7) self.device = device self def forward(self, x, v): retur...
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.utils.data from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._...
SuperXiang/GMN
Linear_dynamics
false
5,871
[ "MIT" ]
1
b74364e5b9f424b63a5ce63a207a6e4a067d7d3b
https://github.com/SuperXiang/GMN/tree/b74364e5b9f424b63a5ce63a207a6e4a067d7d3b
import torch import torch.utils.data from torch import nn class Model(nn.Module): def __init__(self, device='cpu'): super().__init__() self.time = nn.Parameter(torch.ones(1) * 0.7) self.device = device self def forward(self, x, v): return x + v * self.time def get_i...
ContrastiveLoss
# 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 torchvision.transforms import functional as F import torch.nn as nn import torch.nn.functional as F class ContrastiveLoss(nn.Module): """ Contrastive loss function. Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf """ def __init__(self, margin: 'float'...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
Swall0w/cougar
ContrastiveLoss
false
5,872
[ "MIT" ]
1
9161b2b1d0c256f4bb952ec190351684f28ec1b7
https://github.com/Swall0w/cougar/tree/9161b2b1d0c256f4bb952ec190351684f28ec1b7
import torch from torchvision.transforms import functional as F import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Contrastive loss function. Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf """ def __init__(self, margin: 'float'=2.0): ...
SeqFC1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SeqFC1(nn.Module): """ Neural network definition """ def __init__(self, size): super(SeqFC1, self).__init__() self.size = size self.fc1 = nn.Linear(in_features=self.size, out_features=16) self.fc2 = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Thibaud-Ardoin/Dial-a-Ride
SeqFC1
false
5,873
[ "MIT" ]
1
7d9b3cd904d3194dccad31fec2533e2cf58cad0c
https://github.com/Thibaud-Ardoin/Dial-a-Ride/tree/7d9b3cd904d3194dccad31fec2533e2cf58cad0c
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Neural network definition """ def __init__(self, size): super().__init__() self.size = size self.fc1 = nn.Linear(in_features=self.size, out_features=16) self.fc2 = nn.Linear(in_f...
Net_BP
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 Net_BP(torch.nn.Module): def __init__(self, n_features, n_hidden=50, n_output=1): super(Net_BP, self).__init__() self.hidden = torch.nn.Linear(n_features, n_hidden) self.predict = torch.nn.Linear(n_hidden, n_output) def forward(self,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
Tappai/PV_prediction
Net_BP
false
5,874
[ "Apache-2.0" ]
1
2ff1e1af183a28f07ebc2ec2979488eb8e246813
https://github.com/Tappai/PV_prediction/tree/2ff1e1af183a28f07ebc2ec2979488eb8e246813
import torch import torch.nn.functional as F class Model(torch.nn.Module): def __init__(self, n_features, n_hidden=50, n_output=1): super().__init__() self.hidden = torch.nn.Linear(n_features, n_hidden) self.predict = torch.nn.Linear(n_hidden, n_output) def forward(self, x): ...
DQN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 DQN(nn.Module): def __init__(self, size, upscale_factor, layer_size, channels): super(DQN, self).__init__() self.relu = nn.ReLU() self.fc1 = nn.Linear(in_features=size ** 2, out_features=layer_size) self.fc2 = nn.Linear(in_features=layer_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Thibaud-Ardoin/Dial-a-Ride
DQN
false
5,875
[ "MIT" ]
1
7d9b3cd904d3194dccad31fec2533e2cf58cad0c
https://github.com/Thibaud-Ardoin/Dial-a-Ride/tree/7d9b3cd904d3194dccad31fec2533e2cf58cad0c
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, size, upscale_factor, layer_size, channels): super().__init__() self.relu = nn.ReLU() self.fc1 = nn.Linear(in_features=size ** 2, out_features=layer_size) self.fc2 = nn.Linear(in_features=layer_size, out...
SameModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class SameModule(nn.Module): def __init__(self, dim): super().__init__() self.conv = nn.Conv2d(dim + 1, 1, kernel_size=(1, 1)) torch.nn.init.kaiming_normal_(self.conv.weight) self.dim = dim def...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SpyrosMouselinos/DeltaFormers
SameModule
false
5,876
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.conv = nn.Conv2d(dim + 1, 1, kernel_size=(1, 1)) torch.nn.init.kaiming_normal_(self.conv.weight) self.dim = dim def forw...
FC1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 FC1(nn.Module): """ Neural network definition """ def __init__(self, size, hidden_layers): super(FC1, self).__init__() self.size = size self.hidden_layers = hidden_layers self.fc1 = nn.Linear(in_featu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
Thibaud-Ardoin/Dial-a-Ride
FC1
false
5,877
[ "MIT" ]
1
7d9b3cd904d3194dccad31fec2533e2cf58cad0c
https://github.com/Thibaud-Ardoin/Dial-a-Ride/tree/7d9b3cd904d3194dccad31fec2533e2cf58cad0c
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Neural network definition """ def __init__(self, size, hidden_layers): super().__init__() self.size = size self.hidden_layers = hidden_layers self.fc1 = nn.Linear(in_features=sel...
HyperLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn.functional as F import torch.nn as nn class HyperLinear(nn.Module): def __init__(self, in_features, out_features, num_hparams, bias=True): super(HyperLinear, self).__init__() self.in_features = in_features self.out_features = out_features 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 math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.a...
ThrunGroup/implicit-hyper-opt
HyperLinear
false
5,878
[ "MIT" ]
1
fe4ac539c947ca8083049d23c5f1f67f44cd09f0
https://github.com/ThrunGroup/implicit-hyper-opt/tree/fe4ac539c947ca8083049d23c5f1f67f44cd09f0
import math import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, in_features, out_features, num_hparams, bias=True): super().__init__() self.in_features = in_features self.out_features = out_features self.num_hparams = num_h...
DQN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 DQN(nn.Module): def __init__(self, input_size, hidden_1_size, hidden_2_size, output_size): super().__init__() self.fc1 = nn.Linear(input_size, hidden_1_size) self.fc2 = nn.Linear(hidden_1_size, hidden_2_size) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
TejaswiniMedi/DRL
DQN
false
5,879
[ "MIT" ]
1
d4a694c5e505822e6e8627be52afd0ccc60f80ef
https://github.com/TejaswiniMedi/DRL/tree/d4a694c5e505822e6e8627be52afd0ccc60f80ef
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_size, hidden_1_size, hidden_2_size, output_size): super().__init__() self.fc1 = nn.Linear(input_size, hidden_1_size) self.fc2 = nn.Linear(hidden_1_size, hidden_2_size) ...
PositionwiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class PositionwiseFeedForward(nn.Module): """A two-feed-forward-layer module. Parameters ---------- d_model : int embed_dim. d_inner : int dff. dropout : float dropout rate. """ def __init__(s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
TaoranJ/PC-RNN
PositionwiseFeedForward
false
5,880
[ "MIT" ]
1
f360b464cf68737fefd5e6093e55056838693b1b
https://github.com/TaoranJ/PC-RNN/tree/f360b464cf68737fefd5e6093e55056838693b1b
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """A two-feed-forward-layer module. Parameters ---------- d_model : int embed_dim. d_inner : int dff. dropout : float dropout rate. """ def __init__(self, d, d_inner): ...
Switch
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.init import kaiming_normal def ZeroInitializer(param): shape = param.size() init = np.zeros(shape).astype(np.float32) param.data.set_(torch.from_numpy(init)) def Linear(initializer=kaiming_normal, bias_in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import numpy as np ...
TaoMiner/eesc
Switch
false
5,881
[ "Apache-2.0" ]
1
fa0ca532333cad2262d20707899f97a6c8a99cfb
https://github.com/TaoMiner/eesc/tree/fa0ca532333cad2262d20707899f97a6c8a99cfb
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.init import kaiming_normal def ZeroInitializer(param): shape = param.size() init = np.zeros(shape).astype(np.float32) param.data.set_(torch.from_numpy(init)) def Linear(initializer=kaiming_normal, bias_in...
PerOutputClassifierHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 from torch.nn import Module import torch import torch.nn as nn import torch.nn class PerOutputClassifierHead(Module): def __init__(self, config: 'dict'): super(PerOutputClassifierHead, self).__init__() self.linear_layer_1 = nn.Linear(config['hidden_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 from torch.nn import Module i...
SpyrosMouselinos/DeltaFormers
PerOutputClassifierHead
false
5,882
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
from _paritybench_helpers import _mock_config from torch.nn import Module import torch import torch.nn as nn import torch.nn class Model(Module): def __init__(self, config: 'dict'): super().__init__() self.linear_layer_1 = nn.Linear(config['hidden_dim'], config[ 'hidden_dim'] // 2) ...
Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self, board_width, board_height): super(Net, self).__init__() self.board_width = board_width self.board_height = board_height self.conv1 = nn.Conv2d(4, 32, kernel_size=3, padding=...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
SummitChen/ComputationalAdvertisement
Net
false
5,883
[ "MIT" ]
1
05a9e8bd82ca834219121de4257185d63f592d78
https://github.com/SummitChen/ComputationalAdvertisement/tree/05a9e8bd82ca834219121de4257185d63f592d78
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, board_width, board_height): super().__init__() self.board_width = board_width self.board_height = board_height self.conv1 = nn.Conv2d(4, 32, kernel_size=3, padding=1) ...
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 from torch.nn import functional as F class VAE(nn.Module): def __init__(self): super(VAE, self).__init__() self.fc1 = nn.Linear(84 * 84, 400) self.fc21 = nn.Linear(400, 20) self.fc22 = nn.Linear(400, 20) self.fc3 = nn.Linear(20, 400) ...
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 import triton_helpers from...
TannerSorensen/speech_production_manifolds
VAE
false
5,884
[ "MIT" ]
1
0dcc2c099ad0e1e157c7f108e28f5957d4ac2f48
https://github.com/TannerSorensen/speech_production_manifolds/tree/0dcc2c099ad0e1e157c7f108e28f5957d4ac2f48
import torch from torch import nn from torch.nn import functional as F class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(84 * 84, 400) self.fc21 = nn.Linear(400, 20) self.fc22 = nn.Linear(400, 20) self.fc3 = nn.Linear(20, 400) self...
down
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.functional import F import torch.nn as nn import torch.nn.functional as F class down(nn.Module): """ A class for creating neural network blocks containing layers: Average Pooling --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class t...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Thomasedv/AI_Interpolation
down
false
5,885
[ "MIT" ]
1
cee51d92185a43a60797785554ee1ae924e5da0d
https://github.com/Thomasedv/AI_Interpolation/tree/cee51d92185a43a60797785554ee1ae924e5da0d
import torch from torch.functional import F import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ A class for creating neural network blocks containing layers: Average Pooling --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU This is used in the UNet Class ...
BMNLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.nn as nn def binary_logistic_regression_loss(reg_score, label, threshold=0.5, ratio_range=(1.05, 21), eps=1e-05): """Binary Logistic Regression Loss.""" label = label.view(-1) reg_score = reg_score.contiguous().view(-1) pmask = (label > thr...
import torch from torch import device import triton import triton.language as tl from 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_ma...
SvipRepetitionCounting/TransRAC
BMNLoss
false
5,886
[ "Apache-2.0" ]
1
eec12553dfa1e2fde6356b0e2703c633d225feb3
https://github.com/SvipRepetitionCounting/TransRAC/tree/eec12553dfa1e2fde6356b0e2703c633d225feb3
import torch import torch.nn.functional as F import torch.nn as nn def binary_logistic_regression_loss(reg_score, label, threshold=0.5, ratio_range=(1.05, 21), eps=1e-05): """Binary Logistic Regression Loss.""" label = label.view(-1) reg_score = reg_score.contiguous().view(-1) pmask = (label > thr...
L1_Charbonnier_loss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class L1_Charbonnier_loss(nn.Module): """L1 Charbonnierloss.""" def __init__(self): super(L1_Charbonnier_loss, self).__init__() self.eps = 1e-06 def forward(self, X, Y): diff = torch.add(X, -Y) error = torch.sqrt(diff * diff + self.eps) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
Tiger1994/LapSRN
L1_Charbonnier_loss
false
5,887
[ "MIT" ]
1
4f2222ebad97ad6730fe352f5a3c8a06f0f61e7a
https://github.com/Tiger1994/LapSRN/tree/4f2222ebad97ad6730fe352f5a3c8a06f0f61e7a
import torch import torch.nn as nn class Model(nn.Module): """L1 Charbonnierloss.""" def __init__(self): super().__init__() self.eps = 1e-06 def forward(self, X, Y): diff = torch.add(X, -Y) error = torch.sqrt(diff * diff + self.eps) loss = torch.sum(error) ...
FC2
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 FC2(nn.Module): """ Neural network definition """ def __init__(self, size): super(FC2, self).__init__() self.size = size self.fc1 = nn.Linear(in_features=self.size ** 2, out_features=128) self.fc2 = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Thibaud-Ardoin/Dial-a-Ride
FC2
false
5,888
[ "MIT" ]
1
7d9b3cd904d3194dccad31fec2533e2cf58cad0c
https://github.com/Thibaud-Ardoin/Dial-a-Ride/tree/7d9b3cd904d3194dccad31fec2533e2cf58cad0c
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Neural network definition """ def __init__(self, size): super().__init__() self.size = size self.fc1 = nn.Linear(in_features=self.size ** 2, out_features=128) self.fc2 = nn.Linea...
NeuralNetMultiplePositionalArguments
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 import torch.utils.checkpoint class NeuralNetMultiplePositionalArguments(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArguments, self).__init__() self.fc1 = torch.nn.Linear(input_size, 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 import torch.nn import torch....
TingGong1/onnxruntime
NeuralNetMultiplePositionalArguments
false
5,889
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn import torch.onnx import torch.utils.checkpoint 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....
HuggingfaceFastGelu
# 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 import torch.onnx import torch.utils.checkpoint class HuggingfaceFastGelu(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(x * 0.7978845608 * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn import torch.onnx import torch.utils.checkpoint assert_size_str...
TingGong1/onnxruntime
HuggingfaceFastGelu
false
5,890
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class Model(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(x * 0.7978845608 * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
IIDIsotropicGaussianUVLoss
# 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.utils.data from torch import nn import torch.nn.functional as F class IIDIsotropicGaussianUVLoss(nn.Module): """ Loss for the case of iid residuals with isotropic covariance: $Sigma_i = sigma_i^2 I$ The loss (negative log likelihood) is then: $1/2 sum_{i=1}^n ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import math...
TinBacon/FastAutoAugmentation
IIDIsotropicGaussianUVLoss
false
5,891
[ "Apache-2.0" ]
1
011e4e348fd9a937a29df11695dc71410f555d0a
https://github.com/TinBacon/FastAutoAugmentation/tree/011e4e348fd9a937a29df11695dc71410f555d0a
import math import torch import torch.utils.data from torch import nn import torch.nn.functional as F class Model(nn.Module): """ Loss for the case of iid residuals with isotropic covariance: $Sigma_i = sigma_i^2 I$ The loss (negative log likelihood) is then: $1/2 sum_{i=1}^n (log(2 pi) + 2 log si...
IndepAnisotropicGaussianUVLoss
# 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.utils.data from torch import nn import torch.nn.functional as F class IndepAnisotropicGaussianUVLoss(nn.Module): """ Loss for the case of independent residuals with anisotropic covariances: $Sigma_i = sigma_i^2 I + r_i r_i^T$ The loss (negative log likelihood) is ...
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 math...
TinBacon/FastAutoAugmentation
IndepAnisotropicGaussianUVLoss
false
5,892
[ "Apache-2.0" ]
1
011e4e348fd9a937a29df11695dc71410f555d0a
https://github.com/TinBacon/FastAutoAugmentation/tree/011e4e348fd9a937a29df11695dc71410f555d0a
import math import torch import torch.utils.data from torch import nn import torch.nn.functional as F class Model(nn.Module): """ Loss for the case of independent residuals with anisotropic covariances: $Sigma_i = sigma_i^2 I + r_i r_i^T$ The loss (negative log likelihood) is then: $1/2 sum_{i=1}^...
BVNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class BVNet(nn.Module): """ Baseline REINFORCE - Value Calculating Network """ def __init__(self, input_size): super(BVNet, self).__init__() self.input_size = input_size self.fc1 = nn.Linear(inp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SpyrosMouselinos/DeltaFormers
BVNet
false
5,893
[ "Apache-2.0" ]
1
38508fa9b85f2c50aa0031b67e7e8feff1a75b27
https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn class Model(nn.Module): """ Baseline REINFORCE - Value Calculating Network """ def __init__(self, input_size): super().__init__() self.input_size = input_size self.fc1 = nn.Linear(input_size, in...
MegatronFastGelu
# 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 import torch.onnx import torch.utils.checkpoint class MegatronFastGelu(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def g...
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 import torch.onnx import torch.utils.checkpoint assert_size_str...
TingGong1/onnxruntime
MegatronFastGelu
false
5,894
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class Model(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inp...
MegatronGelu
# 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 import torch.onnx import torch.utils.checkpoint class MegatronGelu(torch.nn.Module): def forward(self, x): return x * 0.5 * (torch.erf(x / 1.41421) + 1.0) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn import torch.onnx import torch.utils.checkpoint assert_size_str...
TingGong1/onnxruntime
MegatronGelu
false
5,895
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class Model(torch.nn.Module): def forward(self, x): return x * 0.5 * (torch.erf(x / 1.41421) + 1.0) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SelfAttention(nn.Module): def __init__(self, embed_size, heads): super(SelfAttention, self).__init__() self.embed_size = embed_size self.heads = heads self.head_dim = embed_size // heads assert self.head_dim * heads == embed_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._inductor.runtime....
Thibaud-Ardoin/Dial-a-Ride
SelfAttention
false
5,896
[ "MIT" ]
1
7d9b3cd904d3194dccad31fec2533e2cf58cad0c
https://github.com/Thibaud-Ardoin/Dial-a-Ride/tree/7d9b3cd904d3194dccad31fec2533e2cf58cad0c
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, embed_size, heads): super().__init__() self.embed_size = embed_size self.heads = heads self.head_dim = embed_size // heads assert self.head_dim * heads == embed_size, 'Embedding size needs to be ...
NeuralNetPartialNoGradModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 import torch.utils.checkpoint class NeuralNetPartialNoGradModel(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetPartialNoGradModel, self).__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size).requir...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
TingGong1/onnxruntime
NeuralNetPartialNoGradModel
false
5,897
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn import torch.onnx import torch.utils.checkpoint 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).requires_grad_( False) self.relu = torch....
KLLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor class KLLoss(torch.nn.KLDivLoss): def __init__(self, batch_wise=False): super(KLLoss, self).__init__(reduction='batchmean') self.batch_wise = batch_wise def forward(self, input: 'Tensor', target: 'Tensor') ->Tensor: if self.batch_wise: ...
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 assert_size...
Tomoya-K-0504/deepSELF
KLLoss
false
5,898
[ "MIT" ]
1
0e5a7d0169b3e9edcb5c8d9802140a84ce5cb69a
https://github.com/Tomoya-K-0504/deepSELF/tree/0e5a7d0169b3e9edcb5c8d9802140a84ce5cb69a
import torch from torch import Tensor class Model(torch.nn.KLDivLoss): def __init__(self, batch_wise=False): super().__init__(reduction='batchmean') self.batch_wise = batch_wise def forward(self, input: 'Tensor', target: 'Tensor') ->Tensor: if self.batch_wise: n_labels = ...
SANet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.backends.cudnn def calc_mean_std(feat, eps=1e-05): size = feat.size() assert len(size) == 4 N, C = size[:2] feat_var = feat.view(N, C, -1).var(dim=2) + eps feat_std = feat_var.sqrt().view(N, C, 1, 1) feat_mean = feat.view(N, C, -1).mean(dim=2).vi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
TimandXiyu/SANet-style-transfer-
SANet
false
5,899
[ "MIT" ]
1
91c3dd1344d1dded61aa2e79618240a49345b40e
https://github.com/TimandXiyu/SANet-style-transfer-/tree/91c3dd1344d1dded61aa2e79618240a49345b40e
import torch import torch.nn as nn import torch.backends.cudnn def calc_mean_std(feat, eps=1e-05): size = feat.size() assert len(size) == 4 N, C = size[:2] feat_var = feat.view(N, C, -1).var(dim=2) + eps feat_std = feat_var.sqrt().view(N, C, 1, 1) feat_mean = feat.view(N, C, -1).mean(dim=2).vi...
LayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn import torch.onnx import torch.utils.checkpoint class LayerNorm(nn.Module): def __init__(self, hidden_size, epsilon, cast_fp16=True, formula=0): super().__init__() self.layer_norm = nn.LayerNorm(hidden_size, eps=epsilon) self.layer_norm.b...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn import torch.onnx import torch.utils.chec...
TingGong1/onnxruntime
LayerNorm
false
5,900
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn as nn import torch.nn import torch.onnx import torch.utils.checkpoint class Model(nn.Module): def __init__(self, hidden_size, epsilon, cast_fp16=True, formula=0): super().__init__() self.layer_norm = nn.LayerNorm(hidden_size, eps=epsilon) self.layer_norm.bias....
AttentionSeq2Vec
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch.nn import Linear from typing import Optional from torch.nn import Tanh def masked_softmax(vector: 'torch.FloatTensor', mask: 'torch.ByteTensor'): """ 计算带有 masked 的 softmax :param vector: shape: (B, seq_len) :param mask: shape: (B, seq_len), :retu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math fr...
Tiffany-HONG/easytext
AttentionSeq2Vec
false
5,901
[ "MIT" ]
1
9c717d11240d96fab98b0532084ebb5c093d55bd
https://github.com/Tiffany-HONG/easytext/tree/9c717d11240d96fab98b0532084ebb5c093d55bd
from torch.nn import Module import torch from torch.nn import Linear from typing import Optional from torch.nn import Tanh def masked_softmax(vector: 'torch.FloatTensor', mask: 'torch.ByteTensor'): """ 计算带有 masked 的 softmax :param vector: shape: (B, seq_len) :param mask: shape: (B, seq_len), :retu...
NeuralNetNonDifferentiableOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 import torch.utils.checkpoint class NeuralNetNonDifferentiableOutput(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetNonDifferentiableOutput, self).__init__() self.fc1 = torch.nn.Linear(input_size, hidden_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
TingGong1/onnxruntime
NeuralNetNonDifferentiableOutput
false
5,902
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn import torch.onnx import torch.utils.checkpoint 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....
Normalize
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor class Normalize(torch.nn.Module): def forward(self, x: 'Tensor'): return (x - x.mean()) / x.std() def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._...
Tomoya-K-0504/deepSELF
Normalize
false
5,903
[ "MIT" ]
1
0e5a7d0169b3e9edcb5c8d9802140a84ce5cb69a
https://github.com/Tomoya-K-0504/deepSELF/tree/0e5a7d0169b3e9edcb5c8d9802140a84ce5cb69a
import torch from torch import Tensor class Model(torch.nn.Module): def forward(self, x: 'Tensor'): return (x - x.mean()) / x.std() def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
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 import torch.utils.checkpoint class NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency(torch. nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
TingGong1/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency
false
5,904
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn import torch.onnx import torch.utils.checkpoint 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.softmax = torch.nn.Softmax(dim=1) s...
PositionalScaledDotProductAttention
# 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.utils.data import torch import torch.nn as nn import torch.nn.functional as F class PositionalScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention with optional positional encodings """ def __init__(self, temperature, positional_encoding=None, attn_dropout=0.1 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
TomerRonen34/MeshCNN
PositionalScaledDotProductAttention
false
5,905
[ "MIT" ]
1
8c50f3804c48044b78572d652a42184640e904d9
https://github.com/TomerRonen34/MeshCNN/tree/8c50f3804c48044b78572d652a42184640e904d9
import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Scaled Dot-Product Attention with optional positional encodings """ def __init__(self, temperature, positional_encoding=None, attn_dropout=0.1 ): super().__init_...
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 import torch.utils.checkpoint class NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency(torch .nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
TingGong1/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
false
5,906
[ "MIT" ]
1
435010ab6873974803591fa22262ed8b3e36e44d
https://github.com/TingGong1/onnxruntime/tree/435010ab6873974803591fa22262ed8b3e36e44d
import torch import torch.nn import torch.onnx import torch.utils.checkpoint 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_si...
ScaledDotProductAttention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention from https://github.com/jadore801120/attention-is-all-you-need-pytorch by Yu-Hsiang Huang """ def __init__(self,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
TomerRonen34/MeshCNN
ScaledDotProductAttention
false
5,907
[ "MIT" ]
1
8c50f3804c48044b78572d652a42184640e904d9
https://github.com/TomerRonen34/MeshCNN/tree/8c50f3804c48044b78572d652a42184640e904d9
import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Scaled Dot-Product Attention from https://github.com/jadore801120/attention-is-all-you-need-pytorch by Yu-Hsiang Huang """ def __init__(self, temperature, attn_d...
ConvPredictor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 ConvPredictor(nn.Module): def __init__(self, input_dim, output_dim, groups): super(ConvPredictor, self).__init__() self.feature_maps = input_dim self.groups = groups self.output_dim = output_dim self.conv = nn.Conv1d(in_channels=sel...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
TomScheffers/Residual-Prediction-Networks-using-Pytorch
ConvPredictor
false
5,908
[ "MIT" ]
1
c0e8b60c188414d71c389a0fd034f50017c24a93
https://github.com/TomScheffers/Residual-Prediction-Networks-using-Pytorch/tree/c0e8b60c188414d71c389a0fd034f50017c24a93
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_dim, output_dim, groups): super().__init__() self.feature_maps = input_dim self.groups = groups self.output_dim = output_dim self.conv = nn.Conv1d(in_channels=self.feature_maps, out_channel...
L2Norm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.init as init import torch.utils.data from numpy.random import * class L2Norm(nn.Module): def __init__(self, n_channels, scale): super(L2Norm, self).__init__() self.n_channels = n_channels self.gamma = scale or None self.eps = 1e-1...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.init as init import torch.utils.data from...
Tony-Khor/PyTorch-From-Zero-to-All
L2Norm
false
5,909
[ "MIT" ]
1
d8f9b6d81fe390dee93a887f342dc818553e61b3
https://github.com/Tony-Khor/PyTorch-From-Zero-to-All/tree/d8f9b6d81fe390dee93a887f342dc818553e61b3
import torch import torch.nn as nn import torch.nn.init as init import torch.utils.data from numpy.random import * class Model(nn.Module): def __init__(self, n_channels, scale): super().__init__() self.n_channels = n_channels self.gamma = scale or None self.eps = 1e-10 sel...
Pooling
# 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 Pooling(nn.Module): """ Implementation of pooling for PoolFormer --pool_size: pooling size """ def __init__(self, pool_size=3): super().__init__() self.pool = nn.AvgPool2d(pool_size, stride=1, padding=pool_size // 2, count_incl...
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...
TranNhiem/MVAR_SSL
Pooling
false
5,910
[ "MIT" ]
1
339964db4d40f06a92866675ff99ef67cd968cca
https://github.com/TranNhiem/MVAR_SSL/tree/339964db4d40f06a92866675ff99ef67cd968cca
import torch import torch.nn as nn class Model(nn.Module): """ Implementation of pooling for PoolFormer --pool_size: pooling size """ def __init__(self, pool_size=3): super().__init__() self.pool = nn.AvgPool2d(pool_size, stride=1, padding=pool_size // 2, count_includ...
Transform
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.backends.cudnn def calc_mean_std(feat, eps=1e-05): size = feat.size() assert len(size) == 4 N, C = size[:2] feat_var = feat.view(N, C, -1).var(dim=2) + eps feat_std = feat_var.sqrt().view(N, C, 1, 1) feat_mean = feat.view(N, C, -1).mean(dim=2).vi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
TimandXiyu/SANet-style-transfer-
Transform
false
5,911
[ "MIT" ]
1
91c3dd1344d1dded61aa2e79618240a49345b40e
https://github.com/TimandXiyu/SANet-style-transfer-/tree/91c3dd1344d1dded61aa2e79618240a49345b40e
import torch import torch.nn as nn import torch.backends.cudnn def calc_mean_std(feat, eps=1e-05): size = feat.size() assert len(size) == 4 N, C = size[:2] feat_var = feat.view(N, C, -1).var(dim=2) + eps feat_std = feat_var.sqrt().view(N, C, 1, 1) feat_mean = feat.view(N, C, -1).mean(dim=2).vi...
VGG16
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torchvision.transforms.functional as F import torch.nn as nn import torch.nn.functional as F class Normalize: def __init__(self, mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)): self.mean = mean self.std = std def undo(self, imgarr): proc...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 numpy as np import tor...
SharhadBashar/1-stage-wseg
VGG16
false
5,913
[ "Apache-2.0" ]
1
83bf13444f5039ffed2de1605f09b3f90b525586
https://github.com/SharhadBashar/1-stage-wseg/tree/83bf13444f5039ffed2de1605f09b3f90b525586
import torch import numpy as np import torchvision.transforms.functional as F import torch.nn as nn import torch.nn.functional as F class Normalize: def __init__(self, mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)): self.mean = mean self.std = std def undo(self, imgarr): proc...
L2Norm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class L2Norm(nn.Module): """Channel-wise L2 normalization.""" def __init__(self, in_channels): super(L2Norm, self).__init__() self.weight = nn.Parameter(torch.randn(in_channels)) def forward(self, x): """out = weight * x / sqrt(\\sum x_i^2)""" ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
TropComplique/ssd-pytorch
L2Norm
false
5,914
[ "MIT" ]
1
e91af875c65dc64a21b838a6645fc803ef690dcf
https://github.com/TropComplique/ssd-pytorch/tree/e91af875c65dc64a21b838a6645fc803ef690dcf
import torch import torch.nn as nn class Model(nn.Module): """Channel-wise L2 normalization.""" def __init__(self, in_channels): super().__init__() self.weight = nn.Parameter(torch.randn(in_channels)) def forward(self, x): """out = weight * x / sqrt(\\sum x_i^2)""" unsque...
UnitNorm
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data class UnitNorm(nn.Module): def forward(self, x): x = nn.functional.normalize(x, dim=1) return 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 import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import...
UMBCvision/CMSF
UnitNorm
false
5,915
[ "MIT" ]
1
4aaac1833a0c8cfd67aa05762e43478983d74c08
https://github.com/UMBCvision/CMSF/tree/4aaac1833a0c8cfd67aa05762e43478983d74c08
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data class Model(nn.Module): def forward(self, x): x = nn.functional.normalize(x, dim=1) return x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Whitening2d
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from torch.cuda.amp import custom_fwd from torch.nn.functional import conv2d class Whitening2d(nn.Module): def __init__(self, output_dim: 'int', eps: 'float'=0.0): """Layer that computes hard whitening for W-MSE using the Cholesky decomposition. Args: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
TranNhiem/MVAR_SSL
Whitening2d
false
5,916
[ "MIT" ]
1
339964db4d40f06a92866675ff99ef67cd968cca
https://github.com/TranNhiem/MVAR_SSL/tree/339964db4d40f06a92866675ff99ef67cd968cca
import torch import torch.nn as nn from torch.cuda.amp import custom_fwd from torch.nn.functional import conv2d class Model(nn.Module): def __init__(self, output_dim: 'int', eps: 'float'=0.0): """Layer that computes hard whitening for W-MSE using the Cholesky decomposition. Args: out...
UpsampleConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 UpsampleConv2d(nn.Module): """ Avoid checkerboard patterns by upsampling the image and convolving. https://distill.pub/2016/deconv-checkerboard/ """ def __init__(self, in_channels, out_channels, kernel_size, stride, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
TrueMatthewKirkham/face-preserving-style-transfer
UpsampleConv2d
false
5,917
[ "MIT" ]
1
ae8a9509570227ea52776fba85658022124c886c
https://github.com/TrueMatthewKirkham/face-preserving-style-transfer/tree/ae8a9509570227ea52776fba85658022124c886c
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): """ Avoid checkerboard patterns by upsampling the image and convolving. https://distill.pub/2016/deconv-checkerboard/ """ def __init__(self, in_channels, out_channels, kernel_size, stride, padding,...
LayerNormChannel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 LayerNormChannel(nn.Module): """ LayerNorm only for Channel Dimension. Input: tensor in shape [B, C, H, W] """ def __init__(self, num_channels, eps=1e-05): super().__init__() self.weight = nn.Parameter(torch.ones(num_channels)) self...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
TranNhiem/MVAR_SSL
LayerNormChannel
false
5,918
[ "MIT" ]
1
339964db4d40f06a92866675ff99ef67cd968cca
https://github.com/TranNhiem/MVAR_SSL/tree/339964db4d40f06a92866675ff99ef67cd968cca
import torch import torch.nn as nn class Model(nn.Module): """ LayerNorm only for Channel Dimension. Input: tensor in shape [B, C, H, W] """ def __init__(self, num_channels, eps=1e-05): super().__init__() self.weight = nn.Parameter(torch.ones(num_channels)) self.bias = nn....
MarginRankingLearningLoss
# 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 MarginRankingLearningLoss(nn.Module): def __init__(self, margin=1.0): super(MarginRankingLearningLoss, self).__init__() self.margin = margin def forward(self, inputs, targets): random = torch.randperm(inputs.size...
import torch from torch import device import triton import triton.language as tl from 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.guard...
VKCOM/TopicsDataset
MarginRankingLearningLoss
false
5,919
[ "MIT" ]
1
149919321ba61a8f17b22f62f60f4aedec43d72b
https://github.com/VKCOM/TopicsDataset/tree/149919321ba61a8f17b22f62f60f4aedec43d72b
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, margin=1.0): super().__init__() self.margin = margin def forward(self, inputs, targets): random = torch.randperm(inputs.size(0)) inputs[random] pred_lossi = in...
GumbelQuantizer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import functional as F class GumbelQuantizer(nn.Module): def __init__(self, input_dim, num_latents, embedding_dim): super().__init__() self.embedding_dim = embedding_dim self.num_latents = num_latents self.proj = nn.Conv2d(input_dim...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
TobiasNorlund/vq-vae
GumbelQuantizer
false
5,920
[ "Apache-2.0" ]
1
bdfc35f35491e8d4877a13f7f84d6cbdcc69daa0
https://github.com/TobiasNorlund/vq-vae/tree/bdfc35f35491e8d4877a13f7f84d6cbdcc69daa0
import torch import torch.nn as nn from torch.nn import functional as F class Model(nn.Module): def __init__(self, input_dim, num_latents, embedding_dim): super().__init__() self.embedding_dim = embedding_dim self.num_latents = num_latents self.proj = nn.Conv2d(input_dim, num_late...