entry_point
stringlengths
1
65
original_triton_python_code
stringlengths
208
619k
optimised_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
FTest
import torch import torch.nn as nn class FTest(nn.Module): def __init__(self): super(FTest, self).__init__() def forward(self, x, y): x = x - y - 8.3 return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
goldbattle/onnx2keras
FTest
false
12,461
[ "MIT" ]
0
dcf52041299ce4216552d1132ec86eb4debd5303
https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303
Linear
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn.modules.loss class Linear(Module): """ to embedding feature """ def __init__(self, in_features, out_features, dropout=0.0, act=F...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module i...
goodman1204/CAN-pytorch
Linear
false
12,462
[ "MIT" ]
0
73d9486c93dd069101c750f94a0750fff0500abb
https://github.com/goodman1204/CAN-pytorch/tree/73d9486c93dd069101c750f94a0750fff0500abb
FTanhTest
import torch import torch.nn as nn class FTanhTest(nn.Module): """ Test for nn.functional types """ def __init__(self): super(FTanhTest, self).__init__() def forward(self, x): from torch.nn import functional as F return F.tanh(x) def get_inputs(): return [torch.rand...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
goldbattle/onnx2keras
FTanhTest
false
12,463
[ "MIT" ]
0
dcf52041299ce4216552d1132ec86eb4debd5303
https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303
FSELUTest
import torch import torch.nn as nn class FSELUTest(nn.Module): """ Test for nn.functional types """ def __init__(self): super(FSELUTest, self).__init__() def forward(self, x): from torch.nn import functional as F return F.selu(x) def get_inputs(): return [torch.rand...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
goldbattle/onnx2keras
FSELUTest
false
12,464
[ "MIT" ]
0
dcf52041299ce4216552d1132ec86eb4debd5303
https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303
HouseHolderFlow
import torch import torch.utils.data import torch.nn as nn class HouseHolderFlow(nn.Module): def forward(self, v, z): """ :param v: batch_size (B) x latent_size (L) :param z: batch_size (B) x latent_size (L) :return: z_new = z - 2* v v_T / norm(v,2) * z """ vvT = t...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn as nn assert_size_stride = torch._C._dyn...
gpoesia/variational-item-response-theory-public
HouseHolderFlow
false
12,465
[ "MIT" ]
0
6a0db81068695422dddec8832ce353879c5acb82
https://github.com/gpoesia/variational-item-response-theory-public/tree/6a0db81068695422dddec8832ce353879c5acb82
Critic
import torch import torch.nn as nn import torch.nn.functional as F class Critic(nn.Module): def __init__(self, hidden_size, num_inputs, action_space): super(Critic, self).__init__() self.action_space = action_space num_outputs = action_space.shape[0] self.linear1 = nn.Linear(num_i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
gntoni/pytorch-ddpg-naf
Critic
false
12,466
[ "MIT" ]
0
d208d0c0c38a9d2d2041f1e7e95695359eba430e
https://github.com/gntoni/pytorch-ddpg-naf/tree/d208d0c0c38a9d2d2041f1e7e95695359eba430e
ItemInferenceNetwork
import torch import torch.utils.data import torch.nn as nn class ItemInferenceNetwork(nn.Module): def __init__(self, num_item, item_feat_dim): super().__init__() self.mu_lookup = nn.Embedding(num_item, item_feat_dim) self.logvar_lookup = nn.Embedding(num_item, item_feat_dim) def forw...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
gpoesia/variational-item-response-theory-public
ItemInferenceNetwork
false
12,467
[ "MIT" ]
0
6a0db81068695422dddec8832ce353879c5acb82
https://github.com/gpoesia/variational-item-response-theory-public/tree/6a0db81068695422dddec8832ce353879c5acb82
KLDivergence
import torch import torch.nn.functional as F import torch.nn as nn import torch.optim def kl_divergence(y, target, mask=None, reduce=True): loss = (target * torch.log(target) - target * F.log_softmax(y, 1)).sum(1) if mask is not None: loss = mask * loss if reduce: return loss.mean() el...
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.functi...
gsaiabhishek/AUTOMATA
KLDivergence
false
12,468
[ "MIT" ]
0
e944992a7bf3a50bc8951a303294b3a798822176
https://github.com/gsaiabhishek/AUTOMATA/tree/e944992a7bf3a50bc8951a303294b3a798822176
CrossEntropy
import torch from torch.nn.functional import cross_entropy import torch.nn as nn import torch.optim class CrossEntropy(nn.Module): def __init__(self, reduce): super().__init__() self.reduce = reduce def forward(self, y, target, mask=None, *args, **kwargs): return cross_entropy(y, tar...
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 ...
gsaiabhishek/AUTOMATA
CrossEntropy
false
12,469
[ "MIT" ]
0
e944992a7bf3a50bc8951a303294b3a798822176
https://github.com/gsaiabhishek/AUTOMATA/tree/e944992a7bf3a50bc8951a303294b3a798822176
Copy
import torch from torch import nn class Copy(nn.Module): def __init__(self, hidden_size, copy_weight=1.0): """Calculate copy attention""" super().__init__() self.Wcopy = nn.Linear(hidden_size, hidden_size) self.copy_weight = copy_weight def forward(self, enc_out_hs, dec_hs): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
gusalsdmlwlq/DAMD
Copy
false
12,470
[ "Apache-2.0" ]
0
e98feaf5d9f251132e655bbc5fdb2c080cbed90e
https://github.com/gusalsdmlwlq/DAMD/tree/e98feaf5d9f251132e655bbc5fdb2c080cbed90e
Actor
import torch import torch.nn as nn import torch.nn.functional as F class Actor(nn.Module): def __init__(self, hidden_size, num_inputs, action_space): super(Actor, self).__init__() self.action_space = action_space num_outputs = action_space.shape[0] self.linear1 = nn.Linear(num_inp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
gntoni/pytorch-ddpg-naf
Actor
false
12,471
[ "MIT" ]
0
d208d0c0c38a9d2d2041f1e7e95695359eba430e
https://github.com/gntoni/pytorch-ddpg-naf/tree/d208d0c0c38a9d2d2041f1e7e95695359eba430e
Baseline
import torch import torch.utils import torch.utils.data import torch.nn as nn import torch.nn.functional as F from torch.nn import init class Baseline(nn.Module): """ Baseline network """ @staticmethod def weight_init(m): if isinstance(m, nn.Linear): init.kaiming_normal_(m.wei...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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.utils import tor...
dikers/DeepHyper
Baseline
false
12,472
[ "Apache-2.0" ]
0
827a8f3077e18b71cf448a2e56e49670428b1bfd
https://github.com/dikers/DeepHyper/tree/827a8f3077e18b71cf448a2e56e49670428b1bfd
Network
import torch import torch.nn.functional as F from torch import nn class Network(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, seed, fc1_units=128, fc2_units=128): """Initialize parameters and build model. Params ====== state_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
gray-li/HalfRainbowDQN
Network
false
12,473
[ "MIT" ]
0
43e2b12945c14e0e39eea3bbf56c7af785c48720
https://github.com/gray-li/HalfRainbowDQN/tree/43e2b12945c14e0e39eea3bbf56c7af785c48720
Attn
import torch import torch.nn.functional as F from torch import nn class Attn(nn.Module): def __init__(self, hidden_size): super().__init__() self.hidden_size = hidden_size self.attn = nn.Linear(self.hidden_size * 2, hidden_size) self.v = nn.Linear(hidden_size, 1, bias=False) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
gusalsdmlwlq/DAMD
Attn
false
12,474
[ "Apache-2.0" ]
0
e98feaf5d9f251132e655bbc5fdb2c080cbed90e
https://github.com/gusalsdmlwlq/DAMD/tree/e98feaf5d9f251132e655bbc5fdb2c080cbed90e
MedianPool2d
import torch import torch.optim import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.utils import _pair from torch.nn.modules.utils import _quadruple class MedianPool2d(nn.Module): """ Median pool (usable as median filter when stride=1) module. Args: kernel_size: size of pooli...
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.optim import torch.nn as nn from torch.nn.modules.utils impo...
guzor/rgdb-semantic-segmentation
MedianPool2d
false
12,475
[ "MIT" ]
0
d9f3d8f1b2cb7357f64914bb873513dd16fad6df
https://github.com/guzor/rgdb-semantic-segmentation/tree/d9f3d8f1b2cb7357f64914bb873513dd16fad6df
PlanarFlow
import torch import torch.utils.data import torch.nn as nn import torch.nn.functional as F class PlanarFlow(nn.Module): """Planar normalizing flow [Rezende & Mohamed 2015]. Provides a tighter bound on the ELBO by giving more expressive power to the approximate distribution, such as by introducing cova...
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.utils.data import torch.nn as nn assert_size_stri...
gpoesia/variational-item-response-theory-public
PlanarFlow
false
12,476
[ "MIT" ]
0
6a0db81068695422dddec8832ce353879c5acb82
https://github.com/gpoesia/variational-item-response-theory-public/tree/6a0db81068695422dddec8832ce353879c5acb82
CharbonnierLoss
import functools import torch import torch.nn as nn from torch.nn import functional as F def reduce_loss(loss, reduction): """Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "mean" and "sum". Returns: Tensor: Reduced lo...
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 functools import torc...
hejm37/mmediting
CharbonnierLoss
false
12,477
[ "Apache-2.0" ]
0
d4086aaf8a36ae830f1714aad585900d24ad1156
https://github.com/hejm37/mmediting/tree/d4086aaf8a36ae830f1714aad585900d24ad1156
Conv2dWithConstraint
import torch from torch import nn class Conv2dWithConstraint(nn.Conv2d): def __init__(self, *args, max_norm=1, **kwargs): self.max_norm = max_norm super(Conv2dWithConstraint, self).__init__(*args, **kwargs) def forward(self, x): self.weight.data = torch.renorm(self.weight.data, p=2, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
gzoumpourlis/braindecode
Conv2dWithConstraint
false
12,478
[ "BSD-3-Clause" ]
0
6bd595a146d0854541ff02b4483c011a394fdf0a
https://github.com/gzoumpourlis/braindecode/tree/6bd595a146d0854541ff02b4483c011a394fdf0a
MeanSquared
import torch import torch.nn.functional as F import torch.nn as nn import torch.optim def mean_squared(y, target, mask=None, reduce=True): y = y.softmax(1) loss = F.mse_loss(y, target, reduction='none').mean(1) if mask is not None: loss = mask * loss if reduce: return loss.mean() e...
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.functi...
gsaiabhishek/AUTOMATA
MeanSquared
false
12,479
[ "MIT" ]
0
e944992a7bf3a50bc8951a303294b3a798822176
https://github.com/gsaiabhishek/AUTOMATA/tree/e944992a7bf3a50bc8951a303294b3a798822176
Net
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.fc1 = nn.Linear(28 * 28, 64) self.fc2 = nn.Linear(64, 24) self.fc3 = nn.Linear(24, 10) def forward(self, x): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
graciofilipe/deep-learning-v2-pytorch
Net
false
12,480
[ "MIT" ]
0
b1aa2189c99ecd1b79deb6c499bae9d1fa52fa19
https://github.com/graciofilipe/deep-learning-v2-pytorch/tree/b1aa2189c99ecd1b79deb6c499bae9d1fa52fa19
DiscShiftLoss
import torch import torch.nn as nn class DiscShiftLoss(nn.Module): """Disc shift loss. Args: loss_weight (float, optional): Loss weight. Defaults to 1.0. """ def __init__(self, loss_weight=0.1): super(DiscShiftLoss, self).__init__() self.loss_weight = loss_weight ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
hejm37/mmediting
DiscShiftLoss
false
12,481
[ "Apache-2.0" ]
0
d4086aaf8a36ae830f1714aad585900d24ad1156
https://github.com/hejm37/mmediting/tree/d4086aaf8a36ae830f1714aad585900d24ad1156
TwoLayerNet
import torch import torch.quantization import torch.onnx import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class TwoLayerNet(torch.nn.Module): def __init__(self, D_in, H, D_out): """ In the constructor we instantiate two nn.Linear modules and ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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.quantization imp...
harrydrippin/tutorials
TwoLayerNet
false
12,482
[ "BSD-3-Clause" ]
0
a8def2dfd44b4b8e22c36a3e4470f37b59ebedfb
https://github.com/harrydrippin/tutorials/tree/a8def2dfd44b4b8e22c36a3e4470f37b59ebedfb
CharbonnierCompLoss
import functools import torch import torch.nn as nn from torch.nn import functional as F def reduce_loss(loss, reduction): """Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "mean" and "sum". Returns: Tensor: Reduced lo...
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 functools import torc...
hejm37/mmediting
CharbonnierCompLoss
false
12,483
[ "Apache-2.0" ]
0
d4086aaf8a36ae830f1714aad585900d24ad1156
https://github.com/hejm37/mmediting/tree/d4086aaf8a36ae830f1714aad585900d24ad1156
SoftCrossEntropyLoss2d
import torch import torch.nn as nn import torch.nn.functional as F class SoftCrossEntropyLoss2d(nn.Module): def __init__(self): super(SoftCrossEntropyLoss2d, self).__init__() def forward(self, inputs, targets): loss = 0 inputs = -F.log_softmax(inputs, dim=1) for index in rang...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
hainguyen15/GLNet
SoftCrossEntropyLoss2d
false
12,484
[ "MIT" ]
0
dc5d2d000a37e9415f742ed04b7e99973a068279
https://github.com/hainguyen15/GLNet/tree/dc5d2d000a37e9415f742ed04b7e99973a068279
L1CompositionLoss
import functools import torch import torch.nn as nn from torch.nn import functional as F def reduce_loss(loss, reduction): """Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "mean" and "sum". Returns: Tensor: Reduced lo...
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 functools impor...
hejm37/mmediting
L1CompositionLoss
false
12,485
[ "Apache-2.0" ]
0
d4086aaf8a36ae830f1714aad585900d24ad1156
https://github.com/hejm37/mmediting/tree/d4086aaf8a36ae830f1714aad585900d24ad1156
Net
import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self, _input_size: 'int', _output_size: 'int', _hidden_layers: 'int', _hidden_size: 'int'): super(Net, self).__init__() self.input = nn.Linear(_input_size, _hidden_size) self.hidd...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
hantonelli/AprendizajePorRefuerzos
Net
false
12,486
[ "MIT" ]
0
eeffa4aa36fa5c14739206e4c4bd0a1bd76f6af1
https://github.com/hantonelli/AprendizajePorRefuerzos/tree/eeffa4aa36fa5c14739206e4c4bd0a1bd76f6af1
PlainRefiner
import torch import torch.nn as nn class PlainRefiner(nn.Module): """Simple refiner from Deep Image Matting. Args: conv_channels (int): Number of channels produced by the three main convolutional layer. loss_refine (dict): Config of the loss of the refiner. Default: None. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
hejm37/mmediting
PlainRefiner
false
12,487
[ "Apache-2.0" ]
0
d4086aaf8a36ae830f1714aad585900d24ad1156
https://github.com/hejm37/mmediting/tree/d4086aaf8a36ae830f1714aad585900d24ad1156
VarianceNorm2d
import torch import torch.nn as nn class VarianceNorm2d(nn.Module): def __init__(self, num_features, bias=False): super().__init__() self.num_features = num_features self.bias = bias self.alpha = nn.Parameter(torch.zeros(num_features)) self.alpha.data.normal_(1, 0.02) ...
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_...
henryaddison/score_sde_pytorch
VarianceNorm2d
false
12,488
[ "Apache-2.0" ]
0
be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
https://github.com/henryaddison/score_sde_pytorch/tree/be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
GRelu
import torch import torch.nn as nn import torch.nn.functional as F class GRelu(nn.Module): """Generic ReLU.""" def __init__(self, leak=0.0, max=float('inf'), sub=0.0): super().__init__() self.leak = leak self.max = max self.sub = sub def forward(self, x): """Check...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
hdmamin/ml_htools
GRelu
false
12,489
[ "MIT" ]
0
9b8e8fbb561c4ae7c6ee282c8b5fc7876935dd50
https://github.com/hdmamin/ml_htools/tree/9b8e8fbb561c4ae7c6ee282c8b5fc7876935dd50
MeanPoolConv
import torch import torch.nn as nn class MeanPoolConv(nn.Module): def __init__(self, input_dim, output_dim, kernel_size=3, biases=True): super().__init__() self.conv = nn.Conv2d(input_dim, output_dim, kernel_size, stride=1, padding=kernel_size // 2, bias=biases) def forward(self,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
henryaddison/score_sde_pytorch
MeanPoolConv
false
12,490
[ "Apache-2.0" ]
0
be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
https://github.com/henryaddison/score_sde_pytorch/tree/be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
Mnist_CNN
import torch import torch.nn as nn import torch.nn.functional as F import torch.quantization import torch.onnx import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class Mnist_CNN(nn.Module): def __init__(self): super().__init__() self.conv1 = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
harrydrippin/tutorials
Mnist_CNN
false
12,491
[ "BSD-3-Clause" ]
0
a8def2dfd44b4b8e22c36a3e4470f37b59ebedfb
https://github.com/harrydrippin/tutorials/tree/a8def2dfd44b4b8e22c36a3e4470f37b59ebedfb
AttentionPool2d
import torch import torch.nn.functional as F from torch import nn class AttentionPool2d(nn.Module): def __init__(self, spacial_dim: 'int', embed_dim: 'int', num_heads: 'int', output_dim: 'int'=None): super().__init__() self.positional_embedding = nn.Parameter(torch.randn(spacial_dim ** ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
graceduansu/CLIP
AttentionPool2d
false
12,492
[ "MIT" ]
0
14605e2118f43312cc00bf549aec388f5ddf802b
https://github.com/graceduansu/CLIP/tree/14605e2118f43312cc00bf549aec388f5ddf802b
QREmbeddingBag
import torch import numpy as np import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch.nn.functional as F from torch.nn.parameter import Parameter class QREmbeddingBag(nn.Module): """Computes sums or means over two 'bags' of embed...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import numpy as np import torch.nn as nn import torch.nn.parallel import torch....
hekaplex/resnet_dl
QREmbeddingBag
false
12,493
[ "Apache-2.0" ]
0
fc8d4dcc0adffbe22d01d333e6cf5db955f2f011
https://github.com/hekaplex/resnet_dl/tree/fc8d4dcc0adffbe22d01d333e6cf5db955f2f011
SRCNN
import logging import torch import torch.nn as nn def get_root_logger(log_file=None, log_level=logging.INFO): """Get the root logger. The logger will be initialized if it has not been initialized. By default a StreamHandler will be added. If `log_file` is specified, a FileHandler will also be added. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
hejm37/mmediting
SRCNN
false
12,494
[ "Apache-2.0" ]
0
d4086aaf8a36ae830f1714aad585900d24ad1156
https://github.com/hejm37/mmediting/tree/d4086aaf8a36ae830f1714aad585900d24ad1156
MLP
import torch from torch import nn import torch.nn.functional as F from torch.utils.data import * class MLP(nn.Module): def __init__(self): super(MLP, self).__init__() self.fc1 = nn.Linear(784, 512) self.fc2 = nn.Linear(512, 128) self.fc3 = nn.Linear(128, 10) def forward(self,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
heheda12345/nnfusion
MLP
false
12,495
[ "MIT" ]
0
8cf153c1adae094fa891021bd6da70aeeee112ba
https://github.com/heheda12345/nnfusion/tree/8cf153c1adae094fa891021bd6da70aeeee112ba
Conv2dBlock
import torch import torch.nn.functional as F from torch import nn class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super(AdaptiveInstanceNorm2d, self).__init__() self.num_features = num_features self.eps = eps self.momentum = mome...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn.functional as...
hendraet/research-GANwriting
Conv2dBlock
false
12,496
[ "MIT" ]
0
e62a16529db3037169d9b33ecba5735c99e73bc3
https://github.com/hendraet/research-GANwriting/tree/e62a16529db3037169d9b33ecba5735c99e73bc3
MatrixConv2dResblock
import torch import torch.nn as nn import torch.autograd class MatrixConv2dResblock(nn.Module): def __init__(self, weight_shape, stride=1, padding=0, with_batchnorm= False, act_func='ReLU'): super(MatrixConv2dResblock, self).__init__() self.conv = nn.Conv2d(weight_shape[3], weight_shape[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 import torch.nn as nn import ...
hirayamy/nngen
MatrixConv2dResblock
false
12,497
[ "Apache-2.0" ]
0
63f72be83e4bb1a697a969fb6a14d0335ec0316f
https://github.com/hirayamy/nngen/tree/63f72be83e4bb1a697a969fb6a14d0335ec0316f
ActFirstResBlock
import torch import torch.nn.functional as F from torch import nn class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super(AdaptiveInstanceNorm2d, self).__init__() self.num_features = num_features self.eps = eps self.momentum = mome...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
hendraet/research-GANwriting
ActFirstResBlock
false
12,498
[ "MIT" ]
0
e62a16529db3037169d9b33ecba5735c99e73bc3
https://github.com/hendraet/research-GANwriting/tree/e62a16529db3037169d9b33ecba5735c99e73bc3
UpsampleConv
import torch import torch.nn as nn class UpsampleConv(nn.Module): def __init__(self, input_dim, output_dim, kernel_size=3, biases=True): super().__init__() self.conv = nn.Conv2d(input_dim, output_dim, kernel_size, stride=1, padding=kernel_size // 2, bias=biases) self.pixelshuf...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
henryaddison/score_sde_pytorch
UpsampleConv
false
12,499
[ "Apache-2.0" ]
0
be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
https://github.com/henryaddison/score_sde_pytorch/tree/be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
InstanceNorm2dPlus
import torch import torch.nn as nn class InstanceNorm2dPlus(nn.Module): def __init__(self, num_features, bias=True): super().__init__() self.num_features = num_features self.bias = bias self.instance_norm = nn.InstanceNorm2d(num_features, affine=False, track_running_st...
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_...
henryaddison/score_sde_pytorch
InstanceNorm2dPlus
false
12,500
[ "Apache-2.0" ]
0
be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
https://github.com/henryaddison/score_sde_pytorch/tree/be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
MatrixAdd
import torch import torch.nn as nn import torch.autograd class MatrixAdd(nn.Module): def __init__(self): super(MatrixAdd, self).__init__() def forward(self, x, y): z = torch.add(x, y) return z def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def g...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.autograd assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._d...
hirayamy/nngen
MatrixAdd
false
12,501
[ "Apache-2.0" ]
0
63f72be83e4bb1a697a969fb6a14d0335ec0316f
https://github.com/hirayamy/nngen/tree/63f72be83e4bb1a697a969fb6a14d0335ec0316f
MSECompositionLoss
import functools import torch import torch.nn as nn from torch.nn import functional as F def reduce_loss(loss, reduction): """Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "mean" and "sum". Returns: Tensor: Reduced lo...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import functools import torch.nn as nn from torch.nn import functional as F assert_size_s...
hejm37/mmediting
MSECompositionLoss
false
12,502
[ "Apache-2.0" ]
0
d4086aaf8a36ae830f1714aad585900d24ad1156
https://github.com/hejm37/mmediting/tree/d4086aaf8a36ae830f1714aad585900d24ad1156
ConvMeanPool
import torch import torch.nn as nn class ConvMeanPool(nn.Module): def __init__(self, input_dim, output_dim, kernel_size=3, biases=True, adjust_padding=False): super().__init__() if not adjust_padding: conv = nn.Conv2d(input_dim, output_dim, kernel_size, stride=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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
henryaddison/score_sde_pytorch
ConvMeanPool
false
12,503
[ "Apache-2.0" ]
0
be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
https://github.com/henryaddison/score_sde_pytorch/tree/be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
MatrixConv2dMultiResblock
import torch import torch.nn as nn import torch.autograd class MatrixConv2dMultiResblock(nn.Module): def __init__(self, weight_shape, stride=1, padding=0, with_batchnorm= False, act_func='ReLU'): super(MatrixConv2dMultiResblock, self).__init__() self.conv1 = nn.Conv2d(weight_shape[3], wei...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
hirayamy/nngen
MatrixConv2dMultiResblock
false
12,504
[ "Apache-2.0" ]
0
63f72be83e4bb1a697a969fb6a14d0335ec0316f
https://github.com/hirayamy/nngen/tree/63f72be83e4bb1a697a969fb6a14d0335ec0316f
Conv2d
from torch.autograd import Function import torch import numpy as np import torch.nn as nn import torch.nn.functional as F def _setup_kernel(k): k = np.asarray(k, dtype=np.float32) if k.ndim == 1: k = np.outer(k, k) k /= np.sum(k) assert k.ndim == 2 assert k.shape[0] == k.shape[1] retur...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.autograd import Function import numpy as np import torch.nn as nn imp...
henryaddison/score_sde_pytorch
Conv2d
false
12,505
[ "Apache-2.0" ]
0
be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
https://github.com/henryaddison/score_sde_pytorch/tree/be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
FPNSegHead
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data class FPNSegHead(nn.Module): def __init__(self, num_in, num_mid, num_out): super().__init__() self.block0 = nn.Conv2d(num_in, num_mid, kernel_size=3, padding=1, bias=False) s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
hoangnguyen11291/Kuril-DeBlur
FPNSegHead
false
12,506
[ "BSD-3-Clause" ]
0
7c36fc50780e3dda82eb42443d5623d34e6b02a6
https://github.com/hoangnguyen11291/Kuril-DeBlur/tree/7c36fc50780e3dda82eb42443d5623d34e6b02a6
ResidualBlock
import torch import torch.nn as nn from functools import partial def ncsn_conv3x3(in_planes, out_planes, stride=1, bias=True, dilation=1, init_scale=1.0, padding=1): """3x3 convolution with PyTorch initialization. Same as NCSNv1/NCSNv2.""" init_scale = 1e-10 if init_scale == 0 else init_scale conv = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
henryaddison/score_sde_pytorch
ResidualBlock
false
12,507
[ "Apache-2.0" ]
0
be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
https://github.com/henryaddison/score_sde_pytorch/tree/be07c3a3346bf8ceadabf6a3b436db5d5c3d0252
Net
import torch import torch.nn.functional as F import torch.nn as nn class Net(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 16, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(16, 8, kernel_size=3, padding=1) self.fc1 = nn.Linear(8 * 8 * 8, 32) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
hishamelreedy/Aucrobotics_QA_AutonomousInspector
Net
false
12,508
[ "MIT" ]
0
6bad141a62827fa7a299325c69597f17b162400e
https://github.com/hishamelreedy/Aucrobotics_QA_AutonomousInspector/tree/6bad141a62827fa7a299325c69597f17b162400e
CoordConv
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): """ Args: input_tensor: shape(batch, channel, x_dim, y_dim) """ batch_size, _,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
hoseDUDEface/AdaptiveWingLoss
CoordConv
false
12,509
[ "Apache-2.0" ]
0
9185799d87567044f437147639c3999418529684
https://github.com/hoseDUDEface/AdaptiveWingLoss/tree/9185799d87567044f437147639c3999418529684
FC_Q
import torch import torch.nn as nn import torch.nn.functional as F class FC_Q(nn.Module): def __init__(self, state_dim, num_actions): super(FC_Q, self).__init__() self.q1 = nn.Linear(state_dim, 256) self.q2 = nn.Linear(256, 256) self.q3 = nn.Linear(256, num_actions) 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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
hotaekjoo/SQV
FC_Q
false
12,510
[ "MIT" ]
0
d725342e7fd8548ee5fa018e5ccac4542969deed
https://github.com/hotaekjoo/SQV/tree/d725342e7fd8548ee5fa018e5ccac4542969deed
InstanceNormLayer
import torch import torch.nn as nn class InstanceNormLayer(nn.Module): """Implements instance normalization layer.""" def __init__(self, epsilon=1e-08): super().__init__() self.eps = 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_...
huaji0353/higan
InstanceNormLayer
false
12,511
[ "MIT" ]
0
a082dc2be8651725d38b8d48d7e1c7261740013d
https://github.com/huaji0353/higan/tree/a082dc2be8651725d38b8d48d7e1c7261740013d
AddCoords
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): """ Args: input_tensor: shape(batch, channel, x_dim, y_dim) """ batch_size, _,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
hoseDUDEface/AdaptiveWingLoss
AddCoords
false
12,512
[ "Apache-2.0" ]
0
9185799d87567044f437147639c3999418529684
https://github.com/hoseDUDEface/AdaptiveWingLoss/tree/9185799d87567044f437147639c3999418529684
GE2ELoss
import torch import torch.nn.functional as F import torch.nn as nn def calc_loss(sim_matrix): same_idx = list(range(sim_matrix.size(0))) pos = sim_matrix[same_idx, :, same_idx] neg = (torch.exp(sim_matrix).sum(dim=2) + 1e-06).log_() per_embedding_loss = -1 * (pos - neg) loss = per_embedding_loss.s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
helia95/SpeakerRecognition_tutorial
GE2ELoss
false
12,513
[ "MIT" ]
0
5c00f9165fd260d50b74ab46e4d81d7cfd77ab8c
https://github.com/helia95/SpeakerRecognition_tutorial/tree/5c00f9165fd260d50b74ab46e4d81d7cfd77ab8c
GraphConv
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class GraphConv(nn.Module): def __init__(self, input_dim, output_dim, add_self=False, normalize_embedding=False, dropout=0.0, bias=True): super(GraphConv, self).__init__() self.add_self = add_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 import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dyn...
hujilin1229/diffpool
GraphConv
false
12,514
[ "MIT" ]
0
5b9bd73d794b63f5ea6d48e60cba090aa6e3ce72
https://github.com/hujilin1229/diffpool/tree/5b9bd73d794b63f5ea6d48e60cba090aa6e3ce72
BinaryLoss
import torch import torch.nn as nn import torch.nn.functional as F class BinaryLoss(nn.Module): def __init__(self): super(BinaryLoss, self).__init__() def forward(self, pos_score, neg_score): pos_loss = -F.log_softmax(pos_score)[:, 1] neg_loss = -F.log_softmax(neg_score)[:, 0] ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
huanglianghua/mdnet-light
BinaryLoss
false
12,515
[ "MIT" ]
0
955b61b8555a49fdf2e2310aa0756c68f955212c
https://github.com/huanglianghua/mdnet-light/tree/955b61b8555a49fdf2e2310aa0756c68f955212c
WeightedTVLoss
import functools import torch from torch import nn as nn from torch.nn import functional as F from torch.nn import init as init from torchvision.models import vgg as vgg import torch.utils.data from torch.utils import data as data from torch import autograd as autograd def reduce_loss(loss, reduction): """Reduce ...
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 functools from torch import nn as nn from torch.nn import function...
hyunobae/BasicSR
WeightedTVLoss
false
12,516
[ "Apache-2.0" ]
0
f2c2fc6cf28933658816c808f55c95fa20b16483
https://github.com/hyunobae/BasicSR/tree/f2c2fc6cf28933658816c808f55c95fa20b16483
PARALoss
import torch import torch.nn as nn import torch.nn.functional as F class PARALoss(nn.Module): """ Softmax classifier for sentence-level relation extraction. """ def __init__(self): """ Args: sentence_encoder: encoder for sentences num_class: number of classes ...
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...
igorvlnascimento/open-nre
PARALoss
false
12,517
[ "MIT" ]
0
a6e42ef074d62be4d3ceb571f412d5be8c0502d7
https://github.com/igorvlnascimento/open-nre/tree/a6e42ef074d62be4d3ceb571f412d5be8c0502d7
FeedForward
import torch import torch.utils.data import torch.nn as nn from torch.nn.functional import relu from torch.nn.functional import dropout class FeedForward(nn.Module): def __init__(self, input_size): super(FeedForward, self).__init__() self.fc1 = nn.Linear(input_size, 16) self.fc2 = nn.Line...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.utils.data impor...
ibraheem-moosa/protein-bvalue-prediction
FeedForward
false
12,518
[ "MIT" ]
0
9d0607ade30d8877ea89c5f24184d3af0580f912
https://github.com/ibraheem-moosa/protein-bvalue-prediction/tree/9d0607ade30d8877ea89c5f24184d3af0580f912
SoftGate
import torch from torch import nn as nn from torch.nn import init as init from torchvision.models import vgg as vgg import torch.utils.data from torch.utils import data as data from torch import autograd as autograd class SoftGate(nn.Module): COEFF = 12.0 def forward(self, x): return torch.sigmoid(x)...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn as nn from torch.nn import init as init from torchvision.models import vgg as vgg import torch.utils.data from torch.ut...
hyunobae/BasicSR
SoftGate
false
12,519
[ "Apache-2.0" ]
0
f2c2fc6cf28933658816c808f55c95fa20b16483
https://github.com/hyunobae/BasicSR/tree/f2c2fc6cf28933658816c808f55c95fa20b16483
ResUnit
import torch import torch.nn as nn class ResUnit(nn.Module): def __init__(self, ksize=3, wkdim=64): super(ResUnit, self).__init__() self.conv1 = nn.Conv2d(wkdim, wkdim, ksize, 1, int(ksize / 2)) self.active = nn.PReLU() self.conv2 = nn.Conv2d(wkdim, wkdim, ksize, 1, int(ksize / 2)...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
huang-junhong/SIRSRGAN
ResUnit
false
12,520
[ "Apache-2.0" ]
0
a774416cd45a00982141a1571cb2a8a18bb05c86
https://github.com/huang-junhong/SIRSRGAN/tree/a774416cd45a00982141a1571cb2a8a18bb05c86
MultiHeadAttention
import torch import numpy as np class MultiHeadAttention(torch.nn.Module): def __init__(self, input_size, output_size, num_heads, output_attentions=False): super(MultiHeadAttention, self).__init__() self.output_attentions = output_attentions self.num_heads = num_heads 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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
igorvlnascimento/open-nre
MultiHeadAttention
false
12,521
[ "MIT" ]
0
a6e42ef074d62be4d3ceb571f412d5be8c0502d7
https://github.com/igorvlnascimento/open-nre/tree/a6e42ef074d62be4d3ceb571f412d5be8c0502d7
TLU
import torch from torch import nn class TLU(nn.Module): def __init__(self, num_features): """max(y, tau) = max(y - tau, 0) + tau = ReLU(y - tau) + tau""" super(TLU, self).__init__() self.num_features = num_features self.tau = nn.parameter.Parameter(torch.Tensor(1, num_features, 1,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
ildoonet/pytorch-filter-response-norm
TLU
false
12,522
[ "MIT" ]
0
e6885f2b2272fa6cde0a131d3b3a0e42b8c6d579
https://github.com/ildoonet/pytorch-filter-response-norm/tree/e6885f2b2272fa6cde0a131d3b3a0e42b8c6d579
MobileBertSelfAttention
from _paritybench_helpers import _mock_config import math import torch from torch import nn import torch.utils.checkpoint class MobileBertSelfAttention(nn.Module): def __init__(self, config): super().__init__() self.num_attention_heads = config.num_attention_heads self.attention_head_size...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Clemens123/transformers
MobileBertSelfAttention
false
12,523
[ "Apache-2.0" ]
0
22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
GANFeatLoss
import functools import torch from torch import nn as nn from torch.nn import functional as F from torch.nn import init as init from torchvision.models import vgg as vgg import torch.utils.data from torch.utils import data as data from torch import autograd as autograd def reduce_loss(loss, reduction): """Reduce ...
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 functools from torch import nn as nn from torch.nn import function...
hyunobae/BasicSR
GANFeatLoss
false
12,524
[ "Apache-2.0" ]
0
f2c2fc6cf28933658816c808f55c95fa20b16483
https://github.com/hyunobae/BasicSR/tree/f2c2fc6cf28933658816c808f55c95fa20b16483
Net
import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self, n_input, n_output): super(Net, self).__init__() self.fc1 = nn.Linear(n_input, 20) self.dropout1 = nn.Dropout(0.25) self.fc2 = nn.Linear(20, 20) self.dropout2 = nn.Dr...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
ihsgnef/duolingo-halflife-regression
Net
false
12,525
[ "MIT" ]
0
01c7895eee0450462b5277a055d2ae1de58f1be5
https://github.com/ihsgnef/duolingo-halflife-regression/tree/01c7895eee0450462b5277a055d2ae1de58f1be5
Conv_Q
import torch import torch.nn as nn import torch.nn.functional as F class Conv_Q(nn.Module): def __init__(self, frames, num_actions): super(Conv_Q, self).__init__() self.c1 = nn.Conv2d(frames, 32, kernel_size=8, stride=4) self.c2 = nn.Conv2d(32, 64, kernel_size=4, stride=2) self.c3...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
hotaekjoo/SQV
Conv_Q
false
12,526
[ "MIT" ]
0
d725342e7fd8548ee5fa018e5ccac4542969deed
https://github.com/hotaekjoo/SQV/tree/d725342e7fd8548ee5fa018e5ccac4542969deed
PARALossSoftmax
import torch import torch.nn as nn import torch.nn.functional as F class PARALossSoftmax(nn.Module): """ Softmax classifier for sentence-level relation extraction. """ def __init__(self): """ Args: sentence_encoder: encoder for sentences num_class: number of cl...
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 ...
igorvlnascimento/open-nre
PARALossSoftmax
false
12,527
[ "MIT" ]
0
a6e42ef074d62be4d3ceb571f412d5be8c0502d7
https://github.com/igorvlnascimento/open-nre/tree/a6e42ef074d62be4d3ceb571f412d5be8c0502d7
ModulatedConv2d
from torch.autograd import Function import math import torch from torch import nn as nn from torch.nn import functional as F from torch.nn import init as init from torchvision.models import vgg as vgg import torch.utils.data from torch.utils import data as data from torch import autograd as autograd def make_resample...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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.autograd...
hyunobae/BasicSR
ModulatedConv2d
false
12,528
[ "Apache-2.0" ]
0
f2c2fc6cf28933658816c808f55c95fa20b16483
https://github.com/hyunobae/BasicSR/tree/f2c2fc6cf28933658816c808f55c95fa20b16483
ToRGB
from torch.autograd import Function import math import torch from torch import nn as nn from torch.nn import functional as F from torch.nn import init as init from torchvision.models import vgg as vgg import torch.utils.data from torch.utils import data as data from torch import autograd as autograd def make_resample...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.autograd import Function import math from torch import nn as nn from ...
hyunobae/BasicSR
ToRGB
false
12,529
[ "Apache-2.0" ]
0
f2c2fc6cf28933658816c808f55c95fa20b16483
https://github.com/hyunobae/BasicSR/tree/f2c2fc6cf28933658816c808f55c95fa20b16483
ScaleNorm
import torch from torch import nn class ScaleNorm(nn.Module): def __init__(self, dim, eps=1e-05): super().__init__() self.scale = dim ** -0.5 self.eps = eps self.g = nn.Parameter(torch.ones(1)) def forward(self, x): norm = torch.linalg.norm(x, dim=-1, keepdim=True) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_...
imflash217/bumblebee
ScaleNorm
false
12,530
[ "MIT" ]
0
09343d42634aa954cac867f7e426eee260b4df57
https://github.com/imflash217/bumblebee/tree/09343d42634aa954cac867f7e426eee260b4df57
ReluSquared
import torch from torch import nn import torch.nn.functional as F class ReluSquared(nn.Module): def forward(self, input): return F.relu(input) ** 2 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
imflash217/bumblebee
ReluSquared
false
12,531
[ "MIT" ]
0
09343d42634aa954cac867f7e426eee260b4df57
https://github.com/imflash217/bumblebee/tree/09343d42634aa954cac867f7e426eee260b4df57
gram_mse_loss
import torch import torch.nn as nn class gram_matrix(nn.Module): def forward(self, input): b, c, w, h = input.size() F = input.view(b, c, h * w) G = torch.bmm(F, F.transpose(1, 2)) G.div_(h * w) return G class gram_mse_loss(nn.Module): def forward(self, input, targe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
ipjessica/neural-style-transfer
gram_mse_loss
false
12,532
[ "MIT" ]
0
ae0fc5e1e69d5d52997e5cab69e880085e04723b
https://github.com/ipjessica/neural-style-transfer/tree/ae0fc5e1e69d5d52997e5cab69e880085e04723b
ECB
import torch from torch import nn as nn from torch.nn import functional as F from torch.nn import init as init from torchvision.models import vgg as vgg import torch.utils.data from torch.utils import data as data from torch import autograd as autograd class SeqConv3x3(nn.Module): def __init__(self, seq_type, in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn as nn from torch.nn import functional as F from torch.nn im...
hyunobae/BasicSR
ECB
false
12,533
[ "Apache-2.0" ]
0
f2c2fc6cf28933658816c808f55c95fa20b16483
https://github.com/hyunobae/BasicSR/tree/f2c2fc6cf28933658816c808f55c95fa20b16483
FullSelfAttn
import torch import torch.nn as nn import torch.utils.data class FullSelfAttn(nn.Module): """ Self attention Layer""" def __init__(self, in_dim): super().__init__() self.query_conv = nn.Conv2d(in_channels=in_dim, out_channels=in_dim // 2, kernel_size=1) self.key_conv = nn....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ilyak93/SinGanF2
FullSelfAttn
false
12,534
[ "MIT" ]
0
fa6b135ef4699626ce450afd02ed3b269e4ca16d
https://github.com/ilyak93/SinGanF2/tree/fa6b135ef4699626ce450afd02ed3b269e4ca16d
gram_matrix
import torch import torch.nn as nn class gram_matrix(nn.Module): def forward(self, input): b, c, w, h = input.size() F = input.view(b, c, h * w) G = torch.bmm(F, F.transpose(1, 2)) G.div_(h * w) return G def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_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...
ipjessica/neural-style-transfer
gram_matrix
false
12,535
[ "MIT" ]
0
ae0fc5e1e69d5d52997e5cab69e880085e04723b
https://github.com/ipjessica/neural-style-transfer/tree/ae0fc5e1e69d5d52997e5cab69e880085e04723b
GramMatrix
import torch import torch.nn as nn class GramMatrix(nn.Module): def forward(self, input): a, b, c, d = input.size() features = input.view(a * b, c * d) G = torch.mm(features, features.t()) return G.div(a * b * c * d) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
invoker4zoo/pytorch_model
GramMatrix
false
12,536
[ "MIT" ]
0
b74f005ba1be5e66fafaa2745fc7d1815979e91f
https://github.com/invoker4zoo/pytorch_model/tree/b74f005ba1be5e66fafaa2745fc7d1815979e91f
ChannelWiseLayerNorm
import torch import torch.nn as nn class ChannelWiseLayerNorm(nn.LayerNorm): """ Channel wise layer normalization """ def __init__(self, *args, **kwargs): super(ChannelWiseLayerNorm, self).__init__(*args, **kwargs) def forward(self, x): """ x: BS x N x K """ ...
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_...
intflow/FullSubNet
ChannelWiseLayerNorm
false
12,537
[ "MIT" ]
0
193091acac4c747730db5ace33fd1b8870e7c735
https://github.com/intflow/FullSubNet/tree/193091acac4c747730db5ace33fd1b8870e7c735
CumulativeMagSpectralNorm
import torch import torch.nn as nn class CumulativeMagSpectralNorm(nn.Module): def __init__(self, cumulative=False, use_mid_freq_mu=False): """ Args: cumulative: 是否采用累积的方式计算 mu use_mid_freq_mu: 仅采用中心频率的 mu 来代替全局 mu Notes: 先算均值再累加 等同于 先累加再算均值 ...
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...
intflow/FullSubNet
CumulativeMagSpectralNorm
false
12,538
[ "MIT" ]
0
193091acac4c747730db5ace33fd1b8870e7c735
https://github.com/intflow/FullSubNet/tree/193091acac4c747730db5ace33fd1b8870e7c735
GradientReversal
import torch class GradientReversalFunction(torch.autograd.Function): """ Gradient Reversal Layer from: Unsupervised Domain Adaptation by Backpropagation (Ganin & Lempitsky, 2015) Forward pass is the identity function. In the backward pass, the upstream gradients are multiplied by -lambda (i.e...
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...
ishine/CDFSE_FastSpeech2
GradientReversal
false
12,539
[ "MIT" ]
0
f0facd077fa3e11b2704f2e8a1d1315bd1f4f493
https://github.com/ishine/CDFSE_FastSpeech2/tree/f0facd077fa3e11b2704f2e8a1d1315bd1f4f493
ConvLeaky
import torch from torch import nn from torch.nn import functional as F class ConvLeaky(nn.Module): def __init__(self, in_dim, out_dim): super(ConvLeaky, self).__init__() self.conv1 = nn.Conv2d(in_channels=in_dim, out_channels=out_dim, kernel_size=3, stride=1, padding=1) self.c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
ivan94fi/fast-sr-unet
ConvLeaky
false
12,540
[ "MIT" ]
0
76ff5ee1ca87d8cdd06ce3ec406cfac533041d83
https://github.com/ivan94fi/fast-sr-unet/tree/76ff5ee1ca87d8cdd06ce3ec406cfac533041d83
ConvTemporalGraphical
import torch import torch.nn as nn class ConvTemporalGraphical(nn.Module): """The basic module for applying a graph convolution. Args: in_channels (int): Number of channels in the input sequence data out_channels (int): Number of channels produced by the convolution A_channels (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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
ishine/speech2affective_gestures
ConvTemporalGraphical
false
12,541
[ "MIT" ]
0
ea99e3edd82b8ab50a6f63cff301618762b73187
https://github.com/ishine/speech2affective_gestures/tree/ea99e3edd82b8ab50a6f63cff301618762b73187
SACActorNetwork
import torch import torch.nn.functional as F import torch.nn as nn class SACActorNetwork(nn.Module): def __init__(self, input_shape, output_shape, n_features, **kwargs): super(SACActorNetwork, self).__init__() n_input = input_shape[-1] n_output = output_shape[0] self._h1 = nn.Line...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
jacarvalho/mushroom-rl-benchmark
SACActorNetwork
false
12,542
[ "MIT" ]
0
5bc2e9b1a12be33827d6edcd5c5ad49571e11275
https://github.com/jacarvalho/mushroom-rl-benchmark/tree/5bc2e9b1a12be33827d6edcd5c5ad49571e11275
A2CNetwork
import torch import torch.nn as nn class A2CNetwork(nn.Module): def __init__(self, input_shape, output_shape, n_features, **kwargs): super(A2CNetwork, self).__init__() n_input = input_shape[-1] n_output = output_shape[0] self._h1 = nn.Linear(n_input, n_features) self._h2 =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
jacarvalho/mushroom-rl-benchmark
A2CNetwork
false
12,543
[ "MIT" ]
0
5bc2e9b1a12be33827d6edcd5c5ad49571e11275
https://github.com/jacarvalho/mushroom-rl-benchmark/tree/5bc2e9b1a12be33827d6edcd5c5ad49571e11275
DropConnect
import torch class DropConnect(torch.nn.Module): def __init__(self, p): super(DropConnect, self).__init__() self.p = p def forward(self, inputs): batch_size = inputs.shape[0] inputs.shape[2] inputs.shape[3] channel_size = inputs.shape[1] keep_prob = 1 ...
import torch from torch import device import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_si...
jack-willturner/nas-without-training
DropConnect
false
12,544
[ "MIT" ]
0
d5e915b5f391f51d902f33b1d4beedfe3b09d2e0
https://github.com/jack-willturner/nas-without-training/tree/d5e915b5f391f51d902f33b1d4beedfe3b09d2e0
MaxPool3x3
import torch import torch.nn as nn class MaxPool3x3(nn.Module): """3x3 max pool with no subsampling.""" def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1): super(MaxPool3x3, self).__init__() self.maxpool = nn.MaxPool2d(kernel_size, stride, padding) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
jack-willturner/nas-without-training
MaxPool3x3
false
12,545
[ "MIT" ]
0
d5e915b5f391f51d902f33b1d4beedfe3b09d2e0
https://github.com/jack-willturner/nas-without-training/tree/d5e915b5f391f51d902f33b1d4beedfe3b09d2e0
SimpleAndModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleAndModule(torch.nn.Module): def __init__(self): super(SimpleAndModule, self).__init__() def forward(self, a, b): c = torch.logical_and(a, b) return torch.logical_and(c, c) def get_inputs(): return [torc...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
briancoutinho/glow
SimpleAndModule
false
12,546
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
SACCriticNetwork
import torch import torch.nn.functional as F import torch.nn as nn class SACCriticNetwork(nn.Module): def __init__(self, input_shape, output_shape, n_features, **kwargs): super().__init__() n_input = input_shape[-1] n_output = output_shape[0] self._h1 = nn.Linear(n_input, n_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 import triton_helpers import torch.nn as nn assert_...
jacarvalho/mushroom-rl-benchmark
SACCriticNetwork
false
12,547
[ "MIT" ]
0
5bc2e9b1a12be33827d6edcd5c5ad49571e11275
https://github.com/jacarvalho/mushroom-rl-benchmark/tree/5bc2e9b1a12be33827d6edcd5c5ad49571e11275
MLPArchitecture
import torch import torch.nn as nn from collections.abc import Iterable class MLPArchitecture(nn.Module): def __init__(self, batch_size, n_outputs, state_size): super(MLPArchitecture, self).__init__() if isinstance(state_size, Iterable): assert len(state_size) == 1 state_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 from co...
ivallesp/RL_Banana_Collector
MLPArchitecture
false
12,548
[ "MIT" ]
0
cf09ffa9cff8015dd47592509ae482b99339a960
https://github.com/ivallesp/RL_Banana_Collector/tree/cf09ffa9cff8015dd47592509ae482b99339a960
OneTupleModule
import torch import torch.jit import torch.onnx import torch.nn class OneTupleModule(torch.nn.Module): def __init__(self): super(OneTupleModule, self).__init__() def forward(self, x): y = 2 * x return y, def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
briancoutinho/glow
OneTupleModule
false
12,549
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
SimpleACosModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleACosModule(torch.nn.Module): def __init__(self): super(SimpleACosModule, self).__init__() def forward(self, a): return torch.acos(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
briancoutinho/glow
SimpleACosModule
false
12,550
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
DetachModel
import torch import torch.jit import torch.onnx import torch.nn class DetachModel(torch.nn.Module): def __init__(self): super(DetachModel, self).__init__() def forward(self, a): b = a.detach() return b + b def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_input...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
briancoutinho/glow
DetachModel
false
12,551
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
Net
import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=5, padding=2) self.conv2 = nn.Conv2d(32, 64, kernel_size=5, padding=2) self.conv3 = nn.Conv2d(64, 64, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
inani47/Transfer_Learning
Net
false
12,552
[ "BSD-2-Clause" ]
0
1e28614ceaa38a8034aa45c92b8265c79e64780a
https://github.com/inani47/Transfer_Learning/tree/1e28614ceaa38a8034aa45c92b8265c79e64780a
DQNFeatureNetwork
import torch import torch.nn.functional as F import torch.nn as nn class DQNFeatureNetwork(nn.Module): def __init__(self, input_shape, output_shape, **kwargs): super().__init__() n_input = input_shape[0] self._h1 = nn.Conv2d(n_input, 32, kernel_size=8, stride=4) self._h2 = nn.Conv...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
jacarvalho/mushroom-rl-benchmark
DQNFeatureNetwork
false
12,553
[ "MIT" ]
0
5bc2e9b1a12be33827d6edcd5c5ad49571e11275
https://github.com/jacarvalho/mushroom-rl-benchmark/tree/5bc2e9b1a12be33827d6edcd5c5ad49571e11275
SimpleBmmModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleBmmModule(torch.nn.Module): def forward(self, a, b): return (a + a).bmm(b) def get_inputs(): return [torch.rand([4, 4, 4]), torch.rand([4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
briancoutinho/glow
SimpleBmmModule
false
12,554
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
RepeatModule
import torch import torch.jit import torch.onnx import torch.nn class RepeatModule(torch.nn.Module): def __init__(self, repeats): super(RepeatModule, self).__init__() self.repeats = repeats def forward(self, tensor): tensor = tensor + tensor return tensor.repeat(self.repeats)...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
briancoutinho/glow
RepeatModule
false
12,555
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
SimpleClampModel
import torch import torch.jit import torch.onnx import torch.nn class SimpleClampModel(torch.nn.Module): def __init__(self, min, max): super(SimpleClampModel, self).__init__() self.min = min self.max = max def forward(self, input): return torch.clamp(input, self.min, self.max...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
briancoutinho/glow
SimpleClampModel
false
12,556
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
SimpleATanModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleATanModule(torch.nn.Module): def __init__(self): super(SimpleATanModule, self).__init__() def forward(self, a): return torch.atan(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
briancoutinho/glow
SimpleATanModule
false
12,557
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
SimpleConvTranspose2dModule
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleConvTranspose2dModule(torch.nn.Module): def __init__(self, stride=1, padding=0, output_padding=0, dilation=1, groups=1): super(SimpleConvTranspose2dModule, self).__init__() self.str...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch...
briancoutinho/glow
SimpleConvTranspose2dModule
false
12,558
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
SimpleConv2dModule
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleConv2dModule(torch.nn.Module): def __init__(self, stride=1, padding=0, dilation=1, groups=1): super(SimpleConv2dModule, self).__init__() self.stride = stride self.padding = 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.jit import torch...
briancoutinho/glow
SimpleConv2dModule
false
12,559
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5
SimpleASinModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleASinModule(torch.nn.Module): def __init__(self): super(SimpleASinModule, self).__init__() def forward(self, a): return torch.asin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
briancoutinho/glow
SimpleASinModule
false
12,560
[ "Apache-2.0" ]
0
4c919d60b3c33296c4109aec8020a1733c98f5b5
https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5