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
torch_uint8_to_float
# 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 torch_uint8_to_float(torch.nn.Module): def __init__(self): super(torch_uint8_to_float, self).__init__() def forward(self, x): return x.permute(2, 0, 1).unsqueeze(0).contiguous() def get_inputs(): return [torch.rand([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...
ozendelait/pytorch-semseg
torch_uint8_to_float
false
7,440
[ "MIT" ]
1
200491febd653bd26befcd5b3d52c614aa832b7e
https://github.com/ozendelait/pytorch-semseg/tree/200491febd653bd26befcd5b3d52c614aa832b7e
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): return x.permute(2, 0, 1).unsqueeze(0).contiguous() def get_inputs(): return [torch.rand([4, 4, 4])] def get_init_inputs(): return []
LearnedSigmoid
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 LearnedSigmoid(nn.Module): def __init__(self, slope=1): super().__init__() self.q = torch.nn.Parameter(torch.ones(slope)) self.q.requiresGrad = True def forward(self, x): return torch.multiply(torch.sigmoid(x), self.q) def get_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
pabloguarda/NeuralTransportationNetworks
LearnedSigmoid
false
7,441
[ "MIT" ]
1
0461c26128b09488aff237b760068b43d131f8a9
https://github.com/pabloguarda/NeuralTransportationNetworks/tree/0461c26128b09488aff237b760068b43d131f8a9
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, slope=1): super().__init__() self.q = torch.nn.Parameter(torch.ones(slope)) self.q.requiresGrad = True def forward(self, x): return torch.multiply(torch.sigmoid(x), self.q) def get_inputs(): r...
Lenet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Sequential from torch.nn import Conv2d import torch.nn import torch.optim class Lenet(nn.Module): def __init__(self): super(Lenet, self).__init__() layer1 = Sequential() layer1.add_module('conv1', Conv2d(3, 32, 3, 1, padding=1)) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn from torch.nn import Sequential from torch.nn import Conv2d...
partnernetsoftware/openlab
Lenet
false
7,442
[ "MIT" ]
1
faa4e58486a7bc4140ad3d56545bfb736cb86696
https://github.com/partnernetsoftware/openlab/tree/faa4e58486a7bc4140ad3d56545bfb736cb86696
import torch from torch import nn from torch.nn import Sequential from torch.nn import Conv2d import torch.nn import torch.optim class Model(nn.Module): def __init__(self): super().__init__() layer1 = Sequential() layer1.add_module('conv1', Conv2d(3, 32, 3, 1, padding=1)) self.lay...
SilogLoss
# 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 SilogLoss(nn.Module): def __init__(self, ratio=10, ratio2=0.85): super().__init__() self.ratio = ratio self.ratio2 = ratio2 def forward(self, pred, gt): log_diff = torch.log(pred * self.ratio) - torch.log(gt * self.ratio) silog...
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...
pection/packnet-sfm
SilogLoss
false
7,443
[ "MIT" ]
1
d5673567b649e6bfda292c894cacdeb06aa80913
https://github.com/pection/packnet-sfm/tree/d5673567b649e6bfda292c894cacdeb06aa80913
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, ratio=10, ratio2=0.85): super().__init__() self.ratio = ratio self.ratio2 = ratio2 def forward(self, pred, gt): log_diff = torch.log(pred * self.ratio) - torch.log(gt * self.ratio) silog1 = ...
BerHuLoss
# 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 BerHuLoss(nn.Module): """Class implementing the BerHu loss.""" def __init__(self, threshold=0.2): """ Initializes the BerHuLoss class. Parameters ---------- threshold : float Mask parameter """ super...
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 ...
pection/packnet-sfm
BerHuLoss
false
7,444
[ "MIT" ]
1
d5673567b649e6bfda292c894cacdeb06aa80913
https://github.com/pection/packnet-sfm/tree/d5673567b649e6bfda292c894cacdeb06aa80913
import torch import torch.nn as nn class Model(nn.Module): """Class implementing the BerHu loss.""" def __init__(self, threshold=0.2): """ Initializes the BerHuLoss class. Parameters ---------- threshold : float Mask parameter """ super()._...
_ImpalaCNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Tuple from torch import nn class _ImpalaResBlock(nn.Module): def __init__(self, n_channels: 'int'): super().__init__() self.n_channels = n_channels kernel_size = 3 padding = 1 self.relu = nn.ReLU() self.relu_inplace = nn.ReLU() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from typing import Tuple from...
nrfulton/vsrl-framework
_ImpalaCNN
false
7,445
[ "MIT" ]
1
c778824b3285e3e994a4c5846c7b1c2ac03c669b
https://github.com/nrfulton/vsrl-framework/tree/c778824b3285e3e994a4c5846c7b1c2ac03c669b
import torch from typing import Tuple from torch import nn class _ImpalaResBlock(nn.Module): def __init__(self, n_channels: 'int'): super().__init__() self.n_channels = n_channels kernel_size = 3 padding = 1 self.relu = nn.ReLU() self.relu_inplace = nn.ReLU() ...
Decoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Decoder(nn.Module): def __init__(self, input_size): super(Decoder, self).__init__() self.fully = nn.Linear(input_size, 40) self.conv1 = nn.ConvTranspose2d(40, 20, kernel_size=5, stride=2) self.conv2 = nn.ConvTranspose2d(20, 10, 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 assert_...
pacslab/serverless-ml-serving
Decoder
false
7,446
[ "MIT" ]
1
03a4cd5f1739aa4710ef886edd9332b3d755efbd
https://github.com/pacslab/serverless-ml-serving/tree/03a4cd5f1739aa4710ef886edd9332b3d755efbd
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_size): super().__init__() self.fully = nn.Linear(input_size, 40) self.conv1 = nn.ConvTranspose2d(40, 20, kernel_size=5, stride=2) self.conv2 = nn.ConvTranspose2d(20, 10, kernel_size=5, stride=2) ...
InvDepth
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 InvDepth(nn.Module): """Inverse depth layer""" def __init__(self, in_channels, out_channels=1, min_depth=0.5): """ Initializes an InvDepth object. Parameters ---------- in_channels : int Number of input channels ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
pection/packnet-sfm
InvDepth
false
7,447
[ "MIT" ]
1
d5673567b649e6bfda292c894cacdeb06aa80913
https://github.com/pection/packnet-sfm/tree/d5673567b649e6bfda292c894cacdeb06aa80913
import torch import torch.nn as nn class Model(nn.Module): """Inverse depth layer""" def __init__(self, in_channels, out_channels=1, min_depth=0.5): """ Initializes an InvDepth object. Parameters ---------- in_channels : int Number of input channels ...
StackedAutoencoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 StackedAutoencoder(nn.Module): """ 1-hidden layer AE trained with MSE loss """ def __init__(self, input_size, hidden_layer_size): super(StackedAutoencoder, self).__init__() self.encoder = nn.Linear(input_size, hidden_layer_size) self.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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
pemami4911/ppi-with-stacked-autoencoders
StackedAutoencoder
false
7,448
[ "MIT" ]
1
c09aba827ac6991da3dbf1b2628ac5d0f5041548
https://github.com/pemami4911/ppi-with-stacked-autoencoders/tree/c09aba827ac6991da3dbf1b2628ac5d0f5041548
import torch import torch.nn as nn class Model(nn.Module): """ 1-hidden layer AE trained with MSE loss """ def __init__(self, input_size, hidden_layer_size): super().__init__() self.encoder = nn.Linear(input_size, hidden_layer_size) self.decoder = nn.Linear(hidden_layer_size, ...
HardGRUCellNUAPT
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from typing import Optional import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed def truncated_normal(t, mean=0.0, std=0.01): torch.nn.init.normal_(t, mean=mea...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math import torch.nn a...
pan185/UnarySim
HardGRUCellNUAPT
false
7,449
[ "MIT" ]
1
c03386efdbb8151f3c33f34b44d1d6a6fc960434
https://github.com/pan185/UnarySim/tree/c03386efdbb8151f3c33f34b44d1d6a6fc960434
import math import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from typing import Optional import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed def truncated_normal(t, mean=0.0, std=0.01): torch.nn.init.normal_(t, mean=mea...
InstanceNormLayer
# 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 InstanceNormLayer(nn.Module): """Implements instance normalization layer.""" def __init__(self, epsilon=1e-08): super().__init__() self.epsilon = epsilon def forward(self, x): if len(x.shape) != 4: raise ValueError( ...
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_...
perladoubinsky/balanced_sampling_gan_controls
InstanceNormLayer
false
7,450
[ "MIT" ]
1
cbec7a38176406c0e19d4b6ebbc6c6b52d268036
https://github.com/perladoubinsky/balanced_sampling_gan_controls/tree/cbec7a38176406c0e19d4b6ebbc6c6b52d268036
import torch import torch.nn as nn class Model(nn.Module): """Implements instance normalization layer.""" def __init__(self, epsilon=1e-08): super().__init__() self.epsilon = epsilon def forward(self, x): if len(x.shape) != 4: raise ValueError( f'The i...
ModelNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ModelNet(nn.Module): def __init__(self, input_size, num_hidden_layers=1, hidden_layer_size= 512, num_labels=2): super(ModelNet, self).__init__() self.model = nn.Sequential() for i in range(num_hidden_layers): self.model.add_modu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
patelrajnath/makeesy-deep-learning
ModelNet
false
7,451
[ "Apache-2.0" ]
1
172f8a4301d6b60927824a56648d60559ba3f14e
https://github.com/patelrajnath/makeesy-deep-learning/tree/172f8a4301d6b60927824a56648d60559ba3f14e
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_size, num_hidden_layers=1, hidden_layer_size= 512, num_labels=2): super().__init__() self.model = nn.Sequential() for i in range(num_hidden_layers): self.model.add_module(f'ff_{i}', nn....
LocalDictionaryLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn class LocalDictionaryLoss(torch.nn.Module): def __init__(self, penalty): super(LocalDictionaryLoss, self).__init__() self.penalty = penalty def forward(self, A, y, x): return self.forward_detailed(A, y, x)[2] def forward_detailed(self, A, y, 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 import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride ...
pbt17/manifold-learning-with-simplex-constraints
LocalDictionaryLoss
false
7,452
[ "MIT" ]
1
36609e2d05600965ee1331823547a077ba7b5a51
https://github.com/pbt17/manifold-learning-with-simplex-constraints/tree/36609e2d05600965ee1331823547a077ba7b5a51
import torch import torch.nn class Model(torch.nn.Module): def __init__(self, penalty): super().__init__() self.penalty = penalty def forward(self, A, y, x): return self.forward_detailed(A, y, x)[2] def forward_detailed(self, A, y, x): weight = (y.unsqueeze(1) - A.unsque...
Discriminator
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.utils.data from collections import * class Discriminator(nn.Module): def __init__(self, n_hidden): super(Discriminator, self).__init__() self.weight = nn.Parameter(torch.Tensor(n_hidden, n_hidden)) self.reset_parameters() 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 import math import torch.nn as nn import torch.utils.data from collections impor...
pgplus1628/dgl
Discriminator
false
7,453
[ "Apache-2.0" ]
1
bf3994eea68b5841349f1616f41d0f70123a11ec
https://github.com/pgplus1628/dgl/tree/bf3994eea68b5841349f1616f41d0f70123a11ec
import math import torch import torch.nn as nn import torch.utils.data from collections import * class Model(nn.Module): def __init__(self, n_hidden): super().__init__() self.weight = nn.Parameter(torch.Tensor(n_hidden, n_hidden)) self.reset_parameters() def uniform(self, size, tenso...
baseline
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 baseline(torch.nn.Module): def __init__(self): super(baseline, self).__init__() self.conv1 = torch.nn.Conv2d(3, 6, 5) self.pool = torch.nn.MaxPool2d(2, 2) self.conv2 = torch.nn.Conv2d(6, 16, 5) self.fc1 = torch.nn.Linear(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....
patrickjdarrow/unsupervised_augmentations
baseline
false
7,454
[ "MIT" ]
1
5a81fa45865f2537c4c73e9307f83a873928e5ae
https://github.com/patrickjdarrow/unsupervised_augmentations/tree/5a81fa45865f2537c4c73e9307f83a873928e5ae
import torch import torch.nn.functional as F class Model(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = torch.nn.Conv2d(3, 6, 5) self.pool = torch.nn.MaxPool2d(2, 2) self.conv2 = torch.nn.Conv2d(6, 16, 5) self.fc1 = torch.nn.Linear(16 * 5 * 5, 120) ...
HaltingUnit
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 as th import torch.utils.data from collections import * import torch.nn.init as INIT from torch.nn import LayerNorm class HaltingUnit(nn.Module): halting_bias_init = 1.0 def __init__(self, dim_model): super(HaltingUnit, self).__init__() self.lin...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
pgplus1628/dgl
HaltingUnit
false
7,455
[ "Apache-2.0" ]
1
bf3994eea68b5841349f1616f41d0f70123a11ec
https://github.com/pgplus1628/dgl/tree/bf3994eea68b5841349f1616f41d0f70123a11ec
import torch import torch.nn as nn import torch as th import torch.utils.data from collections import * import torch.nn.init as INIT from torch.nn import LayerNorm class Model(nn.Module): halting_bias_init = 1.0 def __init__(self, dim_model): super().__init__() self.linear = nn.Linear(dim_mod...
EuclideanGMM
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import math import torch import torch.nn as nn def gaussian_prob_density(x, mu, sigma, normalized=False): if normalized: k = mu.shape[-1] scaler = (2 * math.pi) ** (-k / 2) sigma_det = torch.prod(sigma, dim=-1) ** -0.5 bias = (x - mu).unsqueeze(-2) sigma_inv = torch.diag_embed(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.triton_helpers import math as tl_math import math i...
ownzonefeng/Graph-based-text-representations
EuclideanGMM
false
7,456
[ "MIT" ]
1
4ddac6980d2741284474778dae2c2afa0adb5cda
https://github.com/ownzonefeng/Graph-based-text-representations/tree/4ddac6980d2741284474778dae2c2afa0adb5cda
import math import torch import torch.nn as nn def gaussian_prob_density(x, mu, sigma, normalized=False): if normalized: k = mu.shape[-1] scaler = (2 * math.pi) ** (-k / 2) sigma_det = torch.prod(sigma, dim=-1) ** -0.5 bias = (x - mu).unsqueeze(-2) sigma_inv = torch.diag_embed(1 / ...
HardMGUCellNUA
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from typing import Optional import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed def truncated_normal(t, mean=0.0, std=0.01): torch.nn.init.normal_(t, mean=mea...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math import torch.nn a...
pan185/UnarySim
HardMGUCellNUA
false
7,457
[ "MIT" ]
1
c03386efdbb8151f3c33f34b44d1d6a6fc960434
https://github.com/pan185/UnarySim/tree/c03386efdbb8151f3c33f34b44d1d6a6fc960434
import math import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from typing import Optional import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed def truncated_normal(t, mean=0.0, std=0.01): torch.nn.init.normal_(t, mean=mea...
UnpackLayerConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Conv2D(nn.Module): """ 2D convolution with GroupNorm and ELU Parameters ---------- in_channels : int Number of input channels out_channels : int Number of output channels kernel_size : int Kernel size stride : int ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
pection/packnet-sfm
UnpackLayerConv2d
false
7,459
[ "MIT" ]
1
d5673567b649e6bfda292c894cacdeb06aa80913
https://github.com/pection/packnet-sfm/tree/d5673567b649e6bfda292c894cacdeb06aa80913
import torch import torch.nn as nn class Conv2D(nn.Module): """ 2D convolution with GroupNorm and ELU Parameters ---------- in_channels : int Number of input channels out_channels : int Number of output channels kernel_size : int Kernel size stride : int ...
Conv2dLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_features = num_features self....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
piggy2303/DeepFillv2_Pytorch
Conv2dLayer
false
7,460
[ "MIT" ]
1
dd35299f11704f878ed7a33e14ccd51a9d64baaf
https://github.com/piggy2303/DeepFillv2_Pytorch/tree/dd35299f11704f878ed7a33e14ccd51a9d64baaf
import torch import torch.nn as nn from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_features self.affine = affine...
Contracting_Block
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Contracting_Block(nn.Module): def __init__(self, in_channels, out_channels): super(Contracting_Block, self).__init__() self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3) self.conv2 = nn.Conv2d(out_chann...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
parth2035/U-Net-Implementation
Contracting_Block
false
7,461
[ "MIT" ]
1
36ed8d140ef8a0031f63f2d1f577dcef92c4dab6
https://github.com/parth2035/U-Net-Implementation/tree/36ed8d140ef8a0031f63f2d1f577dcef92c4dab6
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_channels, out_channels): super().__init__() self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3) self.conv2 = nn.Conv2d(out_channels, out_channels, kernel_size=3) ...
Differencial_SMAPE
# 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 Differencial_SMAPE(nn.Module): def __init__(self): super(Differencial_SMAPE, self).__init__() def forward(self, true, predicted): epsilon = 0.1 summ = torch.clamp(torch.abs(true) + torch.abs(predicted) + epsilon, min=0.5 + epsilon)...
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 ...
pixel-ports/PV_prod_predic
Differencial_SMAPE
false
7,462
[ "Apache-2.0" ]
1
2ceb4cf8218f43f3ea94c5520b1904663cfb0de1
https://github.com/pixel-ports/PV_prod_predic/tree/2ceb4cf8218f43f3ea94c5520b1904663cfb0de1
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, true, predicted): epsilon = 0.1 summ = torch.clamp(torch.abs(true) + torch.abs(predicted) + epsilon, min=0.5 + epsilon) smape = torch.abs(predicted ...
HardMGUCellPT
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from typing import Optional import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed def truncated_normal(t, mean=0.0, std=0.01): torch.nn.init.normal_(t, mean=mea...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math import torch.nn a...
pan185/UnarySim
HardMGUCellPT
false
7,463
[ "MIT" ]
1
c03386efdbb8151f3c33f34b44d1d6a6fc960434
https://github.com/pan185/UnarySim/tree/c03386efdbb8151f3c33f34b44d1d6a6fc960434
import math import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from typing import Optional import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed def truncated_normal(t, mean=0.0, std=0.01): torch.nn.init.normal_(t, mean=mea...
BertMixedLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 import torch.nn as nn class BertAttention(nn.Module): """BERT attention layer. Based on: BERT (pytorch-transformer) https://github.com/huggingface/transformers """ def __init__(self, config) ->None: sup...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Jianrong-Lu/MONAI
BertMixedLayer
false
7,464
[ "Apache-2.0" ]
1
c319ca8ff31aa980a045f1b913fb2eb22aadb080
https://github.com/Jianrong-Lu/MONAI/tree/c319ca8ff31aa980a045f1b913fb2eb22aadb080
from _paritybench_helpers import _mock_config import math import torch import torch.nn import torch.nn as nn class BertAttention(nn.Module): """BERT attention layer. Based on: BERT (pytorch-transformer) https://github.com/huggingface/transformers """ def __init__(self, config) ->None: sup...
SmoothL1Loss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.cuda import torch.distributed import torch.multiprocessing class SmoothL1Loss(nn.Module): """Smooth L1 Loss""" def __init__(self, beta=0.11): super().__init__() self.beta = beta def forward(self, pred, target): x = (pred - target).a...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn import torch.cuda import torch.distributed import t...
pkashinkunti/retinanet-examples
SmoothL1Loss
false
7,465
[ "BSD-3-Clause" ]
1
30466522c018d4d0bd921485024e871b32ec4e73
https://github.com/pkashinkunti/retinanet-examples/tree/30466522c018d4d0bd921485024e871b32ec4e73
import torch import torch.nn as nn import torch.cuda import torch.distributed import torch.multiprocessing class Model(nn.Module): """Smooth L1 Loss""" def __init__(self, beta=0.11): super().__init__() self.beta = beta def forward(self, pred, target): x = (pred - target).abs() ...
ConvBatchNorm2d
# 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 ConvBatchNorm2d(nn.BatchNorm2d): def __init__(self, num_features, momentum=0.9, epsilon=1e-05): """ input: assume 4D input (mini_batch_size, # channel, w, h) momentum: momentum for exponential average """ super(nn.BatchNorm2d, self)...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
pigunther/Self-Correction-Human-Parsing-Updated
ConvBatchNorm2d
false
7,466
[ "MIT" ]
1
17331eaa5d6586a1ebb633eb61ed810d00d30a2f
https://github.com/pigunther/Self-Correction-Human-Parsing-Updated/tree/17331eaa5d6586a1ebb633eb61ed810d00d30a2f
import torch import torch.nn as nn class Model(nn.BatchNorm2d): def __init__(self, num_features, momentum=0.9, epsilon=1e-05): """ input: assume 4D input (mini_batch_size, # channel, w, h) momentum: momentum for exponential average """ super(nn.BatchNorm2d, self).__init__(...
AdaIN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch class AdaIN(torch.nn.Module): def __init__(self, channels_in, channels_out, norm=True): super(AdaIN, self).__init__() self.channels_in = channels_in self.channels_out = channels_out self.norm = norm self.affine_scale = torch.nn.Linear(channels_in, channels_out...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride ...
pigunther/Self-Correction-Human-Parsing-Updated
AdaIN
false
7,467
[ "MIT" ]
1
17331eaa5d6586a1ebb633eb61ed810d00d30a2f
https://github.com/pigunther/Self-Correction-Human-Parsing-Updated/tree/17331eaa5d6586a1ebb633eb61ed810d00d30a2f
import torch class Model(torch.nn.Module): def __init__(self, channels_in, channels_out, norm=True): super().__init__() self.channels_in = channels_in self.channels_out = channels_out self.norm = norm self.affine_scale = torch.nn.Linear(channels_in, channels_out, bias ...
TransposeConv2dLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.nn import Parameter assert_size_stride = torch....
piggy2303/DeepFillv2_Pytorch
TransposeConv2dLayer
false
7,468
[ "MIT" ]
1
dd35299f11704f878ed7a33e14ccd51a9d64baaf
https://github.com/piggy2303/DeepFillv2_Pytorch/tree/dd35299f11704f878ed7a33e14ccd51a9d64baaf
import torch import torch.nn as nn from torch.nn import functional as F from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch.cuda import torch.distributed import torch.multiprocessing class FocalLoss(nn.Module): """Focal Loss - https://arxiv.org/abs/1708.02002""" def __init__(self, alpha=0.25, gamma=2): super().__init__() self.alpha = a...
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...
pkashinkunti/retinanet-examples
FocalLoss
false
7,469
[ "BSD-3-Clause" ]
1
30466522c018d4d0bd921485024e871b32ec4e73
https://github.com/pkashinkunti/retinanet-examples/tree/30466522c018d4d0bd921485024e871b32ec4e73
import torch import torch.nn as nn import torch.nn.functional as F import torch.cuda import torch.distributed import torch.multiprocessing class Model(nn.Module): """Focal Loss - https://arxiv.org/abs/1708.02002""" def __init__(self, alpha=0.25, gamma=2): super().__init__() self.alpha = alpha...
sobel_net
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import numpy as np from torch import nn import torch.nn.functional as F class sobel_net(nn.Module): def __init__(self): super().__init__() self.conv_opx = nn.Conv2d(1, 1, 3, bias=False) self.conv_opy = nn.Conv2d(1, 1, 3, bias=False) sobel_kernelx = np.array([[-1, 0, 1...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
phonhay103/DocTr
sobel_net
false
7,470
[ "MIT" ]
1
f052703976e2558633027907af48ecb1dc7718ff
https://github.com/phonhay103/DocTr/tree/f052703976e2558633027907af48ecb1dc7718ff
import torch import numpy as np from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv_opx = nn.Conv2d(1, 1, 3, bias=False) self.conv_opy = nn.Conv2d(1, 1, 3, bias=False) sobel_kernelx = np.array([[-1, 0, 1], [...
TrendNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 TrendNet(nn.Module): def __init__(self, feature_size): super(TrendNet, self).__init__() self.hidden_size1 = 16 self.hidden_size2 = 16 self.output_size = 1 self.fc1 = nn.Linear(feature_size, self.hidden_size1) self.fc2 = nn.L...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
pixel-ports/PV_prod_predic
TrendNet
false
7,471
[ "Apache-2.0" ]
1
2ceb4cf8218f43f3ea94c5520b1904663cfb0de1
https://github.com/pixel-ports/PV_prod_predic/tree/2ceb4cf8218f43f3ea94c5520b1904663cfb0de1
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, feature_size): super().__init__() self.hidden_size1 = 16 self.hidden_size2 = 16 self.output_size = 1 self.fc1 = nn.Linear(feature_size, self.hidden_size1) self.fc2 = nn.Linear(self.hidden...
FlowHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 FlowHead(nn.Module): def __init__(self, input_dim=128, hidden_dim=256): super(FlowHead, self).__init__() self.conv1 = nn.Conv2d(input_dim, hidden_dim, 3, padding=1) self.conv2 = nn.Conv2d(hidden_dim, 2, 3, padding=1) self.relu = nn.ReLU(inpl...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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...
phonhay103/DocTr
FlowHead
false
7,472
[ "MIT" ]
1
f052703976e2558633027907af48ecb1dc7718ff
https://github.com/phonhay103/DocTr/tree/f052703976e2558633027907af48ecb1dc7718ff
import torch from torch import nn class Model(nn.Module): def __init__(self, input_dim=128, hidden_dim=256): super().__init__() self.conv1 = nn.Conv2d(input_dim, hidden_dim, 3, padding=1) self.conv2 = nn.Conv2d(hidden_dim, 2, 3, padding=1) self.relu = nn.ReLU(inplace=True) de...
GatedConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_features = num_features self....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
piggy2303/DeepFillv2_Pytorch
GatedConv2d
false
7,473
[ "MIT" ]
1
dd35299f11704f878ed7a33e14ccd51a9d64baaf
https://github.com/piggy2303/DeepFillv2_Pytorch/tree/dd35299f11704f878ed7a33e14ccd51a9d64baaf
import torch import torch.nn as nn from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_features self.affine = affine...
ContinuousActor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class ContinuousActor(nn.Module): """ContinuousActor network :param state_size: the size of the sta...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import numpy as np ...
pjordan/rlcc
ContinuousActor
false
7,474
[ "Apache-2.0" ]
1
e84b8b5c14680dbad2efae22756fb40606b2384a
https://github.com/pjordan/rlcc/tree/e84b8b5c14680dbad2efae22756fb40606b2384a
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Model(nn.Module): """ContinuousActor network :param state_size: the size of the state space ...
PositionwiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class PositionwiseFeedForward(nn.Module): """Positionwise feed forward :param int idim: input dimenstion :param int hidden_units: number of hidden units :param float dropout_rate: dropout rate """ def __init__(self, idim, hid...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
pkufool/DaVinci-Speech
PositionwiseFeedForward
false
7,475
[ "MIT" ]
1
98602363168476356d492852093adbe65c65ac95
https://github.com/pkufool/DaVinci-Speech/tree/98602363168476356d492852093adbe65c65ac95
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Positionwise feed forward :param int idim: input dimenstion :param int hidden_units: number of hidden units :param float dropout_rate: dropout rate """ def __init__(self, idim, hidden_units, dropout...
BertPooler
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 BertPooler(nn.Module): def __init__(self, config): super(BertPooler, self).__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.activation = nn.Tanh() def forward(self, hi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
AlanFokCo/bert-chinese-horovod-elastic
BertPooler
false
7,476
[ "Apache-2.0" ]
1
02317d0857e0e8e313dd63ead61ca9996b25548e
https://github.com/AlanFokCo/bert-chinese-horovod-elastic/tree/02317d0857e0e8e313dd63ead61ca9996b25548e
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.activation = nn.Tanh() def forward(self, hidden_states): ...
VariableBoxMLP
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.optim import torch.jit import torch.nn as nn class VariableBoxMLP(nn.Module): def __init__(self, num_in_features: 'int', num_out_features: 'int', neurons_per_layer: 'int', hidden_layers: 'int'): super(VariableBoxMLP, self).__init__() self.hidden_layers = hidden_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 import torch.optim ...
plaveczlambert/deep_euler_tests
VariableBoxMLP
false
7,477
[ "MIT" ]
1
a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a
https://github.com/plaveczlambert/deep_euler_tests/tree/a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a
import torch import torch.optim import torch.jit import torch.nn as nn class Model(nn.Module): def __init__(self, num_in_features: 'int', num_out_features: 'int', neurons_per_layer: 'int', hidden_layers: 'int'): super().__init__() self.hidden_layers = hidden_layers self.act = nn.E...
SimpleMLP
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.optim import torch.jit import torch.nn as nn class SimpleMLP(nn.Module): def __init__(self, num_in_features: 'int', num_out_features: 'int', neurons_per_layer: 'int'): super(SimpleMLP, self).__init__() self.act = nn.ELU() self.l_in = nn.Linear(in_features...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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.optim ...
plaveczlambert/deep_euler_tests
SimpleMLP
false
7,478
[ "MIT" ]
1
a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a
https://github.com/plaveczlambert/deep_euler_tests/tree/a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a
import torch import torch.optim import torch.jit import torch.nn as nn class Model(nn.Module): def __init__(self, num_in_features: 'int', num_out_features: 'int', neurons_per_layer: 'int'): super().__init__() self.act = nn.ELU() self.l_in = nn.Linear(in_features=num_in_features, o...
TransposeGatedConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
piggy2303/DeepFillv2_Pytorch
TransposeGatedConv2d
false
7,479
[ "MIT" ]
1
dd35299f11704f878ed7a33e14ccd51a9d64baaf
https://github.com/piggy2303/DeepFillv2_Pytorch/tree/dd35299f11704f878ed7a33e14ccd51a9d64baaf
import torch import torch.nn as nn from torch.nn import functional as F from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_...
BasePolicy
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 BasePolicy(nn.Module): """ Base policy network """ def __init__(self, input_dim, out_dim, hidden_dim=64, nonlin=F. leaky_relu, norm_in=False, onehot_dim=0): """ Inputs: input_dim (int): Number...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.functional as F assert_size_stride = torch...
pohanchi/DL_final_project
BasePolicy
false
7,480
[ "Apache-2.0" ]
1
8ade422f61a2e8bd4256523ebda56e19b189fe91
https://github.com/pohanchi/DL_final_project/tree/8ade422f61a2e8bd4256523ebda56e19b189fe91
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Base policy network """ def __init__(self, input_dim, out_dim, hidden_dim=64, nonlin=F. leaky_relu, norm_in=False, onehot_dim=0): """ Inputs: input_dim (int): Number of d...
ContinuousCritic
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class ContinuousCritic(nn.Module): """ContinuousCritic network :param state_size: the size of the s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
pjordan/rlcc
ContinuousCritic
false
7,481
[ "Apache-2.0" ]
1
e84b8b5c14680dbad2efae22756fb40606b2384a
https://github.com/pjordan/rlcc/tree/e84b8b5c14680dbad2efae22756fb40606b2384a
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Model(nn.Module): """ContinuousCritic network :param state_size: the size of the state space ...
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 class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(kernel_size=5, in_channels=3, out_channels=3) self.pool1 = nn.MaxPool2d(kernel_size=2, stride=2) self.conv2 = nn.Conv2d(kernel_size=5, in_channels=3, out...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
pippinhio/image-recognition
Net
false
7,482
[ "MIT" ]
1
89569a0d66ae144d2f6e6f2d73a8577ef8b2272b
https://github.com/pippinhio/image-recognition/tree/89569a0d66ae144d2f6e6f2d73a8577ef8b2272b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(kernel_size=5, in_channels=3, out_channels=3) self.pool1 = nn.MaxPool2d(kernel_size=2, stride=2) self.conv2 = nn.Conv2d(kernel_size=5, in_channels=3, out_channe...
AddBroadcastPosEmbed
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn def tensor_slice(x, begin, size): assert all([(b >= 0) for b in begin]) size = [(l - b if s == -1 else s) for s, b, l in zip(size, begin, x.shape)] assert all([(s >= 0) for s in size]) slices = [slice(b, b + s) for b, s in zip(begin, size)] return x[slices] cla...
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...
pointoflight/VideoGPT
AddBroadcastPosEmbed
false
7,483
[ "MIT" ]
1
85f19d8cb0d251238f295f0294e69b9299c13e21
https://github.com/pointoflight/VideoGPT/tree/85f19d8cb0d251238f295f0294e69b9299c13e21
import torch import torch.nn as nn def tensor_slice(x, begin, size): assert all([(b >= 0) for b in begin]) size = [(l - b if s == -1 else s) for s, b, l in zip(size, begin, x.shape)] assert all([(s >= 0) for s in size]) slices = [slice(b, b + s) for b, s in zip(begin, size)] return x[slices] cla...
Model
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super(Model, self).__init__() self.conv1_7x7_s2 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3 ) self.pool1_3x3_s2 = nn.MaxPool2d(3, stride=2, ceil_mode=True) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
m-decoster/DeepHand-PyTorch
Model
false
7,484
[ "MIT" ]
1
ece77e04ec261a540b011fd00584bfc6d7337dc5
https://github.com/m-decoster/DeepHand-PyTorch/tree/ece77e04ec261a540b011fd00584bfc6d7337dc5
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super(Model, self).__init__() self.conv1_7x7_s2 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3 ) self.pool1_3x3_s2 = nn.MaxPool2d(3, stride=2, ceil_mode=True) ...
SamePadConv3d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 SamePadConv3d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, bias=True): super().__init__() if isinstance(kernel_size, int): kernel_size = (kernel_size,) * 3 if 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
pointoflight/VideoGPT
SamePadConv3d
false
7,485
[ "MIT" ]
1
85f19d8cb0d251238f295f0294e69b9299c13e21
https://github.com/pointoflight/VideoGPT/tree/85f19d8cb0d251238f295f0294e69b9299c13e21
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, bias=True): super().__init__() if isinstance(kernel_size, int): kernel_size = (kernel_size,) * 3 if isinstanc...
SamePadConvTranspose3d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 SamePadConvTranspose3d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, bias=True): super().__init__() if isinstance(kernel_size, int): kernel_size = (kernel_size,) * 3 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
pointoflight/VideoGPT
SamePadConvTranspose3d
false
7,486
[ "MIT" ]
1
85f19d8cb0d251238f295f0294e69b9299c13e21
https://github.com/pointoflight/VideoGPT/tree/85f19d8cb0d251238f295f0294e69b9299c13e21
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, bias=True): super().__init__() if isinstance(kernel_size, int): kernel_size = (kernel_size,) * 3 if isinstanc...
Pooler
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F from torch.optim.lr_scheduler import * def linear(x): return x def activation(func_a): """Activation function wrapper """ try: f = eval(func_a) except: f = linear return f class DropoutWrapper(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 import torch.nn as nn import torch.nn.functional as F from torch.optim.lr_schedu...
praj000/DeepPavlov
Pooler
false
7,487
[ "Apache-2.0" ]
1
3c9e4c989c6f6b89cd187f0ec2e2b7c71d1e3bf3
https://github.com/praj000/DeepPavlov/tree/3c9e4c989c6f6b89cd187f0ec2e2b7c71d1e3bf3
import torch import torch.nn as nn import torch.nn.functional as F from torch.optim.lr_scheduler import * def linear(x): return x def activation(func_a): """Activation function wrapper """ try: f = eval(func_a) except: f = linear return f class DropoutWrapper(nn.Module): ...
ReconstructionLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from functools import reduce import torch.utils.data class BaseModule(nn.Module): """ Implements the basic module. All other modules inherit from this one """ def load_w(self, checkpoint_path): """ Loads a checkpoint into the state_dict. ...
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 functools import reduce import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride e...
ppalaupuigdevall/moments-vae
ReconstructionLoss
false
7,488
[ "MIT" ]
1
99384094b5b7213e7669ad492f1b56216045b190
https://github.com/ppalaupuigdevall/moments-vae/tree/99384094b5b7213e7669ad492f1b56216045b190
import torch import torch.nn as nn from functools import reduce import torch.utils.data class BaseModule(nn.Module): """ Implements the basic module. All other modules inherit from this one """ def load_w(self, checkpoint_path): """ Loads a checkpoint into the state_dict. ...
_DQN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.nn.functional as F class _DQN(nn.Module): def __init__(self, observation_space, action_space): super(_DQN, self).__init__() self.fc1 = nn.Linear(observation_space, 8) self.fc2 = nn.Linear(8, 4) self.fc3 = nn.Linear(4, action_space) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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...
pouyan9675/DeepFlappyBird
_DQN
false
7,489
[ "MIT" ]
1
3dc727cc7fb2ce9e0e665d26770c08d3e924f6c2
https://github.com/pouyan9675/DeepFlappyBird/tree/3dc727cc7fb2ce9e0e665d26770c08d3e924f6c2
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, observation_space, action_space): super().__init__() self.fc1 = nn.Linear(observation_space, 8) self.fc2 = nn.Linear(8, 4) self.fc3 = nn.Linear(4, action_space) def fo...
Advantage_estimate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Advantage_estimate(nn.Module): def __init__(self, input_shape, output_shape, device, hidden_shape=128): super(Advantage_estimate, self).__init__() self.device = device self.dropout = nn.Dropout(p=0.01) self.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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
pupupue/Deep-RL-atari
Advantage_estimate
false
7,490
[ "MIT" ]
1
9b97157f87826feafcf272761d7eef9693a2b2c4
https://github.com/pupupue/Deep-RL-atari/tree/9b97157f87826feafcf272761d7eef9693a2b2c4
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_shape, output_shape, device, hidden_shape=128): super().__init__() self.device = device self.dropout = nn.Dropout(p=0.01) self.input_shape = input_shape self...
InverseSigmoidTransformer
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data import torch.nn.functional as F from torch.distributions.utils import probs_to_logits class Bijection(nn.Module): """ An invertible transformation. """ def __init__(self): super().__init__() def forward(self, inputs, context): ...
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...
probabll/dgm.pt
InverseSigmoidTransformer
false
7,491
[ "MIT" ]
1
95b5b1eb798b87c3d621e7416cc1c423c076c865
https://github.com/probabll/dgm.pt/tree/95b5b1eb798b87c3d621e7416cc1c423c076c865
import torch import torch.nn as nn import torch.utils.data import torch.nn.functional as F from torch.distributions.utils import probs_to_logits class Bijection(nn.Module): """ An invertible transformation. """ def __init__(self): super().__init__() def forward(self, inputs, context): ...
Value_estimate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Value_estimate(nn.Module): def __init__(self, input_shape, device, output_shape=1, hidden_shape=128): super(Value_estimate, self).__init__() self.device = device self.dropout = nn.Dropout(p=0.01) self.input_s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
pupupue/Deep-RL-atari
Value_estimate
false
7,492
[ "MIT" ]
1
9b97157f87826feafcf272761d7eef9693a2b2c4
https://github.com/pupupue/Deep-RL-atari/tree/9b97157f87826feafcf272761d7eef9693a2b2c4
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_shape, device, output_shape=1, hidden_shape=128): super().__init__() self.device = device self.dropout = nn.Dropout(p=0.01) self.input_shape = input_shape se...
SigmoidTransformer
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data import torch.nn.functional as F from torch.distributions.utils import probs_to_logits class Bijection(nn.Module): """ An invertible transformation. """ def __init__(self): super().__init__() def forward(self, inputs, context): ...
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.utils.data import torch.nn....
probabll/dgm.pt
SigmoidTransformer
false
7,493
[ "MIT" ]
1
95b5b1eb798b87c3d621e7416cc1c423c076c865
https://github.com/probabll/dgm.pt/tree/95b5b1eb798b87c3d621e7416cc1c423c076c865
import torch import torch.nn as nn import torch.utils.data import torch.nn.functional as F from torch.distributions.utils import probs_to_logits class Bijection(nn.Module): """ An invertible transformation. """ def __init__(self): super().__init__() def forward(self, inputs, context): ...
distLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn.utils.weight_norm import WeightNorm import torch.optim class distLinear(nn.Module): def __init__(self, indim, outdim): super(distLinear, self).__init__() self.L = nn.Linear(indim, outdim, bias=False) self.class_wise_learnable_norm = 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.triton_helpers import libdevice import torch.nn as ...
prabhat1081/self-supervision-cs221
distLinear
false
7,494
[ "Apache-2.0" ]
1
41912c01dd7bf44d45a27d7c715a8db2ee9bbc28
https://github.com/prabhat1081/self-supervision-cs221/tree/41912c01dd7bf44d45a27d7c715a8db2ee9bbc28
import torch import torch.nn as nn from torch.nn.utils.weight_norm import WeightNorm import torch.optim class Model(nn.Module): def __init__(self, indim, outdim): super().__init__() self.L = nn.Linear(indim, outdim, bias=False) self.class_wise_learnable_norm = True if self.class_w...
GumbelSoftmaxLayer
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from torch.distributions import RelaxedOneHotCategorical import torch.nn.parallel import torch.utils.data import torch.distributions def gumbel_softmax_sample(logits: 'torch.Tensor', temperature: 'float'=1.0, training: 'bool'=True, straight_through: 'bool'=False): size = log...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.distributions import RelaxedOneHotCategorical import torch.nn.parallel import torch.utils.data import torch...
ptigas/EGG
GumbelSoftmaxLayer
false
7,495
[ "MIT" ]
1
5319cc9de2c17bc72de717737cfbb5be2285c59b
https://github.com/ptigas/EGG/tree/5319cc9de2c17bc72de717737cfbb5be2285c59b
import torch import torch.nn as nn from torch.distributions import RelaxedOneHotCategorical import torch.nn.parallel import torch.utils.data import torch.distributions def gumbel_softmax_sample(logits: 'torch.Tensor', temperature: 'float'=1.0, training: 'bool'=True, straight_through: 'bool'=False): size = log...
Crop
# 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 typing import cast from torch import nn from torchvision.transforms import functional as F import torch.nn.functional as F import torchvision.transforms.functional as F import torch.autograd class Crop(nn.Module): def __init__(self, *, top: int, left: int, height: int, width: int) ->None: ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.autograd assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dy...
pystiche/papers
Crop
false
7,496
[ "BSD-3-Clause" ]
1
0d8179dc51f6eda0b27fa525dc0b86b866bc88e1
https://github.com/pystiche/papers/tree/0d8179dc51f6eda0b27fa525dc0b86b866bc88e1
import torch from typing import cast from torch import nn from torchvision.transforms import functional as F import torch.nn.functional as F import torchvision.transforms.functional as F import torch.autograd class Model(nn.Module): def __init__(self, *, top: int, left: int, height: int, width: int) ->None: ...
TonemappedRelativeMSE
# 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 def _tonemap(im): """Helper Reinhards tonemapper. Args: im(torch.Tensor): image to tonemap. Returns: (torch.Tensor) tonemaped image. """ im = torch.clamp(im, min=0) return im / (1 + im) class TonemappedRelativeMSE(torch.nn.Module): """Relative mean-squared er...
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...
qbhan/pathembed
TonemappedRelativeMSE
false
7,497
[ "MIT" ]
1
c21823529840593bf606e10696f5879e5adb51b2
https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2
import torch def _tonemap(im): """Helper Reinhards tonemapper. Args: im(torch.Tensor): image to tonemap. Returns: (torch.Tensor) tonemaped image. """ im = torch.clamp(im, min=0) return im / (1 + im) class Model(torch.nn.Module): """Relative mean-squared error on tonemaped...
ReinforcedReceiver
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.utils.data from torch.distributions import Bernoulli import torch.distributions class ReinforcedReceiver(nn.Module): def __init__(self, n_bits, n_hidden): super(ReinforcedReceiver, self).__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.parallel import torch.utils.data import to...
ptigas/EGG
ReinforcedReceiver
false
7,498
[ "MIT" ]
1
5319cc9de2c17bc72de717737cfbb5be2285c59b
https://github.com/ptigas/EGG/tree/5319cc9de2c17bc72de717737cfbb5be2285c59b
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.utils.data from torch.distributions import Bernoulli import torch.distributions class Model(nn.Module): def __init__(self, n_bits, n_hidden): super().__init__() self.emb_column = nn.Linear(n_b...
Luong_Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Luong_Attention(nn.Module): def __init__(self, hidden_size, score='general'): super(Luong_Attention, self).__init__() assert score.lower() in ['concat', 'general', 'dot'] self.score = score.lower() def wn(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....
placaille/nmt-comp550
Luong_Attention
false
7,499
[ "MIT" ]
1
5809ca68dbd7e5452361700f905740a783f9451c
https://github.com/placaille/nmt-comp550/tree/5809ca68dbd7e5452361700f905740a783f9451c
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, hidden_size, score='general'): super().__init__() assert score.lower() in ['concat', 'general', 'dot'] self.score = score.lower() def wn(x): return nn.utils.w...
TensorPermute
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data class TensorPermute(torch.nn.Module): """ Convert a torch.FloatTensor of shape (NUM_IMAGES x CHANNELS x HEIGHT x WIDTH) to a torch.FloatTensor of shape (CHANNELS x NUM_IMAGES x HEIGHT x WIDTH). """ def forward(self, tensor): return tensor.permute(1, 0,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_...
pz-white/pykale
TensorPermute
false
7,500
[ "MIT" ]
1
de40d1e8a88aa824ffbd1e072b02fe92b57b7c69
https://github.com/pz-white/pykale/tree/de40d1e8a88aa824ffbd1e072b02fe92b57b7c69
import torch import torch.utils.data class Model(torch.nn.Module): """ Convert a torch.FloatTensor of shape (NUM_IMAGES x CHANNELS x HEIGHT x WIDTH) to a torch.FloatTensor of shape (CHANNELS x NUM_IMAGES x HEIGHT x WIDTH). """ def forward(self, tensor): return tensor.permute(1, 0, 2, 3).c...
OptimizedMLP
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.optim import torch.jit import torch.nn as nn class OptimizedMLP(nn.Module): def __init__(self, num_in_features: 'int', num_out_features: 'int'): super(OptimizedMLP, self).__init__() self.act = nn.ELU() self.l_in = nn.Linear(in_features=num_in_features, out_featur...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.optim ...
plaveczlambert/deep_euler_tests
OptimizedMLP
false
7,501
[ "MIT" ]
1
a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a
https://github.com/plaveczlambert/deep_euler_tests/tree/a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a
import torch import torch.optim import torch.jit import torch.nn as nn class Model(nn.Module): def __init__(self, num_in_features: 'int', num_out_features: 'int'): super().__init__() self.act = nn.ELU() self.l_in = nn.Linear(in_features=num_in_features, out_features=107) self.l1 =...
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 from torch import nn class Net(nn.Module): def __init__(self, input_size, output_size, num_emojis, dropout): super().__init__() self.V = torch.nn.Parameter(torch.empty(num_emojis, output_size). uniform_(-0.1, 0.1)) self.dropout = torch.nn.Dropout(p=dropout) ...
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...
pwiercinski/emoji2vec_pytorch
Net
false
7,502
[ "MIT" ]
1
be7c3297998baa85a9542c0d2183d1dbed0f3adb
https://github.com/pwiercinski/emoji2vec_pytorch/tree/be7c3297998baa85a9542c0d2183d1dbed0f3adb
import torch from torch import nn class Model(nn.Module): def __init__(self, input_size, output_size, num_emojis, dropout): super().__init__() self.V = torch.nn.Parameter(torch.empty(num_emojis, output_size). uniform_(-0.1, 0.1)) self.dropout = torch.nn.Dropout(p=dropout) ...
Rotate
# 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 typing import cast from torch import nn from torchvision.transforms import functional as F import torch.nn.functional as F import torchvision.transforms.functional as F import torch.autograd class Rotate(nn.Module): def __init__(self, angle: 'float') ->None: super().__init__() s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
pystiche/papers
Rotate
false
7,503
[ "BSD-3-Clause" ]
1
0d8179dc51f6eda0b27fa525dc0b86b866bc88e1
https://github.com/pystiche/papers/tree/0d8179dc51f6eda0b27fa525dc0b86b866bc88e1
import torch from typing import cast from torch import nn from torchvision.transforms import functional as F import torch.nn.functional as F import torchvision.transforms.functional as F import torch.autograd class Model(nn.Module): def __init__(self, angle: 'float') ->None: super().__init__() se...
srcEncoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 srcEncoder(nn.Module): def __init__(self, in_ch, hid_ch): super(srcEncoder, self).__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
qbhan/pathembed
srcEncoder
false
7,504
[ "MIT" ]
1
c21823529840593bf606e10696f5879e5adb51b2
https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_ch, hid_ch): super().__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=1) def forward(s...
TonemappedMSE
# 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 def _tonemap(im): """Helper Reinhards tonemapper. Args: im(torch.Tensor): image to tonemap. Returns: (torch.Tensor) tonemaped image. """ im = torch.clamp(im, min=0) return im / (1 + im) class TonemappedMSE(torch.nn.Module): """Mean-squared error on tonemaped ...
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...
qbhan/pathembed
TonemappedMSE
false
7,505
[ "MIT" ]
1
c21823529840593bf606e10696f5879e5adb51b2
https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2
import torch def _tonemap(im): """Helper Reinhards tonemapper. Args: im(torch.Tensor): image to tonemap. Returns: (torch.Tensor) tonemaped image. """ im = torch.clamp(im, min=0) return im / (1 + im) class Model(torch.nn.Module): """Mean-squared error on tonemaped images. ...
Residual_Block
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 AddCoords(nn.Module): def __init__(self, with_r=False): super().__init__() self.with_r = with_r def forward(self, input_tensor): """ @param input_tensor: shape(batch, channel, x_dim, y_dim) """ batch_size, _, x_dim, y_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....
patrickacole/ccsrresnet
Residual_Block
false
7,506
[ "MIT" ]
1
693d6673c26860bc9f7ced187006d8ef0a8386e6
https://github.com/patrickacole/ccsrresnet/tree/693d6673c26860bc9f7ced187006d8ef0a8386e6
import torch import torch.nn as nn class AddCoords(nn.Module): def __init__(self, with_r=False): super().__init__() self.with_r = with_r def forward(self, input_tensor): """ @param input_tensor: shape(batch, channel, x_dim, y_dim) """ batch_size, _, x_dim, y_d...
InformedSender
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.utils.data import torch.distributions class InformedSender(nn.Module): def __init__(self, game_size, feat_size, embedding_size, hidden_size, vocab_size=100, temp=1.0): super(InformedSender, 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....
ptigas/EGG
InformedSender
false
7,507
[ "MIT" ]
1
5319cc9de2c17bc72de717737cfbb5be2285c59b
https://github.com/ptigas/EGG/tree/5319cc9de2c17bc72de717737cfbb5be2285c59b
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.utils.data import torch.distributions class Model(nn.Module): def __init__(self, game_size, feat_size, embedding_size, hidden_size, vocab_size=100, temp=1.0): super().__init__() self.g...
ResBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class ResBlock(nn.Module): def __init__(self, in_ch, hid_ch): super(ResBlock, self).__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
qbhan/pathembed
ResBlock
false
7,508
[ "MIT" ]
1
c21823529840593bf606e10696f5879e5adb51b2
https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_ch, hid_ch): super().__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=1) def forward(s...
FeatureEncoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ResBlock(nn.Module): def __init__(self, in_ch, hid_ch): super(ResBlock, self).__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
qbhan/pathembed
FeatureEncoder
false
7,509
[ "MIT" ]
1
c21823529840593bf606e10696f5879e5adb51b2
https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2
import torch import torch.nn as nn class ResBlock(nn.Module): def __init__(self, in_ch, hid_ch): super().__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=1) def forwar...
PredictionHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 PredictionHead(nn.Module): """ Simple classification prediction-head block to plug ontop of the 4D output of a CNN. Args: num_classes: the number of different classes that can be predicted. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
pz-white/pykale
PredictionHead
false
7,510
[ "MIT" ]
1
de40d1e8a88aa824ffbd1e072b02fe92b57b7c69
https://github.com/pz-white/pykale/tree/de40d1e8a88aa824ffbd1e072b02fe92b57b7c69
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): """ Simple classification prediction-head block to plug ontop of the 4D output of a CNN. Args: num_classes: the number of different classes that can be predicted. input_sh...
LinearDiag
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 LinearDiag(nn.Module): def __init__(self, num_features, bias=False): super(LinearDiag, self).__init__() weight = torch.FloatTensor(num_features).fill_(1) self.weight = nn.Parameter(weight, requires_grad=True) if bias: bias = tor...
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...
qianrusun1015/E3BM-1
LinearDiag
false
7,511
[ "Apache-2.0" ]
1
d2c957bdff66fe28a288f1518f224a1e034d543f
https://github.com/qianrusun1015/E3BM-1/tree/d2c957bdff66fe28a288f1518f224a1e034d543f
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_features, bias=False): super().__init__() weight = torch.FloatTensor(num_features).fill_(1) self.weight = nn.Parameter(weight, requires_grad=True) if bias: bias = torch.FloatTensor(num_fe...
FeatExemplarAvgBlock
# 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 FeatExemplarAvgBlock(nn.Module): def __init__(self, nFeat): super(FeatExemplarAvgBlock, self).__init__() def forward(self, features_train, labels_train): labels_train_transposed = labels_train.transpose(1, 2) weight_novel = torch.bmm(labels_tr...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
qianrusun1015/E3BM-1
FeatExemplarAvgBlock
false
7,512
[ "Apache-2.0" ]
1
d2c957bdff66fe28a288f1518f224a1e034d543f
https://github.com/qianrusun1015/E3BM-1/tree/d2c957bdff66fe28a288f1518f224a1e034d543f
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, nFeat): super().__init__() def forward(self, features_train, labels_train): labels_train_transposed = labels_train.transpose(1, 2) weight_novel = torch.bmm(labels_train_transposed, features_train) w...
CONV
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F class CONV(nn.Module): def __init__(self, input_shape, device): super(CONV, self).__init__() self.device = device self.input_shape = input_shape self.poolavg = nn.AvgPool2d(2, 2) self.con...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np import tor...
pupupue/Deep-RL-atari
CONV
false
7,513
[ "MIT" ]
1
9b97157f87826feafcf272761d7eef9693a2b2c4
https://github.com/pupupue/Deep-RL-atari/tree/9b97157f87826feafcf272761d7eef9693a2b2c4
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_shape, device): super().__init__() self.device = device self.input_shape = input_shape self.poolavg = nn.AvgPool2d(2, 2) self.conv1 = nn.C...
Quantization
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch.nn as nn class Quant(torch.autograd.Function): @staticmethod def forward(ctx, input): input = torch.clamp(input, 0, 1) output = (input * 255.0).round() / 255.0 return output @staticmethod def backward(ctx, grad_output): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.utils.data impo...
qwopqwop200/Fast-Invertible-Rescaling-Net
Quantization
false
7,514
[ "MIT" ]
1
871733f2eee7929d6b37c4d1d6a27347b39b67a9
https://github.com/qwopqwop200/Fast-Invertible-Rescaling-Net/tree/871733f2eee7929d6b37c4d1d6a27347b39b67a9
import torch import torch.utils.data import torch.nn as nn class Quant(torch.autograd.Function): @staticmethod def forward(ctx, input): input = torch.clamp(input, 0, 1) output = (input * 255.0).round() / 255.0 return output @staticmethod def backward(ctx, grad_output): ...
kernelPredictor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 kernelPredictor(nn.Module): def __init__(self, in_ch, hid_ch, pred_kernel_size=21): super(kernelPredictor, self).__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=1) self.conv2 = nn.Conv2d(hid_ch, pred_kernel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
qbhan/pathembed
kernelPredictor
false
7,515
[ "MIT" ]
1
c21823529840593bf606e10696f5879e5adb51b2
https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_ch, hid_ch, pred_kernel_size=21): super().__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=1) self.conv2 = nn.Conv2d(hid_ch, pred_kernel_size ** 2, kernel_size=1) ...
GatedFusion
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 GatedFusion(nn.Module): """ Reference: - ACL2020, Document-Level Event Role Filler Extraction using Multi-Granularity Contextualized Encoding """ def __init__(self, n_in): super().__init__() self.n_in = n_in self.hidden2scalar1 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
qinyan-li/DocEE
GatedFusion
false
7,516
[ "MIT" ]
1
e8d2202a44907df5f12f9a67180d849a54421ab7
https://github.com/qinyan-li/DocEE/tree/e8d2202a44907df5f12f9a67180d849a54421ab7
import torch import torch.nn as nn class Model(nn.Module): """ Reference: - ACL2020, Document-Level Event Role Filler Extraction using Multi-Granularity Contextualized Encoding """ def __init__(self, n_in): super().__init__() self.n_in = n_in self.hidden2scalar1 = nn.L...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): """ Applies an attention mechanism on the output features from the decoder. 「A Structured Self-Attentive Sentence Embedding」 Paper https://arxiv.org/abs/1703.03130 .. math:: \\begin{array}{ll} ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
qute012/Korean-Speech-Recognition
Attention
false
7,517
[ "Apache-2.0" ]
1
0e037fd03df1ad6bf1084ee748781cdf4d428940
https://github.com/qute012/Korean-Speech-Recognition/tree/0e037fd03df1ad6bf1084ee748781cdf4d428940
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Applies an attention mechanism on the output features from the decoder. 「A Structured Self-Attentive Sentence Embedding」 Paper https://arxiv.org/abs/1703.03130 .. math:: \\begin{array}{ll} ...
L1
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch.nn as nn class L1(nn.Module): def __init__(self, eps=1e-06): super(L1, self).__init__() self.eps = eps def forward(self, x, target): diff = x - target return torch.mean(torch.sum(torch.sqrt(diff * diff + self.eps), (1, ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.utils.data import torch.nn as nn assert_size_stride = torch._C._dy...
qwopqwop200/Fast-Invertible-Rescaling-Net
L1
false
7,518
[ "MIT" ]
1
871733f2eee7929d6b37c4d1d6a27347b39b67a9
https://github.com/qwopqwop200/Fast-Invertible-Rescaling-Net/tree/871733f2eee7929d6b37c4d1d6a27347b39b67a9
import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self, eps=1e-06): super().__init__() self.eps = eps def forward(self, x, target): diff = x - target return torch.mean(torch.sum(torch.sqrt(diff * diff + self.eps), (1, ...
FullyConnected2
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 FullyConnected2(nn.Module): def __init__(self, hidden_size, output_size): super(FullyConnected2, self).__init__() self.lrelu = nn.LeakyReLU(0.1) self.linear_layer = nn.Linear(hidden_size, hidden_size, bias=True) self.linear_layer_1 = nn.Lin...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
qweas120/Active_VLN
FullyConnected2
false
7,519
[ "MIT" ]
1
d5dabd5fe6127bcfec023b90f14a4ba5ac671f9b
https://github.com/qweas120/Active_VLN/tree/d5dabd5fe6127bcfec023b90f14a4ba5ac671f9b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, hidden_size, output_size): super().__init__() self.lrelu = nn.LeakyReLU(0.1) self.linear_layer = nn.Linear(hidden_size, hidden_size, bias=True) self.linear_layer_1 = nn.Linear(hidden_size, output_size, b...
FullyConnected
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 FullyConnected(nn.Module): def __init__(self, hidden_size, output_size): super(FullyConnected, self).__init__() self.lrelu = nn.LeakyReLU(0.1) self.linear_layer = nn.Linear(hidden_size, output_size, bias=False) def forward(self, input): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
qweas120/Active_VLN
FullyConnected
false
7,520
[ "MIT" ]
1
d5dabd5fe6127bcfec023b90f14a4ba5ac671f9b
https://github.com/qweas120/Active_VLN/tree/d5dabd5fe6127bcfec023b90f14a4ba5ac671f9b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, hidden_size, output_size): super().__init__() self.lrelu = nn.LeakyReLU(0.1) self.linear_layer = nn.Linear(hidden_size, output_size, bias=False) def forward(self, input): out = self.lrelu(self.linea...
PA
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils.data import torch.nn as nn class PA(nn.Module): def __init__(self, nf): super(PA, self).__init__() self.conv = nn.Conv2d(nf, nf, 1) self.sigmoid = nn.Sigmoid() def forward(self, x): y = self.conv(x) y = self.sigmoid(y) out = tor...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn as nn assert_size_stride = torch._C._dyn...
qwopqwop200/Fast-Invertible-Rescaling-Net
PA
false
7,521
[ "MIT" ]
1
871733f2eee7929d6b37c4d1d6a27347b39b67a9
https://github.com/qwopqwop200/Fast-Invertible-Rescaling-Net/tree/871733f2eee7929d6b37c4d1d6a27347b39b67a9
import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self, nf): super().__init__() self.conv = nn.Conv2d(nf, nf, 1) self.sigmoid = nn.Sigmoid() def forward(self, x): y = self.conv(x) y = self.sigmoid(y) out = torch.mu...
TextureLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch.nn as nn import torch.nn.functional as F def gram_matrix(input): a, b, c, d = input.size() features = input.view(a, b, c * d) G = torch.bmm(features, torch.transpose(features, 1, 2)) return G.div(b * c * d) class TextureLoss(nn.Module): def __in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn as nn assert_size_stride = torch._C._dyn...
qwopqwop200/Fast-Invertible-Rescaling-Net
TextureLoss
false
7,522
[ "MIT" ]
1
871733f2eee7929d6b37c4d1d6a27347b39b67a9
https://github.com/qwopqwop200/Fast-Invertible-Rescaling-Net/tree/871733f2eee7929d6b37c4d1d6a27347b39b67a9
import torch import torch.utils.data import torch.nn as nn import torch.nn.functional as F def gram_matrix(input): a, b, c, d = input.size() features = input.view(a, b, c * d) G = torch.bmm(features, torch.transpose(features, 1, 2)) return G.div(b * c * d) class Model(nn.Module): def __init__(s...
Conv2dMtl
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import math import torch import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn.modules.module import Module from torch.nn.modules.utils import _pair class _ConvNdMtl(Module): def __init__(self, in_channels, out_channels, kernel_size, stride, pa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module import math from torch.nn.parameter import Parameter...
qianrusun1015/E3BM-1
Conv2dMtl
false
7,523
[ "Apache-2.0" ]
1
d2c957bdff66fe28a288f1518f224a1e034d543f
https://github.com/qianrusun1015/E3BM-1/tree/d2c957bdff66fe28a288f1518f224a1e034d543f
from torch.nn import Module import math import torch import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn.modules.module import Module from torch.nn.modules.utils import _pair class _ConvNdMtl(Module): def __init__(self, in_channels, out_channels, kernel_size, stride, pa...
L2
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch.nn as nn class L2(nn.Module): def __init__(self): super(L2, self).__init__() def forward(self, x, target): return torch.mean(torch.sum((x - target) ** 2, (1, 2, 3))) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
qwopqwop200/Fast-Invertible-Rescaling-Net
L2
false
7,524
[ "MIT" ]
1
871733f2eee7929d6b37c4d1d6a27347b39b67a9
https://github.com/qwopqwop200/Fast-Invertible-Rescaling-Net/tree/871733f2eee7929d6b37c4d1d6a27347b39b67a9
import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x, target): return torch.mean(torch.sum((x - target) ** 2, (1, 2, 3))) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]...
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 import torch.nn as nn import torch.nn.parallel class NoiseInjection(nn.Module): def __init__(self, channel): super().__init__() self.weight = nn.Parameter(0.01 * torch.randn(1, channel, 1, 1)) def forward(self, feat, noise=None): if noise is None: noise = tor...
import torch from torch import device import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.parallel assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
rakshithShetty/SemanticAdversary
NoiseInjection
false
7,526
[ "MIT" ]
1
e6d50f00af6f7d847cba4210613afea4be773254
https://github.com/rakshithShetty/SemanticAdversary/tree/e6d50f00af6f7d847cba4210613afea4be773254
import torch import torch.nn as nn import torch.nn.parallel class Model(nn.Module): def __init__(self, channel): super().__init__() self.weight = nn.Parameter(0.01 * torch.randn(1, channel, 1, 1)) def forward(self, feat, noise=None): if noise is None: noise = torch.randn(...
GaussianSmoothing
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import math import torch import torch.nn as nn import torch.nn.parallel class GaussianSmoothing(nn.Module): """ Apply gaussian smoothing on a 1d, 2d or 3d tensor. Filtering is performed seperately for each channel in the input using a depthwise convolution. Arguments: channels (int, sequen...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 assert_size_stride = ...
rakshithShetty/SemanticAdversary
GaussianSmoothing
false
7,528
[ "MIT" ]
1
e6d50f00af6f7d847cba4210613afea4be773254
https://github.com/rakshithShetty/SemanticAdversary/tree/e6d50f00af6f7d847cba4210613afea4be773254
import math import torch import torch.nn as nn import torch.nn.parallel class Model(nn.Module): """ Apply gaussian smoothing on a 1d, 2d or 3d tensor. Filtering is performed seperately for each channel in the input using a depthwise convolution. Arguments: channels (int, sequence): Number ...
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 import torch.nn.parallel import torch.utils.data import torch.distributions class TransformerEncoderLayer(nn.Module): def __init__(self, embed_dim, num_heads, hidden_size, dropout=0.0, attention_dropout=0.0, activation_dropout=0.0): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ptigas/EGG
TransformerEncoderLayer
false
7,529
[ "MIT" ]
1
5319cc9de2c17bc72de717737cfbb5be2285c59b
https://github.com/ptigas/EGG/tree/5319cc9de2c17bc72de717737cfbb5be2285c59b
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.utils.data import torch.distributions class Model(nn.Module): def __init__(self, embed_dim, num_heads, hidden_size, dropout=0.0, attention_dropout=0.0, activation_dropout=0.0): super().__init_...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.nn.functional as F def focal_loss(input_values, gamma): """Computes the focal loss""" p = torch.exp(-input_values) loss = (1 - p) ** gamma * input_values return loss.mean() class Focal...
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 ...
raman32/LDAM-DRW
FocalLoss
false
7,530
[ "MIT" ]
1
7ce2251c01b94c7259108a1e188457f0b720651d
https://github.com/raman32/LDAM-DRW/tree/7ce2251c01b94c7259108a1e188457f0b720651d
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.nn.functional as F def focal_loss(input_values, gamma): """Computes the focal loss""" p = torch.exp(-input_values) loss = (1 - p) ** gamma * input_values return loss.mean() class Model...
F_conv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import warnings import torch.nn as nn import torch.nn.functional as F class F_conv(nn.Module): """ResNet transformation, not itself reversible, just used below""" def __init__(self, in_channels, channels, channels_hidden=None, stride= None, kernel_size=3, leaky_slope=0.1, batch_norm=Fals...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 warnings import torch.nn as nn assert_size_stride = torch._C._dynamo.guar...
ramonpeter/LaSeR
F_conv
false
7,531
[ "MIT" ]
1
28daa6876256501ed0d3e84a4ddfedc7892bd528
https://github.com/ramonpeter/LaSeR/tree/28daa6876256501ed0d3e84a4ddfedc7892bd528
import torch import warnings import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ResNet transformation, not itself reversible, just used below""" def __init__(self, in_channels, channels, channels_hidden=None, stride= None, kernel_size=3, leaky_slope=0.1, batch_norm=False...
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 class Critic(torch.nn.Module): def __init__(self, critic_lr, critic_epochs): super(Critic, self).__init__() self.initialize_network() self.optimizer = torch.optim.Adam(lr=critic_lr, params=self. parameters()) self.loss = torch.nn.MSELoss() self.dev...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
Gregory-Eales/Proximal-Policy-Optimization
Critic
false
7,532
[ "Apache-2.0" ]
1
134f930bd1436c34e79af9344fe70f75e11c8a30
https://github.com/Gregory-Eales/Proximal-Policy-Optimization/tree/134f930bd1436c34e79af9344fe70f75e11c8a30
import torch class Model(torch.nn.Module): def __init__(self, critic_lr, critic_epochs): super().__init__() self.initialize_network() self.optimizer = torch.optim.Adam(lr=critic_lr, params=self. parameters()) self.loss = torch.nn.MSELoss() self.device = torch.d...
scaleCompositor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ResBlock(nn.Module): def __init__(self, in_ch, hid_ch): super(ResBlock, self).__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
qbhan/pathembed
scaleCompositor
false
7,533
[ "MIT" ]
1
c21823529840593bf606e10696f5879e5adb51b2
https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2
import torch import torch.nn as nn class ResBlock(nn.Module): def __init__(self, in_ch, hid_ch): super().__init__() self.act = nn.ReLU() self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=1) def forwar...
NormedLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.nn.functional as F from torch.nn import Parameter class NormedLinear(nn.Module): def __init__(self, in_features, out_features): super(NormedLinear, self).__init__() self.weight = Pa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
raman32/LDAM-DRW
NormedLinear
false
7,534
[ "MIT" ]
1
7ce2251c01b94c7259108a1e188457f0b720651d
https://github.com/raman32/LDAM-DRW/tree/7ce2251c01b94c7259108a1e188457f0b720651d
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.nn.functional as F from torch.nn import Parameter class Model(nn.Module): def __init__(self, in_features, out_features): super().__init__() self.weight = Parameter(torch.Tensor(in_f...
ParagraphPlanSelectionAttention
# 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.cuda import torch.distributed def aeq(*args): """ Assert all arguments have the same value """ arguments = (arg for arg in args) first = next(arguments) assert all(arg == first for arg in arguments ), 'Not ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ratishsp/data2text-seq-plan-py
ParagraphPlanSelectionAttention
false
7,535
[ "MIT" ]
1
16b5242903371280cae8d23ad5a2472d539ea744
https://github.com/ratishsp/data2text-seq-plan-py/tree/16b5242903371280cae8d23ad5a2472d539ea744
import torch import torch.nn as nn import torch.nn.functional as F import torch.cuda import torch.distributed def aeq(*args): """ Assert all arguments have the same value """ arguments = (arg for arg in args) first = next(arguments) assert all(arg == first for arg in arguments ), 'Not ...
GlobalAttentionContext
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.cuda import torch.distributed def aeq(*args): """ Assert all arguments have the same value """ arguments = (arg for arg in args) first = next(arguments) assert all(arg == first for arg in arguments ), 'Not ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ratishsp/data2text-seq-plan-py
GlobalAttentionContext
false
7,537
[ "MIT" ]
1
16b5242903371280cae8d23ad5a2472d539ea744
https://github.com/ratishsp/data2text-seq-plan-py/tree/16b5242903371280cae8d23ad5a2472d539ea744
import torch import torch.nn as nn import torch.nn.functional as F import torch.cuda import torch.distributed def aeq(*args): """ Assert all arguments have the same value """ arguments = (arg for arg in args) first = next(arguments) assert all(arg == first for arg in arguments ), 'Not ...
CCX_loss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch.nn as nn class CCX_loss(nn.Module): def __init__(self, eps=1e-06, h=0.5): super(CCX_loss, self).__init__() self.eps = eps self.h = h def forward(self, x, y): N, C, _H, _W = x.size() y_mu = y.mean(3).mean(2).mean(0).res...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
qwopqwop200/Fast-Invertible-Rescaling-Net
CCX_loss
false
7,538
[ "MIT" ]
1
871733f2eee7929d6b37c4d1d6a27347b39b67a9
https://github.com/qwopqwop200/Fast-Invertible-Rescaling-Net/tree/871733f2eee7929d6b37c4d1d6a27347b39b67a9
import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self, eps=1e-06, h=0.5): super().__init__() self.eps = eps self.h = h def forward(self, x, y): N, C, _H, _W = x.size() y_mu = y.mean(3).mean(2).mean(0).reshape(1, -1, 1, 1)...
DepthConv2dv2
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 from torch.autograd import Variable class tLN(nn.Module): def __init__(self, dimension, eps=1e-08, trainable=True): super(tLN, self).__init__() self.eps = eps if trainable: self.gain = nn.Parameter(torch.ones(1, dimension, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import numpy as np ...
rbodo/pytorch-OpCounter
DepthConv2dv2
false
7,539
[ "MIT" ]
1
1857cbb5f9e53343fb349af84efdfde2554a2691
https://github.com/rbodo/pytorch-OpCounter/tree/1857cbb5f9e53343fb349af84efdfde2554a2691
import torch import numpy as np import torch.nn as nn from torch.autograd import Variable class tLN(nn.Module): def __init__(self, dimension, eps=1e-08, trainable=True): super().__init__() self.eps = eps if trainable: self.gain = nn.Parameter(torch.ones(1, dimension, 1, 1)) ...
tLN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.autograd import Variable class tLN(nn.Module): def __init__(self, dimension, eps=1e-08, trainable=True): super(tLN, self).__init__() self.eps = eps if trainable: self.gain = nn.Parameter(torch.ones(1, dimension, 1, 1)) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn from torch.autograd import Variable assert_size_stride = ...
rbodo/pytorch-OpCounter
tLN
false
7,540
[ "MIT" ]
1
1857cbb5f9e53343fb349af84efdfde2554a2691
https://github.com/rbodo/pytorch-OpCounter/tree/1857cbb5f9e53343fb349af84efdfde2554a2691
import torch import torch.nn as nn from torch.autograd import Variable class Model(nn.Module): def __init__(self, dimension, eps=1e-08, trainable=True): super().__init__() self.eps = eps if trainable: self.gain = nn.Parameter(torch.ones(1, dimension, 1, 1)) self.bi...
LearnedKernel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 LearnedKernel(nn.Module): def __init__(self, args: 'Namespace'): super(LearnedKernel, self).__init__() self.A = nn.Linear(args.ffn_hidden_size, args.ffn_hidden_size) def forward(self, encodings: 'torch.Ten...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
AayushGrover/ViscaNet
LearnedKernel
false
7,541
[ "MIT" ]
1
41786e10b84f2264b638567bdce1c189c1b66b00
https://github.com/AayushGrover/ViscaNet/tree/41786e10b84f2264b638567bdce1c189c1b66b00
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): def __init__(self, args: 'Namespace'): super().__init__() self.A = nn.Linear(args.ffn_hidden_size, args.ffn_hidden_size) def forward(self, encodings: 'torch.Tensor'): return (self...
ProteinResNetPooler
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 ProteinResNetPooler(nn.Module): def __init__(self, config): super().__init__() self.attention_weights = nn.Linear(config.hidden_size, 1) self.dense = nn.Linear(config.hidden_size, config.hidden_size) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
rdedhia/tape
ProteinResNetPooler
false
7,542
[ "BSD-3-Clause" ]
1
421feeb589e4469fb18e297d233d12c1e682338a
https://github.com/rdedhia/tape/tree/421feeb589e4469fb18e297d233d12c1e682338a
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() self.attention_weights = nn.Linear(config.hidden_size, 1) self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.act...
Scale
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Scale(nn.Module): def __init__(self, num_features): super().__init__() self.num_features = num_features self.scale = nn.Parameter(torch.zeros(num_features)) self.register_buffer('saved_mean', torch.zeros(num_features)) self.register_...
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...
rgflowopen/rg-flow
Scale
false
7,543
[ "MIT" ]
1
f1ebb56e3e51bb26ecc2f10fe61eb34cae18398b
https://github.com/rgflowopen/rg-flow/tree/f1ebb56e3e51bb26ecc2f10fe61eb34cae18398b
import torch from torch import nn class Model(nn.Module): def __init__(self, num_features): super().__init__() self.num_features = num_features self.scale = nn.Parameter(torch.zeros(num_features)) self.register_buffer('saved_mean', torch.zeros(num_features)) self.register_...