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
SENet
import torch import torch.nn as nn import torch.utils.data class SENet(nn.Module): """support estimation network""" def __init__(self, input_size: 'int', hidden_size: 'int', output_dims: 'int') ->None: super(SENet, self).__init__() self.l_1 = nn.Linear(input_size, 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 ...
Weiyuhong-1998/DI-engine
SENet
false
14,579
[ "Apache-2.0" ]
464
88658ea358298c6e61e95a454284b8853a3e9484
https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484
ATOCAttentionUnit
import torch from typing import Union import torch.nn as nn from typing import Dict import torch.utils.data class ATOCAttentionUnit(nn.Module): """ Overview: the attention unit of the atoc network. We now implement it as two-layer MLP, same as the original paper Interface: __init__, forwa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
Weiyuhong-1998/DI-engine
ATOCAttentionUnit
false
14,580
[ "Apache-2.0" ]
464
88658ea358298c6e61e95a454284b8853a3e9484
https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484
ReverseMaskConv
import math import torch import torch.nn as nn from torch.nn.parameter import Parameter def weights_init(init_type='gaussian'): def init_fun(m): classname = m.__class__.__name__ if (classname.find('Conv') == 0 or classname.find('Linear') == 0 ) and hasattr(m, 'weight'): if...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Vious/LBAM_Pytorch
ReverseMaskConv
false
14,581
[ "MIT" ]
112
b9292440e7a7559c027f48d6fd061dcabc41a6bf
https://github.com/Vious/LBAM_Pytorch/tree/b9292440e7a7559c027f48d6fd061dcabc41a6bf
AvgPool2dSame
import math import torch import numpy as np from typing import List import torch.nn as nn import torch.nn.functional as F import torch.utils.data def get_same_padding(x: 'int', k: 'int', s: 'int', d: 'int'): return max((math.ceil(x / s) - 1) * s + (k - 1) * d + 1 - x, 0) def pad_same(x, k: 'List[int]', s: 'List...
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 numpy as np from typing import List import torch.nn as nn import torch.nn.functional as F import torch.utils.data assert_...
Weiyuhong-1998/DI-engine
AvgPool2dSame
false
14,582
[ "Apache-2.0" ]
464
88658ea358298c6e61e95a454284b8853a3e9484
https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484
ScaledDotProductAttention
import torch from typing import Optional import torch.nn as nn import torch.nn.functional as F import torch.utils.data class ScaledDotProductAttention(nn.Module): """ Overview: Implementation of dot product attentionn with scaling. """ def __init__(self, d_k: 'int', dropout: 'float'=0.0) ->No...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Weiyuhong-1998/DI-engine
ScaledDotProductAttention
false
14,583
[ "Apache-2.0" ]
464
88658ea358298c6e61e95a454284b8853a3e9484
https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484
BertIntermediate
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
VinodS7/sota-music-tagging-models
BertIntermediate
false
14,584
[ "MIT" ]
199
6232abe693ebe6a99ea64a3ea1fe65c34d0a9dd0
https://github.com/VinodS7/sota-music-tagging-models/tree/6232abe693ebe6a99ea64a3ea1fe65c34d0a9dd0
SHR_Block
import torch import torch.nn as nn import torch.utils.data class Mlp(nn.Module): def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0): super().__init__() out_features = out_features or in_features hidden_features = hidden_features o...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Vegetebird/MHFormer
SHR_Block
false
14,585
[ "MIT" ]
83
68d793414e13c256249431a45ac49949930c8e7f
https://github.com/Vegetebird/MHFormer/tree/68d793414e13c256249431a45ac49949930c8e7f
MultiHeadAttention
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class MultiHeadAttention(nn.Module): def __init__(self, in_dim, out_dim, out_heads, relation_dim=0, residual =False, projection=True, layer_norm=True): super().__init__() self.in_dim = in_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....
Weiyuhong-1998/DI-engine
MultiHeadAttention
false
14,586
[ "Apache-2.0" ]
464
88658ea358298c6e61e95a454284b8853a3e9484
https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484
CNN
import torch import torch.nn as nn import torch.nn.functional as F class CNN(nn.Module): def __init__(self, input_size=50, hidden_size=256, dropout=0, kernel_size=3, padding=1, activation_function=F.relu): """ Args: input_size: dimention of input embedding kernel_s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
WinterSoHot/OpenNRE
CNN
false
14,587
[ "MIT" ]
3,284
bc58d8fff2a2f42a5349c184f16ab7a8c50ae32b
https://github.com/WinterSoHot/OpenNRE/tree/bc58d8fff2a2f42a5349c184f16ab7a8c50ae32b
MS_Block
import torch from torch import nn from torch.nn.functional import interpolate class MS_Block(nn.Module): def __init__(self, in_channel, out_channel, pool_level, txt_length): super(MS_Block, self).__init__() self.txt_length = txt_length pool_kernel = 5 * pool_level, 1 pool_stride =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
WangGodder/deep-cross-modal-hashing
MS_Block
false
14,588
[ "MIT" ]
65
9784397c1076c81b43ebd856cb24b8a67cf8f41e
https://github.com/WangGodder/deep-cross-modal-hashing/tree/9784397c1076c81b43ebd856cb24b8a67cf8f41e
MaxMarginRankingLoss
import torch import torch.nn as nn import torch.nn.functional as F class MaxMarginRankingLoss(nn.Module): def __init__(self, margin=1): super(MaxMarginRankingLoss, self).__init__() self.margin = margin def forward(self, x): n = x.size()[0] x1 = torch.diag(x) x1 = x1.u...
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...
Worm4047/TVR
MaxMarginRankingLoss
false
14,589
[ "MIT" ]
106
2a8ce2edbdc0966aef3b84c28872267039f01700
https://github.com/Worm4047/TVR/tree/2a8ce2edbdc0966aef3b84c28872267039f01700
BertOutput
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class BertOutput(nn.Module): def __init__(self, config): super(BertOutput, self).__init__() self.dense = nn.Linear(config.intermediate_size, config.hidden_size) self.LayerNorm = nn.LayerNorm(config.hidden_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 from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
Worm4047/TVR
BertOutput
false
14,590
[ "MIT" ]
106
2a8ce2edbdc0966aef3b84c28872267039f01700
https://github.com/Worm4047/TVR/tree/2a8ce2edbdc0966aef3b84c28872267039f01700
StdConv2d
import torch import torch.nn as nn import torch.nn.functional as F class StdConv2d(nn.Conv2d): def forward(self, x): w = self.weight v, m = torch.var_mean(w, dim=[1, 2, 3], keepdim=True, unbiased=False) w = (w - m) / torch.sqrt(v + 1e-05) return F.conv2d(x, w, self.bias, self.stri...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
Willy0919/progressive-coordinate-transforms
StdConv2d
false
14,591
[ "Apache-2.0", "MIT" ]
142
b637fa2541a815d270e162a4c9cd3348b098d48a
https://github.com/Willy0919/progressive-coordinate-transforms/tree/b637fa2541a815d270e162a4c9cd3348b098d48a
DWConv
import torch from torch import nn class BasicConv(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', use_bn=True, use_relu=True, inplace=True): super().__init__() self.conv = 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 from torch import nn assert_s...
WenmuZhou/crnn.pytorch
DWConv
false
14,592
[ "Apache-2.0" ]
46
bf7a7c62376eee93943ca7c68e88e3d563c09aa8
https://github.com/WenmuZhou/crnn.pytorch/tree/bf7a7c62376eee93943ca7c68e88e3d563c09aa8
Gradient_Loss
import torch import numpy as np import torch.utils.data import torch.nn as nn class Gradient_Loss(nn.Module): def __init__(self, losstype='l2'): super(Gradient_Loss, self).__init__() a = np.array([[1, 0, -1], [2, 0, -2], [1, 0, -1]]) conv1 = nn.Conv2d(3, 3, kernel_size=3, stride=1, paddin...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 numpy ...
WestCityInstitute/InvDN
Gradient_Loss
false
14,593
[ "Apache-2.0" ]
122
3846cf3548ccf6690e58be3aafe1f6d98c56b90d
https://github.com/WestCityInstitute/InvDN/tree/3846cf3548ccf6690e58be3aafe1f6d98c56b90d
CHI_Block
import torch import torch.nn as nn import torch.utils.data class Mlp(nn.Module): def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0): super().__init__() out_features = out_features or in_features hidden_features = hidden_features o...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Vegetebird/MHFormer
CHI_Block
false
14,594
[ "MIT" ]
83
68d793414e13c256249431a45ac49949930c8e7f
https://github.com/Vegetebird/MHFormer/tree/68d793414e13c256249431a45ac49949930c8e7f
FeatureResizer
import torch from torch import nn class FeatureResizer(nn.Module): """ This class takes as input a set of embeddings of dimension C1 and outputs a set of embedding of dimension C2, after a linear transformation, dropout and normalization (LN). """ def __init__(self, input_feat_size, output_feat_s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
XiaoJake/MTTR
FeatureResizer
false
14,595
[ "Apache-2.0" ]
516
c383c5b151e3c97aeb45cd2fb4bf08719016498b
https://github.com/XiaoJake/MTTR/tree/c383c5b151e3c97aeb45cd2fb4bf08719016498b
BertAttention
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Worm4047/TVR
BertAttention
false
14,596
[ "MIT" ]
106
2a8ce2edbdc0966aef3b84c28872267039f01700
https://github.com/Worm4047/TVR/tree/2a8ce2edbdc0966aef3b84c28872267039f01700
multi_head_attention_2d
import torch import torch.nn as nn class multi_head_attention_2d(torch.nn.Module): def __init__(self, in_channel, key_filters, value_filters, output_filters, num_heads, dropout_prob=0.5, layer_type='SAME'): super().__init__() """Multihead scaled-dot-product attention with input/output tra...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Whu-wxy/Non-local-U-Nets-2D-block
multi_head_attention_2d
false
14,597
[ "MIT" ]
117
668d0356b9a276f6cfdc69d669da7d47b260c4c0
https://github.com/Whu-wxy/Non-local-U-Nets-2D-block/tree/668d0356b9a276f6cfdc69d669da7d47b260c4c0
MNIST_CNN
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.optim class MNIST_CNN(nn.Module): """ Hand-tuned architecture for MNIST. Weirdness I've noticed so far with this architecture: - adding a linear layer after the mean-pool in features hurts R...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Weixin-Liang/MetaShift
MNIST_CNN
false
14,598
[ "MIT" ]
54
84e090a13652437f8f392065f6bebf938e4c7fa3
https://github.com/Weixin-Liang/MetaShift/tree/84e090a13652437f8f392065f6bebf938e4c7fa3
DCHR
import torch import torch.nn as nn class DCHR(nn.Module): def __init__(self, stride): super(DCHR, self).__init__() self.pool = nn.AvgPool2d(kernel_size=stride) def forward(self, x): pool = self.pool(x) shape = pool.shape shape = [i for i in shape] shape[1] = s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
XiaotaoChen/model-quantization
DCHR
false
14,599
[ "BSD-2-Clause" ]
66
a745ef691e9329b9c973a2dd795761cd3da8b6ae
https://github.com/XiaotaoChen/model-quantization/tree/a745ef691e9329b9c973a2dd795761cd3da8b6ae
ESA
import torch import torch.nn as nn import torch.nn.functional as F class ESA(nn.Module): def __init__(self, channel=64, reduction=4, bias=True): super(ESA, self).__init__() self.r_nc = channel // reduction self.conv1 = nn.Conv2d(channel, self.r_nc, kernel_size=1) self.conv21 = 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 assert_...
WestCityInstitute/KAIR
ESA
false
14,600
[ "MIT" ]
1,521
3eb3cc7776fa8c57e8ed7c71bfa8039beb4c6677
https://github.com/WestCityInstitute/KAIR/tree/3eb3cc7776fa8c57e8ed7c71bfa8039beb4c6677
SEBlock
import torch from torch import nn from torch.nn import functional as F class HardSigmoid(nn.Module): def __init__(self, slope=0.2, offset=0.5): super().__init__() self.slope = slope self.offset = offset def forward(self, x): x = self.slope * x + self.offset x = F.thre...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 from tor...
WenmuZhou/crnn.pytorch
SEBlock
false
14,601
[ "Apache-2.0" ]
46
bf7a7c62376eee93943ca7c68e88e3d563c09aa8
https://github.com/WenmuZhou/crnn.pytorch/tree/bf7a7c62376eee93943ca7c68e88e3d563c09aa8
GlobalAvgPool
import torch import torch as th from torch import nn class GlobalAvgPool(nn.Module): def __init__(self): super(GlobalAvgPool, self).__init__() def forward(self, x): return th.mean(x, dim=[-2, -1]) 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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
XudongLinthu/video_feature_extractor
GlobalAvgPool
false
14,602
[ "Apache-2.0" ]
250
54bdbeef2e9f4db8d7697b26edef124979625f58
https://github.com/XudongLinthu/video_feature_extractor/tree/54bdbeef2e9f4db8d7697b26edef124979625f58
UNetSeeInDark
import torch from torch import nn class UNetSeeInDark(nn.Module): def __init__(self, in_channels=4, out_channels=3): super(UNetSeeInDark, self).__init__() self.conv1_1 = nn.Conv2d(in_channels, 32, kernel_size=3, stride=1, padding=1) self.conv1_2 = nn.Conv2d(32, 32, kernel_size...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
Vandermode/ELD
UNetSeeInDark
false
14,603
[ "MIT" ]
258
aa0edb44a8fc20e01f83c1f6e93ee70d3190e142
https://github.com/Vandermode/ELD/tree/aa0edb44a8fc20e01f83c1f6e93ee70d3190e142
TrainablePositionalEncoding
import torch import torch.nn as nn class TrainablePositionalEncoding(nn.Module): """Construct the embeddings from word, position and token_type embeddings. """ def __init__(self, max_position_embeddings, hidden_size, dropout=0.1): super(TrainablePositionalEncoding, self).__init__() self.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.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
Worm4047/TVR
TrainablePositionalEncoding
false
14,604
[ "MIT" ]
106
2a8ce2edbdc0966aef3b84c28872267039f01700
https://github.com/Worm4047/TVR/tree/2a8ce2edbdc0966aef3b84c28872267039f01700
EnchanceReLU
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class EnchanceReLU(nn.ReLU): def __init__(self, args): super(EnchanceReLU, self).__init__(inplace=True) self.shift = getattr(args, 'fm_boundary', 0.25) def forward(self, x): x = x + self.shift 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._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
XiaotaoChen/model-quantization
EnchanceReLU
false
14,605
[ "BSD-2-Clause" ]
66
a745ef691e9329b9c973a2dd795761cd3da8b6ae
https://github.com/XiaotaoChen/model-quantization/tree/a745ef691e9329b9c973a2dd795761cd3da8b6ae
GeM
import torch import torch.nn as nn class GeM(nn.Module): def __init__(self, p=3, eps=1e-06): super(GeM, self).__init__() self.p = nn.Parameter(torch.ones(1) * p) self.eps = eps def forward(self, x): return nn.functional.avg_pool2d(x.clamp(min=self.eps).pow(self.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 libdevice import torch.nn as nn assert...
XiaoJake/MinkLocMultimodal
GeM
false
14,606
[ "MIT" ]
49
683ef1aae35ab1b60f13cefccfdd0e3f9cb9ea6e
https://github.com/XiaoJake/MinkLocMultimodal/tree/683ef1aae35ab1b60f13cefccfdd0e3f9cb9ea6e
BertSelfAttention
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Worm4047/TVR
BertSelfAttention
false
14,607
[ "MIT" ]
106
2a8ce2edbdc0966aef3b84c28872267039f01700
https://github.com/Worm4047/TVR/tree/2a8ce2edbdc0966aef3b84c28872267039f01700
ResBlock
import torch import torch.utils.data import torch.nn as nn class ResBlock(nn.Module): def __init__(self, channel_in, channel_out): super(ResBlock, self).__init__() feature = 64 self.conv1 = nn.Conv2d(channel_in, feature, kernel_size=3, padding=1) self.relu1 = nn.LeakyReLU(negative...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
WestCityInstitute/InvDN
ResBlock
false
14,608
[ "Apache-2.0" ]
122
3846cf3548ccf6690e58be3aafe1f6d98c56b90d
https://github.com/WestCityInstitute/InvDN/tree/3846cf3548ccf6690e58be3aafe1f6d98c56b90d
GeLU
import torch import torch.nn as nn class GeLU(nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(x * 0.7978845608 * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): 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 as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
YJiangcm/Chinese-sentence-pair-modeling
GeLU
false
14,609
[ "Apache-2.0" ]
49
90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
https://github.com/YJiangcm/Chinese-sentence-pair-modeling/tree/90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
PatchMerging
import torch import torchvision.transforms.functional as F import torch.nn.functional as F from torch import nn class PatchMerging(nn.Module): """ Patch Merging Layer Args: dim (int): Number of input channels. norm_layer (nn.Module, optional): Normalization layer. Default: nn.LayerNorm "...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
XiaoJake/MTTR
PatchMerging
false
14,610
[ "Apache-2.0" ]
516
c383c5b151e3c97aeb45cd2fb4bf08719016498b
https://github.com/XiaoJake/MTTR/tree/c383c5b151e3c97aeb45cd2fb4bf08719016498b
NIN2d
import torch import torch.nn as nn from torch.nn import Parameter def norm(p: 'torch.Tensor', dim: 'int'): """Computes the norm over all dimensions except dim""" if dim is None: return p.norm() elif dim == 0: output_size = (p.size(0),) + (1,) * (p.dim() - 1) return p.contiguous().v...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
XuezheMax/macow
NIN2d
false
14,611
[ "Apache-2.0" ]
60
6de247c09b590a037c9eec2d6b1248845f6efb31
https://github.com/XuezheMax/macow/tree/6de247c09b590a037c9eec2d6b1248845f6efb31
NIN4d
import torch import torch.nn as nn from torch.nn import Parameter def norm(p: 'torch.Tensor', dim: 'int'): """Computes the norm over all dimensions except dim""" if dim is None: return p.norm() elif dim == 0: output_size = (p.size(0),) + (1,) * (p.dim() - 1) return p.contiguous().v...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
XuezheMax/macow
NIN4d
false
14,612
[ "Apache-2.0" ]
60
6de247c09b590a037c9eec2d6b1248845f6efb31
https://github.com/XuezheMax/macow/tree/6de247c09b590a037c9eec2d6b1248845f6efb31
LinearWeightNorm
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.triton_helpers import libdevice import torch.nn as ...
XuezheMax/macow
LinearWeightNorm
false
14,613
[ "Apache-2.0" ]
60
6de247c09b590a037c9eec2d6b1248845f6efb31
https://github.com/XuezheMax/macow/tree/6de247c09b590a037c9eec2d6b1248845f6efb31
DepthwiseSeparableConv
import torch import torch.nn as nn import torch.nn.functional as F class DepthwiseSeparableConv(nn.Module): """ Depth-wise separable convolution uses less parameters to generate output by convolution. :Examples: >>> m = DepthwiseSeparableConv(300, 200, 5, dim=1) >>> input_tensor = torch.ra...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
Worm4047/TVR
DepthwiseSeparableConv
false
14,614
[ "MIT" ]
106
2a8ce2edbdc0966aef3b84c28872267039f01700
https://github.com/Worm4047/TVR/tree/2a8ce2edbdc0966aef3b84c28872267039f01700
McDalNetLoss
import torch import torch.nn as nn import torch.nn.functional as F def discrepancy_slice_wasserstein(p1, p2): s = p1.shape if s[1] > 1: proj = torch.randn(s[1], 128) proj *= torch.rsqrt(torch.sum(torch.mul(proj, proj), 0, keepdim=True)) p1 = torch.matmul(p1, proj) p2 = torch.ma...
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 ...
YBZh/MultiClassDA
McDalNetLoss
false
14,615
[ "MIT" ]
53
b0f61a5fe82f8b5414a14e8d77753fbf5d4bcb93
https://github.com/YBZh/MultiClassDA/tree/b0f61a5fe82f8b5414a14e8d77753fbf5d4bcb93
TorchAdd
import torch import torch.nn as nn class TorchAdd(nn.Module): """ TorchAdd Module. """ def forward(self, input_list): return input_list[0] + input_list[1] 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Yakings/AIPerf
TorchAdd
false
14,616
[ "MIT" ]
52
6e5c50a3b769ab4b1075aaab9841b5554f40bceb
https://github.com/Yakings/AIPerf/tree/6e5c50a3b769ab4b1075aaab9841b5554f40bceb
GlobalAvgPool1d
import torch import torch.nn as nn from abc import abstractmethod from torch.nn import functional class AvgPool(nn.Module): """ AvgPool Module. """ def __init__(self): super().__init__() @abstractmethod def forward(self, input_tensor): pass class GlobalAvgPool1d(AvgPool): ...
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 abc import abstractmethod assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = to...
Yakings/AIPerf
GlobalAvgPool1d
false
14,617
[ "MIT" ]
52
6e5c50a3b769ab4b1075aaab9841b5554f40bceb
https://github.com/Yakings/AIPerf/tree/6e5c50a3b769ab4b1075aaab9841b5554f40bceb
Log_Loss
import torch import torch.utils.data import torch.nn as nn import torch.nn.parallel class Log_Loss(nn.Module): def __init__(self): super(Log_Loss, self).__init__() def forward(self, ytrue, ypred): delta = ypred - ytrue return torch.mean(torch.log(torch.cosh(delta))) def get_inputs(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
YanLu-nyu/transferlearning
Log_Loss
false
14,618
[ "MIT" ]
9,657
037806c6eb8b0c12aefbfbf3e35cbf893093cff9
https://github.com/YanLu-nyu/transferlearning/tree/037806c6eb8b0c12aefbfbf3e35cbf893093cff9
GCN
import torch import torch.nn as nn import torch.nn.parallel class GCN(nn.Module): """ Graph convolution unit (single layer) """ def __init__(self, num_state, num_node, bias=False): super(GCN, self).__init__() self.conv1 = nn.Conv1d(num_node, num_node, kernel_size=1) self.relu = 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 ...
YJSYJSYJS/GloRe
GCN
false
14,619
[ "MIT" ]
200
b236dc92bd89f59c2b591c1b1ba5ead134ea75cd
https://github.com/YJSYJSYJS/GloRe/tree/b236dc92bd89f59c2b591c1b1ba5ead134ea75cd
Sine
import torch import torch.nn as nn class Sine(nn.Module): def __init__(self, w0): super().__init__() self.w0 = w0 def forward(self, x): return torch.sin(self.w0 * x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {'w0': 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 math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
YangChenye/neurecon
Sine
false
14,620
[ "MIT" ]
432
972e810ec252cfd16f630b1de6d2802d1b8de59a
https://github.com/YangChenye/neurecon/tree/972e810ec252cfd16f630b1de6d2802d1b8de59a
Prone
import logging import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.utils import _quadruple def conv1x1(in_planes, out_planes, stride=1, args=None, force_fp=False): """1x1 convolution""" if args is not None and hasattr(args, 'keyword'): return custom_conv(in_planes,...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 logging import torch.nn as nn import torch.nn.functional as F from torch....
XiaotaoChen/model-quantization
Prone
false
14,621
[ "BSD-2-Clause" ]
66
a745ef691e9329b9c973a2dd795761cd3da8b6ae
https://github.com/XiaotaoChen/model-quantization/tree/a745ef691e9329b9c973a2dd795761cd3da8b6ae
CFRB
import torch from collections import OrderedDict import torch.nn as nn import torch.nn.functional as F def sequential(*args): """Advanced nn.Sequential. Args: nn.Sequential, nn.Module Returns: nn.Sequential """ if len(args) == 1: if isinstance(args[0], OrderedDict): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 collections import Order...
WestCityInstitute/KAIR
CFRB
false
14,622
[ "MIT" ]
1,521
3eb3cc7776fa8c57e8ed7c71bfa8039beb4c6677
https://github.com/WestCityInstitute/KAIR/tree/3eb3cc7776fa8c57e8ed7c71bfa8039beb4c6677
PatchEmbed3D
import torch import torchvision.transforms.functional as F import torch.nn.functional as F from torch import nn class PatchEmbed3D(nn.Module): """ Video to Patch Embedding. Args: patch_size (int): Patch token size. Default: (2,4,4). in_chans (int): Number of input video channels. Default: 3. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
XiaoJake/MTTR
PatchEmbed3D
false
14,623
[ "Apache-2.0" ]
516
c383c5b151e3c97aeb45cd2fb4bf08719016498b
https://github.com/XiaoJake/MTTR/tree/c383c5b151e3c97aeb45cd2fb4bf08719016498b
convBlock_basic
import torch from torch import nn class convBlock_basic(nn.Module): def __init__(self, inChannel, outChannel, kernel, stride, pad, use_batchnorm=False): super(convBlock_basic, self).__init__() self.use_batchnorm = use_batchnorm self.conv = nn.Conv2d(inChannel, outChannel, kernel, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
YacobBY/ICDAR2019-ArT-Recognition-Alchemy
convBlock_basic
false
14,624
[ "MIT" ]
209
911c572c2aff4599a74b7974d46ef4cfb17078b9
https://github.com/YacobBY/ICDAR2019-ArT-Recognition-Alchemy/tree/911c572c2aff4599a74b7974d46ef4cfb17078b9
AttentionUnit
import torch import torch.nn.functional as F from torch import nn from torch.nn import init class AttentionUnit(nn.Module): def __init__(self, sDim, xDim, attDim): super(AttentionUnit, self).__init__() self.sDim = sDim self.xDim = xDim self.attDim = attDim self.sEmbed = 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....
YacobBY/ICDAR2019-ArT-Recognition-Alchemy
AttentionUnit
false
14,625
[ "MIT" ]
209
911c572c2aff4599a74b7974d46ef4cfb17078b9
https://github.com/YacobBY/ICDAR2019-ArT-Recognition-Alchemy/tree/911c572c2aff4599a74b7974d46ef4cfb17078b9
SoftmaxAttention
import torch import torch.nn as nn def masked_softmax(tensor, mask): """ Apply a masked softmax on the last dimension of a tensor. The input tensor and mask should be of size (batch, *, sequence_length). Args: tensor: The tensor on which the softmax function must be applied along t...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
YJiangcm/Chinese-sentence-pair-modeling
SoftmaxAttention
false
14,626
[ "Apache-2.0" ]
49
90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
https://github.com/YJiangcm/Chinese-sentence-pair-modeling/tree/90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
OZELoss
import torch import torch.utils.data import torch.nn as nn import torch.nn.parallel class OZELoss(nn.Module): """Custom loss for TRNSys metamodel. Compute, for temperature and consumptions, the intergral of the squared differences over time. Sum the log with a coeficient ``alpha``. .. math:: ...
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.utils.data import torch.nn as nn import torch.nn.parallel as...
YanLu-nyu/transferlearning
OZELoss
false
14,627
[ "MIT" ]
9,657
037806c6eb8b0c12aefbfbf3e35cbf893093cff9
https://github.com/YanLu-nyu/transferlearning/tree/037806c6eb8b0c12aefbfbf3e35cbf893093cff9
AdjustSigmoid
from torch.nn import Module import torch from torch import Tensor from typing import Optional def KORNIA_CHECK_IS_TENSOR(x, msg: 'Optional[str]'=None): if not isinstance(x, Tensor): raise TypeError(f'Not a Tensor type. Got: {type(x)}.\n{msg}') def adjust_sigmoid(image: 'Tensor', cutoff: 'float'=0.5, gai...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch.nn import Module from torch import Tensor from typing import O...
YanivHollander/kornia
AdjustSigmoid
false
14,628
[ "ECL-2.0", "Apache-2.0" ]
418
ccd258d0956da89b1feca96448eff8e4969d405a
https://github.com/YanivHollander/kornia/tree/ccd258d0956da89b1feca96448eff8e4969d405a
PositionwiseFeedForward
import torch import torch.utils.data import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel from typing import Optional class PositionwiseFeedForward(nn.Module): """Position-wise Feed Forward Network block from Attention is All You Need. Apply two linear transformations to each input,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.utils.data impor...
YanLu-nyu/transferlearning
PositionwiseFeedForward
false
14,629
[ "MIT" ]
9,657
037806c6eb8b0c12aefbfbf3e35cbf893093cff9
https://github.com/YanLu-nyu/transferlearning/tree/037806c6eb8b0c12aefbfbf3e35cbf893093cff9
Hflip
import torch import torch.nn as nn def hflip(input: 'torch.Tensor') ->torch.Tensor: """Horizontally flip a tensor image or a batch of tensor images. .. image:: _static/img/hflip.png Input must be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`. Args: input: input tens...
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...
YanivHollander/kornia
Hflip
false
14,630
[ "ECL-2.0", "Apache-2.0" ]
418
ccd258d0956da89b1feca96448eff8e4969d405a
https://github.com/YanivHollander/kornia/tree/ccd258d0956da89b1feca96448eff8e4969d405a
BinaryFocalLossWithLogits
import torch import warnings from typing import Optional import torch.nn as nn import torch.nn.functional as F def binary_focal_loss_with_logits(input: 'torch.Tensor', target: 'torch.Tensor', alpha: 'float'=0.25, gamma: 'float'=2.0, reduction: 'str'='none', eps: 'Optional[float]'=None) ->torch.Tensor: """...
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 warn...
YanivHollander/kornia
BinaryFocalLossWithLogits
false
14,631
[ "ECL-2.0", "Apache-2.0" ]
418
ccd258d0956da89b1feca96448eff8e4969d405a
https://github.com/YanivHollander/kornia/tree/ccd258d0956da89b1feca96448eff8e4969d405a
AdjustLog
from torch.nn import Module import torch from torch import Tensor from typing import Optional def KORNIA_CHECK_IS_TENSOR(x, msg: 'Optional[str]'=None): if not isinstance(x, Tensor): raise TypeError(f'Not a Tensor type. Got: {type(x)}.\n{msg}') def adjust_log(image: 'Tensor', gain: 'float'=1, inv: 'bool'...
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.nn import Module ...
YanivHollander/kornia
AdjustLog
false
14,632
[ "ECL-2.0", "Apache-2.0" ]
418
ccd258d0956da89b1feca96448eff8e4969d405a
https://github.com/YanivHollander/kornia/tree/ccd258d0956da89b1feca96448eff8e4969d405a
FullAttention
from torch.nn import Module import torch from torch.nn import Dropout class FullAttention(Module): def __init__(self, use_dropout=False, attention_dropout=0.1): super().__init__() self.use_dropout = use_dropout self.dropout = Dropout(attention_dropout) def forward(self, queries, keys...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YanivHollander/kornia
FullAttention
false
14,633
[ "ECL-2.0", "Apache-2.0" ]
418
ccd258d0956da89b1feca96448eff8e4969d405a
https://github.com/YanivHollander/kornia/tree/ccd258d0956da89b1feca96448eff8e4969d405a
Alignment
from _paritybench_helpers import _mock_config from torch.nn import Module import math import torch import torch.nn as nn import torch.nn.functional as f 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....
YJiangcm/Chinese-sentence-pair-modeling
Alignment
false
14,634
[ "Apache-2.0" ]
49
90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
https://github.com/YJiangcm/Chinese-sentence-pair-modeling/tree/90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
PatchEmbed
import torch from torch import nn class PatchEmbed(nn.Module): """ Image to Patch Embedding """ def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768): super().__init__() num_patches = img_size // patch_size * (img_size // patch_size) self.img_size = img_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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
YangtaoWANG95/TokenCut
PatchEmbed
false
14,635
[ "MIT" ]
97
ea585c55e631d17c239f875550b2d0b230446b25
https://github.com/YangtaoWANG95/TokenCut/tree/ea585c55e631d17c239f875550b2d0b230446b25
BlobDoG
import torch from torch import Tensor from typing import Optional import torch.nn as nn from typing import List def KORNIA_CHECK_IS_TENSOR(x, msg: 'Optional[str]'=None): if not isinstance(x, Tensor): raise TypeError(f'Not a Tensor type. Got: {type(x)}.\n{msg}') def KORNIA_CHECK_SHAPE(x, shape: 'List[str...
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 Tensor from typing import Optional import torch.nn as nn from typing import List assert_size_stride = torch._C._dynamo.gua...
YanivHollander/kornia
BlobDoG
false
14,636
[ "ECL-2.0", "Apache-2.0" ]
418
ccd258d0956da89b1feca96448eff8e4969d405a
https://github.com/YanivHollander/kornia/tree/ccd258d0956da89b1feca96448eff8e4969d405a
EltwiseSubEmbed
import torch from torch import nn class EltwiseSubEmbed(nn.Module): def __init__(self, nonlinearity='square', use_batch_norm=False, use_classifier=False, num_features=0, num_classes=0): super(EltwiseSubEmbed, self).__init__() self.nonlinearity = nonlinearity if nonlinearity is not...
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...
YantaoShen/kpm_rw_person_reid
EltwiseSubEmbed
false
14,637
[ "MIT" ]
112
01393e024aa1139c9e7e934954cc35826f438a54
https://github.com/YantaoShen/kpm_rw_person_reid/tree/01393e024aa1139c9e7e934954cc35826f438a54
Qux
import torch import torch.jit import torch.onnx import torch.nn class Qux(torch.nn.Module): def __init__(self, x): super(Qux, self).__init__() self.x = x def forward(self, a, b): return a - b - self.x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
Qux
false
14,638
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
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._...
YaronBenAtar/glow
SimpleACosModule
false
14,639
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
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....
YaronBenAtar/glow
SimpleClampModel
false
14,640
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
Homography
import torch import torch.nn as nn class Homography(nn.Module): """Homography geometric model to be used together with ImageRegistrator module for the optimization-based image registration.""" def __init__(self) ->None: super().__init__() self.model = nn.Parameter(torch.eye(3)) ...
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...
YanivHollander/kornia
Homography
false
14,641
[ "ECL-2.0", "Apache-2.0" ]
418
ccd258d0956da89b1feca96448eff8e4969d405a
https://github.com/YanivHollander/kornia/tree/ccd258d0956da89b1feca96448eff8e4969d405a
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...
YaronBenAtar/glow
RepeatModule
false
14,642
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
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._...
YaronBenAtar/glow
SimpleASinModule
false
14,643
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleConvTranspose2dModule
import torch import torch.jit import torch.nn.functional as F 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...
YaronBenAtar/glow
SimpleConvTranspose2dModule
false
14,644
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
MultiHeadAttention
import torch import numpy as np import torch.utils.data import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel from typing import Optional def generate_local_map_mask(chunk_size: 'int', attention_size: 'int', mask_future=False, device: 'torch.device'='cpu') ->torch.BoolTensor: """Compu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YanLu-nyu/transferlearning
MultiHeadAttention
false
14,645
[ "MIT" ]
9,657
037806c6eb8b0c12aefbfbf3e35cbf893093cff9
https://github.com/YanLu-nyu/transferlearning/tree/037806c6eb8b0c12aefbfbf3e35cbf893093cff9
SimpleArgSortModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleArgSortModule(torch.nn.Module): def __init__(self, descending=True): super(SimpleArgSortModule, self).__init__() self.descending = descending def forward(self, inputs): return torch.argsort(inputs, dim=-1, de...
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....
YaronBenAtar/glow
SimpleArgSortModule
false
14,646
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleAvgPool2dModule
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleAvgPool2dModule(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0): super(SimpleAvgPool2dModule, self).__init__() self.kernel_size = kernel_size self.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 import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleAvgPool2dModule
false
14,647
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleAbsModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleAbsModule(torch.nn.Module): def __init__(self): super(SimpleAbsModule, self).__init__() def forward(self, a): return torch.abs(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 math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleAbsModule
false
14,648
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
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._...
YaronBenAtar/glow
SimpleATanModule
false
14,649
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
Wide_Conv
import torch import torch.nn as nn def match_score(s1, s2, mask1, mask2): """ s1, s2: batch_size * seq_len * dim """ _batch, seq_len, _dim = s1.shape s1 = s1 * mask1.eq(0).unsqueeze(2).float() s2 = s2 * mask2.eq(0).unsqueeze(2).float() s1 = s1.unsqueeze(2).repeat(1, 1, seq_len, 1) s2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
YJiangcm/Chinese-sentence-pair-modeling
Wide_Conv
false
14,650
[ "Apache-2.0" ]
49
90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
https://github.com/YJiangcm/Chinese-sentence-pair-modeling/tree/90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
SimpleAddMmModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleAddMmModule(torch.nn.Module): def __init__(self, alpha=1, beta=1): super(SimpleAddMmModule, self).__init__() self.alpha = alpha self.beta = beta def forward(self, a, b, c): return (a + a).addmm(b, 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 import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
YaronBenAtar/glow
SimpleAddMmModule
false
14,651
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
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...
YaronBenAtar/glow
SimpleBmmModule
false
14,652
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleAvgPool1dModule
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleAvgPool1dModule(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0): super(SimpleAvgPool1dModule, self).__init__() self.kernel_size = kernel_size self.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 import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleAvgPool1dModule
false
14,653
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleClampMinModel
import torch import torch.jit import torch.onnx import torch.nn class SimpleClampMinModel(torch.nn.Module): def __init__(self, min): super(SimpleClampMinModel, self).__init__() self.min = min def forward(self, input): return torch.clamp_min(input, self.min) def get_inputs(): re...
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....
YaronBenAtar/glow
SimpleClampMinModel
false
14,654
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleCeilModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleCeilModule(torch.nn.Module): def forward(self, a, b): c = a + b return torch.ceil(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleCeilModule
false
14,655
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
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...
YaronBenAtar/glow
SimpleAndModule
false
14,656
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleNotModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleNotModule(torch.nn.Module): def __init__(self): super(SimpleNotModule, self).__init__() def forward(self, a): b = torch.logical_not(a) return torch.logical_not(b) def get_inputs(): return [torch.rand([4...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleNotModule
false
14,657
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleCosModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleCosModule(torch.nn.Module): def __init__(self): super(SimpleCosModule, self).__init__() def forward(self, a): return torch.cos(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 math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleCosModule
false
14,658
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleFmodModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleFmodModule(torch.nn.Module): def __init__(self): super(SimpleFmodModule, self).__init__() def forward(self, a, b): if b.size() == torch.Size([]): c = a.fmod(b.item()) else: c = a.fmod(...
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._...
YaronBenAtar/glow
SimpleFmodModule
false
14,659
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleLinearModule
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleLinearModule(torch.nn.Module): def __init__(self): super(SimpleLinearModule, self).__init__() def forward(self, input, weight, bias=None): return F.linear(input + input, weight, bias) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
YaronBenAtar/glow
SimpleLinearModule
false
14,660
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleFloorModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleFloorModule(torch.nn.Module): def forward(self, a, b): c = a + b return torch.floor(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleFloorModule
false
14,661
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleExpModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleExpModule(torch.nn.Module): def forward(self, input): other = torch.exp(input) return torch.exp(other) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleExpModule
false
14,662
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleCumSumModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleCumSumModule(torch.nn.Module): def __init__(self, dim): super(SimpleCumSumModule, self).__init__() self.dim = dim def forward(self, tensor): return torch.cumsum(tensor, self.dim) def get_inputs(): 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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleCumSumModule
false
14,663
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleMinModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleMinModule(torch.nn.Module): def __init__(self): super(SimpleMinModule, self).__init__() def forward(self, a, b): return torch.min(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
SimpleMinModule
false
14,664
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleGeluModule
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleGeluModule(torch.nn.Module): def forward(self, tensor): return F.gelu(tensor + tensor) 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.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleGeluModule
false
14,665
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleLogModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleLogModule(torch.nn.Module): def __init__(self, *dimensions): super(SimpleLogModule, self).__init__() def forward(self, a): b = torch.log(a) return torch.log(b) def get_inputs(): return [torch.rand([4, 4...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleLogModule
false
14,666
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleMatmulModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleMatmulModule(torch.nn.Module): def __init__(self): super(SimpleMatmulModule, self).__init__() def forward(self, a, b): return a.matmul(b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
YaronBenAtar/glow
SimpleMatmulModule
false
14,667
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleMulModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleMulModule(torch.nn.Module): def __init__(self): super(SimpleMulModule, self).__init__() def forward(self, left, right): other = left.mul(right.item() if right.size() == torch.Size([]) else right) ...
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...
YaronBenAtar/glow
SimpleMulModule
false
14,668
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleModule(torch.nn.Module): def __init__(self): super(SimpleModule, self).__init__() def forward(self, x): y = x + x y = y + 2 return y def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleModule
false
14,669
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleConv2dModule
import torch import torch.jit import torch.nn.functional as F 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...
YaronBenAtar/glow
SimpleConv2dModule
false
14,670
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleOrModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleOrModule(torch.nn.Module): def __init__(self): super(SimpleOrModule, self).__init__() def forward(self, a, b): c = torch.logical_or(a, b) return torch.logical_or(c, c) def get_inputs(): return [torch.ra...
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...
YaronBenAtar/glow
SimpleOrModule
false
14,671
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleLogSoftmaxModel
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleLogSoftmaxModel(torch.nn.Module): def __init__(self, dimension): super(SimpleLogSoftmaxModel, self).__init__() self.dimension = dimension def forward(self, tensor): return F.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.jit impor...
YaronBenAtar/glow
SimpleLogSoftmaxModel
false
14,672
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
Foo
import torch import torch.jit import torch.onnx import torch.nn class Foo(torch.nn.Module): def __init__(self): super(Foo, self).__init__() self.conv1 = torch.nn.Conv2d(3, 6, 3) self.relu = torch.nn.ReLU() self.conv2 = torch.nn.Conv2d(6, 16, 3) def forward(self, x): x...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch...
YaronBenAtar/glow
Foo
false
14,673
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleReluModel
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleReluModel(torch.nn.Module): def __init__(self, inplace=False): super(SimpleReluModel, self).__init__() self.inplace = inplace def forward(self, tensor): other = F.relu(tensor, ...
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....
YaronBenAtar/glow
SimpleReluModel
false
14,674
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleLeakyReluModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleLeakyReluModule(torch.nn.Module): def __init__(self, negative_slope=0.01, inplace=False): super(SimpleLeakyReluModule, self).__init__() self.negative_slope = negative_slope self.inplace = inplace def forward(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleLeakyReluModule
false
14,675
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimplePowModule
import torch import torch.jit import torch.onnx import torch.nn class SimplePowModule(torch.nn.Module): def __init__(self, power): super(SimplePowModule, self).__init__() self.power = power def forward(self, tensor): return torch.pow(tensor, self.power) def get_inputs(): return...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimplePowModule
false
14,676
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleMaxModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleMaxModule(torch.nn.Module): def __init__(self): super(SimpleMaxModule, self).__init__() def forward(self, a, b): return torch.max(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
SimpleMaxModule
false
14,677
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
SimpleXorModule
import torch import torch.jit import torch.onnx import torch.nn class SimpleXorModule(torch.nn.Module): def __init__(self): super(SimpleXorModule, self).__init__() def forward(self, a, b): c = torch.logical_xor(a, b) return torch.logical_xor(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...
YaronBenAtar/glow
SimpleXorModule
false
14,678
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86