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
GELU
import torch import torch.nn as nn import torch.nn.functional as F class GELU(nn.Module): def __init__(self): super(GELU, self).__init__() def forward(self, x): return F.relu(x, inplace=True) 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride @...
akulaarora/pre-training
GELU
false
14,779
[ "Apache-2.0" ]
107
312ae1ec1ec279da557543184fc064dade76dbbd
https://github.com/akulaarora/pre-training/tree/312ae1ec1ec279da557543184fc064dade76dbbd
BCEWithLogitsLoss
import torch import torch as th import torch.nn as nn class BCEWithLogitsLoss(nn.Module): def __init__(self, weight=None): super().__init__() self.loss = th.nn.BCEWithLogitsLoss(weight=weight) def forward(self, x, target): return self.loss(x, target) def get_inputs(): return [t...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
albanie/collaborative-experts
BCEWithLogitsLoss
false
14,780
[ "Apache-2.0" ]
237
b41defc4fb8de451809014c970ccbe518621909f
https://github.com/albanie/collaborative-experts/tree/b41defc4fb8de451809014c970ccbe518621909f
ConcatReLU
import torch import torch.nn as nn import torch.nn.functional as F def concat_relu(x): """Concatenated ReLU (http://arxiv.org/abs/1603.05201).""" return F.relu(torch.cat([x, -x], dim=1)) class ConcatReLU(nn.Module): """Concatenated ReLU (http://arxiv.org/abs/1603.05201).""" def forward(self, 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 from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn.functional as F assert_size_stride = torch._C._dyna...
alisiahkoohi/survae_flows
ConcatReLU
false
14,781
[ "MIT" ]
262
e1747b05524c7ab540a211ed360ab3e67bc3e96d
https://github.com/alisiahkoohi/survae_flows/tree/e1747b05524c7ab540a211ed360ab3e67bc3e96d
down_shifted_conv2d
import torch import torch.nn as nn from torch.nn.utils import weight_norm as wn def down_shift(x, pad=None): xs = [int(y) for y in x.size()] x = x[:, :, :xs[2] - 1, :] pad = nn.ZeroPad2d((0, 0, 1, 0)) if pad is None else pad return pad(x) class down_shifted_conv2d(nn.Module): def __init__(self,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
ajayjain/lmconv
down_shifted_conv2d
false
14,782
[ "MIT" ]
69
e00576de5118702c90493e88c6e459b0e45d1290
https://github.com/ajayjain/lmconv/tree/e00576de5118702c90493e88c6e459b0e45d1290
ConcatELU
import torch import torch.nn as nn import torch.nn.functional as F def concat_elu(x): """Like concatenated ReLU (http://arxiv.org/abs/1603.05201), but with ELU instead.""" return F.elu(torch.cat([x, -x], dim=1)) class ConcatELU(nn.Module): """Like concatenated ReLU (http://arxiv.org/abs/1603.05201), but...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.functional as F assert_size_stride = torc...
alisiahkoohi/survae_flows
ConcatELU
false
14,783
[ "MIT" ]
262
e1747b05524c7ab540a211ed360ab3e67bc3e96d
https://github.com/alisiahkoohi/survae_flows/tree/e1747b05524c7ab540a211ed360ab3e67bc3e96d
LandmarkHead
import torch import torch.nn as nn from itertools import product as product class LandmarkHead(nn.Module): def __init__(self, inchannels=512, num_anchors=2): super(LandmarkHead, self).__init__() self.conv1x1 = nn.Conv2d(inchannels, num_anchors * 10, kernel_size= (1, 1), stride=1, padd...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from itertools import product as product assert_size_strid...
ai18435136351/facenet-retinaface-pytorch
LandmarkHead
false
14,784
[ "MIT" ]
48
f228969e46d7402170b708798a210de552879d16
https://github.com/ai18435136351/facenet-retinaface-pytorch/tree/f228969e46d7402170b708798a210de552879d16
AutoregressiveShift
import torch import torch.nn as nn class AutoregressiveShift(nn.Module): """Shifts input right to make model autoregressive.""" def __init__(self, embed_dim): super(AutoregressiveShift, self).__init__() self.embed_dim = embed_dim self.first_token = nn.Parameter(torch.Tensor(1, 1, embe...
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...
alisiahkoohi/survae_flows
AutoregressiveShift
false
14,785
[ "MIT" ]
262
e1747b05524c7ab540a211ed360ab3e67bc3e96d
https://github.com/alisiahkoohi/survae_flows/tree/e1747b05524c7ab540a211ed360ab3e67bc3e96d
EPELoss
import torch import torch.nn as nn class EPELoss(nn.Module): def __init__(self): super(EPELoss, self).__init__() def forward(self, output, target): lossvalue = torch.norm(output - target + 1e-16, p=2, dim=1).mean() return lossvalue def get_inputs(): return [torch.rand([4, 4, 4,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
aishmittal/DocProj
EPELoss
false
14,786
[ "MIT" ]
246
761e27927ab7a83f48e347921dc023d45a9d394f
https://github.com/aishmittal/DocProj/tree/761e27927ab7a83f48e347921dc023d45a9d394f
RewardCriterion
import torch import torch.nn as nn from torch.autograd import * import torch.nn def to_contiguous(tensor): if tensor.is_contiguous(): return tensor else: return tensor.contiguous() class RewardCriterion(nn.Module): def __init__(self): super(RewardCriterion, self).__init__() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.autograd import * import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_str...
aliabd/cos-cvae
RewardCriterion
false
14,787
[ "Apache-2.0" ]
53
d6f94dd0f1de6727e43da55d36a6433fbfd0c44b
https://github.com/aliabd/cos-cvae/tree/d6f94dd0f1de6727e43da55d36a6433fbfd0c44b
MLP
import torch import torch.nn as nn from torch.autograd import * import torch.nn.parallel import torch.utils.data class FC(nn.Module): def __init__(self, in_size, out_size, dropout_r=0.0, use_relu=True): super(FC, self).__init__() self.dropout_r = dropout_r self.use_relu = use_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 import torch.nn as nn from to...
alfred100p/VC-R-CNN
MLP
false
14,788
[ "MIT" ]
344
c887f5b6db6932fb5c828c8037e299ce5baadb9e
https://github.com/alfred100p/VC-R-CNN/tree/c887f5b6db6932fb5c828c8037e299ce5baadb9e
Linear_dynamics
import torch import torch.utils.data from torch import nn class Linear_dynamics(nn.Module): def __init__(self, device='cpu'): super(Linear_dynamics, self).__init__() self.time = nn.Parameter(torch.ones(1) * 0.7) self.device = device self def forward(self, x, v): retur...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._...
alanpaivaa/egnn
Linear_dynamics
false
14,789
[ "MIT" ]
142
e9ca6c0c3e1d30a7598efbd66034121b4af8dccc
https://github.com/alanpaivaa/egnn/tree/e9ca6c0c3e1d30a7598efbd66034121b4af8dccc
PositionalEncoding1d
import math import torch import torch.nn as nn class PositionalEncoding1d(nn.Module): """ Learning positional embeddings. Args: shape: Iterable, the shape of the input. embedding_dim: int, the size of each embedding vector. """ def __init__(self, size, embedding_dim): sup...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guar...
alisiahkoohi/survae_flows
PositionalEncoding1d
false
14,790
[ "MIT" ]
262
e1747b05524c7ab540a211ed360ab3e67bc3e96d
https://github.com/alisiahkoohi/survae_flows/tree/e1747b05524c7ab540a211ed360ab3e67bc3e96d
SilogLoss
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...
aliyun/dro-sfm
SilogLoss
false
14,791
[ "MIT" ]
147
8707e2e0ef799d7d47418a018060f503ef449fe3
https://github.com/aliyun/dro-sfm/tree/8707e2e0ef799d7d47418a018060f503ef449fe3
PositionalEncodingImage
import math import torch import torch.nn as nn class PositionalEncodingImage(nn.Module): """ Learning positional embeddings for images. Embeddings for channel, height and width are added to form the full positional embedding. These encodings correspond to the ones from Sparse Transformers (https://arx...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guar...
alisiahkoohi/survae_flows
PositionalEncodingImage
false
14,792
[ "MIT" ]
262
e1747b05524c7ab540a211ed360ab3e67bc3e96d
https://github.com/alisiahkoohi/survae_flows/tree/e1747b05524c7ab540a211ed360ab3e67bc3e96d
DumbFeat
import torch import torch.nn as nn import torch.optim class DumbFeat(nn.Module): def __init__(self, dropout): super().__init__() if dropout > 0.0: self.dropout = torch.nn.Dropout(p=dropout, inplace=False) else: self.dropout = None def forward(self, x): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.optim assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dyna...
alisure-fork/BF3S
DumbFeat
false
14,793
[ "Apache-2.0" ]
130
99cfb7ce4696f2585bb7c2502f234e60c55e8007
https://github.com/alisure-fork/BF3S/tree/99cfb7ce4696f2585bb7c2502f234e60c55e8007
BerHuLoss
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 ...
aliyun/dro-sfm
BerHuLoss
false
14,794
[ "MIT" ]
147
8707e2e0ef799d7d47418a018060f503ef449fe3
https://github.com/aliyun/dro-sfm/tree/8707e2e0ef799d7d47418a018060f503ef449fe3
MultinomialNLLLoss
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch.onnx def _reduce(x, reduction='elementwise_mean'): if reduction == 'none': return x elif reduction == 'elementwise_mea...
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 ...
akshayka/gavel
MultinomialNLLLoss
false
14,795
[ "MIT" ]
67
40a22a725f2e70478483e98c9b07c6fc588e0c40
https://github.com/akshayka/gavel/tree/40a22a725f2e70478483e98c9b07c6fc588e0c40
GatedTanhUnit
import torch import torch.nn as nn def gated_tanh(x, dim): """Gated Tanh activation.""" x_tanh, x_sigmoid = torch.chunk(x, 2, dim=dim) return torch.tanh(x_tanh) * torch.sigmoid(x_sigmoid) class GatedTanhUnit(nn.Module): """Gated Tanh activation.""" def __init__(self, dim=-1): super(Gate...
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_...
alisiahkoohi/survae_flows
GatedTanhUnit
false
14,796
[ "MIT" ]
262
e1747b05524c7ab540a211ed360ab3e67bc3e96d
https://github.com/alisiahkoohi/survae_flows/tree/e1747b05524c7ab540a211ed360ab3e67bc3e96d
GatedConv2d
import torch import torch.nn as nn class GatedConv2d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, padding): super(GatedConv2d, self).__init__() self.in_channels = in_channels self.conv = nn.Conv2d(in_channels, out_channels * 3, kernel_size= kernel_siz...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
alisiahkoohi/survae_flows
GatedConv2d
false
14,797
[ "MIT" ]
262
e1747b05524c7ab540a211ed360ab3e67bc3e96d
https://github.com/alisiahkoohi/survae_flows/tree/e1747b05524c7ab540a211ed360ab3e67bc3e96d
Alignment
from _paritybench_helpers import _mock_config from torch.nn import Module import math import torch import torch.nn.functional as f import torch.nn as nn class Module(nn.Module): def __init__(self): super().__init__() self.summary = {} def add_summary(self, name, val): if self.trainin...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
alibaba-edu/simple-effective-text-matching-pytorch
Alignment
false
14,798
[ "Apache-2.0" ]
278
05d572e30801b235e989c78c95dd24d5f5d35f74
https://github.com/alibaba-edu/simple-effective-text-matching-pytorch/tree/05d572e30801b235e989c78c95dd24d5f5d35f74
MegatronGelu
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class MegatronGelu(torch.nn.Module): def forward(self, x): return x * 0.5 * (torch.erf(x / 1.41421) + 1.0) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn import torch.onnx import torch.utils.checkpoint assert_size_str...
almiliMSFT/onnxruntime
MegatronGelu
false
14,799
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
MegatronFastGelu
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class MegatronFastGelu(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def g...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn import torch.onnx import torch.utils.checkpoint assert_size_str...
almiliMSFT/onnxruntime
MegatronFastGelu
false
14,800
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
MyCustomFunctionReluModel
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class MyCustomFunctionReluModel(torch.nn.Module): def __init__(self): super().__init__() class MyReLU(torch.autograd.Function): @staticmethod def forward(ctx, input): ctx.save_f...
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 import torch.onnx import torch.utils.checkpoint assert_size_stride = torc...
almiliMSFT/onnxruntime
MyCustomFunctionReluModel
false
14,801
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
LayerNorm
import torch import torch.nn as nn import torch.nn import torch.onnx import torch.utils.checkpoint class LayerNorm(nn.Module): def __init__(self, hidden_size, epsilon, cast_fp16=True, formula=0): super().__init__() self.layer_norm = nn.LayerNorm(hidden_size, eps=epsilon) self.layer_norm.b...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn import torch.onnx import torch.utils.chec...
almiliMSFT/onnxruntime
LayerNorm
false
14,802
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
DepthHead
import torch import torch.nn as nn import torch.nn.functional as F class DepthHead(nn.Module): def __init__(self, input_dim=256, hidden_dim=128, scale=False): super(DepthHead, self).__init__() self.scale = scale self.conv1 = nn.Conv2d(input_dim, hidden_dim, 3, padding=1) self.conv...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
aliyun/dro-sfm
DepthHead
false
14,803
[ "MIT" ]
147
8707e2e0ef799d7d47418a018060f503ef449fe3
https://github.com/aliyun/dro-sfm/tree/8707e2e0ef799d7d47418a018060f503ef449fe3
FeatBlock
import torch import torch.nn as nn class FeatBlock(nn.Module): def __init__(self, planes=128, out_dim=128): super().__init__() self.conv1 = nn.Conv2d(planes, planes, 3, padding=1) self.conv2 = nn.Conv2d(planes, out_dim, 3, padding=1) self.relu = nn.ReLU(inplace=True) def forw...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
aliyun/dro-sfm
FeatBlock
false
14,804
[ "MIT" ]
147
8707e2e0ef799d7d47418a018060f503ef449fe3
https://github.com/aliyun/dro-sfm/tree/8707e2e0ef799d7d47418a018060f503ef449fe3
ProjectionInputDepth
import torch import torch.nn as nn import torch.nn.functional as F class ProjectionInputDepth(nn.Module): def __init__(self, cost_dim, hidden_dim, out_chs): super().__init__() self.out_chs = out_chs self.convc1 = nn.Conv2d(cost_dim, hidden_dim, 1, padding=0) self.convc2 = nn.Conv2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
aliyun/dro-sfm
ProjectionInputDepth
false
14,805
[ "MIT" ]
147
8707e2e0ef799d7d47418a018060f503ef449fe3
https://github.com/aliyun/dro-sfm/tree/8707e2e0ef799d7d47418a018060f503ef449fe3
NeuralNetNonDifferentiableOutput
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class NeuralNetNonDifferentiableOutput(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetNonDifferentiableOutput, self).__init__() self.fc1 = torch.nn.Linear(input_size, hidden_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
almiliMSFT/onnxruntime
NeuralNetNonDifferentiableOutput
false
14,806
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
NeuralNetPartialNoGradModel
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class NeuralNetPartialNoGradModel(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetPartialNoGradModel, self).__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size).requir...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
almiliMSFT/onnxruntime
NeuralNetPartialNoGradModel
false
14,807
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
PixelSort
import torch from torch import nn class PixelSort(nn.Module): """The inverse operation of PixelShuffle Reduces the spatial resolution, increasing the number of channels. Currently, scale 0.5 is supported only. Later, torch.nn.functional.pixel_sort may be implemented. Reference: http://pyto...
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...
alpayuz/DeepDeblur-PyTorch
PixelSort
false
14,808
[ "MIT" ]
158
771252e123e3a11da849bb9cef2a7cc49d8d1a2d
https://github.com/alpayuz/DeepDeblur-PyTorch/tree/771252e123e3a11da849bb9cef2a7cc49d8d1a2d
BertPooler
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 ...
Aksh97/VGCN-BERT
BertPooler
false
14,809
[ "MIT" ]
106
62b5ae5a3c53f4bff555027d87a57d3a994a32bb
https://github.com/Aksh97/VGCN-BERT/tree/62b5ae5a3c53f4bff555027d87a57d3a994a32bb
enhance_net_nopool
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim class CSDN_Tem(nn.Module): def __init__(self, in_ch, out_ch): super(CSDN_Tem, self).__init__() self.depth_conv = nn.Conv2d(in_channels=in_ch, out_channels=in_ch, kernel_size=3, stride=1, padding=1, g...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
alisonwqq/Zero-DCE_extension
enhance_net_nopool
false
14,810
[ "MIT" ]
97
6b59b36cbe2983e216789583d837bdc88d3e5cf8
https://github.com/alisonwqq/Zero-DCE_extension/tree/6b59b36cbe2983e216789583d837bdc88d3e5cf8
NeuralNetMultiplePositionalArguments
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class NeuralNetMultiplePositionalArguments(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArguments, self).__init__() self.fc1 = torch.nn.Linear(input_size, h...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
almiliMSFT/onnxruntime
NeuralNetMultiplePositionalArguments
false
14,811
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
TransformerEncoderLayer
from torch.nn import Module import torch import torch.nn as nn import torch.optim import torch.utils.data import torch.nn.functional as F from torch.nn import Linear from torch.nn import Dropout from torch.nn import LayerNorm from torch.nn import Identity def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
alihassanijr/Compact-Transformers
TransformerEncoderLayer
false
14,812
[ "Apache-2.0" ]
281
61b656eacdf113f92900f800410bb788bb7d9a3c
https://github.com/alihassanijr/Compact-Transformers/tree/61b656eacdf113f92900f800410bb788bb7d9a3c
TV_L1LOSS
import torch import torch.nn as nn import torch.utils.data class TV_L1LOSS(nn.Module): def __init__(self): super(TV_L1LOSS, self).__init__() def forward(self, x, y): size = x.size() h_tv_diff = torch.abs(x[:, :, 1:, :] - x[:, :, :-1, :] - (y[:, :, 1 :, :] - y[:, :, :-1, :...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn import torch.utils.data assert_size_stride = torch....
alsgkals2/SRResCGAN
TV_L1LOSS
false
14,813
[ "MIT" ]
81
a71201a93e1819045f9c7711743812546d3a1f31
https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31
L1GradLoss
import torch import torch.nn as nn import torch.utils.data class L1GradLoss(nn.Module): def __init__(self, grad=False): super(L1GradLoss, self).__init__() self.grad = grad def forward(self, input, target): err = input - target loss = err.norm(p=1).div(err.numel()) if ...
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 ...
alsgkals2/SRResCGAN
L1GradLoss
false
14,814
[ "MIT" ]
81
a71201a93e1819045f9c7711743812546d3a1f31
https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency(torch .nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
almiliMSFT/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
false
14,815
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
MSEGradLoss
import torch import torch.nn as nn import torch.utils.data class MSEGradLoss(nn.Module): def __init__(self, grad=False): super(MSEGradLoss, self).__init__() self.grad = grad def forward(self, input, target): err = input - target loss = err.norm(p=2).pow(2).div(err.numel()) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import...
alsgkals2/SRResCGAN
MSEGradLoss
false
14,816
[ "MIT" ]
81
a71201a93e1819045f9c7711743812546d3a1f31
https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31
PoseHead
import torch import torch.nn as nn class PoseHead(nn.Module): def __init__(self, input_dim=256, hidden_dim=128): super(PoseHead, self).__init__() self.conv1_pose = nn.Conv2d(input_dim, hidden_dim, 3, padding=1) self.conv2_pose = nn.Conv2d(hidden_dim, 6, 3, padding=1) self.relu = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
aliyun/dro-sfm
PoseHead
false
14,817
[ "MIT" ]
147
8707e2e0ef799d7d47418a018060f503ef449fe3
https://github.com/aliyun/dro-sfm/tree/8707e2e0ef799d7d47418a018060f503ef449fe3
ProjectionInputPose
import torch import torch.nn as nn import torch.nn.functional as F class ProjectionInputPose(nn.Module): def __init__(self, cost_dim, hidden_dim, out_chs): super().__init__() self.out_chs = out_chs self.convc1 = nn.Conv2d(cost_dim, hidden_dim, 1, padding=0) self.convc2 = nn.Conv2d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
aliyun/dro-sfm
ProjectionInputPose
false
14,818
[ "MIT" ]
147
8707e2e0ef799d7d47418a018060f503ef449fe3
https://github.com/aliyun/dro-sfm/tree/8707e2e0ef799d7d47418a018060f503ef449fe3
ResNetV2
import torch from collections import OrderedDict import torch.nn as nn import torch.nn.functional as F def conv1x1(cin, cout, stride=1, bias=False): return StdConv2d(cin, cout, kernel_size=1, stride=stride, padding=0, bias=bias) def conv3x3(cin, cout, stride=1, groups=1, bias=False): return StdConv2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Willy0919/progressive-coordinate-transforms
ResNetV2
false
14,819
[ "Apache-2.0", "MIT" ]
142
b637fa2541a815d270e162a4c9cd3348b098d48a
https://github.com/Willy0919/progressive-coordinate-transforms/tree/b637fa2541a815d270e162a4c9cd3348b098d48a
NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency
import torch import torch.nn import torch.onnx import torch.utils.checkpoint class NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency(torch. nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
almiliMSFT/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency
false
14,820
[ "MIT" ]
6,036
c002dc86a364852859ca9642698fcfc5edf22c9d
https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d
TV_L1Loss
import torch import torch.nn as nn import torch.utils.data class TV_L1Loss(nn.Module): def __init__(self, tv_loss_weight=1): super(TV_L1Loss, self).__init__() def forward(self, x): batch_size = x.size()[0] h_x = x.size()[2] w_x = x.size()[3] count_h = self.tensor_size...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn import torch.utils.data assert_size_stride = torch....
alsgkals2/SRResCGAN
TV_L1Loss
false
14,821
[ "MIT" ]
81
a71201a93e1819045f9c7711743812546d3a1f31
https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31
GraphLearner
from torch.nn import Module import torch from torch.nn.modules.module import Module import torch.nn as nn import torch.nn.functional as F class GraphLearner(Module): def __init__(self, in_feature_dim, combined_feature_dim, K, dropout=0.0): super(GraphLearner, self).__init__() """ ## Varia...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
aimbrain/vqa-project
GraphLearner
false
14,822
[ "Apache-2.0" ]
145
341122a267293017b55db4f033fbe81445af03ea
https://github.com/aimbrain/vqa-project/tree/341122a267293017b55db4f033fbe81445af03ea
LSTMRegressCriterion
import torch import torch.nn as nn class LSTMRegressCriterion(nn.Module): def __init__(self): super(LSTMRegressCriterion, self).__init__() def forward(self, pred, target, mask): pred = pred.clone() target = target.clone() mask = mask.clone() target = target[:, :pred.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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
aluo-x/shape2prog
LSTMRegressCriterion
false
14,823
[ "BSD-2-Clause" ]
109
1177e5205b99bb293e353688b564c94a14211c75
https://github.com/aluo-x/shape2prog/tree/1177e5205b99bb293e353688b564c94a14211c75
ResidualBlock
import torch import torch.nn as nn import torch.utils.data class ResidualBlock(nn.Module): def __init__(self, channels): super(ResidualBlock, self).__init__() self.conv1 = nn.Conv2d(channels, channels, kernel_size=3, padding=1) self.prelu = nn.PReLU() self.conv2 = nn.Conv2d(channe...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
alsgkals2/SRResCGAN
ResidualBlock
false
14,824
[ "MIT" ]
81
a71201a93e1819045f9c7711743812546d3a1f31
https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31
TV_L2Loss
import torch import torch.nn as nn import torch.utils.data class TV_L2Loss(nn.Module): def __init__(self): super(TV_L2Loss, self).__init__() def forward(self, x): batch_size = x.size()[0] h_x = x.size()[2] w_x = x.size()[3] count_h = self.tensor_size(x[:, :, 1:, :]) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
alsgkals2/SRResCGAN
TV_L2Loss
false
14,825
[ "MIT" ]
81
a71201a93e1819045f9c7711743812546d3a1f31
https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31
SigmoidRange
from torch.nn import Module import functools import torch import torch.nn as nn from typing import * def sigmoid_range(x, low, high): """Sigmoid function with range `(low, high)`""" return torch.sigmoid(x) * (high - low) + low class PrePostInitMeta(type): """A metaclass that calls optional `__pre_init__...
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.nn import Module import functools import torch.nn as nn from typing import * assert_size_stride = torch._C._dynamo.guards.assert_...
amaarora/fastai_dev
SigmoidRange
false
14,826
[ "Apache-2.0" ]
380
ffea51a553e4a7f71bc7240730b370cd0d07cb0a
https://github.com/amaarora/fastai_dev/tree/ffea51a553e4a7f71bc7240730b370cd0d07cb0a
LSTMClassCriterion
import torch import torch.nn as nn def to_contiguous(tensor): if tensor.is_contiguous(): return tensor else: return tensor.contiguous() class LSTMClassCriterion(nn.Module): def __init__(self): super(LSTMClassCriterion, self).__init__() def forward(self, pred, target, mask):...
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...
aluo-x/shape2prog
LSTMClassCriterion
false
14,827
[ "BSD-2-Clause" ]
109
1177e5205b99bb293e353688b564c94a14211c75
https://github.com/aluo-x/shape2prog/tree/1177e5205b99bb293e353688b564c94a14211c75
Discriminator
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Discriminator(nn.Module): def __init__(self, num_inputs, args): super(Discriminator, self).__init__() self.fc1 = nn.Linear(num_inputs, args.hidden_size) self.fc2 = nn.Linear(args.hidden_size, args.hidde...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
amy12xx/lets-do-irl
Discriminator
false
14,828
[ "MIT" ]
408
fd469e9fb7426e41b07c83ce4b87962ac3543b1e
https://github.com/amy12xx/lets-do-irl/tree/fd469e9fb7426e41b07c83ce4b87962ac3543b1e
MaxMarginRankingLoss
import torch import numpy as np from torch import nn import torch.nn.functional as F class MaxMarginRankingLoss(nn.Module): def __init__(self, margin=1.0, negative_weighting=False, batch_size=1, n_pair=1, hard_negative_rate=0.5): super(MaxMarginRankingLoss, self).__init__() self.margin = ...
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 numpy as np from torch import nn assert_size_stride = torch._C._dynamo.guards.asse...
amirziai/CLIP4Clip
MaxMarginRankingLoss
false
14,829
[ "MIT" ]
294
d1f31c881ed897a513c29e62512cd56c482420e6
https://github.com/amirziai/CLIP4Clip/tree/d1f31c881ed897a513c29e62512cd56c482420e6
GaussianFilter
import torch import torch.nn as nn import torch.utils.data class GaussianFilter(nn.Module): def __init__(self, kernel_size=13, stride=1, padding=6): super(GaussianFilter, self).__init__() mean = (kernel_size - 1) / 2.0 variance = ((kernel_size - 1) / 6.0) ** 2.0 x_coord = torch.ar...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
alsgkals2/SRResCGAN
GaussianFilter
false
14,830
[ "MIT" ]
81
a71201a93e1819045f9c7711743812546d3a1f31
https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31
VDB
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class VDB(nn.Module): def __init__(self, num_inputs, args): super(VDB, self).__init__() self.fc1 = nn.Linear(num_inputs, args.hidden_size) self.fc2 = nn.Linear(args.hidden_size, args.z_size) self.fc3 ...
import torch from torch import device from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libd...
amy12xx/lets-do-irl
VDB
false
14,831
[ "MIT" ]
408
fd469e9fb7426e41b07c83ce4b87962ac3543b1e
https://github.com/amy12xx/lets-do-irl/tree/fd469e9fb7426e41b07c83ce4b87962ac3543b1e
Critic
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Critic(nn.Module): def __init__(self, num_inputs, args): super(Critic, self).__init__() self.fc1 = nn.Linear(num_inputs, args.hidden_size) self.fc2 = nn.Linear(args.hidden_size, args.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 import torch.nn as ...
amy12xx/lets-do-irl
Critic
false
14,832
[ "MIT" ]
408
fd469e9fb7426e41b07c83ce4b87962ac3543b1e
https://github.com/amy12xx/lets-do-irl/tree/fd469e9fb7426e41b07c83ce4b87962ac3543b1e
BasicBlock
import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): expansion = 1 def __init__(self, in_planes, planes, stride=1): super(BasicBlock, self).__init__() self.conv1 = nn.Conv2d(in_planes, planes, kernel_size=3, stride= stride, padding=1, bia...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
amyami187/nngeometry
BasicBlock
false
14,833
[ "MIT" ]
103
cb516da3f7a019e148f48ff3ef3bed0cdae0d184
https://github.com/amyami187/nngeometry/tree/cb516da3f7a019e148f48ff3ef3bed0cdae0d184
DeResNetBlockGroupNorm
import torch import torch.nn as nn def deconv3x3(in_planes, out_planes, stride=1, output_padding=0): """3x3 deconvolution with padding""" return nn.ConvTranspose2d(in_planes, out_planes, kernel_size=3, stride= stride, padding=1, output_padding=output_padding, bias=False) class DeResNetBlockGroupNorm...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
andrecianflone/wolf
DeResNetBlockGroupNorm
false
14,834
[ "Apache-2.0" ]
75
826bbedc58d4d29871110349356868066a3108e6
https://github.com/andrecianflone/wolf/tree/826bbedc58d4d29871110349356868066a3108e6
PairwiseBilinear
import math import torch import torch.nn as nn class PairwiseBilinear(nn.Module): """ https://github.com/stanfordnlp/stanza/blob/v1.1.1/stanza/models/common/biaffine.py#L5 # noqa """ def __init__(self, in1_features: 'int', in2_features: 'int', out_features: 'int', bias: 'bool'=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 import math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.a...
andhikayusup/biaffineparser
PairwiseBilinear
false
14,835
[ "Apache-2.0" ]
46
30180b805bdb6c0f1e0386ceb090ba83d6ab2621
https://github.com/andhikayusup/biaffineparser/tree/30180b805bdb6c0f1e0386ceb090ba83d6ab2621
CrossEmbeddings
from _paritybench_helpers import _mock_config import torch from torch import nn class CrossEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings. """ def __init__(self, config): super(CrossEmbeddings, self).__init__() self.position_embeddings = n...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
amirziai/CLIP4Clip
CrossEmbeddings
false
14,836
[ "MIT" ]
294
d1f31c881ed897a513c29e62512cd56c482420e6
https://github.com/amirziai/CLIP4Clip/tree/d1f31c881ed897a513c29e62512cd56c482420e6
AdaIN2d
import torch import torch.nn as nn class AdaIN2d(nn.Module): def __init__(self, in_channels, in_features): super(AdaIN2d, self).__init__() self.norm = nn.InstanceNorm2d(in_channels, affine=False, track_running_stats=False) self.net = nn.Linear(in_features, 2 * in_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 from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
andrecianflone/wolf
AdaIN2d
false
14,837
[ "Apache-2.0" ]
75
826bbedc58d4d29871110349356868066a3108e6
https://github.com/andrecianflone/wolf/tree/826bbedc58d4d29871110349356868066a3108e6
Biaffine
import math import torch import torch.nn as nn class PairwiseBilinear(nn.Module): """ https://github.com/stanfordnlp/stanza/blob/v1.1.1/stanza/models/common/biaffine.py#L5 # noqa """ def __init__(self, in1_features: 'int', in2_features: 'int', out_features: 'int', bias: 'bool'=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 import math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.a...
andhikayusup/biaffineparser
Biaffine
false
14,838
[ "Apache-2.0" ]
46
30180b805bdb6c0f1e0386ceb090ba83d6ab2621
https://github.com/andhikayusup/biaffineparser/tree/30180b805bdb6c0f1e0386ceb090ba83d6ab2621
DeepMind
import torch import torch.nn as nn import torch.nn.functional as F class DeepMind(nn.Module): def __init__(self): super(DeepMind, self).__init__() self.conv1 = nn.Conv2d(4, 32, 8, stride=4) self.conv2 = nn.Conv2d(32, 64, 4, stride=2) self.conv3 = nn.Conv2d(64, 32, 3, 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 from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
TianhongDai/Self_Imitation_Learning
DeepMind
false
14,839
[ "MIT" ]
61
e49003582fa3d875495d84682f2a3332d4922dbc
https://github.com/TianhongDai/Self_Imitation_Learning/tree/e49003582fa3d875495d84682f2a3332d4922dbc
Actor
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Actor(nn.Module): def __init__(self, num_inputs, num_outputs, args): super(Actor, self).__init__() self.fc1 = nn.Linear(num_inputs, args.hidden_size) self.fc2 = nn.Linear(args.hidden_size, args.hidden_s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
amy12xx/lets-do-irl
Actor
false
14,840
[ "MIT" ]
408
fd469e9fb7426e41b07c83ce4b87962ac3543b1e
https://github.com/amy12xx/lets-do-irl/tree/fd469e9fb7426e41b07c83ce4b87962ac3543b1e
MAELoss
import torch import torch.nn as nn class MAELoss(nn.Module): def __init__(self): super(MAELoss, self).__init__() def forward(self, outputs, target, *args): val_pixels = torch.ne(target, 0).float() loss = target * val_pixels - outputs * val_pixels return torch.sum(torch.abs(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 torch.nn as nn ...
anglixjtu/MSG_CHN_WACV20
MAELoss
false
14,841
[ "Apache-2.0" ]
61
6910894cf3caed2ffde27586f96b132b0c1d1a98
https://github.com/anglixjtu/MSG_CHN_WACV20/tree/6910894cf3caed2ffde27586f96b132b0c1d1a98
LinearConvNet
import torch import torch.nn as nn class LinearConvNet(nn.Module): def __init__(self): super(LinearConvNet, self).__init__() self.conv1 = nn.Conv2d(1, 5, 3, 1) self.conv2 = nn.Conv2d(1, 3, 2, 1, bias=False) def forward(self, x): conv1_out = self.conv1(x) conv2_out = s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
amyami187/nngeometry
LinearConvNet
false
14,842
[ "MIT" ]
103
cb516da3f7a019e148f48ff3ef3bed0cdae0d184
https://github.com/amyami187/nngeometry/tree/cb516da3f7a019e148f48ff3ef3bed0cdae0d184
NICEMLPBlock
import torch import torch.nn as nn class LinearWeightNorm(nn.Module): def __init__(self, in_features, out_features, bias=True): super(LinearWeightNorm, self).__init__() self.linear = nn.Linear(in_features, out_features, bias=bias) self.reset_parameters() def reset_parameters(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....
andrecianflone/wolf
NICEMLPBlock
false
14,843
[ "Apache-2.0" ]
75
826bbedc58d4d29871110349356868066a3108e6
https://github.com/andrecianflone/wolf/tree/826bbedc58d4d29871110349356868066a3108e6
TransformerEncoderLayer
import torch import torch.nn as nn import torch.nn.functional as F def _get_activation_fn(activation): if activation == 'relu': return F.relu elif activation == 'gelu': return F.gelu raise RuntimeError('activation should be relu/gelu, not {}'.format( activation)) class DotProduct...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
amazon-research/long-short-term-transformer
TransformerEncoderLayer
false
14,844
[ "Apache-2.0" ]
52
a425be4b52ab68fddd85c91d26571e4cdfe8379a
https://github.com/amazon-research/long-short-term-transformer/tree/a425be4b52ab68fddd85c91d26571e4cdfe8379a
SetConv
import torch import torch.nn as nn import torch.nn.functional as F class SetConv(nn.Module): def __init__(self, sample_feats, predicate_feats, join_feats, hid_units): super(SetConv, self).__init__() self.sample_mlp1 = nn.Linear(sample_feats, hid_units) self.sample_mlp2 = nn.Linear(hid_uni...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
amogkam/learnedcardinalities
SetConv
false
14,845
[ "MIT" ]
64
295eabcf9ede38e7e9d1a6a8bcd00f349b628bf9
https://github.com/amogkam/learnedcardinalities/tree/295eabcf9ede38e7e9d1a6a8bcd00f349b628bf9
MAE
import torch import torch.nn as nn class MAE(nn.Module): def __init__(self): super(MAE, self).__init__() def forward(self, outputs, target, *args): val_pixels = (target > 0).float() * (outputs > 0).float() err = torch.abs(target * val_pixels - outputs * val_pixels) loss = 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 from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
anglixjtu/MSG_CHN_WACV20
MAE
false
14,846
[ "Apache-2.0" ]
61
6910894cf3caed2ffde27586f96b132b0c1d1a98
https://github.com/anglixjtu/MSG_CHN_WACV20/tree/6910894cf3caed2ffde27586f96b132b0c1d1a98
TransformerDecoderLayer
import torch import torch.nn as nn import torch.nn.functional as F def _get_activation_fn(activation): if activation == 'relu': return F.relu elif activation == 'gelu': return F.gelu raise RuntimeError('activation should be relu/gelu, not {}'.format( activation)) class DotProduct...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
amazon-research/long-short-term-transformer
TransformerDecoderLayer
false
14,847
[ "Apache-2.0" ]
52
a425be4b52ab68fddd85c91d26571e4cdfe8379a
https://github.com/amazon-research/long-short-term-transformer/tree/a425be4b52ab68fddd85c91d26571e4cdfe8379a
ConvNet
import torch import torch.nn as nn import torch.nn.functional as tF class ConvNet(nn.Module): def __init__(self): super(ConvNet, self).__init__() self.conv1 = nn.Conv2d(1, 5, 3, 1) self.conv2 = nn.Conv2d(5, 6, 4, 1, bias=False) self.conv3 = nn.Conv2d(6, 7, 3, 1) self.fc1 =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
amyami187/nngeometry
ConvNet
false
14,848
[ "MIT" ]
103
cb516da3f7a019e148f48ff3ef3bed0cdae0d184
https://github.com/amyami187/nngeometry/tree/cb516da3f7a019e148f48ff3ef3bed0cdae0d184
MSELoss
import torch import torch.nn as nn class MSELoss(nn.Module): def __init__(self): super(MSELoss, self).__init__() def forward(self, outputs, target, *args): val_pixels = torch.ne(target, 0).float() loss = target * val_pixels - outputs * val_pixels return torch.sum(loss ** 2) /...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
anglixjtu/MSG_CHN_WACV20
MSELoss
false
14,849
[ "Apache-2.0" ]
61
6910894cf3caed2ffde27586f96b132b0c1d1a98
https://github.com/anglixjtu/MSG_CHN_WACV20/tree/6910894cf3caed2ffde27586f96b132b0c1d1a98
MeanAggregator
import torch import torch.nn as nn class MeanAggregator(nn.Module): def __init__(self): super(MeanAggregator, self).__init__() def forward(self, x: 'torch.Tensor'): return x.mean(dim=1) def __call__(self, *args, **kwargs): return super(MeanAggregator, self).__call__(*args, **kwa...
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...
angpo/VKD
MeanAggregator
false
14,850
[ "MIT" ]
68
2a136e00dad4c73612d6efe087675604ac2416eb
https://github.com/angpo/VKD/tree/2a136e00dad4c73612d6efe087675604ac2416eb
DepthwiseSeparableConv
import torch import torch.nn.functional as F import torch.cuda import torch.nn as nn class DepthwiseSeparableConv(nn.Module): def __init__(self, in_ch, out_ch, k, bias=True): super().__init__() self.depthwise_conv = nn.Conv1d(in_channels=in_ch, out_channels= in_ch, kernel_size=k, grou...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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.cuda import torc...
andy840314/QANet-pytorch-
DepthwiseSeparableConv
false
14,851
[ "MIT" ]
92
3c11e2d7139e040eee90dd24b673eb1039957cae
https://github.com/andy840314/QANet-pytorch-/tree/3c11e2d7139e040eee90dd24b673eb1039957cae
BuildBlock
import torch import torch.nn.functional as F from torch import nn class BuildBlock(nn.Module): def __init__(self, planes=256): super(BuildBlock, self).__init__() self.planes = planes self.toplayer1 = nn.Conv2d(2048, planes, kernel_size=1, stride=1, padding=0) self.topl...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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...
YacobBY/ICDAR2019-ArT-Recognition-Alchemy
BuildBlock
false
14,852
[ "MIT" ]
209
911c572c2aff4599a74b7974d46ef4cfb17078b9
https://github.com/YacobBY/ICDAR2019-ArT-Recognition-Alchemy/tree/911c572c2aff4599a74b7974d46ef4cfb17078b9
ResNetV2
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.model_zoo import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed from collections import OrderedDict def conv1x1(cin, cout, stride=1, bias=False): return StdConv2d(cin, cout, kern...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
HelenR6/imagenet-r
ResNetV2
false
14,853
[ "MIT" ]
155
0bf04f2bf5d60d1098fc9a78f4e8c042e434eb69
https://github.com/HelenR6/imagenet-r/tree/0bf04f2bf5d60d1098fc9a78f4e8c042e434eb69
RMSE
import torch import torch.nn as nn class RMSE(nn.Module): def __init__(self): super(RMSE, self).__init__() def forward(self, outputs, target, *args): val_pixels = (target > 0).float() * (outputs > 0).float() err = (target * val_pixels - outputs * val_pixels) ** 2 loss = torch...
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_...
anglixjtu/MSG_CHN_WACV20
RMSE
false
14,854
[ "Apache-2.0" ]
61
6910894cf3caed2ffde27586f96b132b0c1d1a98
https://github.com/anglixjtu/MSG_CHN_WACV20/tree/6910894cf3caed2ffde27586f96b132b0c1d1a98
SequenceBias
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from torch.nn.parameter import Parameter class SequenceBias(nn.Module): """ Adds one bias element to the end of the sequence. so if the input has a shape ``(L, N, E)``, where ``L`` i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from torch.nn.parameter import Pa...
anibadde/opacus
SequenceBias
false
14,855
[ "Apache-2.0" ]
958
be221231e1b579bdae4ad34c8ae0c7c4928cee25
https://github.com/anibadde/opacus/tree/be221231e1b579bdae4ad34c8ae0c7c4928cee25
iMAE
import torch import torch.nn as nn class iMAE(nn.Module): def __init__(self): super(iMAE, self).__init__() def forward(self, outputs, target, *args): outputs = outputs / 1000.0 target = target / 1000.0 outputs[outputs == 0] = -1 target[target == 0] = -1 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.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
anglixjtu/MSG_CHN_WACV20
iMAE
false
14,856
[ "Apache-2.0" ]
61
6910894cf3caed2ffde27586f96b132b0c1d1a98
https://github.com/anglixjtu/MSG_CHN_WACV20/tree/6910894cf3caed2ffde27586f96b132b0c1d1a98
ResNetBlockGroupNorm
import torch import torch.nn as nn def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) class ResNetBlockGroupNorm(nn.Module): def __init__(self, inplanes, planes, num_groups...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
andrecianflone/wolf
ResNetBlockGroupNorm
false
14,857
[ "Apache-2.0" ]
75
826bbedc58d4d29871110349356868066a3108e6
https://github.com/andrecianflone/wolf/tree/826bbedc58d4d29871110349356868066a3108e6
Swish
import torch import torch.nn as nn import torch.distributed class Swish(nn.Module): def __init__(self): super(Swish, self).__init__() self.beta = nn.Parameter(torch.tensor(1.0)) def forward(self, x): return x * torch.sigmoid(self.beta * 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 import torch.nn as nn import torch.distributed assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C...
anidnerocram/PointFlow
Swish
false
14,858
[ "MIT" ]
539
b9f82a5534fad830c99ba0a30f4f3320626f64f4
https://github.com/anidnerocram/PointFlow/tree/b9f82a5534fad830c99ba0a30f4f3320626f64f4
iRMSE
import torch import torch.nn as nn class iRMSE(nn.Module): def __init__(self): super(iRMSE, self).__init__() def forward(self, outputs, target, *args): outputs = outputs / 1000.0 target = target / 1000.0 outputs[outputs == 0] = -1 target[target == 0] = -1 outp...
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_...
anglixjtu/MSG_CHN_WACV20
iRMSE
false
14,859
[ "Apache-2.0" ]
61
6910894cf3caed2ffde27586f96b132b0c1d1a98
https://github.com/anglixjtu/MSG_CHN_WACV20/tree/6910894cf3caed2ffde27586f96b132b0c1d1a98
DPRNNCell
import math import torch from torch import Tensor import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Optional class RNNLinear(nn.Linear): """Applies a linear transformation to the incoming data: :math:`y = xA^T + b` This module is the...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
anibadde/opacus
DPRNNCell
false
14,860
[ "Apache-2.0" ]
958
be221231e1b579bdae4ad34c8ae0c7c4928cee25
https://github.com/anibadde/opacus/tree/be221231e1b579bdae4ad34c8ae0c7c4928cee25
JointsMSELoss
import torch import torch.nn as nn import torch.utils.data import torch.nn.parallel import torch.optim import torch.utils.data.distributed import torch.multiprocessing class JointsMSELoss(nn.Module): def __init__(self, use_target_weight): super(JointsMSELoss, self).__init__() self.criterion = nn....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data import torch.nn.parallel import torch.optim import torch.utils.data.distributed import torch.m...
ankhzaya/HigherHRNet-Human-Pose-Estimation
JointsMSELoss
false
14,861
[ "MIT" ]
775
b4610aecaa5cf3de3cd69bfb13c7c79c8d514c7c
https://github.com/ankhzaya/HigherHRNet-Human-Pose-Estimation/tree/b4610aecaa5cf3de3cd69bfb13c7c79c8d514c7c
Cosine
from _paritybench_helpers import _mock_config import torch from torch.optim.lr_scheduler import * class Cosine(torch.nn.Module): def __init__(self, config): super().__init__() def forward(self, src, tgt): src = src.float() tgt = tgt.float() return (torch.matmul(src, tgt.trans...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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.optim.lr...
anlewy/mt-dnn
Cosine
false
14,862
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
MseCriterion
import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * class Criterion(_Loss): def __init__(self, alpha=1.0, name='criterion'): super().__init__() """Alpha is used to weight each loss term """ self.alpha = alpha ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * assert_siz...
anlewy/mt-dnn
MseCriterion
false
14,863
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
HLCriterion
import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * class Criterion(_Loss): def __init__(self, alpha=1.0, name='criterion'): super().__init__() """Alpha is used to weight each loss term """ self.alpha = alpha ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch....
anlewy/mt-dnn
HLCriterion
false
14,864
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
NsKlCriterion
import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * def stable_kl(logit, target, epsilon=1e-06, reduce=True): logit = logit.view(-1, logit.size(-1)).float() target = target.view(-1, target.size(-1)).float() bs = logit.size(0) p = ...
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...
anlewy/mt-dnn
NsKlCriterion
false
14,865
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
DPGRUCell
import math import torch from torch import Tensor import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Optional class RNNLinear(nn.Linear): """Applies a linear transformation to the incoming data: :math:`y = xA^T + b` This module is the...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
anibadde/opacus
DPGRUCell
false
14,866
[ "Apache-2.0" ]
958
be221231e1b579bdae4ad34c8ae0c7c4928cee25
https://github.com/anibadde/opacus/tree/be221231e1b579bdae4ad34c8ae0c7c4928cee25
EDMLoss
import torch import torch.nn as nn import torch.optim class EDMLoss(nn.Module): def __init__(self): super(EDMLoss, self).__init__() def forward(self, p_target: 'torch.Tensor', p_estimate: 'torch.Tensor'): assert p_target.shape == p_estimate.shape cdf_target = torch.cumsum(p_target, d...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
ankerok1/nima.pytorch
EDMLoss
false
14,867
[ "MIT" ]
300
bbdbeeb8c22d880205a4fa35cfc2a533d064ee5d
https://github.com/ankerok1/nima.pytorch/tree/bbdbeeb8c22d880205a4fa35cfc2a533d064ee5d
KlCriterion
import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * class Criterion(_Loss): def __init__(self, alpha=1.0, name='criterion'): super().__init__() """Alpha is used to weight each loss term """ self.alpha = alpha ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch....
anlewy/mt-dnn
KlCriterion
false
14,868
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
JSCriterion
import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * class Criterion(_Loss): def __init__(self, alpha=1.0, name='criterion'): super().__init__() """Alpha is used to weight each loss term """ self.alpha = alpha ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch....
anlewy/mt-dnn
JSCriterion
false
14,869
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
SymKlCriterion
import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * class Criterion(_Loss): def __init__(self, alpha=1.0, name='criterion'): super().__init__() """Alpha is used to weight each loss term """ self.alpha = alpha ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch....
anlewy/mt-dnn
SymKlCriterion
false
14,870
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
MultiheadAttentionWrapper
import torch import torch.nn.functional as F import torch.nn as nn from torch.nn.utils import weight_norm 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 ...
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.functional as F import torch.nn as nn from torch.nn.utils import weight_norm from torch.optim.lr_scheduler import * assert_s...
anlewy/mt-dnn
MultiheadAttentionWrapper
false
14,871
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
DPLSTMCell
import math import torch from torch import Tensor import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Tuple from typing import Optional class RNNLinear(nn.Linear): """Applies a linear transformation to the incoming data: :math:`y = xA^T + b...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
anibadde/opacus
DPLSTMCell
false
14,872
[ "Apache-2.0" ]
958
be221231e1b579bdae4ad34c8ae0c7c4928cee25
https://github.com/anibadde/opacus/tree/be221231e1b579bdae4ad34c8ae0c7c4928cee25
Clump
import torch from torch import nn class Clump(nn.Module): """Clipping input tensor.""" def __init__(self, min_v: 'int'=-50, max_v: 'int'=50): """Class for preparing input for DL model with mixed data. Args: min_v: Min value. max_v: Max value. """ supe...
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...
antigab/LightAutoML
Clump
false
14,873
[ "Apache-2.0" ]
766
51a4e2bd0ebffbe0817fb50434280f8e7c40fa4c
https://github.com/antigab/LightAutoML/tree/51a4e2bd0ebffbe0817fb50434280f8e7c40fa4c
NsSymKlCriterion
import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from torch.optim.lr_scheduler import * def stable_kl(logit, target, epsilon=1e-06, reduce=True): logit = logit.view(-1, logit.size(-1)).float() target = target.view(-1, target.size(-1)).float() bs = logit.size(0) p = ...
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...
anlewy/mt-dnn
NsSymKlCriterion
false
14,874
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
BiLinearSim
from _paritybench_helpers import _mock_config import torch from torch.optim.lr_scheduler import * class BiLinearSim(torch.nn.Module): def __init__(self, config): super().__init__() self.linear = torch.nn.Linear(config.hidden_size, config. hidden_size, bias=False) 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.optim.lr_scheduler import * assert_size_stride = torch._C._dynamo.gua...
anlewy/mt-dnn
BiLinearSim
false
14,875
[ "MIT" ]
2,075
eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45
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.norm(x, dim=-1, keepdim=True) * self.sc...
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_...
antofuller/configaformers
ScaleNorm
false
14,876
[ "Apache-2.0" ]
51
293253cd35d96c8a24c4004ba3d24fc6dc85a260
https://github.com/antofuller/configaformers/tree/293253cd35d96c8a24c4004ba3d24fc6dc85a260
RMSNorm
import torch from torch import nn class RMSNorm(nn.Module): def __init__(self, dim, eps=1e-08): super().__init__() self.scale = dim ** -0.5 self.eps = eps self.g = nn.Parameter(torch.ones(dim)) def forward(self, x): _norm = torch.norm(x, dim=-1, keepdim=True) * self.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 from torch import nn assert_...
antofuller/configaformers
RMSNorm
false
14,877
[ "Apache-2.0" ]
51
293253cd35d96c8a24c4004ba3d24fc6dc85a260
https://github.com/antofuller/configaformers/tree/293253cd35d96c8a24c4004ba3d24fc6dc85a260
InputProjectionA
import torch import torch.nn as nn class InputProjectionA(nn.Module): """ This class projects the input image to the same spatial dimensions as the feature map. For example, if the input image is 512 x512 x3 and spatial dimensions of feature map size are 56x56xF, then this class will generate an outpu...
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...
anilsathyan7/Portrait-Segmentation
InputProjectionA
false
14,878
[ "MIT" ]
537
dbf69b043cf70d3362bc500ee620f20807e622d2
https://github.com/anilsathyan7/Portrait-Segmentation/tree/dbf69b043cf70d3362bc500ee620f20807e622d2