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
RpowInt
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class RpowInt(torch.nn.Module): def __init__(self): super(RpowInt, self).__init__() def forward(self, x): return 2 ** x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
bunderhi/torch2trt
RpowInt
false
1,650
[ "MIT" ]
0
fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d
https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): return 2 ** x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Perplexity
# 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 as nn from torch.nn.modules.loss import CrossEntropyLoss class Perplexity(CrossEntropyLoss): __constants__ = ['weight', 'ignore_index', 'reduction'] def __init__(self, weight=None, size_average=None, ignore_index=-100, reduce=None): super(Perplexity, self).__...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn a...
cesarali/Tyche
Perplexity
false
1,651
[ "MIT" ]
0
d892df9e0b982f538ae38221ff5848f6d726a4fb
https://github.com/cesarali/Tyche/tree/d892df9e0b982f538ae38221ff5848f6d726a4fb
import torch from torch import nn as nn from torch.nn.modules.loss import CrossEntropyLoss class Model(CrossEntropyLoss): __constants__ = ['weight', 'ignore_index', 'reduction'] def __init__(self, weight=None, size_average=None, ignore_index=-100, reduce=None): super().__init__(weight, size_a...
NoiseInjection
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class NoiseInjection(nn.Module): def __init__(self, channel): super().__init__() self.weight = nn.Parameter(torch.zeros(1, channel, 1, 1)) def forward(self, image, noise): return image + self.weight * noise def get_inputs(): return [torch.rand(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
celdeldel/style_conditionnal_gan
NoiseInjection
false
1,652
[ "MIT" ]
0
3a4623560af1e12d46e2f9ffa9726c29df9d5680
https://github.com/celdeldel/style_conditionnal_gan/tree/3a4623560af1e12d46e2f9ffa9726c29df9d5680
import torch from torch import nn class Model(nn.Module): def __init__(self, channel): super().__init__() self.weight = nn.Parameter(torch.zeros(1, channel, 1, 1)) def forward(self, image, noise): return image + self.weight * noise def get_inputs(): return [torch.rand([4, 4, 4,...
Stub
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class Stub(nn.Module): def __init__(self, shape): super(Stub, self).__init__() self.shape = shape return def forward(self, x): return x.new_ones(self.shape) def get_inputs(): return [torch.rand([4, 4, 4, 4])] ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
cestcedric/TSSR-GAN
Stub
false
1,653
[ "BSD-2-Clause", "MIT" ]
0
d6e1b50409e0f0591660552993e6d5b70d41e766
https://github.com/cestcedric/TSSR-GAN/tree/d6e1b50409e0f0591660552993e6d5b70d41e766
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, shape): super().__init__() self.shape = shape return def forward(self, x): return x.new_ones(self.shape) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_i...
FusedDownsample
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 from math import sqrt class FusedDownsample(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, padding=0): super().__init__() weight = torch.randn(out_channel, in_channel, kernel_size, kernel_size) bi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn from math import sqrt assert_size_stride = torch._C._dynamo...
celdeldel/style_conditionnal_gan
FusedDownsample
false
1,654
[ "MIT" ]
0
3a4623560af1e12d46e2f9ffa9726c29df9d5680
https://github.com/celdeldel/style_conditionnal_gan/tree/3a4623560af1e12d46e2f9ffa9726c29df9d5680
import torch from torch import nn from torch.nn import functional as F from math import sqrt class Model(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, padding=0): super().__init__() weight = torch.randn(out_channel, in_channel, kernel_size, kernel_size) bias = torch...
CustomReLU
# 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 CustomReLU(nn.Module): def __init__(self, max_z=6.0): super(CustomReLU, self).__init__() self.max_z = max_z def forward(self, x): return torch.clamp(x, min=0, max=self.max_z) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
charlesmackin/tiny
CustomReLU
false
1,655
[ "Apache-2.0" ]
0
bf8afc5cfc15e12efdd3bca0d559adfdfc435981
https://github.com/charlesmackin/tiny/tree/bf8afc5cfc15e12efdd3bca0d559adfdfc435981
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, max_z=6.0): super().__init__() self.max_z = max_z def forward(self, x): return torch.clamp(x, min=0, max=self.max_z) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): re...
FusedUpsample
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 from math import sqrt class FusedUpsample(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, padding=0): super().__init__() weight = torch.randn(in_channel, out_channel, kernel_size, kernel_size) bias...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn from math import sqrt assert_size_stride = torch._C._dynamo...
celdeldel/style_conditionnal_gan
FusedUpsample
false
1,656
[ "MIT" ]
0
3a4623560af1e12d46e2f9ffa9726c29df9d5680
https://github.com/celdeldel/style_conditionnal_gan/tree/3a4623560af1e12d46e2f9ffa9726c29df9d5680
import torch from torch import nn from torch.nn import functional as F from math import sqrt class Model(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, padding=0): super().__init__() weight = torch.randn(in_channel, out_channel, kernel_size, kernel_size) bias = torch...
_UpsampleLinear
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class _UpsampleLinear(nn.Module): def __init__(self, scale): super(_UpsampleLinear, self).__init__() self._mode = 'linear', 'bilinear', 'trilinear' self.scale = scale def forward(self, x, scale...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guard...
cestcedric/TSSR-GAN
_UpsampleLinear
false
1,657
[ "BSD-2-Clause", "MIT" ]
0
d6e1b50409e0f0591660552993e6d5b70d41e766
https://github.com/cestcedric/TSSR-GAN/tree/d6e1b50409e0f0591660552993e6d5b70d41e766
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): def __init__(self, scale): super().__init__() self._mode = 'linear', 'bilinear', 'trilinear' self.scale = scale def forward(self, x, scale=None): scale = scale o...
FlawDetectorCriterion
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class FlawDetectorCriterion(nn.Module): """ Criterion of the flaw detector. """ def __init__(self): super(FlawDetectorCriterion, self).__init__() def forward(self, pred, gt, is_ssl=False, reduction=True): loss = F.mse...
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...
charlesCXK/PixelSSL
FlawDetectorCriterion
false
1,658
[ "Apache-2.0" ]
0
2e85e12c1db5b24206bfbbf2d7f6348ae82b2105
https://github.com/charlesCXK/PixelSSL/tree/2e85e12c1db5b24206bfbbf2d7f6348ae82b2105
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Criterion of the flaw detector. """ def __init__(self): super().__init__() def forward(self, pred, gt, is_ssl=False, reduction=True): loss = F.mse_loss(pred, gt, reduction='none') i...
ActivationNoise
# 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 ActivationNoise(nn.Module): """Gaussian noise regularizer. Args: sigma (float, optional): relative standard deviation used to generate the noise. Relative means that it will be multiplied by the magnitude of the value your are adding th...
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...
charlesmackin/tiny
ActivationNoise
false
1,659
[ "Apache-2.0" ]
0
bf8afc5cfc15e12efdd3bca0d559adfdfc435981
https://github.com/charlesmackin/tiny/tree/bf8afc5cfc15e12efdd3bca0d559adfdfc435981
import torch import torch.nn as nn class Model(nn.Module): """Gaussian noise regularizer. Args: sigma (float, optional): relative standard deviation used to generate the noise. Relative means that it will be multiplied by the magnitude of the value your are adding the noise to...
MeanVoxelFeatureExtractor
# 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 VoxelFeatureExtractor(nn.Module): def __init__(self, **kwargs): super().__init__() def get_output_feature_dim(self): raise NotImplementedError def forward(self, **kwargs): raise NotImplementedError class MeanVoxelFeatureExtractor(VoxelF...
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...
charlesyz/PCDet
MeanVoxelFeatureExtractor
false
1,660
[ "Apache-2.0" ]
0
1eb6b1dc5a3d563d7532b1c8ee3be007cbeafc80
https://github.com/charlesyz/PCDet/tree/1eb6b1dc5a3d563d7532b1c8ee3be007cbeafc80
import torch import torch.nn as nn class VoxelFeatureExtractor(nn.Module): def __init__(self, **kwargs): super().__init__() def get_output_feature_dim(self): raise NotImplementedError def forward(self, **kwargs): raise NotImplementedError class Model(VoxelFeatureExtractor): ...
make_dilation_dense
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class make_dilation_dense(nn.Module): def __init__(self, nChannels, growthRate, kernel_size=3): super(make_dilation_dense, self).__init__() self.conv = nn.Conv2d(nChannels, growthRate, kernel_size= ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
cestcedric/TSSR-GAN
make_dilation_dense
false
1,661
[ "BSD-2-Clause", "MIT" ]
0
d6e1b50409e0f0591660552993e6d5b70d41e766
https://github.com/cestcedric/TSSR-GAN/tree/d6e1b50409e0f0591660552993e6d5b70d41e766
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): def __init__(self, nChannels, growthRate, kernel_size=3): super().__init__() self.conv = nn.Conv2d(nChannels, growthRate, kernel_size= kernel_size, padding=(kernel_size -...
SelfAttentionRE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F from torch import nn class SelfAttentionRE(nn.Module): def __init__(self, emb_dim): super().__init__() self.query_mlp = nn.Linear(in_features=emb_dim, out_features=1) self.value_mlp = nn.Linear(in_features=emb_dim, out_features=emb_dim) de...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chaitanya2334/lsm
SelfAttentionRE
false
1,662
[ "MIT" ]
0
504c732238b419cd77e7e0a97af040778ee9c7dd
https://github.com/chaitanya2334/lsm/tree/504c732238b419cd77e7e0a97af040778ee9c7dd
import torch import torch.nn.functional as F from torch import nn class Model(nn.Module): def __init__(self, emb_dim): super().__init__() self.query_mlp = nn.Linear(in_features=emb_dim, out_features=1) self.value_mlp = nn.Linear(in_features=emb_dim, out_features=emb_dim) def forward(...
FFN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 collections import OrderedDict class FFN(nn.Module): def __init__(self, layer_arch, input_size, output_size, bias=True): super(FFN, self).__init__() self.layer_arch = layer_arch self.input_size = input_size self.output_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 from co...
charlesxin97/ToolFinder_binder
FFN
false
1,663
[ "Apache-2.0" ]
0
49467d5519adcd6d881e57d460c97c37b6a45add
https://github.com/charlesxin97/ToolFinder_binder/tree/49467d5519adcd6d881e57d460c97c37b6a45add
import torch import torch.nn as nn from collections import OrderedDict class Model(nn.Module): def __init__(self, layer_arch, input_size, output_size, bias=True): super().__init__() self.layer_arch = layer_arch self.input_size = input_size self.output_size = output_size se...
FCDiscriminatorCriterion
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class FCDiscriminatorCriterion(nn.Module): def __init__(self): super(FCDiscriminatorCriterion, self).__init__() def forward(self, pred, gt): loss = F.binary_cross_entropy_with_logits(pred, gt, reduction='none') 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, math as tl_math import torc...
charlesCXK/PixelSSL
FCDiscriminatorCriterion
false
1,664
[ "Apache-2.0" ]
0
2e85e12c1db5b24206bfbbf2d7f6348ae82b2105
https://github.com/charlesCXK/PixelSSL/tree/2e85e12c1db5b24206bfbbf2d7f6348ae82b2105
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, pred, gt): loss = F.binary_cross_entropy_with_logits(pred, gt, reduction='none') return torch.mean(loss, dim=(1, 2, 3)) def get_inputs...
PolicyNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.distributions import Normal class PolicyNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size, action_range= 1.0, init_w=0.003, log_std_min=-20, log_std_max=2): super(PolicyNetwo...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chagri/SOTA-RL-Algorithms
PolicyNetwork
false
1,665
[ "Apache-2.0" ]
0
58b416e7c706d8426dc402482e72ca7283568e71
https://github.com/chagri/SOTA-RL-Algorithms/tree/58b416e7c706d8426dc402482e72ca7283568e71
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal class Model(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size, action_range= 1.0, init_w=0.003, log_std_min=-20, log_std_max=2): super().__init__() ...
TemporalAggregation_Mean
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn from math import sqrt as sqrt from itertools import product as product class TemporalAggregation_Mean(nn.Module): def __init__(self, cfg): super(TemporalAggregation_Mean, self).__init__() self.K = cfg.K def forw...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from math import sqrt as sqrt from itertools import product as product assert_size_stride = torch._C._dynamo.guards.as...
burhanmudassar/pytorch-action-detection
TemporalAggregation_Mean
false
1,666
[ "MIT" ]
0
16afb9312248d73c0e2be56ac733e0a33040307e
https://github.com/burhanmudassar/pytorch-action-detection/tree/16afb9312248d73c0e2be56ac733e0a33040307e
from _paritybench_helpers import _mock_config import torch import torch.nn as nn from math import sqrt as sqrt from itertools import product as product class Model(nn.Module): def __init__(self, cfg): super().__init__() self.K = cfg.K def forward(self, s): s = s.view(s.size(0) // sel...
GlobalMaxPool1D
# 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 functional class GlobalMaxPool1D(torch.nn.Module): def __init__(self): super(GlobalMaxPool1D, self).__init__() def forward(self, x): """ x shape: (batch_size, channel, seq_len) return shape: (batch_size, channel, 1) """ ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
charliemorning/mlws
GlobalMaxPool1D
false
1,667
[ "MIT" ]
0
8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784
https://github.com/charliemorning/mlws/tree/8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784
import torch import torch.nn.functional as functional class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): """ x shape: (batch_size, channel, seq_len) return shape: (batch_size, channel, 1) """ return functional.max_pool1d...
GlobalAvgPool1D
# 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 functional class GlobalAvgPool1D(torch.nn.Module): def __init__(self): super(GlobalAvgPool1D, self).__init__() def forward(self, x): """ x shape: (batch_size, channel, seq_len) return shape: (batch_size, channel, 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda reinterpret...
charliemorning/mlws
GlobalAvgPool1D
false
1,668
[ "MIT" ]
0
8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784
https://github.com/charliemorning/mlws/tree/8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784
import torch import torch.nn.functional as functional class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): """ x shape: (batch_size, channel, seq_len) return shape: (batch_size, channel, 1) """ return functional.avg_pool1d...
Mask
# 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 Mask(nn.Module): def forward(self, seq, mask): seq_mask = torch.unsqueeze(mask, 2) seq_mask = torch.transpose(seq_mask.repeat(1, 1, seq.size()[1]), 1, 2) return seq.where(torch.eq(seq_mask, 1), torch.zeros_like(seq)) def get_inputs(): return ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
charliemorning/mlws
Mask
false
1,669
[ "MIT" ]
0
8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784
https://github.com/charliemorning/mlws/tree/8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784
import torch import torch.nn as nn class Model(nn.Module): def forward(self, seq, mask): seq_mask = torch.unsqueeze(mask, 2) seq_mask = torch.transpose(seq_mask.repeat(1, 1, seq.size()[1]), 1, 2) return seq.where(torch.eq(seq_mask, 1), torch.zeros_like(seq)) def get_inputs(): return...
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, input_size, nb_action): super(Network, self).__init__() self.input_size = input_size self.nb_action = nb_action self.fc1 = nn.Linear(input_size, 32) 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_...
cheapmouse94/Machine_Learning-Gates-python
Network
false
1,670
[ "MIT" ]
0
1e159ccf8f9a5db9104fa3926b85750787676e15
https://github.com/cheapmouse94/Machine_Learning-Gates-python/tree/1e159ccf8f9a5db9104fa3926b85750787676e15
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_size, nb_action): super().__init__() self.input_size = input_size self.nb_action = nb_action self.fc1 = nn.Linear(input_size, 32) self.fc2 = nn.Linear(32, 64...
FeedForwardNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 class FeedForwardNN(nn.Module): """ A standard in_dim-64-64-out_dim Feed Forward Neural Network. """ def __init__(self, in_dim, out_dim): """ Initialize the network and set up the layers. Parameters: i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
chenjun-110/WZCQ
FeedForwardNN
false
1,671
[ "Apache-2.0" ]
0
e2de7743ad671e8632cfa084638555d7f1deb42f
https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ A standard in_dim-64-64-out_dim Feed Forward Neural Network. """ def __init__(self, in_dim, out_dim): """ Initialize the network and set up the layers. Parameters: in_dim - ...
MLPEncoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 MLPEncoder(nn.Module): def __init__(self, d_in, d_out): super(MLPEncoder, self).__init__() H1 = 100 H2 = 10 self.d_in = d_in self.l1 = nn.Linear(d_in, H1) self.l11 = nn.Linear(H1, H2) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
cheng-xie/motionEncode
MLPEncoder
false
1,672
[ "MIT" ]
0
fa2152b3eaf2e09ad9477d054566db0a7bc4c7b4
https://github.com/cheng-xie/motionEncode/tree/fa2152b3eaf2e09ad9477d054566db0a7bc4c7b4
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, d_in, d_out): super().__init__() H1 = 100 H2 = 10 self.d_in = d_in self.l1 = nn.Linear(d_in, H1) self.l11 = nn.Linear(H1, H2) self.l2 = nn.Linear(H...
posFFN1d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class posFFN1d(nn.Module): def __init__(self, d_hid, d_inner_hid, window=1, dropout=0.1): super().__init__() self.w_1 = nn.Conv1d(d_hid, d_inner_hid, kernel_size=window) self.relu = nn.ReLU() self.w_2 = nn.Conv1d(d_inner_hid, d_hid, kernel_size=wi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chaitanya2334/lsm
posFFN1d
false
1,673
[ "MIT" ]
0
504c732238b419cd77e7e0a97af040778ee9c7dd
https://github.com/chaitanya2334/lsm/tree/504c732238b419cd77e7e0a97af040778ee9c7dd
import torch from torch import nn class Model(nn.Module): def __init__(self, d_hid, d_inner_hid, window=1, dropout=0.1): super().__init__() self.w_1 = nn.Conv1d(d_hid, d_inner_hid, kernel_size=window) self.relu = nn.ReLU() self.w_2 = nn.Conv1d(d_inner_hid, d_hid, kernel_size=windo...
BaseModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 torchvision.transforms import * import torch.nn as nn import torch.nn.functional as F class BaseModel(nn.Module): def __init__(self, num_classes): super().__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=7, stride=1) self.conv2 = nn.Conv2d(32, 64, kernel_size=3, stri...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 torchvision.transforms i...
bsm8734/BC_stage1_Image_Classification
BaseModel
false
1,674
[ "MIT" ]
0
f915a6fb6748bd9041b1dc2e917d732e202e9cc3
https://github.com/bsm8734/BC_stage1_Image_Classification/tree/f915a6fb6748bd9041b1dc2e917d732e202e9cc3
import torch from torchvision.transforms import * import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_classes): super().__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=7, stride=1) self.conv2 = nn.Conv2d(32, 64, kernel_size=3, stride=1...
LinearCombine
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 LinearCombine(nn.Module): def __init__(self, layers_num, trainable=True, input_aware=False, word_level=False): super(LinearCombine, self).__init__() self.input_aware = input_aware self.word_level = word_level...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
charliemorning/mlws
LinearCombine
false
1,675
[ "MIT" ]
0
8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784
https://github.com/charliemorning/mlws/tree/8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, layers_num, trainable=True, input_aware=False, word_level=False): super().__init__() self.input_aware = input_aware self.word_level = word_level if input_aware: ...
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 import torch.nn.functional as F class autoencoder(torch.nn.Module): def __init__(self, inputDim): """ In the constructor we instantiate two nn.Linear modules and assign them as member variables. """ h_size = 128 c_size = 8 use_bias = True ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
charlesmackin/tiny
autoencoder
false
1,676
[ "Apache-2.0" ]
0
bf8afc5cfc15e12efdd3bca0d559adfdfc435981
https://github.com/charlesmackin/tiny/tree/bf8afc5cfc15e12efdd3bca0d559adfdfc435981
import torch import torch.nn.functional as F class Model(torch.nn.Module): def __init__(self, inputDim): """ In the constructor we instantiate two nn.Linear modules and assign them as member variables. """ h_size = 128 c_size = 8 use_bias = True sup...
MLPDecoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 MLPDecoder(nn.Module): def __init__(self, d_in, d_out): super(MLPDecoder, self).__init__() H1 = 10 H2 = 100 self._d_in = d_in self._d_out = d_out self.l1 = nn.Linear(d_in, H1) self.l11...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
cheng-xie/motionEncode
MLPDecoder
false
1,677
[ "MIT" ]
0
fa2152b3eaf2e09ad9477d054566db0a7bc4c7b4
https://github.com/cheng-xie/motionEncode/tree/fa2152b3eaf2e09ad9477d054566db0a7bc4c7b4
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, d_in, d_out): super().__init__() H1 = 10 H2 = 100 self._d_in = d_in self._d_out = d_out self.l1 = nn.Linear(d_in, H1) self.l11 = nn.Linear(H1, H2) ...
AE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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.utils.data class AE(nn.Module): """ Class for the AE using Fully Connected """ def __init__(self, opt): super().__init__() assert opt.isize % 4 == 0, 'input size has to be a multiple of 4' ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
cerbero94/GAN_CP
AE
false
1,678
[ "MIT" ]
0
e255f5f5b3733c55d47997c1ffc4161529701f8a
https://github.com/cerbero94/GAN_CP/tree/e255f5f5b3733c55d47997c1ffc4161529701f8a
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """ Class for the AE using Fully Connected """ def __init__(self, opt): super().__init__() assert opt.isize % 4 == 0, 'input size has to be a multiple of 4' ...
my_BinaryCross
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class my_BinaryCross(nn.Module): def __init__(self, args): super(my_BinaryCross, self).__init__() self.args = args def forward(self, output, target, beat): modif_beat = 1.0 / torch.exp(beat) * 10 ...
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 ...
carsault/chord_sequence_prediction
my_BinaryCross
false
1,679
[ "MIT" ]
0
6eb539a963ca6350bcf0c88b8d8756775ad7c488
https://github.com/carsault/chord_sequence_prediction/tree/6eb539a963ca6350bcf0c88b8d8756775ad7c488
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): def __init__(self, args): super().__init__() self.args = args def forward(self, output, target, beat): modif_beat = 1.0 / torch.exp(beat) * 10 modif_beat[modif_beat < 7] =...
GATLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter class GATLayer(Module): def __init__(self, input_channel, output_channel, use_bias=True): super(GATLayer, self).__init__() self.use_bias = u...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chengsilin/Graph_model
GATLayer
false
1,680
[ "MIT" ]
0
0d9714a8b02196fabf5b0ecd0680b7269a22c53b
https://github.com/chengsilin/Graph_model/tree/0d9714a8b02196fabf5b0ecd0680b7269a22c53b
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter class Model(Module): def __init__(self, input_channel, output_channel, use_bias=True): super().__init__() self.use_bias = use_bias s...
FeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 numpy as np import torch.nn as nn def gelu(x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class 全连接层(nn.Module): def __init__(self, 输入_接口, 输出_接口): super().__init__() np.random.seed(1) self.weig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
chenjun-110/WZCQ
FeedForward
false
1,681
[ "Apache-2.0" ]
0
e2de7743ad671e8632cfa084638555d7f1deb42f
https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f
import math import torch import numpy as np import torch.nn as nn def gelu(x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class 全连接层(nn.Module): def __init__(self, 输入_接口, 输出_接口): super().__init__() np.random.seed(1) self.weig...
L1Part
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 itertools import chain as chain import torch.utils.data from collections import OrderedDict import torch.hub import torch.nn.parallel import torch.optim class concatLayer(nn.Module): def __init__(self, in_channels, out_channels_perSub, i, j, appendix): super(concat...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 itertools import chain as chain import torch.utils.da...
byeongjokim/LateTemporalModeling3DCNN_for_sign
L1Part
false
1,682
[ "MIT" ]
0
e3a802fcf91dc3930aea782464ee34d9b747d3ab
https://github.com/byeongjokim/LateTemporalModeling3DCNN_for_sign/tree/e3a802fcf91dc3930aea782464ee34d9b747d3ab
import torch import torch.nn as nn from itertools import chain as chain import torch.utils.data from collections import OrderedDict import torch.hub import torch.nn.parallel import torch.optim class concatLayer(nn.Module): def __init__(self, in_channels, out_channels_perSub, i, j, appendix): super().__in...
判断状态
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 numpy as np import torch.nn as nn def gelu(x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class 全连接层(nn.Module): def __init__(self, 输入_接口, 输出_接口): super().__init__() np.random.seed(1) self.weig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
chenjun-110/WZCQ
判断状态
false
1,683
[ "Apache-2.0" ]
0
e2de7743ad671e8632cfa084638555d7f1deb42f
https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f
import math import torch import numpy as np import torch.nn as nn def gelu(x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class 全连接层(nn.Module): def __init__(self, 输入_接口, 输出_接口): super().__init__() np.random.seed(1) self.weig...
SoftDiceLoss
# 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.utils.data.sampler import * import torch.nn as nn import torch.nn.functional as F class SoftDiceLoss(nn.Module): def __init__(self, weight=None, size_average=True): super(SoftDiceLoss, self).__init__() def forward(self, logits, targets): num = targets.size(0) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.utils.data.sampler import * import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
chicm/carvana
SoftDiceLoss
false
1,684
[ "Apache-2.0" ]
0
493a19fbb2fdab1cc1b4b95d97742684e4144229
https://github.com/chicm/carvana/tree/493a19fbb2fdab1cc1b4b95d97742684e4144229
import torch from torch.utils.data.sampler import * import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, weight=None, size_average=True): super().__init__() def forward(self, logits, targets): num = targets.size(0) probs = F.sigmoid(logits)...
ScaledDotProductAttention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.checkpoint class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
chenxiaoyu523/FEAT3D
ScaledDotProductAttention
false
1,685
[ "MIT" ]
0
ba45ba7c26628a7cc0070b010f4f33893cdac926
https://github.com/chenxiaoyu523/FEAT3D/tree/ba45ba7c26628a7cc0070b010f4f33893cdac926
import torch import torch.nn.functional as F import torch.nn as nn import torch.utils.checkpoint class Model(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(...
BCELoss2d
# 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.utils.data.sampler import * import torch.nn as nn import torch.nn.functional as F class BCELoss2d(nn.Module): def __init__(self, weight=None, size_average=True): super(BCELoss2d, self).__init__() self.bce_loss = nn.BCELoss(weight, size_average) def forward(self, logit...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch....
chicm/carvana
BCELoss2d
false
1,686
[ "Apache-2.0" ]
0
493a19fbb2fdab1cc1b4b95d97742684e4144229
https://github.com/chicm/carvana/tree/493a19fbb2fdab1cc1b4b95d97742684e4144229
import torch from torch.utils.data.sampler import * import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, weight=None, size_average=True): super().__init__() self.bce_loss = nn.BCELoss(weight, size_average) def forward(self, logits, targets): ...
L2Part
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 itertools import chain as chain import torch.utils.data from collections import OrderedDict import torch.hub import torch.nn.parallel import torch.optim class concatLayer(nn.Module): def __init__(self, in_channels, out_channels_perSub, i, j, appendix): super(concat...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 itertools import chain as chain import torch.utils.da...
byeongjokim/LateTemporalModeling3DCNN_for_sign
L2Part
false
1,687
[ "MIT" ]
0
e3a802fcf91dc3930aea782464ee34d9b747d3ab
https://github.com/byeongjokim/LateTemporalModeling3DCNN_for_sign/tree/e3a802fcf91dc3930aea782464ee34d9b747d3ab
import torch import torch.nn as nn from itertools import chain as chain import torch.utils.data from collections import OrderedDict import torch.hub import torch.nn.parallel import torch.optim class concatLayer(nn.Module): def __init__(self, in_channels, out_channels_perSub, i, j, appendix): super().__in...
CMVN
# 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 CMVN(nn.Module): __constants__ = ['mode', 'dim', 'eps'] def __init__(self, mode='global', dim=2, eps=1e-10): super(CMVN, self).__init__() if mode != 'global': raise NotImplementedError( 'Only support global mean variance nor...
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_...
chiluen/s3prl
CMVN
false
1,688
[ "Apache-2.0" ]
0
c81838f6414d3c4767de355144449e40f86c7066
https://github.com/chiluen/s3prl/tree/c81838f6414d3c4767de355144449e40f86c7066
import torch import torch.nn as nn class Model(nn.Module): __constants__ = ['mode', 'dim', 'eps'] def __init__(self, mode='global', dim=2, eps=1e-10): super().__init__() if mode != 'global': raise NotImplementedError( 'Only support global mean variance normalizatio...
FFB
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from math import sqrt as sqrt from itertools import product as product class FFB(nn.Module): def __init__(self, c1, c2, size): super(FFB, self).__init__() self.conv_y1 = nn.Conv2d(c1, c1, kernel_size=1) self.act1 = nn.ReLU(inplace=True) self.conv...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from math import sqrt as sqrt from itertools import produc...
chickenshawama/CFEnet2
FFB
false
1,689
[ "MIT" ]
0
f20dda7ad2923bed4af5d63e705b6849a48e73df
https://github.com/chickenshawama/CFEnet2/tree/f20dda7ad2923bed4af5d63e705b6849a48e73df
import torch import torch.nn as nn from math import sqrt as sqrt from itertools import product as product class Model(nn.Module): def __init__(self, c1, c2, size): super().__init__() self.conv_y1 = nn.Conv2d(c1, c1, kernel_size=1) self.act1 = nn.ReLU(inplace=True) self.conv_y2 = n...
PrecomputedNorm
# 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 PrecomputedNorm(nn.Module): """Normalization using Pre-computed Mean/Std. Args: stats: Precomputed (mean, std). axis: Axis setting used to calculate mean/variance. """ def __init__(self, stats, axis=[1, 2]): super().__init__() s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
chiluen/s3prl
PrecomputedNorm
false
1,690
[ "Apache-2.0" ]
0
c81838f6414d3c4767de355144449e40f86c7066
https://github.com/chiluen/s3prl/tree/c81838f6414d3c4767de355144449e40f86c7066
import torch import torch.nn as nn class Model(nn.Module): """Normalization using Pre-computed Mean/Std. Args: stats: Precomputed (mean, std). axis: Axis setting used to calculate mean/variance. """ def __init__(self, stats, axis=[1, 2]): super().__init__() self.axis =...
AlReLU
# 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 AlReLU(nn.Module): def __init__(self): super().__init__() def forward(self, input): return self.alrelu(input) def alrelu(self, x): alpha = 0.01 return torch.maximum(torch.abs(alpha * x), x) def get_inputs(): return [torch.ran...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn a...
chiranthans23/jigsaw-severity-comments
AlReLU
false
1,691
[ "MIT" ]
0
b92345ff5bf0c2d2fb243b81edd98adc66a2c4ee
https://github.com/chiranthans23/jigsaw-severity-comments/tree/b92345ff5bf0c2d2fb243b81edd98adc66a2c4ee
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, input): return self.alrelu(input) def alrelu(self, x): alpha = 0.01 return torch.maximum(torch.abs(alpha * x), x) def get_inputs(): return [torch.rand...
ScaledSiLU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class ScaledSiLU(torch.nn.Module): def __init__(self): super().__init__() self.scale_factor = 1 / 0.6 self._activation = torch.nn.SiLU() def forward(self, x): return self._activation(x) * self.scale_factor def get_inputs(): return [torch.rand([4, 4, 4, 4])]...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
chris-price19/ocp
ScaledSiLU
false
1,692
[ "MIT", "BSD-3-Clause" ]
0
0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() self.scale_factor = 1 / 0.6 self._activation = torch.nn.SiLU() def forward(self, x): return self._activation(x) * self.scale_factor def get_inputs(): return [torch.rand([4, 4, 4, 4])] de...
SpatialAttentionGate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 SpatialAttentionGate(nn.Module): def __init__(self, channel, reduction=16): super(SpatialAttentionGate, self).__init__() self.fc1 = nn.Conv2d(channel, reduction, kernel_size=1, padding=0) self.fc2 = nn.Conv2d(reducti...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
chicm/clouds
SpatialAttentionGate
false
1,693
[ "MIT" ]
0
66baff6527a55767ba39a531edec6f230d5e58e8
https://github.com/chicm/clouds/tree/66baff6527a55767ba39a531edec6f230d5e58e8
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, channel, reduction=16): super().__init__() self.fc1 = nn.Conv2d(channel, reduction, kernel_size=1, padding=0) self.fc2 = nn.Conv2d(reduction, 1, kernel_size=1, padding=0) def...
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, num_classes=8): super(Net, self).__init__() self.conv1 = nn.Conv2d(3, 10, kernel_size=(3, 3)) self.conv2 = nn.Conv2d(10, 20, kernel_size=(3, 3)) nn.init.xavier_uniform_(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....
chapnitsky/DL
Net
false
1,694
[ "MIT" ]
0
a91e6abd7abc81261ba6797de9a2c6f95b4dcb71
https://github.com/chapnitsky/DL/tree/a91e6abd7abc81261ba6797de9a2c6f95b4dcb71
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_classes=8): super().__init__() self.conv1 = nn.Conv2d(3, 10, kernel_size=(3, 3)) self.conv2 = nn.Conv2d(10, 20, kernel_size=(3, 3)) nn.init.xavier_uniform_(self.conv1....
MultiHeadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F def attention(q, k, v, d_k, mask=None, dropout=None): scores = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(d_k) if mask is not None: mask = mask.unsqueeze(1) scores = scores.masked_fill(mask ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chenjun-110/WZCQ
MultiHeadAttention
false
1,695
[ "Apache-2.0" ]
0
e2de7743ad671e8632cfa084638555d7f1deb42f
https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f
import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F def attention(q, k, v, d_k, mask=None, dropout=None): scores = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(d_k) if mask is not None: mask = mask.unsqueeze(1) scores = scores.masked_fill(mask ...
ExponentialEnvelope
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class ExponentialEnvelope(torch.nn.Module): """ Exponential envelope function that ensures a smooth cutoff, as proposed in Unke, Chmiela, Gastegger, Schütt, Sauceda, Müller 2021. SpookyNet: Learning Force Fields with Electronic Degrees of Freedom and Nonlocal Effects """ def ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_str...
chris-price19/ocp
ExponentialEnvelope
false
1,696
[ "MIT", "BSD-3-Clause" ]
0
0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
import torch class Model(torch.nn.Module): """ Exponential envelope function that ensures a smooth cutoff, as proposed in Unke, Chmiela, Gastegger, Schütt, Sauceda, Müller 2021. SpookyNet: Learning Force Fields with Electronic Degrees of Freedom and Nonlocal Effects """ def __init__(self)...
PolynomialEnvelope
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class PolynomialEnvelope(torch.nn.Module): """ Polynomial envelope function that ensures a smooth cutoff. Parameters ---------- exponent: int Exponent of the envelope function. """ def __init__(self, exponent): super().__init__() assert expone...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
chris-price19/ocp
PolynomialEnvelope
false
1,697
[ "MIT", "BSD-3-Clause" ]
0
0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
import torch class Model(torch.nn.Module): """ Polynomial envelope function that ensures a smooth cutoff. Parameters ---------- exponent: int Exponent of the envelope function. """ def __init__(self, exponent): super().__init__() assert exponent > 0 ...
SelfAttentionPooling
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 SelfAttentionPooling(nn.Module): """ Implementation of SelfAttentionPooling Original Paper: Self-Attention Encoding and Pooling for Speaker Recognition https://arxiv.org/pdf/2008.01077v1.pdf """ def __init__(self, input_dim): super(SelfAttentio...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chiluen/s3prl
SelfAttentionPooling
false
1,698
[ "Apache-2.0" ]
0
c81838f6414d3c4767de355144449e40f86c7066
https://github.com/chiluen/s3prl/tree/c81838f6414d3c4767de355144449e40f86c7066
import torch import torch.nn as nn class Model(nn.Module): """ Implementation of SelfAttentionPooling Original Paper: Self-Attention Encoding and Pooling for Speaker Recognition https://arxiv.org/pdf/2008.01077v1.pdf """ def __init__(self, input_dim): super().__init__() self.W...
Sine
# 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 Sine(nn.Module): def __init__(self, w0: 'float'=30.0): super(Sine, self).__init__() self.w0 = w0 def forward(self, x: 'torch.Tensor') ->torch.Tensor: return torch.sin(self.w0 * x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
chris-price19/ocp
Sine
false
1,699
[ "MIT", "BSD-3-Clause" ]
0
0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, w0: 'float'=30.0): super().__init__() self.w0 = w0 def forward(self, x: 'torch.Tensor') ->torch.Tensor: return torch.sin(self.w0 * x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init...
SiQU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class SiQU(torch.nn.Module): def __init__(self): super().__init__() self._activation = torch.nn.SiLU() def forward(self, x): return x * self._activation(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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
chris-price19/ocp
SiQU
false
1,700
[ "MIT", "BSD-3-Clause" ]
0
0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() self._activation = torch.nn.SiLU() def forward(self, x): return x * self._activation(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SphericalBesselBasis
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 numpy as np class SphericalBesselBasis(torch.nn.Module): """ 1D spherical Bessel basis Parameters ---------- num_radial: int Controls maximum frequency. cutoff: float Cutoff distance in Angstrom. """ def __init__(self, num_radial: 'int'...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import math import numpy as np assert_size_stride = torch._C._dynamo.guar...
chris-price19/ocp
SphericalBesselBasis
false
1,701
[ "MIT", "BSD-3-Clause" ]
0
0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
import math import torch import numpy as np class Model(torch.nn.Module): """ 1D spherical Bessel basis Parameters ---------- num_radial: int Controls maximum frequency. cutoff: float Cutoff distance in Angstrom. """ def __init__(self, num_radial: 'int', cutoff: 'floa...
LeNet300
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 typing import * import torch.nn as nn import torch.nn.functional as F class LeNet300(nn.Module): def __init__(self, num_classes=10): super(LeNet300, self).__init__() self.fc1 = nn.Linear(784, 300) self.fc2 = nn.Linear(300, 100) self.fc3 = nn.Linear(100, 10) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from typing import * import t...
chomd90/snip
LeNet300
false
1,702
[ "MIT" ]
0
04aa8ca76364c61c3f6013832827fa292402652b
https://github.com/chomd90/snip/tree/04aa8ca76364c61c3f6013832827fa292402652b
import torch from typing import * import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_classes=10): super().__init__() self.fc1 = nn.Linear(784, 300) self.fc2 = nn.Linear(300, 100) self.fc3 = nn.Linear(100, 10) def forward(self,...
GaussianSmearing
# 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 GaussianSmearing(nn.Module): def __init__(self, in_features, start=0, end=1, num_freqs=50): super(GaussianSmearing, self).__init__() self.num_freqs = num_freqs offset = torch.linspace(start, end, num_freqs) self.coeff = -0.5 / (offset[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 math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
chris-price19/ocp
GaussianSmearing
false
1,703
[ "MIT", "BSD-3-Clause" ]
0
0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_features, start=0, end=1, num_freqs=50): super().__init__() self.num_freqs = num_freqs offset = torch.linspace(start, end, num_freqs) self.coeff = -0.5 / (offset[1] - offset[0]).item() ** 2 se...
PixelWiseModel
# 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 as nn class PixelWiseModel(nn.Module): """ Baseline class for pixelwise models Args: """ def __init__(self, const, **kwargs): super(PixelWiseModel, self).__init__() self.const = const def forward(self, x): ret = torch.zeros_like(x) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._emp...
ciubecca/3dunet-cavity
PixelWiseModel
false
1,704
[ "MIT" ]
0
cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
import torch from torch import nn as nn class Model(nn.Module): """ Baseline class for pixelwise models Args: """ def __init__(self, const, **kwargs): super().__init__() self.const = const def forward(self, x): ret = torch.zeros_like(x) ret[:] = self.const ...
SubPixelConvolutionalBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class SubPixelConvolutionalBlock(nn.Module): """ A subpixel convolutional block, comprising convolutional, pixel-shuffle, and PReLU activation layers. """ def __init__(self, kernel_size=3, n_channels=64, scaling_factor=3): """ :param kernel_size: kern...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
chilung/NCTU_Adv_DNN_HW4
SubPixelConvolutionalBlock
false
1,705
[ "MIT" ]
0
967f228c6e80cbc703a89ee611b90ef5e037da40
https://github.com/chilung/NCTU_Adv_DNN_HW4/tree/967f228c6e80cbc703a89ee611b90ef5e037da40
import torch from torch import nn class Model(nn.Module): """ A subpixel convolutional block, comprising convolutional, pixel-shuffle, and PReLU activation layers. """ def __init__(self, kernel_size=3, n_channels=64, scaling_factor=3): """ :param kernel_size: kernel size of the convol...
LeNet_300_100
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 typing import * import torch.nn as nn import torch.nn.functional as F class LeNet_300_100(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 300) self.fc2 = nn.Linear(300, 100) self.fc3 = nn.Linear(100, 10) 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 from torch._inductor.runtime....
chomd90/snip
LeNet_300_100
false
1,706
[ "MIT" ]
0
04aa8ca76364c61c3f6013832827fa292402652b
https://github.com/chomd90/snip/tree/04aa8ca76364c61c3f6013832827fa292402652b
import torch from typing import * import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 300) self.fc2 = nn.Linear(300, 100) self.fc3 = nn.Linear(100, 10) def forward(self, x): x =...
Conv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import functional as F class Conv2d(nn.Conv2d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True): super(Conv2d, self).__init__(in_channels, out_channels, kernel_size, strid...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
chris-rgr/image-background-remove-tool
Conv2d
false
1,707
[ "Apache-2.0" ]
0
b57b44099e0e35c90833bed010b071aa39efdc80
https://github.com/chris-rgr/image-background-remove-tool/tree/b57b44099e0e35c90833bed010b071aa39efdc80
import torch import torch.nn as nn from torch.nn import functional as F class Model(nn.Conv2d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True): super().__init__(in_channels, out_channels, kernel_size, stride, padding, d...
AvgPoolPadding
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class AvgPoolPadding(nn.Module): def __init__(self, num_filters, channels_in, stride): super(AvgPoolPadding, self).__init__() self.identity = nn.AvgPool2d(stride, stride=stride) self.num_zeros = num_filters - channels_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 as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
citelab/fastsync
AvgPoolPadding
false
1,708
[ "Apache-2.0" ]
0
8e2166f87fc53479b57fef536a971c3a2e6e4309
https://github.com/citelab/fastsync/tree/8e2166f87fc53479b57fef536a971c3a2e6e4309
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_filters, channels_in, stride): super().__init__() self.identity = nn.AvgPool2d(stride, stride=stride) self.num_zeros = num_filters - channels_in def forward(self, x): ...
QNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class QNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size, init_w=0.003): super(QNetwork, self).__init__() self.linear1 = nn.Linear(num_inputs + num_actions, hidden_size) self.linear2 = nn.Linear(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 as nn assert_...
chagri/SOTA-RL-Algorithms
QNetwork
false
1,709
[ "Apache-2.0" ]
0
58b416e7c706d8426dc402482e72ca7283568e71
https://github.com/chagri/SOTA-RL-Algorithms/tree/58b416e7c706d8426dc402482e72ca7283568e71
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size, init_w=0.003): super().__init__() self.linear1 = nn.Linear(num_inputs + num_actions, hidden_size) self.linear2 = nn.Linear(hidden_size, hidde...
IdentityPadding
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class IdentityPadding(nn.Module): def __init__(self, num_filters, channels_in, stride): super(IdentityPadding, self).__init__() self.identity = nn.MaxPool2d(1, stride=stride) self.num_zeros = num_filters - channels_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 as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
citelab/fastsync
IdentityPadding
false
1,710
[ "Apache-2.0" ]
0
8e2166f87fc53479b57fef536a971c3a2e6e4309
https://github.com/citelab/fastsync/tree/8e2166f87fc53479b57fef536a971c3a2e6e4309
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_filters, channels_in, stride): super().__init__() self.identity = nn.MaxPool2d(1, stride=stride) self.num_zeros = num_filters - channels_in def forward(self, x): ...
WeightedSmoothL1Loss
# 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 as nn class WeightedSmoothL1Loss(nn.SmoothL1Loss): def __init__(self, threshold, initial_weight, apply_below_threshold=True): super().__init__(reduction='none') self.threshold = threshold self.apply_below_threshold = apply_below_threshold self.wei...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn as nn assert_size_stride = torch._C._dynamo.guards.a...
ciubecca/3dunet-cavity
WeightedSmoothL1Loss
false
1,711
[ "MIT" ]
0
cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
import torch from torch import nn as nn class Model(nn.SmoothL1Loss): def __init__(self, threshold, initial_weight, apply_below_threshold=True): super().__init__(reduction='none') self.threshold = threshold self.apply_below_threshold = apply_below_threshold self.weight = initial_w...
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): def __init__(self): super(CNN, self).__init__() self.conv1 = nn.Conv2d(3, 10, kernel_size=5) self.conv2 = nn.Conv2d(10, 20, kernel_size=5) self.conv2_drop = nn.Dropout2d() self.fc1 = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
chihina/Classification_dogs_and_cats
CNN
false
1,712
[ "MIT" ]
0
8797ff688592c148a1c13881394716e117db95a3
https://github.com/chihina/Classification_dogs_and_cats/tree/8797ff688592c148a1c13881394716e117db95a3
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 10, kernel_size=5) self.conv2 = nn.Conv2d(10, 20, kernel_size=5) self.conv2_drop = nn.Dropout2d() self.fc1 = nn.Linea...
GCNModelVAE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn as nn import torch.nn.modules.loss class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chundiliu/random_rewrite
GCNModelVAE
false
1,713
[ "MIT" ]
0
fd106642da82b0ad42b8b0fa405147b321d67cbb
https://github.com/chundiliu/random_rewrite/tree/fd106642da82b0ad42b8b0fa405147b321d67cbb
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn as nn import torch.nn.modules.loss class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 ...
MaxMin
# 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.multiprocessing import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class MaxMin(nn.Module): def __init__(self): super(MaxMin, self).__init__() def forward(self, x): y = torch.reshape(x, (x.sh...
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.multiprocessing import torch.nn as nn import torch.nn.parallel import torch....
ckodser/a_robust_subnetwork_hiddes
MaxMin
false
1,714
[ "Apache-2.0" ]
0
171b43dc7b4446ba722a4c51c52bf561f77e5c55
https://github.com/ckodser/a_robust_subnetwork_hiddes/tree/171b43dc7b4446ba722a4c51c52bf561f77e5c55
import torch import torch.multiprocessing 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__() def forward(self, x): y = torch.reshape(x, (x.shape[0], x.sha...
GCNModelAE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn as nn import torch.nn.modules.loss class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chundiliu/random_rewrite
GCNModelAE
false
1,715
[ "MIT" ]
0
fd106642da82b0ad42b8b0fa405147b321d67cbb
https://github.com/chundiliu/random_rewrite/tree/fd106642da82b0ad42b8b0fa405147b321d67cbb
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn as nn import torch.nn.modules.loss class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 ...
ExtResNetBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn as nn def conv3d(in_channels, out_channels, kernel_size, bias, padding): return nn.Conv3d(in_channels, out_channels, kernel_size, padding= padding, bias=bias) def create_conv(in_channels, out_channels, kernel_size, order, num_groups, padding): """ Create a l...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
ciubecca/3dunet-cavity
ExtResNetBlock
false
1,716
[ "MIT" ]
0
cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
import torch from torch import nn as nn def conv3d(in_channels, out_channels, kernel_size, bias, padding): return nn.Conv3d(in_channels, out_channels, kernel_size, padding= padding, bias=bias) def create_conv(in_channels, out_channels, kernel_size, order, num_groups, padding): """ Create a l...
BCEDiceLoss
# 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 as nn def flatten(tensor): """Flattens a given tensor such that the channel axis is first. The shapes are transformed as follows: (N, C, D, H, W) -> (C, N * D * H * W) """ C = tensor.size(1) axis_order = (1, 0) + tuple(range(2, tensor.dim())) transposed...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
ciubecca/3dunet-cavity
BCEDiceLoss
false
1,717
[ "MIT" ]
0
cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
import torch from torch import nn as nn def flatten(tensor): """Flattens a given tensor such that the channel axis is first. The shapes are transformed as follows: (N, C, D, H, W) -> (C, N * D * H * W) """ C = tensor.size(1) axis_order = (1, 0) + tuple(range(2, tensor.dim())) transposed...
LogisticRegression
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 as nn class LogisticRegression(torch.nn.Module): def __init__(self, **kwargs): super(LogisticRegression, self).__init__() self.linear = nn.Linear(1, 1) def forward(self, x): xin = x.flatten()[:, None] output = torch.sigmoid(self.linear(xin)) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn as nn assert_size_stride = torch._C._dynamo.guards.assert_s...
ciubecca/3dunet-cavity
LogisticRegression
false
1,718
[ "MIT" ]
0
cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
import torch from torch import nn as nn class Model(torch.nn.Module): def __init__(self, **kwargs): super().__init__() self.linear = nn.Linear(1, 1) def forward(self, x): xin = x.flatten()[:, None] output = torch.sigmoid(self.linear(xin)) return output.reshape(x.shape...
SkipLastTargetChannelWrapper
# 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 as nn from torch.nn import MSELoss class SkipLastTargetChannelWrapper(nn.Module): """ Loss wrapper which removes additional target channel """ def __init__(self, loss, squeeze_channel=False): super(SkipLastTargetChannelWrapper, self).__init__() self.l...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._emp...
ciubecca/3dunet-cavity
SkipLastTargetChannelWrapper
false
1,719
[ "MIT" ]
0
cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
import torch from torch import nn as nn from torch.nn import MSELoss class Model(nn.Module): """ Loss wrapper which removes additional target channel """ def __init__(self, loss, squeeze_channel=False): super().__init__() self.loss = loss self.squeeze_channel = squeeze_channel...
GroupWiseLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class GroupWiseLinear(nn.Module): def __init__(self, num_class, hidden_dim, bias=True): super().__init__() self.num_class = num_class self...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed as...
ckvic3/query2labels
GroupWiseLinear
false
1,720
[ "MIT" ]
0
e9c30e1b445be773be397a093fa66aef71d54556
https://github.com/ckvic3/query2labels/tree/e9c30e1b445be773be397a093fa66aef71d54556
import math 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, num_class, hidden_dim, bias=True): super().__init__() self.num_class = num_class self.hidden_di...
ConvNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ConvNet(nn.Module): """Small ConvNet for CONIC.""" def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
citelab/fastsync
ConvNet
false
1,721
[ "Apache-2.0" ]
0
8e2166f87fc53479b57fef536a971c3a2e6e4309
https://github.com/citelab/fastsync/tree/8e2166f87fc53479b57fef536a971c3a2e6e4309
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Small ConvNet for CONIC.""" def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = n...
BCEDiceProbLoss
# 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 as nn def flatten(tensor): """Flattens a given tensor such that the channel axis is first. The shapes are transformed as follows: (N, C, D, H, W) -> (C, N * D * H * W) """ C = tensor.size(1) axis_order = (1, 0) + tuple(range(2, tensor.dim())) transposed...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
ciubecca/3dunet-cavity
BCEDiceProbLoss
false
1,722
[ "MIT" ]
0
cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb
import torch from torch import nn as nn def flatten(tensor): """Flattens a given tensor such that the channel axis is first. The shapes are transformed as follows: (N, C, D, H, W) -> (C, N * D * H * W) """ C = tensor.size(1) axis_order = (1, 0) + tuple(range(2, tensor.dim())) transposed...
AsymmetricLoss
# 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 AsymmetricLoss(nn.Module): def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): super(AsymmetricLoss...
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...
ckvic3/query2labels
AsymmetricLoss
false
1,723
[ "MIT" ]
0
e9c30e1b445be773be397a093fa66aef71d54556
https://github.com/ckvic3/query2labels/tree/e9c30e1b445be773be397a093fa66aef71d54556
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, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): super().__init__() se...
RMSPool
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.utils.data class RMSPool(nn.Module): def __init__(self, kernel_size, stride): super(RMSPool, self).__init__() self.kernel_size = kernel_size self.stride = stride def forward(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 import torch.nn.parallel import torch.utils.data assert_s...
cleverhans-lab/model-extraction-iclr
RMSPool
false
1,724
[ "MIT" ]
0
805205287876423621baca9d5e990edfe68ea803
https://github.com/cleverhans-lab/model-extraction-iclr/tree/805205287876423621baca9d5e990edfe68ea803
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.utils.data class Model(nn.Module): def __init__(self, kernel_size, stride): super().__init__() self.kernel_size = kernel_size self.stride = stride def forward(self, x): x ...
eca_channel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils class eca_channel(nn.Module): def __init__(self, channel, k_size=3): super(eca_channel, self).__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) self.conv = nn.Conv1d(1, 1, kernel_size=k_size, padding=(k_size - 1 ) // 2, bi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils assert_size_stride = torch._C._dynamo.g...
closest-git/QuantumFold
eca_channel
false
1,725
[ "Apache-2.0" ]
0
2dc6afa96cdee91b58f66543b440a2d7a8d32a8a
https://github.com/closest-git/QuantumFold/tree/2dc6afa96cdee91b58f66543b440a2d7a8d32a8a
import torch import torch.nn as nn import torch.utils class Model(nn.Module): def __init__(self, channel, k_size=3): super().__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) self.conv = nn.Conv1d(1, 1, kernel_size=k_size, padding=(k_size - 1 ) // 2, bias=False) self....
LinearActivation
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn as nn class LinearActivation(Module): def __init__(self, in_features, out_features, act='gelu', bias=True): super(LinearActivation, self).__init__() self.Linear = nn.Linear(in_features, out_features, bias=bias) if act == 'relu': ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn impor...
codecaution/Hetu
LinearActivation
false
1,726
[ "Apache-2.0" ]
0
e278732c2fe3554c8d576585f5bcbf79ade31b68
https://github.com/codecaution/Hetu/tree/e278732c2fe3554c8d576585f5bcbf79ade31b68
from torch.nn import Module import torch import torch.nn as nn class Model(Module): def __init__(self, in_features, out_features, act='gelu', bias=True): super().__init__() self.Linear = nn.Linear(in_features, out_features, bias=bias) if act == 'relu': self.act_fn = nn.ReLU() ...
BertLayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn as nn class BertLayerNorm(Module): def __init__(self, hidden_size, eps=1e-12): super(BertLayerNorm, self).__init__() self.shape = torch.Size((hidden_size,)) self.eps = eps self.weight = nn.Parameter(torch.ones(hidden_size)) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn import Module import torch.nn as nn assert_size_stride = torch._C...
codecaution/Hetu
BertLayerNorm
false
1,727
[ "Apache-2.0" ]
0
e278732c2fe3554c8d576585f5bcbf79ade31b68
https://github.com/codecaution/Hetu/tree/e278732c2fe3554c8d576585f5bcbf79ade31b68
from torch.nn import Module import torch import torch.nn as nn class Model(Module): def __init__(self, hidden_size, eps=1e-12): super().__init__() self.shape = torch.Size((hidden_size,)) self.eps = eps self.weight = nn.Parameter(torch.ones(hidden_size)) self.bias = nn.Para...
AsymmetricLossOptimized
# 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 AsymmetricLossOptimized(nn.Module): """ Notice - optimized version, minimizes memory allocation and gpu uploading, favors inplace operations""" def __init__(sel...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
ckvic3/query2labels
AsymmetricLossOptimized
false
1,728
[ "MIT" ]
0
e9c30e1b445be773be397a093fa66aef71d54556
https://github.com/ckvic3/query2labels/tree/e9c30e1b445be773be397a093fa66aef71d54556
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): """ Notice - optimized version, minimizes memory allocation and gpu uploading, favors inplace operations""" def __init__(self, gamma_neg=4, ga...
BertSelfOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class BertSelfOutput(nn.Module): def __init__(self, config): super(BertSelfOutput, self).__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.layer_norm = nn.LayerNorm(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.triton_helpers import libdevice import torch.nn as ...
cjinchao/mner
BertSelfOutput
false
1,729
[ "MIT" ]
0
12776280da314eb7ef22511aa18ca9af0764fb32
https://github.com/cjinchao/mner/tree/12776280da314eb7ef22511aa18ca9af0764fb32
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.layer_norm = nn.LayerNorm(config.hidden_size, config. lay...
Qnet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import random import torch import torch.nn as nn import torch.nn.functional as F class Qnet(nn.Module): def __init__(self): super(Qnet, self).__init__() self.fc1 = nn.Linear(4, 128) self.fc2 = nn.Linear(128, 128) self.fc3 = nn.Linear(128, 2) def forward(self, x): x = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import random import torch.nn...
co24428/minimalRL
Qnet
false
1,730
[ "MIT" ]
0
c758e733438fce1d8421551e75f2117ec3f82028
https://github.com/co24428/minimalRL/tree/c758e733438fce1d8421551e75f2117ec3f82028
import random import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(4, 128) self.fc2 = nn.Linear(128, 128) self.fc3 = nn.Linear(128, 2) def forward(self, x): x = F.relu(se...
BertOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config from torch.nn import Module import torch import torch.nn as nn class BertLayerNorm(Module): def __init__(self, hidden_size, eps=1e-12): super(BertLayerNorm, self).__init__() self.shape = torch.Size((hidden_size,)) self.eps = eps self.w...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
codecaution/Hetu
BertOutput
false
1,731
[ "Apache-2.0" ]
0
e278732c2fe3554c8d576585f5bcbf79ade31b68
https://github.com/codecaution/Hetu/tree/e278732c2fe3554c8d576585f5bcbf79ade31b68
from _paritybench_helpers import _mock_config from torch.nn import Module import torch import torch.nn as nn class BertLayerNorm(Module): def __init__(self, hidden_size, eps=1e-12): super().__init__() self.shape = torch.Size((hidden_size,)) self.eps = eps self.weight = nn.Paramete...
Triangle
# 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 Triangle(nn.Module): def forward(self, x): return x.abs() 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 math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
continual-ml/mpcl
Triangle
false
1,732
[ "Apache-2.0" ]
0
3b7112882ee832212494072e2f5ea7779e3b8aa6
https://github.com/continual-ml/mpcl/tree/3b7112882ee832212494072e2f5ea7779e3b8aa6
import torch import torch.nn as nn class Model(nn.Module): def forward(self, x): return x.abs() def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
RightSVDLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class RightSVDLayer(nn.Module): def __init__(self, iw, ow, dropout=None, bias=True): super().__init__() self.weight = Parameter(torch.Tensor(iw, ow)) self.dropout = drop...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 from torch.nn.parameter import Parameter asser...
collodi/ml_svd
RightSVDLayer
false
1,733
[ "MIT" ]
0
67a608ca10d3d37bf861e4e7490e62d298fa83b9
https://github.com/collodi/ml_svd/tree/67a608ca10d3d37bf861e4e7490e62d298fa83b9
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class Model(nn.Module): def __init__(self, iw, ow, dropout=None, bias=True): super().__init__() self.weight = Parameter(torch.Tensor(iw, ow)) self.dropout = dropout ...
Critic
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Critic(nn.Module): def __init__(self, state_dim, action_dim): super(Critic, self).__init__() self.l1 = nn.Linear(state_dim + action_dim, 256) self.l2 = nn.Linear(256, 256) self.l3 = nn.Linear(256, 1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
clairecw/TD3
Critic
false
1,734
[ "MIT" ]
0
22840c0ee1620086c2495d859be2c3b7a4c70f3f
https://github.com/clairecw/TD3/tree/22840c0ee1620086c2495d859be2c3b7a4c70f3f
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim): super().__init__() self.l1 = nn.Linear(state_dim + action_dim, 256) self.l2 = nn.Linear(256, 256) self.l3 = nn.Linear(256, 1) self.l4 = nn....
NormalizeLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F from torch import nn import torch.utils.data import torch.utils.data.distributed class NormalizeLinear(nn.Module): def __init__(self, act_dim, k_value): super().__init__() self.lin = nn.Linear(act_dim, k_value) def normalize(self): 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 from torch._inductor.runtime....
coupriec/enc_dec
NormalizeLinear
false
1,735
[ "MIT" ]
0
5e31a1cd384f24ac48e932b623780bd0c70103d9
https://github.com/coupriec/enc_dec/tree/5e31a1cd384f24ac48e932b623780bd0c70103d9
import torch from torch.nn import functional as F from torch import nn import torch.utils.data import torch.utils.data.distributed class Model(nn.Module): def __init__(self, act_dim, k_value): super().__init__() self.lin = nn.Linear(act_dim, k_value) def normalize(self): self.lin.wei...
_ConvReLU_
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class _ConvReLU_(nn.Sequential): def __init__(self, in_channels, out_channels, kernel_size, stride, padding, dilation, relu=True): super(_ConvReLU_, self).__init__() self.add_module('conv', nn.Conv2d(in_channels=in_channels, out_channels=out_c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
cplusx/SIGN
_ConvReLU_
false
1,736
[ "Apache-2.0" ]
0
9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae
https://github.com/cplusx/SIGN/tree/9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae
import torch from torch import nn class Model(nn.Sequential): def __init__(self, in_channels, out_channels, kernel_size, stride, padding, dilation, relu=True): super().__init__() self.add_module('conv', nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=...
LeftSVDLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class LeftSVDLayer(nn.Module): def __init__(self, ih, oh, dropout=None, bias=True): super().__init__() self.weight = Parameter(torch.Tensor(oh, ih)) self.dropout = dropo...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn from torch.nn.parameter import Parameter asser...
collodi/ml_svd
LeftSVDLayer
false
1,737
[ "MIT" ]
0
67a608ca10d3d37bf861e4e7490e62d298fa83b9
https://github.com/collodi/ml_svd/tree/67a608ca10d3d37bf861e4e7490e62d298fa83b9
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class Model(nn.Module): def __init__(self, ih, oh, dropout=None, bias=True): super().__init__() self.weight = Parameter(torch.Tensor(oh, ih)) self.dropout = dropout ...
BertAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
cjinchao/mner
BertAttention
false
1,738
[ "MIT" ]
0
12776280da314eb7ef22511aa18ca9af0764fb32
https://github.com/cjinchao/mner/tree/12776280da314eb7ef22511aa18ca9af0764fb32
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidden size (...
_ASPPModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class _ASPPModule(nn.Module): """Atrous Spatial Pyramid Pooling""" def __init__(self, in_channels, out_channels, pyramids): super(_ASPPModule, self).__init__() self.stages = nn.Module() for i, (dilation, padding) in enumerate(zip(pyramids, pyramids)):...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
cplusx/SIGN
_ASPPModule
false
1,739
[ "Apache-2.0" ]
0
9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae
https://github.com/cplusx/SIGN/tree/9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae
import torch from torch import nn class Model(nn.Module): """Atrous Spatial Pyramid Pooling""" def __init__(self, in_channels, out_channels, pyramids): super().__init__() self.stages = nn.Module() for i, (dilation, padding) in enumerate(zip(pyramids, pyramids)): self.stage...
Conv2dBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F from torch import nn class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super(AdaptiveInstanceNorm2d, self).__init__() self.num_features = num_features self.eps = eps self.momentum = mome...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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.functional as...
cplusx/SIGN
Conv2dBlock
false
1,740
[ "Apache-2.0" ]
0
9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae
https://github.com/cplusx/SIGN/tree/9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae
import torch import torch.nn.functional as F from torch import nn class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super().__init__() self.num_features = num_features self.eps = eps self.momentum = momentum self.weight = N...
BertSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn.functional as F import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
codecaution/Hetu
BertSelfAttention
false
1,741
[ "Apache-2.0" ]
0
e278732c2fe3554c8d576585f5bcbf79ade31b68
https://github.com/codecaution/Hetu/tree/e278732c2fe3554c8d576585f5bcbf79ade31b68
from _paritybench_helpers import _mock_config import math import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
Q
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Q(nn.Module): def __init__(self, state_dim, action_dim, hidden): super(Q, self).__init__() self.fc1 = nn.Linear(state_dim + action_dim, hidden) self.fc2 = nn.Linear(hidden, hidden) self.fc3 = nn.Linear(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 import torch.nn as nn assert_...
crislmfroes/Parallel-Manipulation-DRL
Q
false
1,742
[ "MIT" ]
0
b63bd17b933feb5d2844f1db596cd4126380244b
https://github.com/crislmfroes/Parallel-Manipulation-DRL/tree/b63bd17b933feb5d2844f1db596cd4126380244b
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim, hidden): super().__init__() self.fc1 = nn.Linear(state_dim + action_dim, hidden) self.fc2 = nn.Linear(hidden, hidden) self.fc3 = nn.Linear(hidden, 1...
_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 from torch import nn class _SelfAttention_(nn.Module): def __init__(self, in_planes): super(_SelfAttention_, self).__init__() self.f = nn.Conv2d(in_planes, in_planes, (1, 1)) self.g = nn.Conv2d(in_planes, in_planes, (1, 1)) self.h = nn.Conv2d(in_planes, in_planes, (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....
cplusx/SIGN
_SelfAttention_
false
1,743
[ "Apache-2.0" ]
0
9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae
https://github.com/cplusx/SIGN/tree/9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae
import torch from torch import nn class Model(nn.Module): def __init__(self, in_planes): super().__init__() self.f = nn.Conv2d(in_planes, in_planes, (1, 1)) self.g = nn.Conv2d(in_planes, in_planes, (1, 1)) self.h = nn.Conv2d(in_planes, in_planes, (1, 1)) self.sm = nn.Softm...
TransformerEncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Linear(in_features, out_features, bias=True): m = nn.Linear(in_features, out_features, bias) nn.init.xavier_uniform_(m.weight) if bias: nn.init.constant_(m.bias, 0.0) return m class TransformerEncoderLayer(nn.Module): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
cimeister/neural-transducer
TransformerEncoderLayer
false
1,744
[ "MIT" ]
0
e4dfc718bbcf93254ce23750e5428c5131ddfb98
https://github.com/cimeister/neural-transducer/tree/e4dfc718bbcf93254ce23750e5428c5131ddfb98
import torch import torch.nn as nn import torch.nn.functional as F def Linear(in_features, out_features, bias=True): m = nn.Linear(in_features, out_features, bias) nn.init.xavier_uniform_(m.weight) if bias: nn.init.constant_(m.bias, 0.0) return m class Model(nn.Module): def __init__(sel...
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 from torch.nn import Module import math import torch import torch.nn.functional as F import torch.nn as nn class BertLayerNorm(Module): def __init__(self, hidden_size, eps=1e-12): super(BertLayerNorm, self).__init__() self.shape = torch.Size((hidden_s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
codecaution/Hetu
BertAttention
false
1,745
[ "Apache-2.0" ]
0
e278732c2fe3554c8d576585f5bcbf79ade31b68
https://github.com/codecaution/Hetu/tree/e278732c2fe3554c8d576585f5bcbf79ade31b68
from _paritybench_helpers import _mock_config from torch.nn import Module import math import torch import torch.nn.functional as F import torch.nn as nn class BertLayerNorm(Module): def __init__(self, hidden_size, eps=1e-12): super().__init__() self.shape = torch.Size((hidden_size,)) self...
TransformerDecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Linear(in_features, out_features, bias=True): m = nn.Linear(in_features, out_features, bias) nn.init.xavier_uniform_(m.weight) if bias: nn.init.constant_(m.bias, 0.0) return m class TransformerDecoderLayer(nn.Module): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
cimeister/neural-transducer
TransformerDecoderLayer
false
1,746
[ "MIT" ]
0
e4dfc718bbcf93254ce23750e5428c5131ddfb98
https://github.com/cimeister/neural-transducer/tree/e4dfc718bbcf93254ce23750e5428c5131ddfb98
import torch import torch.nn as nn import torch.nn.functional as F def Linear(in_features, out_features, bias=True): m = nn.Linear(in_features, out_features, bias) nn.init.xavier_uniform_(m.weight) if bias: nn.init.constant_(m.bias, 0.0) return m class Model(nn.Module): def __init__(sel...
Mish
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.nn as nn import torch.optim.lr_scheduler import torch.utils.data from torchvision.transforms import * class Mish(nn.Module): def forward(self, x): return x.mul_(F.softplus(x).tanh()) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torch.nn as nn import torch.optim.lr_scheduler import t...
csharpshooter/DeepLearning
Mish
false
1,747
[ "MIT" ]
0
c1d20660c32076468970f7376931e1fcd0d2644e
https://github.com/csharpshooter/DeepLearning/tree/c1d20660c32076468970f7376931e1fcd0d2644e
import torch import torch.nn.functional as F import torch.nn as nn import torch.optim.lr_scheduler import torch.utils.data from torchvision.transforms import * class Model(nn.Module): def forward(self, x): return x.mul_(F.softplus(x).tanh()) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def...
SoftBinaryCrossEntropyLoss
# 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.cpp_extension class SoftBinaryCrossEntropyLoss(torch.nn.Module): def __init__(self, tau=1.0): super().__init__() self.tau = tau self.bce_logit = torch.nn.BCEWithLogitsLoss() def forward(self, pred, true): logits = pred / self.tau l = se...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
crobbins327/semanticGAN_WSI
SoftBinaryCrossEntropyLoss
false
1,748
[ "BSD-2-Clause", "MIT" ]
0
4046ddc822f463e03952402247f79d540bf7be95
https://github.com/crobbins327/semanticGAN_WSI/tree/4046ddc822f463e03952402247f79d540bf7be95
import torch import torch.utils.cpp_extension class Model(torch.nn.Module): def __init__(self, tau=1.0): super().__init__() self.tau = tau self.bce_logit = torch.nn.BCEWithLogitsLoss() def forward(self, pred, true): logits = pred / self.tau l = self.bce_logit(logits, ...
LogCoshLoss
# 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.cpp_extension class LogCoshLoss(torch.nn.Module): def __init__(self): super().__init__() def forward(self, true, pred): loss = true - pred return torch.mean(torch.log(torch.cosh(loss + 1e-12))) def get_inputs(): return [torch.rand([4, 4, 4, 4]), ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
crobbins327/semanticGAN_WSI
LogCoshLoss
false
1,749
[ "BSD-2-Clause", "MIT" ]
0
4046ddc822f463e03952402247f79d540bf7be95
https://github.com/crobbins327/semanticGAN_WSI/tree/4046ddc822f463e03952402247f79d540bf7be95
import torch import torch.utils.cpp_extension class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, true, pred): loss = true - pred return torch.mean(torch.log(torch.cosh(loss + 1e-12))) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch....