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 |
|---|---|---|---|---|---|---|---|---|---|---|
GeneralAttention | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class BaseAttention(nn.Module):
def __init__(self):
super().__init__()
def forward(self, *args, **kwargs):
raise NotImplementedError
class GeneralAttention(BaseAttention):
"""General Attention"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ROBINADC/BiGRU-CRF-with-Attention-for-NER | GeneralAttention | false | 8,707 | [
"MIT"
] | 27 | b9e037ebd6e1d56500ffb60c6030013982c17ded | https://github.com/ROBINADC/BiGRU-CRF-with-Attention-for-NER/tree/b9e037ebd6e1d56500ffb60c6030013982c17ded |
SoftDiceLoss | import torch
import numpy as np
from torch import nn
import torch.nn.functional
def sum_tensor(inp, axes, keepdim=False):
axes = np.unique(axes).astype(int)
if keepdim:
for ax in axes:
inp = inp.sum(int(ax), keepdim=True)
else:
for ax in sorted(axes, reverse=True):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
from torch import nn
import torch.nn.functional
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_str... | Ramsha04/kits19_cnn | SoftDiceLoss | false | 8,708 | [
"Apache-2.0"
] | 15 | 0c1c861ca1a211a840a77e52895548e8d8033470 | https://github.com/Ramsha04/kits19_cnn/tree/0c1c861ca1a211a840a77e52895548e8d8033470 |
DeConvNet64 | import torch
import torch.nn as nn
def get_activation(s_act):
if s_act == 'relu':
return nn.ReLU(inplace=True)
elif s_act == 'sigmoid':
return nn.Sigmoid()
elif s_act == 'softplus':
return nn.Softplus()
elif s_act == 'linear':
return None
elif s_act == 'tanh':
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | Neural-Diffusion-Research/normalized-autoencoders | DeConvNet64 | false | 8,709 | [
"MIT"
] | 30 | 0c77f7e29289e336c0fe5e941aaec8baa4a4fb82 | https://github.com/Neural-Diffusion-Research/normalized-autoencoders/tree/0c77f7e29289e336c0fe5e941aaec8baa4a4fb82 |
GCNLayer | import torch
import torch.nn as nn
import torch.utils.data
class GCNLayer(nn.Module):
def __init__(self, embed_size, dropout=0.0):
super().__init__()
self.embed_size = embed_size
self.ctx_layer = nn.Linear(self.embed_size, self.embed_size, bias=False
)
self.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
import torch.nn as ... | Roc-Ng/HANet | GCNLayer | false | 8,710 | [
"MIT"
] | 34 | e679703e9e725205424d87f750358fb4f62ceec5 | https://github.com/Roc-Ng/HANet/tree/e679703e9e725205424d87f750358fb4f62ceec5 |
BahdanauAttention | import torch
import torch.nn as nn
class BahdanauAttention(nn.Module):
def __init__(self, hidden_dim):
super(BahdanauAttention, self).__init__()
self.W = nn.Linear(hidden_dim, hidden_dim)
self.U = nn.Linear(hidden_dim, hidden_dim)
self.v = nn.Linear(hidden_dim, 1)
def forward... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | RiTUAL-UH/style_NER | BahdanauAttention | false | 8,711 | [
"MIT"
] | 17 | 4bb206cb48a45cc71deea3eea249eeb266c019a4 | https://github.com/RiTUAL-UH/style_NER/tree/4bb206cb48a45cc71deea3eea249eeb266c019a4 |
ScaledDotProductAttention | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class BaseAttention(nn.Module):
def __init__(self):
super().__init__()
def forward(self, *args, **kwargs):
raise NotImplementedError
class ScaledDotProductAttention(BaseAttention):
"""Scaled dot-produ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ROBINADC/BiGRU-CRF-with-Attention-for-NER | ScaledDotProductAttention | false | 8,712 | [
"MIT"
] | 27 | b9e037ebd6e1d56500ffb60c6030013982c17ded | https://github.com/ROBINADC/BiGRU-CRF-with-Attention-for-NER/tree/b9e037ebd6e1d56500ffb60c6030013982c17ded |
AttnGCNLayer | import math
import torch
import torch.nn as nn
import torch.utils.data
class GCNLayer(nn.Module):
def __init__(self, embed_size, dropout=0.0):
super().__init__()
self.embed_size = embed_size
self.ctx_layer = nn.Linear(self.embed_size, self.embed_size, bias=False
)
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.... | Roc-Ng/HANet | AttnGCNLayer | false | 8,713 | [
"MIT"
] | 34 | e679703e9e725205424d87f750358fb4f62ceec5 | https://github.com/Roc-Ng/HANet/tree/e679703e9e725205424d87f750358fb4f62ceec5 |
ASC | import torch
import torch.optim
import torch.nn as nn
import torch.nn.init
class ASC(nn.Module):
def __init__(self, a=3.5):
super().__init__()
self.a = a
def forward(self, input):
return torch.div(torch.exp(self.a * input), torch.sum(torch.exp(
self.a * input), dim=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.optim
import torch.nn as nn
import torch.nn.init
assert_size... | RichardScottOZ/UnDIP | ASC | false | 8,714 | [
"Apache-2.0"
] | 10 | 8e4a39801142495e785cfbae0744872729fa3fac | https://github.com/RichardScottOZ/UnDIP/tree/8e4a39801142495e785cfbae0744872729fa3fac |
RawNTN | import torch
import torch.nn as nn
class RawNTN(nn.Module):
def __init__(self, l_dim, r_dim, k=5, non_linear=torch.tanh):
super(RawNTN, self).__init__()
self.u_R = nn.Linear(k, 1, bias=False)
self.f = non_linear
self.W = nn.Bilinear(l_dim, r_dim, k, bias=True)
self.V = 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.triton_helpers import libdevice
import torch.nn as ... | QingkaiZeng/GenTaxo | RawNTN | false | 8,715 | [
"MIT"
] | 28 | 10257a1714d14c6a4c49cbfa0b507408f718cdf0 | https://github.com/QingkaiZeng/GenTaxo/tree/10257a1714d14c6a4c49cbfa0b507408f718cdf0 |
RawArborist | import torch
import torch.nn as nn
class RawArborist(nn.Module):
def __init__(self, l_dim, r_dim, k=5):
super(RawArborist, self).__init__()
self.u = nn.Linear(l_dim, k, bias=False)
self.W = nn.Bilinear(l_dim, r_dim, k, bias=False)
def forward(self, e, q):
u = self.u(e)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | QingkaiZeng/GenTaxo | RawArborist | false | 8,716 | [
"MIT"
] | 28 | 10257a1714d14c6a4c49cbfa0b507408f718cdf0 | https://github.com/QingkaiZeng/GenTaxo/tree/10257a1714d14c6a4c49cbfa0b507408f718cdf0 |
SLP | import torch
import torch.nn as nn
import torch.nn.functional as F
class SLP(nn.Module):
def __init__(self, l_dim, r_dim, hidden_dim, non_linear=F.tanh):
super(SLP, self).__init__()
self.u_R = nn.Linear(hidden_dim, 1, bias=False)
self.f = non_linear
self.ffn = nn.Linear(l_dim * 2 ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | QingkaiZeng/GenTaxo | SLP | false | 8,717 | [
"MIT"
] | 28 | 10257a1714d14c6a4c49cbfa0b507408f718cdf0 | https://github.com/QingkaiZeng/GenTaxo/tree/10257a1714d14c6a4c49cbfa0b507408f718cdf0 |
LBM | import torch
import torch.nn as nn
class LBM(nn.Module):
def __init__(self, l_dim, r_dim):
super(LBM, self).__init__()
self.W = nn.Bilinear(l_dim * 2, r_dim, 1, bias=False)
def forward(self, e1, e2, q):
"""
e1: tensor of size (*, l_dim)
e2: tensor of size (*, r_dim)
... | 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... | QingkaiZeng/GenTaxo | LBM | false | 8,718 | [
"MIT"
] | 28 | 10257a1714d14c6a4c49cbfa0b507408f718cdf0 | https://github.com/QingkaiZeng/GenTaxo/tree/10257a1714d14c6a4c49cbfa0b507408f718cdf0 |
Attention | import math
import torch
from torch import nn
import torch.utils.data.dataloader
import torch.utils.data
import torch.onnx
import torch.backends.cudnn
class Attention(nn.Module):
def __init__(self, dim_q, dim_kv, num_heads=4, qkv_bias=False, stride=1):
super().__init__()
self.dim = dim_q
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | RISC-NYUAD/SiamTPNTracker | Attention | false | 8,719 | [
"MIT"
] | 12 | cbff7373941cb30d4a970cac1ee29706d422c212 | https://github.com/RISC-NYUAD/SiamTPNTracker/tree/cbff7373941cb30d4a970cac1ee29706d422c212 |
MSELossWithSigmoid | import torch
class MSELossWithSigmoid(torch.nn.Module):
def __init__(self):
super().__init__()
self.mse = torch.nn.MSELoss()
self.sigmoid = torch.nn.Sigmoid()
self.loss = lambda x, y: self.mse(self.sigmoid(x), y)
def forward(self, source, target):
return self.loss(sou... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Roulbac/GanSeg | MSELossWithSigmoid | false | 8,720 | [
"MIT"
] | 20 | 78f354da5d724b93ead3ac6c2b15ae18d3ac0aea | https://github.com/Roulbac/GanSeg/tree/78f354da5d724b93ead3ac6c2b15ae18d3ac0aea |
NTN | import torch
import torch.nn as nn
import torch.nn.functional as F
class NTN(nn.Module):
def __init__(self, l_dim, r_dim, k=5, non_linear=F.tanh):
super(NTN, self).__init__()
self.u_R = nn.Linear(k, 1, bias=False)
self.f = non_linear
self.W = nn.Bilinear(l_dim * 2, r_dim, k, bias=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | QingkaiZeng/GenTaxo | NTN | false | 8,721 | [
"MIT"
] | 28 | 10257a1714d14c6a4c49cbfa0b507408f718cdf0 | https://github.com/QingkaiZeng/GenTaxo/tree/10257a1714d14c6a4c49cbfa0b507408f718cdf0 |
Arborist | import torch
import torch.nn as nn
class Arborist(nn.Module):
def __init__(self, l_dim, r_dim, k=5):
super(Arborist, self).__init__()
self.u = nn.Linear(l_dim * 2, k, bias=False)
self.W = nn.Bilinear(l_dim * 2, r_dim, k, bias=False)
def forward(self, e1, e2, q):
"""
e... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | QingkaiZeng/GenTaxo | Arborist | false | 8,722 | [
"MIT"
] | 28 | 10257a1714d14c6a4c49cbfa0b507408f718cdf0 | https://github.com/QingkaiZeng/GenTaxo/tree/10257a1714d14c6a4c49cbfa0b507408f718cdf0 |
CosineAttention | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class BaseAttention(nn.Module):
def __init__(self):
super().__init__()
def forward(self, *args, **kwargs):
raise NotImplementedError
class CosineAttention(BaseAttention):
"""Cosine Attention"""
d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ROBINADC/BiGRU-CRF-with-Attention-for-NER | CosineAttention | false | 8,723 | [
"MIT"
] | 27 | b9e037ebd6e1d56500ffb60c6030013982c17ded | https://github.com/ROBINADC/BiGRU-CRF-with-Attention-for-NER/tree/b9e037ebd6e1d56500ffb60c6030013982c17ded |
TriNTN | import torch
import torch.nn as nn
import torch.nn.functional as F
class RawNTN(nn.Module):
def __init__(self, l_dim, r_dim, k=5, non_linear=torch.tanh):
super(RawNTN, self).__init__()
self.u_R = nn.Linear(k, 1, bias=False)
self.f = non_linear
self.W = nn.Bilinear(l_dim, r_dim, k,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | QingkaiZeng/GenTaxo | TriNTN | false | 8,724 | [
"MIT"
] | 28 | 10257a1714d14c6a4c49cbfa0b507408f718cdf0 | https://github.com/QingkaiZeng/GenTaxo/tree/10257a1714d14c6a4c49cbfa0b507408f718cdf0 |
BIM | import torch
import torch.nn as nn
class BIM(nn.Module):
def __init__(self, l_dim, r_dim):
super(BIM, self).__init__()
self.W = nn.Bilinear(l_dim * 2, r_dim, 1, bias=False)
def forward(self, e1, e2, q):
"""
e1: tensor of size (*, l_dim)
e2: tensor of size (*, r_dim)
... | 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... | QingkaiZeng/GenTaxo | BIM | false | 8,725 | [
"MIT"
] | 28 | 10257a1714d14c6a4c49cbfa0b507408f718cdf0 | https://github.com/QingkaiZeng/GenTaxo/tree/10257a1714d14c6a4c49cbfa0b507408f718cdf0 |
HighwayNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
class HighwayNetwork(nn.Module):
def __init__(self, size):
super().__init__()
self.W1 = nn.Linear(size, size)
self.W2 = nn.Linear(size, size)
self.W1.bias.data.fill_(0.0)
def forward(self, x):
x1 = sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | Rongjiehuang/Multiband-WaveRNN | HighwayNetwork | false | 8,726 | [
"MIT"
] | 18 | 432e449678220eed841fcb4971415e2e0ac4d9bb | https://github.com/Rongjiehuang/Multiband-WaveRNN/tree/432e449678220eed841fcb4971415e2e0ac4d9bb |
Generator | import torch
import torch.distributed
import torch
import torch.nn as nn
def gumbel_softmax(logits, tau=1.0, hard=False, log_mode=True, dim=-1):
while True:
gumbels = -torch.empty_like(logits).exponential_().log()
gumbels = (logits + gumbels) / tau
if log_mode:
y_soft = gumbels... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | RowitZou/RankAE | Generator | false | 8,727 | [
"MIT"
] | 23 | d47ab58aa4fda203c551e36cbe04edd564b76d89 | https://github.com/RowitZou/RankAE/tree/d47ab58aa4fda203c551e36cbe04edd564b76d89 |
DiceLoss_pt | import torch
import torch.nn as nn
import torch.nn.functional as F
class DiceLoss_pt(nn.Module):
def __init__(self, weight=None, size_average=True):
super(DiceLoss_pt, self).__init__()
def forward(self, y_pred, y_true):
smooth = 1.0
y_pred_sig = F.sigmoid(y_pred)
num = y_true... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | SCCH-KVS/training-engine | DiceLoss_pt | false | 8,728 | [
"Apache-2.0"
] | 17 | dc52b7a06884f967c7c1aabfba39802dd2983162 | https://github.com/SCCH-KVS/training-engine/tree/dc52b7a06884f967c7c1aabfba39802dd2983162 |
My_Tanh | import torch
import torch.utils.data
import torch.nn as nn
class My_Tanh(nn.Module):
def __init__(self):
super(My_Tanh, self).__init__()
self.tanh = nn.Tanh()
def forward(self, x):
return 0.5 * (self.tanh(x) + 1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_ini... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dy... | SUTDBrainLab/MGP-VAE | My_Tanh | false | 8,731 | [
"MIT"
] | 30 | 0b7c252f9f7bdcdf3c4177ac40585633a0e98a0f | https://github.com/SUTDBrainLab/MGP-VAE/tree/0b7c252f9f7bdcdf3c4177ac40585633a0e98a0f |
PreNet | import torch
import torch.nn as nn
import torch.nn.functional as F
class PreNet(nn.Module):
def __init__(self, in_dims, fc1_dims=256, fc2_dims=128, dropout=0.5):
super().__init__()
self.fc1 = nn.Linear(in_dims, fc1_dims)
self.fc2 = nn.Linear(fc1_dims, fc2_dims)
self.p = dropout
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | Rongjiehuang/Multiband-WaveRNN | PreNet | false | 8,733 | [
"MIT"
] | 18 | 432e449678220eed841fcb4971415e2e0ac4d9bb | https://github.com/Rongjiehuang/Multiband-WaveRNN/tree/432e449678220eed841fcb4971415e2e0ac4d9bb |
GNNExplainerProbe | import math
import torch
class AbstractTorchModule(torch.nn.Module):
def __init__(self):
torch.nn.Module.__init__(self)
def save(self, path):
None
torch.save(self.state_dict(), path)
def load(self, path):
None
self.load_state_dict(torch.load(path, map_location=se... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import math
assert_size_stride = torch._C._dynamo.guards.assert_size_stri... | S-Eggers/GraphMask | GNNExplainerProbe | false | 8,735 | [
"MIT"
] | 28 | 9e431a541279801ec46a5b38ed57b2033f795240 | https://github.com/S-Eggers/GraphMask/tree/9e431a541279801ec46a5b38ed57b2033f795240 |
Normalize01 | import torch
import torch.nn as nn
class Normalize01(nn.Module):
def __init__(self):
super().__init__()
def forward(self, result_noisy):
Nbatch = result_noisy.size(0)
result_noisy_01 = torch.zeros_like(result_noisy)
for i in range(Nbatch):
min_val = result_noisy[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
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | ScarWar/DeepSTORM3D | Normalize01 | false | 8,736 | [
"MIT"
] | 25 | 8ba5bc61120abedba9c1b24a994e616e280bdda2 | https://github.com/ScarWar/DeepSTORM3D/tree/8ba5bc61120abedba9c1b24a994e616e280bdda2 |
rSoftMax | import torch
import torch.nn as nn
import torch.nn.functional as F
class rSoftMax(nn.Module):
"""
(radix-majorize) softmax class
input is cardinal-major shaped tensor.
transpose to radix-major
"""
def __init__(self, groups=1, radix=2):
super(rSoftMax, self).__init__()
self.gr... | 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
... | STomoya/ResNeSt | rSoftMax | false | 8,737 | [
"Apache-2.0"
] | 13 | 3b2b4f4a73d138bb1e4ff2b8695be4cf950543da | https://github.com/STomoya/ResNeSt/tree/3b2b4f4a73d138bb1e4ff2b8695be4cf950543da |
SVIGlobalMeanPool2D | import torch
import torch.nn as nn
class SVIGlobalMeanPool2D(nn.Module):
"""
Expects
:param x: [examples, samples, channels, H, W]
:return: [examples, samples, channels]
"""
def __init__(self):
super(SVIGlobalMeanPool2D, self).__init__()
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | SebFar/radial_bnn | SVIGlobalMeanPool2D | false | 8,738 | [
"MIT"
] | 29 | 2497e5e009409ac910d609850eae27f7cc74cec2 | https://github.com/SebFar/radial_bnn/tree/2497e5e009409ac910d609850eae27f7cc74cec2 |
Attentive | import torch
import torch.nn as nn
class Attentive(nn.Module):
def __init__(self, isize):
super(Attentive, self).__init__()
self.w = nn.Parameter(torch.ones(isize))
def forward(self, x):
return x @ torch.diag(self.w)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | SUBLIME-GSL/SUBLIME | Attentive | false | 8,739 | [
"MIT"
] | 19 | 2c9b193abb3f15ae9bab33815e568010057a5564 | https://github.com/SUBLIME-GSL/SUBLIME/tree/2c9b193abb3f15ae9bab33815e568010057a5564 |
Conv2d_fw | import torch
import torch.nn as nn
import torch.nn.functional as F
class Conv2d_fw(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, bias=True):
super(Conv2d_fw, self).__init__(in_channels, out_channels,
kernel_size, stride=stride, padding=pad... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | RongKaiWeskerMA/INSTA | Conv2d_fw | false | 8,741 | [
"MIT"
] | 22 | 298bec0aeac3c1fde7bbcd4dece72ded1056e478 | https://github.com/RongKaiWeskerMA/INSTA/tree/298bec0aeac3c1fde7bbcd4dece72ded1056e478 |
KLD | import torch
class KLD(torch.nn.Module):
def __init__(self, reduction='mean'):
super(KLD, self).__init__()
self.reduction = reduction
def forward(self, mu, logvar, mu_2=None, logvar_2=None):
"""
Calculate the Kullbach-Leibler-Divergence between two Gaussians
:param mu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_str... | SchubertLab/mvTCR | KLD | false | 8,742 | [
"MIT"
] | 16 | d815749e24650f69ef68054e0078d490af91b71d | https://github.com/SchubertLab/mvTCR/tree/d815749e24650f69ef68054e0078d490af91b71d |
TCB | import torch
import torch.nn as nn
from itertools import product as product
class TCB(nn.Module):
"""
Transfer Connection Block Architecture
This block
"""
def __init__(self, lateral_channels, channles, internal_channels=256,
is_batchnorm=False):
"""
:param lateral_channel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 it... | SaralaSewwandi/refinedet-pytorch | TCB | false | 8,743 | [
"MIT"
] | 43 | d1eb9f84216085858562d816f19aeb77c2ab604a | https://github.com/SaralaSewwandi/refinedet-pytorch/tree/d1eb9f84216085858562d816f19aeb77c2ab604a |
resBlock | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class resBlock(nn.Module):
def __init__(self, channelDepth, windowSize=3):
super(resBlock, self).__init__()
padding = math.floor(windowSize / 2)
self.conv1 = nn.Conv2d(channelDepth, channelDepth, windowSize, 1,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | SeokjaeLIM/DSLR-release | resBlock | false | 8,744 | [
"Apache-2.0"
] | 14 | 861429482faf50ee3d6570948af8c48df1fc7f43 | https://github.com/SeokjaeLIM/DSLR-release/tree/861429482faf50ee3d6570948af8c48df1fc7f43 |
TransformerEncoderLayer | from torch.nn import Module
import torch
import torch.nn as nn
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'=False):
"""
Obtained from: github.com: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.... | RongKaiWeskerMA/INSTA | TransformerEncoderLayer | false | 8,745 | [
"MIT"
] | 22 | 298bec0aeac3c1fde7bbcd4dece72ded1056e478 | https://github.com/RongKaiWeskerMA/INSTA/tree/298bec0aeac3c1fde7bbcd4dece72ded1056e478 |
Blockdown | import torch
import torch.utils.data
import torch
import torch.nn as nn
class conv_bn_relu(nn.Module):
def __init__(self, in_channel, out_channel, stride=1, has_relu=True):
super(conv_bn_relu, self).__init__()
self.conv = nn.Conv2d(in_channel, out_channel, 3, stride=stride,
padding=1,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | SeanChenxy/GAN_RS | Blockdown | false | 8,746 | [
"BSD-3-Clause"
] | 17 | a1786b946caf7bd24c83cea4c7a9bb74445cc381 | https://github.com/SeanChenxy/GAN_RS/tree/a1786b946caf7bd24c83cea4c7a9bb74445cc381 |
PolicyBasis | import torch
import numpy as np
import torch.nn as nn
class PolicyBasis(nn.Module):
def __init__(self, action_num, state_dim, task_dim):
super(PolicyBasis, self).__init__()
self.state_dim = state_dim
self.task_dim = task_dim
self.action_num = action_num
self.weight_mu = 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
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | Sha-Lab/SynPo | PolicyBasis | false | 8,747 | [
"MIT"
] | 18 | 8ac35a01d2c810187b9c14b914bcb792ed73caa9 | https://github.com/Sha-Lab/SynPo/tree/8ac35a01d2c810187b9c14b914bcb792ed73caa9 |
C3D | import torch
import torch.nn as nn
import torch.nn
class C3D(nn.Module):
def __init__(self, inplanes, planes):
super(C3D, self).__init__()
self.c3d = nn.Conv3d(inplanes, planes, kernel_size=3, padding=1)
def forward(self, x):
x = self.c3d(x)
return x
def get_inputs():
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
import torch.nn as nn
import torch.nn
assert_size_stride = torch._C._dynamo.guar... | Schmiddo/d2conv3d | C3D | false | 8,748 | [
"MIT"
] | 16 | 9b330be56f0dfb9657a63e3fb3394ab36b35a67b | https://github.com/Schmiddo/d2conv3d/tree/9b330be56f0dfb9657a63e3fb3394ab36b35a67b |
BCELoss | import torch
from torch import nn
import torch.nn.functional as F
import torchvision.transforms.functional as F
from torch.nn import functional as F
import torch.cuda
def binary_cross_entropy(inputs, target, weight=None, reduction='mean',
smooth_eps=None, from_logits=False):
"""cross entropy loss, with suppor... | 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 ... | RichardScottOZ/sota-data-augmentation-and-optimizers | BCELoss | false | 8,749 | [
"MIT"
] | 31 | 60128ca762ac2864a3b54c43c36d1d5aa2033e5a | https://github.com/RichardScottOZ/sota-data-augmentation-and-optimizers/tree/60128ca762ac2864a3b54c43c36d1d5aa2033e5a |
NB | import torch
class NB(torch.nn.Module):
"""
Yang Comment: Usage in forward:
x : Ground truth
mu: Prediction
theta: Another trainable parameter with shape=[xdim(number of count variables)],
simply initialize a nn.Parameter(torch.randn(xdim)) in the model
Be careful, we need the nega... | 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
assert_size... | SchubertLab/mvTCR | NB | false | 8,750 | [
"MIT"
] | 16 | d815749e24650f69ef68054e0078d490af91b71d | https://github.com/SchubertLab/mvTCR/tree/d815749e24650f69ef68054e0078d490af91b71d |
MinibatchStd | import torch
import torch.nn as nn
import torch.utils.tensorboard
import torch.nn
class MinibatchStd(nn.Module):
"""
Adds the aveage std of each data point over a
slice of the minibatch to that slice as a new
feature map. This gives an output with one extra
channel.
Arguments:
group_si... | 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.utils.tensorboard
import torch.nn
assert_siz... | Klanly/StyleFlowPytorch | MinibatchStd | false | 8,751 | [
"MIT"
] | 24 | 4552108ea1de69e9e9c027909738bbc755ab5cf6 | https://github.com/Klanly/StyleFlowPytorch/tree/4552108ea1de69e9e9c027909738bbc755ab5cf6 |
ScaledDotProductAttention | import torch
import torch.nn.functional as F
import torch.nn as nn
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Sha-Lab/CASTLE | ScaledDotProductAttention | false | 8,752 | [
"MIT"
] | 13 | 212cb7aaad1bfae7041c90143220286bde24db33 | https://github.com/Sha-Lab/CASTLE/tree/212cb7aaad1bfae7041c90143220286bde24db33 |
Smooth_loss | import torch
import torch.nn as nn
import torch.nn.functional as F
class Smooth_loss(nn.Module):
def __init__(self, Smooth_weight=1):
super(Smooth_loss, self).__init__()
self.Smooth_weight = Smooth_weight
def forward(self, x):
_b, _c, h, w = x.size()
x_h = F.pad(x, (0, 0, 1, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | SeokjaeLIM/DSLR-release | Smooth_loss | false | 8,753 | [
"Apache-2.0"
] | 14 | 861429482faf50ee3d6570948af8c48df1fc7f43 | https://github.com/SeokjaeLIM/DSLR-release/tree/861429482faf50ee3d6570948af8c48df1fc7f43 |
EncoderCNN | import torch
import torch.nn as nn
import torch.nn.functional as F
class EncoderCNN(nn.Module):
def __init__(self, latent_dim=1024):
super(EncoderCNN, self).__init__()
self.latent_dim = latent_dim
self.conv1_1 = nn.Conv2d(8, 8, 4, stride=2, dilation=1, padding=1)
self.conv1_2 = 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.triton_helpers import libdevice
import torch.nn as ... | SarodYatawatta/federated-pytorch-test | EncoderCNN | false | 8,754 | [
"Apache-2.0"
] | 33 | 42a51ba12a92b32fa19273340d5b61e74e11d8e0 | https://github.com/SarodYatawatta/federated-pytorch-test/tree/42a51ba12a92b32fa19273340d5b61e74e11d8e0 |
SVIGlobalMaxPool2D | import torch
import torch.nn as nn
class SVIGlobalMaxPool2D(nn.Module):
"""
Expects
:param x: [examples, samples, channels, H, W]
:return: [examples, samples, channels]
"""
def __init__(self):
super(SVIGlobalMaxPool2D, self).__init__()
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
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | SebFar/radial_bnn | SVIGlobalMaxPool2D | false | 8,755 | [
"MIT"
] | 29 | 2497e5e009409ac910d609850eae27f7cc74cec2 | https://github.com/SebFar/radial_bnn/tree/2497e5e009409ac910d609850eae27f7cc74cec2 |
GC3d | import torch
import torch.nn as nn
import torch.nn
class GC3d(nn.Module):
def __init__(self, inplanes, planes, kh=7, kw=7, mdim=256, which_conv=
nn.Conv3d):
super(GC3d, self).__init__()
self.conv_l1 = which_conv(inplanes, mdim, kernel_size=(1, kh, 1),
padding=(0, int(kh / 2), ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn
assert_size_stride = torch._C._dynamo.guar... | Schmiddo/d2conv3d | GC3d | false | 8,756 | [
"MIT"
] | 16 | 9b330be56f0dfb9657a63e3fb3394ab36b35a67b | https://github.com/Schmiddo/d2conv3d/tree/9b330be56f0dfb9657a63e3fb3394ab36b35a67b |
DCENetLoss | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
class DCENetLoss(nn.Module):
def __init__(self, config):
super(DCENetLoss, self).__init__()
self.beta = config['beta']
self.pred_seq = config['pred_seq']
def forward(self,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | SeongjuLee/DCENet-PyTorch | DCENetLoss | false | 8,757 | [
"MIT"
] | 10 | eb477ce06356ae597c162dd3229285400ebf9168 | https://github.com/SeongjuLee/DCENet-PyTorch/tree/eb477ce06356ae597c162dd3229285400ebf9168 |
lrBLock_l2 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class resBlock(nn.Module):
def __init__(self, channelDepth, windowSize=3):
super(resBlock, self).__init__()
padding = math.floor(windowSize / 2)
self.conv1 = nn.Conv2d(channelDepth, channelDepth, windowSize, 1,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | SeokjaeLIM/DSLR-release | lrBLock_l2 | false | 8,758 | [
"Apache-2.0"
] | 14 | 861429482faf50ee3d6570948af8c48df1fc7f43 | https://github.com/SeokjaeLIM/DSLR-release/tree/861429482faf50ee3d6570948af8c48df1fc7f43 |
NetVLAD | import torch
import numpy as np
from sklearn.neighbors import NearestNeighbors
import torch.nn as nn
import torch.nn.functional as F
class NetVLAD(nn.Module):
"""NetVLAD layer implementation"""
def __init__(self, num_clusters=64, dim=128, normalize_input=True,
vladv2=False):
"""
Args:... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | NikV-JS/DualVPRUtil | NetVLAD | false | 8,759 | [
"MIT"
] | 31 | 6533e21641faa9156db6e8d95bb5c51cc4b7d377 | https://github.com/NikV-JS/DualVPRUtil/tree/6533e21641faa9156db6e8d95bb5c51cc4b7d377 |
Net1 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net1(nn.Module):
def __init__(self):
super(Net1, self).__init__()
self.conv1 = nn.Conv2d(3, 32, 3)
self.conv2 = nn.Conv2d(32, 32, 3)
self.conv3 = nn.Conv2d(32, 64, 3)
self.conv4 = nn.Conv2d(64, 64, 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._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | SarodYatawatta/federated-pytorch-test | Net1 | false | 8,760 | [
"Apache-2.0"
] | 33 | 42a51ba12a92b32fa19273340d5b61e74e11d8e0 | https://github.com/SarodYatawatta/federated-pytorch-test/tree/42a51ba12a92b32fa19273340d5b61e74e11d8e0 |
FeatureMapPairEncoderV2 | import torch
from torch import nn
import torch.nn.functional as F
class FeatureMapPairEncoderV2(nn.Module):
def __init__(self, init_scale=1.0, no_weight_init=False):
super(FeatureMapPairEncoderV2, self).__init__()
self.conv1 = nn.Conv2d(96, 256, kernel_size=3, stride=1)
self.conv2 = nn.Co... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | KH-Kyle/rmp_nav | FeatureMapPairEncoderV2 | false | 8,761 | [
"MIT"
] | 30 | d598fe70664a4cdc0e9b9dd4b52e84aa3de1b551 | https://github.com/KH-Kyle/rmp_nav/tree/d598fe70664a4cdc0e9b9dd4b52e84aa3de1b551 |
G_Small | import torch
import torch.nn as nn
class Conv2d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, bn
=False, activation='leakyrelu', dropout=False):
super(Conv2d, self).__init__()
padding = int((kernel_size - 1) / 2)
self.conv = nn.Conv2d(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 import triton_helpers
import torch.nn as nn
assert_... | RQuispeC/pytorch-ACSCP | G_Small | false | 8,762 | [
"MIT"
] | 25 | c83f08632012c2245250ff9c5140814461db575c | https://github.com/RQuispeC/pytorch-ACSCP/tree/c83f08632012c2245250ff9c5140814461db575c |
Net2 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net2(nn.Module):
def __init__(self):
super(Net2, self).__init__()
self.conv1 = nn.Conv2d(3, 64, 3, padding=1)
self.conv2 = nn.Conv2d(64, 128, 3, padding=1)
self.conv3 = nn.Conv2d(128, 256, 3, padding=1)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | SarodYatawatta/federated-pytorch-test | Net2 | false | 8,763 | [
"Apache-2.0"
] | 33 | 42a51ba12a92b32fa19273340d5b61e74e11d8e0 | https://github.com/SarodYatawatta/federated-pytorch-test/tree/42a51ba12a92b32fa19273340d5b61e74e11d8e0 |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 5 * 5, 120)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | SarodYatawatta/federated-pytorch-test | Net | false | 8,764 | [
"Apache-2.0"
] | 33 | 42a51ba12a92b32fa19273340d5b61e74e11d8e0 | https://github.com/SarodYatawatta/federated-pytorch-test/tree/42a51ba12a92b32fa19273340d5b61e74e11d8e0 |
ContextgenCNN | import torch
import torch.nn as nn
import torch.nn.functional as F
class ContextgenCNN(nn.Module):
def __init__(self, latent_dim=1024):
super(ContextgenCNN, self).__init__()
self.latent_dim = latent_dim
self.conv1 = nn.Conv2d(self.latent_dim, self.latent_dim // 4, 1,
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.triton_helpers import libdevice
import torch.nn as ... | SarodYatawatta/federated-pytorch-test | ContextgenCNN | false | 8,765 | [
"Apache-2.0"
] | 33 | 42a51ba12a92b32fa19273340d5b61e74e11d8e0 | https://github.com/SarodYatawatta/federated-pytorch-test/tree/42a51ba12a92b32fa19273340d5b61e74e11d8e0 |
G_Large | import torch
import torch.nn as nn
class Conv2d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, bn
=False, activation='leakyrelu', dropout=False):
super(Conv2d, self).__init__()
padding = int((kernel_size - 1) / 2)
self.conv = nn.Conv2d(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 import triton_helpers
import torch.nn as nn
assert_... | RQuispeC/pytorch-ACSCP | G_Large | false | 8,766 | [
"MIT"
] | 25 | c83f08632012c2245250ff9c5140814461db575c | https://github.com/RQuispeC/pytorch-ACSCP/tree/c83f08632012c2245250ff9c5140814461db575c |
Mean_One | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
class Linear(nn.Module):
def __init__(self, options, weights=None):
super(Linear, self).__init__()
self.n_in = options['n_in']
self.n_out = options['n_out']
self.layer ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | KaiQiangSong/joint_parse_summ | Mean_One | false | 8,767 | [
"BSD-3-Clause"
] | 29 | 5d4a40d9a681bc8b06c847643d810846f3867216 | https://github.com/KaiQiangSong/joint_parse_summ/tree/5d4a40d9a681bc8b06c847643d810846f3867216 |
MmQAHead | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
def gelu(x):
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
super(LayerNorm, self).__init__()
self.weight = nn.Paramet... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | MILVLG/rosita | MmQAHead | false | 8,768 | [
"Apache-2.0"
] | 32 | 13f7e68350a64b4b5b2c44b9fa4e7448bbe7420c | https://github.com/MILVLG/rosita/tree/13f7e68350a64b4b5b2c44b9fa4e7448bbe7420c |
DNN | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class DNN(nn.Module):
def __init__(self, config):
super(DNN, self).__init__()
self.fc1 = nn.Linear(784, int(config['hidden_layer1']))
self.dropout = nn.Dropou... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | AmberLJC/Fluid | DNN | false | 8,769 | [
"Apache-2.0"
] | 12 | 85dee374eb2a1c96fecea83d5484ad83d1739e95 | https://github.com/AmberLJC/Fluid/tree/85dee374eb2a1c96fecea83d5484ad83d1739e95 |
CLSHead | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
class CLSHead(nn.Module):
def __init__(self, config, init_weights=None):
super(CLSHead, self).__init__()
self.layer_1 = nn.Linear(config.d_model, config.d_model)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | MSU-MLSys-Lab/CATE | CLSHead | false | 8,770 | [
"Apache-2.0"
] | 15 | 654c393d7df888d2c3f3b90f9e6752faa061157e | https://github.com/MSU-MLSys-Lab/CATE/tree/654c393d7df888d2c3f3b90f9e6752faa061157e |
FrameAvgPool | from _paritybench_helpers import _mock_config
import torch
import torch.nn.parallel
import torch.nn as nn
import torch.utils.data
import torch.backends.cudnn
class FrameAvgPool(nn.Module):
def __init__(self, cfg):
super(FrameAvgPool, self).__init__()
input_size = cfg.INPUT_SIZE
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 import triton_helpers
import torch.nn.parallel
impo... | EGO4D/episodic-memory | FrameAvgPool | false | 8,771 | [
"MIT"
] | 27 | 2a3464882cd4f665c358c1b05a6397339e33c2e1 | https://github.com/EGO4D/episodic-memory/tree/2a3464882cd4f665c358c1b05a6397339e33c2e1 |
ImagePairEncoderV2 | import torch
from torch import nn
import torch.nn.functional as F
class ImagePairEncoderV2(nn.Module):
def __init__(self, init_scale=1.0, bias=True, no_weight_init=False):
super(ImagePairEncoderV2, self).__init__()
self.conv1 = nn.Conv2d(9, 64, kernel_size=5, stride=2, bias=bias)
self.con... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | KH-Kyle/rmp_nav | ImagePairEncoderV2 | false | 8,772 | [
"MIT"
] | 30 | d598fe70664a4cdc0e9b9dd4b52e84aa3de1b551 | https://github.com/KH-Kyle/rmp_nav/tree/d598fe70664a4cdc0e9b9dd4b52e84aa3de1b551 |
ImageEncoderV3 | import torch
from torch import nn
import torch.nn.functional as F
class ImageEncoderV3(nn.Module):
def __init__(self, output_dim=512, init_scale=1.0, residual_link=False):
super(ImageEncoderV3, self).__init__()
self.residual_link = residual_link
self.conv1 = nn.Conv2d(3, output_dim // 8, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | KH-Kyle/rmp_nav | ImageEncoderV3 | false | 8,773 | [
"MIT"
] | 30 | d598fe70664a4cdc0e9b9dd4b52e84aa3de1b551 | https://github.com/KH-Kyle/rmp_nav/tree/d598fe70664a4cdc0e9b9dd4b52e84aa3de1b551 |
BertOutput | from _paritybench_helpers import _mock_config
import torch
from torch import nn
class DecoderBertLayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(DecoderBertLayerNorm, self).__init... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | ArrowLuo/GRACE | BertOutput | false | 8,774 | [
"Apache-2.0"
] | 17 | f27b500ba905685c03eee6d91d87adc9ef78b4d1 | https://github.com/ArrowLuo/GRACE/tree/f27b500ba905685c03eee6d91d87adc9ef78b4d1 |
BertPooler | from _paritybench_helpers import _mock_config
import torch
from torch import 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, hid... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | ArrowLuo/GRACE | BertPooler | false | 8,775 | [
"Apache-2.0"
] | 17 | f27b500ba905685c03eee6d91d87adc9ef78b4d1 | https://github.com/ArrowLuo/GRACE/tree/f27b500ba905685c03eee6d91d87adc9ef78b4d1 |
BertAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import 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.... | ArrowLuo/GRACE | BertAttention | false | 8,776 | [
"Apache-2.0"
] | 17 | f27b500ba905685c03eee6d91d87adc9ef78b4d1 | https://github.com/ArrowLuo/GRACE/tree/f27b500ba905685c03eee6d91d87adc9ef78b4d1 |
SimpleConvNet | import torch
import torch.nn.functional as F
from torch import nn
class SimpleConvNet(nn.Module):
def __init__(self, num_classes=10):
super(SimpleConvNet, self).__init__()
self.conv1_1 = nn.Conv2d(3, 32, 3, 1)
self.conv1_2 = nn.Conv2d(32, 32, 3, 1)
self.conv2_1 = nn.Conv2d(32, 64,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn.functional as... | Princeton-SysML/GradAttack | SimpleConvNet | false | 8,777 | [
"MIT"
] | 43 | 40f0ab3b88d995d9c59acb7609d01380bb0749fe | https://github.com/Princeton-SysML/GradAttack/tree/40f0ab3b88d995d9c59acb7609d01380bb0749fe |
BertSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torch.optim
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:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | DengBoCong/text-sim | BertSelfAttention | false | 8,779 | [
"MIT"
] | 21 | 2c6c323649aa259a7b3d5c6d3714bd1860114826 | https://github.com/DengBoCong/text-sim/tree/2c6c323649aa259a7b3d5c6d3714bd1860114826 |
RobertaSelfOutput | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class RobertaSelfOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | BlackNoodle/TUCORE-GCN | RobertaSelfOutput | false | 8,780 | [
"MIT"
] | 27 | 16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 | https://github.com/BlackNoodle/TUCORE-GCN/tree/16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 |
DecoderAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
class DecoderBertLayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(DecoderBertLayerNorm, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ArrowLuo/GRACE | DecoderAttention | false | 8,781 | [
"Apache-2.0"
] | 17 | f27b500ba905685c03eee6d91d87adc9ef78b4d1 | https://github.com/ArrowLuo/GRACE/tree/f27b500ba905685c03eee6d91d87adc9ef78b4d1 |
BertSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import 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.... | ArrowLuo/GRACE | BertSelfAttention | false | 8,782 | [
"Apache-2.0"
] | 17 | f27b500ba905685c03eee6d91d87adc9ef78b4d1 | https://github.com/ArrowLuo/GRACE/tree/f27b500ba905685c03eee6d91d87adc9ef78b4d1 |
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 ... | IsaacChanghau/ReLoCLNet | BertOutput | false | 8,783 | [
"MIT"
] | 31 | 56cb666ce516cce9acbcfce78fb4e95d81e11e54 | https://github.com/IsaacChanghau/ReLoCLNet/tree/56cb666ce516cce9acbcfce78fb4e95d81e11e54 |
RobertaLMHead | 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 ... | BlackNoodle/TUCORE-GCN | RobertaLMHead | false | 8,784 | [
"MIT"
] | 27 | 16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 | https://github.com/BlackNoodle/TUCORE-GCN/tree/16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 |
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 ... | BingzhangZhu/Covid19-ABSA | BERTIntermediate | false | 8,785 | [
"MIT"
] | 31 | e488e74ee53882bba56aedfafb3846ab82c4678e | https://github.com/BingzhangZhu/Covid19-ABSA/tree/e488e74ee53882bba56aedfafb3846ab82c4678e |
MultiHeadAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
class MultiHeadAttention(nn.Module):
""" Multi-Head Attention module """
def __init__(self, config):
super(MultiHeadAttention, self).__init__()
if config.hidden_size % config.num_attention_heads != 0:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ArrowLuo/GRACE | MultiHeadAttention | false | 8,786 | [
"Apache-2.0"
] | 17 | f27b500ba905685c03eee6d91d87adc9ef78b4d1 | https://github.com/ArrowLuo/GRACE/tree/f27b500ba905685c03eee6d91d87adc9ef78b4d1 |
BertPooler | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.utils.data
import torch
class BertPooler(nn.Module):
def __init__(self, config):
super(BertPooler, self).__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.activation ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Bhaskers-Blu-Org2/Distilled-Sentence-Embedding | BertPooler | false | 8,787 | [
"MIT"
] | 23 | 092b70830564c65a2efe8cadecd5da2d5dfdfba9 | https://github.com/Bhaskers-Blu-Org2/Distilled-Sentence-Embedding/tree/092b70830564c65a2efe8cadecd5da2d5dfdfba9 |
RobertaClassificationHead | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class RobertaClassificationHead(nn.Module):
"""Head for sentence-level classification tasks."""
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | BlackNoodle/TUCORE-GCN | RobertaClassificationHead | false | 8,788 | [
"MIT"
] | 27 | 16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 | https://github.com/BlackNoodle/TUCORE-GCN/tree/16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 |
Mean_Two | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
class Linear(nn.Module):
def __init__(self, options, weights=None):
super(Linear, self).__init__()
self.n_in = options['n_in']
self.n_out = options['n_out']
self.layer ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | KaiQiangSong/joint_parse_summ | Mean_Two | false | 8,789 | [
"BSD-3-Clause"
] | 29 | 5d4a40d9a681bc8b06c847643d810846f3867216 | https://github.com/KaiQiangSong/joint_parse_summ/tree/5d4a40d9a681bc8b06c847643d810846f3867216 |
RobertaSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class RobertaSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if (config.hidden_size % config.num_attention_heads != 0 and not
hasattr(config, 'embedding_size')):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | BlackNoodle/TUCORE-GCN | RobertaSelfAttention | false | 8,790 | [
"MIT"
] | 27 | 16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 | https://github.com/BlackNoodle/TUCORE-GCN/tree/16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 |
DQNMLPBase | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def init(module, weight_init, bias_init, gain=1):
weight_init(module.weight.data, gain=gain)
bias_init(module.bias.data)
return module
def init_normc_(weight, gain=1):
weight.normal_(0, 1)
weight *= gain / torch.sqr... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | KMarino/hrl-ep3 | DQNMLPBase | false | 8,791 | [
"MIT"
] | 17 | f1ad0c936d271955f4899a3a830023e1a2cffda3 | https://github.com/KMarino/hrl-ep3/tree/f1ad0c936d271955f4899a3a830023e1a2cffda3 |
RepresentationModule | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class RepresentationModule(nn.Module):
def __init__(self, config, task_name, repr_size):
super(RepresentationModule, self).__init__()
self.config = config
self.task_name = task_name
self.repr_size = 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Impavidity/relogic | RepresentationModule | false | 8,792 | [
"MIT"
] | 24 | f647106e143cd603b95b63e06ea530cdd516aefe | https://github.com/Impavidity/relogic/tree/f647106e143cd603b95b63e06ea530cdd516aefe |
MmRefsHead | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
def gelu(x):
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
super(LayerNorm, self).__init__()
self.weight = nn.Paramet... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | MILVLG/rosita | MmRefsHead | false | 8,793 | [
"Apache-2.0"
] | 32 | 13f7e68350a64b4b5b2c44b9fa4e7448bbe7420c | https://github.com/MILVLG/rosita/tree/13f7e68350a64b4b5b2c44b9fa4e7448bbe7420c |
BertSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import 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.... | Bhaskers-Blu-Org1/translucent-answer-prediction | BertSelfAttention | false | 8,794 | [
"Apache-2.0"
] | 23 | 1214e0356f24e1a4b1ad64f2eb0edac0baf37a79 | https://github.com/Bhaskers-Blu-Org1/translucent-answer-prediction/tree/1214e0356f24e1a4b1ad64f2eb0edac0baf37a79 |
RWKV_ChannelMix | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
from torch.nn import functional as F
class RWKV_ChannelMix(nn.Module):
def __init__(self, config, layer_id):
super().__init__()
self.layer_id = layer_id
self.time_shift = nn.ZeroPad2d((0, 0, 1, -1))
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.triton_helpers import libdevice, math as tl_math
im... | JunnYu/Paddle-AI-Writer | RWKV_ChannelMix | false | 8,795 | [
"BSD-3-Clause"
] | 25 | 8d211f9e60aeed323b6330065668f54350514c70 | https://github.com/JunnYu/Paddle-AI-Writer/tree/8d211f9e60aeed323b6330065668f54350514c70 |
PredictorCNN | import torch
import torch.nn as nn
class PredictorCNN(nn.Module):
def __init__(self, latent_dim=1024, reduced_dim=64):
super(PredictorCNN, self).__init__()
self.latent_dim = latent_dim
self.reduced_dim = reduced_dim
self.conv1 = nn.Conv2d(self.latent_dim, self.reduced_dim, 1, 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.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | SarodYatawatta/federated-pytorch-test | PredictorCNN | false | 8,796 | [
"Apache-2.0"
] | 33 | 42a51ba12a92b32fa19273340d5b61e74e11d8e0 | https://github.com/SarodYatawatta/federated-pytorch-test/tree/42a51ba12a92b32fa19273340d5b61e74e11d8e0 |
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.... | IsaacChanghau/ReLoCLNet | BertAttention | false | 8,797 | [
"MIT"
] | 31 | 56cb666ce516cce9acbcfce78fb4e95d81e11e54 | https://github.com/IsaacChanghau/ReLoCLNet/tree/56cb666ce516cce9acbcfce78fb4e95d81e11e54 |
cosine_similarity | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class cosine_similarity(nn.Module):
def __init__(self, args):
super(cosine_similarity, self).__init__()
self.row_wise_avgpool = nn.AvgPool1d(kernel_size=3, stride=1)
def forward(self, x, y):
x = x.transp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | IBM/fold2seq | cosine_similarity | false | 8,798 | [
"Apache-2.0"
] | 33 | b9a97d81eac329b5259ad10e2a6f4fe80ade542f | https://github.com/IBM/fold2seq/tree/b9a97d81eac329b5259ad10e2a6f4fe80ade542f |
Attention | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
EPS = 1e-08
def __init__(self, options, weights=None):
super(Attention, self).__init__()
self.n_encoder = options['n_encoder']
self.n_decoder = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | KaiQiangSong/joint_parse_summ | Attention | false | 8,799 | [
"BSD-3-Clause"
] | 29 | 5d4a40d9a681bc8b06c847643d810846f3867216 | https://github.com/KaiQiangSong/joint_parse_summ/tree/5d4a40d9a681bc8b06c847643d810846f3867216 |
TransformerFFN | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
from torch.nn import functional as F
def gelu(x):
"""
GELU activation
https://arxiv.org/abs/1606.08415
https://github.com/huggingface/pytorch-openai-transformer-lm/blob/master/model_pytorch.py#L14
https://... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Impavidity/relogic | TransformerFFN | false | 8,800 | [
"MIT"
] | 24 | f647106e143cd603b95b63e06ea530cdd516aefe | https://github.com/Impavidity/relogic/tree/f647106e143cd603b95b63e06ea530cdd516aefe |
Wav2Vec2ClassificationHead | from _paritybench_helpers import _mock_config
import torch
from torch import nn
class Wav2Vec2ClassificationHead(nn.Module):
"""Head for wav2vec classification task. This class stack an MLP on top of the output of the transformer,
after a pooling layer, defined in Wav2Vec2ForSpeechClassification class"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | D4shka/MMEmotionRecognition | Wav2Vec2ClassificationHead | false | 8,801 | [
"MIT"
] | 11 | 37572a506f8247eb5b14d59139e1f9b52f5f694b | https://github.com/D4shka/MMEmotionRecognition/tree/37572a506f8247eb5b14d59139e1f9b52f5f694b |
TreeNode_De | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
class Linear(nn.Module):
def __init__(self, options, weights=None):
super(Linear, self).__init__()
self.n_in = options['n_in']
self.n_out = options['n_out']
self.layer ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | KaiQiangSong/joint_parse_summ | TreeNode_De | false | 8,802 | [
"BSD-3-Clause"
] | 29 | 5d4a40d9a681bc8b06c847643d810846f3867216 | https://github.com/KaiQiangSong/joint_parse_summ/tree/5d4a40d9a681bc8b06c847643d810846f3867216 |
PartialViewPredictionModule | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class PartialViewPredictionModule(nn.Module):
def __init__(self, config, task_name, n_classes, activate=True):
super(PartialViewPredictionModule, self).__init__()
self.config = config
self.projection = nn.Lin... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | Impavidity/relogic | PartialViewPredictionModule | false | 8,803 | [
"MIT"
] | 24 | f647106e143cd603b95b63e06ea530cdd516aefe | https://github.com/Impavidity/relogic/tree/f647106e143cd603b95b63e06ea530cdd516aefe |
BERTAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class BERTLayerNorm(nn.Module):
def __init__(self, config, variance_epsilon=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(BERTLayerNorm, 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.... | BingzhangZhu/Covid19-ABSA | BERTAttention | false | 8,804 | [
"MIT"
] | 31 | e488e74ee53882bba56aedfafb3846ab82c4678e | https://github.com/BingzhangZhu/Covid19-ABSA/tree/e488e74ee53882bba56aedfafb3846ab82c4678e |
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.... | IsaacChanghau/ReLoCLNet | BertSelfAttention | false | 8,805 | [
"MIT"
] | 31 | 56cb666ce516cce9acbcfce78fb4e95d81e11e54 | https://github.com/IsaacChanghau/ReLoCLNet/tree/56cb666ce516cce9acbcfce78fb4e95d81e11e54 |
Pooler | from _paritybench_helpers import _mock_config
import torch
from torch import nn
class Pooler(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.activation = nn.Tanh()
def forward(self, last_hidden_state):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | MaratSaidov/artificial-text-detection | Pooler | false | 8,806 | [
"MIT"
] | 12 | 74b2100294232ec361db84fdc3a24fdeba1fce49 | https://github.com/MaratSaidov/artificial-text-detection/tree/74b2100294232ec361db84fdc3a24fdeba1fce49 |
Unet | import torch
import torch.utils.data
import torch
import torch.nn as nn
import torch.nn.functional as F
class conv_bn_relu(nn.Module):
def __init__(self, in_channel, out_channel, stride=1, has_relu=True):
super(conv_bn_relu, self).__init__()
self.conv = nn.Conv2d(in_channel, out_channel, 3, strid... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | SeanChenxy/GAN_RS | Unet | false | 8,807 | [
"BSD-3-Clause"
] | 17 | a1786b946caf7bd24c83cea4c7a9bb74445cc381 | https://github.com/SeanChenxy/GAN_RS/tree/a1786b946caf7bd24c83cea4c7a9bb74445cc381 |
RobertaAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
from typing import Tuple
from typing import List
from typing import Set
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[int]') ->Tuple[Set[int],
to... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | BlackNoodle/TUCORE-GCN | RobertaAttention | false | 8,808 | [
"MIT"
] | 27 | 16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 | https://github.com/BlackNoodle/TUCORE-GCN/tree/16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 |
CausalSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torchvision.transforms.functional as F
import torch.nn.functional as F
import torch.nn as nn
from torchvision.transforms import functional as F
from torch.nn import functional as F
class CausalSelfAttention(nn.Module):
def __init__(sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | DQiaole/ZITS | CausalSelfAttention | false | 8,809 | [
"Apache-2.0"
] | 40 | 5f7a060167790789d5e29a3d14d3c2ef8a34e765 | https://github.com/DQiaole/ZITS/tree/5f7a060167790789d5e29a3d14d3c2ef8a34e765 |
AngularPenaltySMLoss | import torch
from torch import nn
import torch.nn.functional as F
class AngularPenaltySMLoss(nn.Module):
def __init__(self, in_features, out_features, loss_type='arcface', eps=
1e-07, s=None, m=None):
"""
Angular Penalty Softmax Loss
Three 'loss_types' available: ['arcface', 'sph... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Seb-Good/physionet-challenge-2020 | AngularPenaltySMLoss | false | 8,810 | [
"BSD-2-Clause"
] | 13 | c6f1648a148335babc0a26d8a589120616327548 | https://github.com/Seb-Good/physionet-challenge-2020/tree/c6f1648a148335babc0a26d8a589120616327548 |
BertOutput | from _paritybench_helpers import _mock_config
import torch
import torch.utils.data
import torch.nn as nn
import torch
import torch.nn.parallel
class BertLayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.... | IsmaelElsharkawi/new_pororo_repo | BertOutput | false | 8,811 | [
"MIT"
] | 19 | 4617083b420615b8a3eb0f44d02e4e91a8f407f7 | https://github.com/IsmaelElsharkawi/new_pororo_repo/tree/4617083b420615b8a3eb0f44d02e4e91a8f407f7 |
PropMaxPool | from _paritybench_helpers import _mock_config
import torch
import torch.nn.parallel
import torch.nn as nn
import torch.utils.data
import torch.backends.cudnn
class PropMaxPool(nn.Module):
def __init__(self, cfg):
super(PropMaxPool, self).__init__()
num_layers = cfg.NUM_LAYERS
self.layers ... | 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.parallel
import torch.nn as nn
import torch.utils.data
import torch.backe... | EGO4D/episodic-memory | PropMaxPool | false | 8,812 | [
"MIT"
] | 27 | 2a3464882cd4f665c358c1b05a6397339e33c2e1 | https://github.com/EGO4D/episodic-memory/tree/2a3464882cd4f665c358c1b05a6397339e33c2e1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.