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 |
|---|---|---|---|---|---|---|---|---|---|---|
FocalLoss | import torch
from torch import nn
class FocalLoss(nn.Module):
def __init__(self, gamma=0, eps=1e-07):
super(FocalLoss, self).__init__()
self.gamma = gamma
self.eps = eps
self.ce = torch.nn.CrossEntropyLoss(reduction='none')
def forward(self, input, target):
logp = sel... | 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
from torch import nn
a... | Lascarfo/kaggle-landmark-recognition-2020-1st-place | FocalLoss | false | 2,501 | [
"MIT"
] | 0 | f9007d81e59ecd1311bdea5586a426b8973a2eb8 | https://github.com/Lascarfo/kaggle-landmark-recognition-2020-1st-place/tree/f9007d81e59ecd1311bdea5586a426b8973a2eb8 |
Attention | import math
import torch
import torch.nn as nn
class Attention(nn.Module):
"""
Using two types of attention mechanism: "Dot" and "Bahdanau"
"""
def __init__(self, hidden_size, use_tanh=False, C=10, name='Bahdanau',
use_cuda=True):
super(Attention, self).__init__()
self.use... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Lance0226/CIS700_Convex_Hull_RL | Attention | false | 2,502 | [
"MIT"
] | 0 | 3c87e063209d535d75fde719bf17f20dd5e68635 | https://github.com/Lance0226/CIS700_Convex_Hull_RL/tree/3c87e063209d535d75fde719bf17f20dd5e68635 |
BothContextGate | import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
class ContextGate(nn.Module):
"""
Context gate is a decoder module that takes as input the previous word
embedding, the current decoder state and the attention state, and
produces a gate.
The gate can be used to select 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.triton_helpers import libdevice
import torch.nn as ... | LeeeeoLiu/OpenNMT-py | BothContextGate | false | 2,503 | [
"MIT"
] | 0 | 9be3a8951e9181aabe5440e4ea98173b7e749b5c | https://github.com/LeeeeoLiu/OpenNMT-py/tree/9be3a8951e9181aabe5440e4ea98173b7e749b5c |
GraphEmbedding | import math
import torch
import torch.nn as nn
class GraphEmbedding(nn.Module):
def __init__(self, input_size, ebd_size, use_cuda=True, use_sdne=True,
add_noise=False, is_training=True):
super(GraphEmbedding, self).__init__()
self.use_cuda = use_cuda
self.use_sdne = use_sdne
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | Lance0226/CIS700_Convex_Hull_RL | GraphEmbedding | false | 2,504 | [
"MIT"
] | 0 | 3c87e063209d535d75fde719bf17f20dd5e68635 | https://github.com/Lance0226/CIS700_Convex_Hull_RL/tree/3c87e063209d535d75fde719bf17f20dd5e68635 |
GeM | import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.parameter import Parameter
def gem(x, p=3, eps=1e-06):
return F.avg_pool2d(x.clamp(min=eps).pow(p), (x.size(-2), x.size(-1))).pow(
1.0 / p)
class GeM(nn.Module):
def __init__(self, p=3, eps=1e-06, p_trainable=True)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
from to... | Lascarfo/kaggle-landmark-recognition-2020-1st-place | GeM | false | 2,505 | [
"MIT"
] | 0 | f9007d81e59ecd1311bdea5586a426b8973a2eb8 | https://github.com/Lascarfo/kaggle-landmark-recognition-2020-1st-place/tree/f9007d81e59ecd1311bdea5586a426b8973a2eb8 |
FocalLossBinary | import torch
import torch.nn.functional
import torch.jit
import torch.nn.functional as F
from functools import partial
from torch.nn.modules.loss import _Loss
def reduced_focal_loss(outputs: 'torch.Tensor', targets: 'torch.Tensor',
threshold: 'float'=0.5, gamma: 'float'=2.0, reduction='mean'):
"""
Compute... | 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... | LeAlex27/nnUNet | FocalLossBinary | false | 2,506 | [
"Apache-2.0"
] | 0 | 9b6912f80904af9eaa4db41cd7e5c7f20058cdde | https://github.com/LeAlex27/nnUNet/tree/9b6912f80904af9eaa4db41cd7e5c7f20058cdde |
SourceContextGate | import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
class ContextGate(nn.Module):
"""
Context gate is a decoder module that takes as input the previous word
embedding, the current decoder state and the attention state, and
produces a gate.
The gate can be used to select 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.triton_helpers import libdevice
import torch.nn as ... | LeeeeoLiu/OpenNMT-py | SourceContextGate | false | 2,507 | [
"MIT"
] | 0 | 9be3a8951e9181aabe5440e4ea98173b7e749b5c | https://github.com/LeeeeoLiu/OpenNMT-py/tree/9be3a8951e9181aabe5440e4ea98173b7e749b5c |
TargetContextGate | import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
class ContextGate(nn.Module):
"""
Context gate is a decoder module that takes as input the previous word
embedding, the current decoder state and the attention state, and
produces a gate.
The gate can be used to select 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.triton_helpers import libdevice
import torch.nn as ... | LeeeeoLiu/OpenNMT-py | TargetContextGate | false | 2,508 | [
"MIT"
] | 0 | 9be3a8951e9181aabe5440e4ea98173b7e749b5c | https://github.com/LeeeeoLiu/OpenNMT-py/tree/9be3a8951e9181aabe5440e4ea98173b7e749b5c |
Foo | import torch
import torch.nn.functional
import torch.nn.parallel
import torch.utils.data
import torch.optim
import torch.utils.data.distributed
import torch.autograd
class Foo(torch.nn.Module):
def __init__(self, size):
super(Foo, self).__init__()
self.n = torch.nn.Parameter(torch.ones(size))
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional
import torch.nn.parallel
import torch.utils.data
import torch.optim
import torch.utils.data.distributed
import to... | Liuhongzhi2018/Person_ReID | Foo | false | 2,509 | [
"MIT"
] | 0 | 51c576ed5b4ed960801669d6d59c0a77405b369d | https://github.com/Liuhongzhi2018/Person_ReID/tree/51c576ed5b4ed960801669d6d59c0a77405b369d |
ScaledDotProductAtten | import torch
import numpy as np
from torch import nn
class ScaledDotProductAtten(nn.Module):
"""
Scaled dot-product attention mechainsm
公式:
$ Attention(Q, K, V) = softmax(rac{Q K^T}{\\sqrt{d_k}})*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 import triton_helpers
from torch._inductor.runtime.... | LinXueyuanStdio/scRNN-seq | ScaledDotProductAtten | false | 2,510 | [
"Apache-2.0"
] | 0 | 87e11a56acb18a86fa4fb309d33a1bc02bf38b39 | https://github.com/LinXueyuanStdio/scRNN-seq/tree/87e11a56acb18a86fa4fb309d33a1bc02bf38b39 |
FunctionalRelu6 | import torch
class FunctionalRelu6(torch.nn.Module):
def forward(self, x):
return torch.nn.functional.relu6(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 import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Ilyabasharov/torch2trt | FunctionalRelu6 | false | 2,511 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TokenEmbedding | import torch
import torch.nn as nn
class TokenEmbedding(nn.Module):
def __init__(self, c_in, d_model):
super(TokenEmbedding, self).__init__()
padding = 1 if torch.__version__ >= '1.5.0' else 2
self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_model,
kernel_size=3, pa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Linan2018/Informer2020 | TokenEmbedding | false | 2,512 | [
"Apache-2.0"
] | 0 | 30e63a7d3ed9310b917b05c4d60b340d2dd0517a | https://github.com/Linan2018/Informer2020/tree/30e63a7d3ed9310b917b05c4d60b340d2dd0517a |
Div | import torch
class Div(torch.nn.Module):
def __init__(self):
super(Div, self).__init__()
def forward(self, x, y):
return x / y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | Div | false | 2,513 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TemporalEmbedding | import math
import torch
import torch.nn as nn
class FixedEmbedding(nn.Module):
def __init__(self, c_in, d_model):
super(FixedEmbedding, self).__init__()
w = torch.zeros(c_in, d_model).float()
w.require_grad = False
position = torch.arange(0, c_in).float().unsqueeze(1)
div... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | Linan2018/Informer2020 | TemporalEmbedding | false | 2,514 | [
"Apache-2.0"
] | 0 | 30e63a7d3ed9310b917b05c4d60b340d2dd0517a | https://github.com/Linan2018/Informer2020/tree/30e63a7d3ed9310b917b05c4d60b340d2dd0517a |
LT | import torch
class LT(torch.nn.Module):
def __init__(self):
super(LT, self).__init__()
def forward(self, x, y):
return x < y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | LT | false | 2,515 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
FFN | import torch
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
class FFN(nn.Module):
def __init__(self, d_model, d_ffn, dropout=0):
super().__init__()
self.linear1 = nn.Linear(d_model, d_ffn)
self.activation = F.rel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Anonymous1376/MOTR | FFN | false | 2,516 | [
"Apache-2.0"
] | 0 | 804cac1a22068af8a8ae127eead8399026d07419 | https://github.com/Anonymous1376/MOTR/tree/804cac1a22068af8a8ae127eead8399026d07419 |
MConnBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.cuda
import torch.distributed
class MConn(nn.Module):
""" My custom connection module
"""
def __init__(self, _dim_1, _dim_2, _dim_3, _linear=False, _ln_size=None):
super(MConn, self).__init__()
self.linear1 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional as F
import torch.cuda
import t... | LeeeeoLiu/OpenNMT-py | MConnBlock | false | 2,517 | [
"MIT"
] | 0 | 9be3a8951e9181aabe5440e4ea98173b7e749b5c | https://github.com/LeeeeoLiu/OpenNMT-py/tree/9be3a8951e9181aabe5440e4ea98173b7e749b5c |
IMul | import torch
class IMul(torch.nn.Module):
def __init__(self):
super(IMul, self).__init__()
def forward(self, x, y):
x *= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_mul_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | Ilyabasharov/torch2trt | IMul | false | 2,518 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
SoftGeneratorAttention | import torch
import torch.nn.functional as F
import torch.nn as nn
class SoftGeneratorAttention(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def apply_bn(self, x):
bn_module = nn.BatchNorm1d(x.size()[1])
return bn_module(x)
def forward(self, key, x):
attn = t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | LinChen-65/pygcn | SoftGeneratorAttention | false | 2,519 | [
"MIT"
] | 0 | 0a77f56fd6d5cb3edc7affc2ba3455733d7da6eb | https://github.com/LinChen-65/pygcn/tree/0a77f56fd6d5cb3edc7affc2ba3455733d7da6eb |
FloorDivConst | import torch
class FloorDivConst(torch.nn.Module):
def __init__(self):
super(FloorDivConst, self).__init__()
def forward(self, x):
return x // 2.0
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | FloorDivConst | false | 2,520 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
DownBlock | import torch
from torchvision.transforms import *
class ConvBlock(torch.nn.Module):
def __init__(self, input_size, output_size, kernel_size=3, stride=1,
padding=1, bias=True, activation='prelu', norm=None):
super(ConvBlock, self).__init__()
self.conv = torch.nn.Conv2d(input_size, output_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 torchvision.transforms import *
assert_size_stride = torch._C._dynamo.guard... | DengZeshuai/DBPN-Pytorch | DownBlock | false | 2,521 | [
"MIT"
] | 0 | a90d241a1c4b07830c6d812ad8389d13e8cf05d1 | https://github.com/DengZeshuai/DBPN-Pytorch/tree/a90d241a1c4b07830c6d812ad8389d13e8cf05d1 |
EQ | import torch
class EQ(torch.nn.Module):
def __init__(self):
super(EQ, self).__init__()
def forward(self, x, y):
return x == y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | EQ | false | 2,522 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
MaxElementwise | import torch
class MaxElementwise(torch.nn.Module):
def forward(self, x, y):
return torch.max(x, y)
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 import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Ilyabasharov/torch2trt | MaxElementwise | false | 2,523 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
Clone | import torch
class Clone(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x.clone()
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | Clone | false | 2,524 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
FloorDivAssign | import torch
class FloorDivAssign(torch.nn.Module):
def __init__(self):
super(FloorDivAssign, self).__init__()
def forward(self, x, y):
x //= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
d... | Ilyabasharov/torch2trt | FloorDivAssign | false | 2,525 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TripletSoftmaxLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class TripletSoftmaxLoss(nn.Module):
def __init__(self, margin=0.0, lambda_factor=0.01):
super(TripletSoftmaxLoss, self).__init__()
self.margin = margin
self.loss_fn = nn.CrossEntropyLoss()
self.lambda_factor = lam... | 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
... | Lm0079/MetricLearningIdentification | TripletSoftmaxLoss | false | 2,526 | [
"MIT"
] | 0 | 3c2c0512fe2fbbb6aacb958106d5f6a03baedc35 | https://github.com/Lm0079/MetricLearningIdentification/tree/3c2c0512fe2fbbb6aacb958106d5f6a03baedc35 |
FloorDiv | import torch
class FloorDiv(torch.nn.Module):
def __init__(self):
super(FloorDiv, self).__init__()
def forward(self, x, y):
return x // y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | FloorDiv | false | 2,527 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
SoftGeneratorPoolMLP | import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.nn import Linear
class SoftGeneratorPoolMLP(nn.Module):
def __init__(self, nin, nhid1, nhid2, nout=1, bias=True):
nn.Module.__init__(self)
self.bias = bias
self.linear1 = Linear(nin, nhid1, bias=self.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 import triton_helpers
import torch.nn as nn
from to... | LinChen-65/pygcn | SoftGeneratorPoolMLP | false | 2,528 | [
"MIT"
] | 0 | 0a77f56fd6d5cb3edc7affc2ba3455733d7da6eb | https://github.com/LinChen-65/pygcn/tree/0a77f56fd6d5cb3edc7affc2ba3455733d7da6eb |
IDiv | import torch
class IDiv(torch.nn.Module):
def __init__(self):
super(IDiv, self).__init__()
def forward(self, x, y):
x /= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_div_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | Ilyabasharov/torch2trt | IDiv | false | 2,529 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
IAdd | import torch
class IAdd(torch.nn.Module):
def __init__(self):
super(IAdd, self).__init__()
def forward(self, x, y):
x += y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_add_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | Ilyabasharov/torch2trt | IAdd | false | 2,530 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TensorClamp | import torch
class TensorClamp(torch.nn.Module):
def forward(self, x):
return x.clamp(-0.1, 0.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._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Ilyabasharov/torch2trt | TensorClamp | false | 2,531 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
MaxPool1D | import torch
class MaxPool1D(torch.nn.Module):
def __init__(self, kernel_size, stride=None, padding=0, ceil_mode=False):
super().__init__()
self.kernel_size = kernel_size
self.stride = stride
self.padding = padding
self.ceil_mode = ceil_mode
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Ilyabasharov/torch2trt | MaxPool1D | false | 2,532 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TensorClampMin | import torch
class TensorClampMin(torch.nn.Module):
def forward(self, x):
return x.clamp_min(-0.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._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Ilyabasharov/torch2trt | TensorClampMin | false | 2,533 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
Pow | import torch
class Pow(torch.nn.Module):
def __init__(self):
super(Pow, self).__init__()
def forward(self, x, y):
return x ** y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | Pow | false | 2,534 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
GT | import torch
class GT(torch.nn.Module):
def __init__(self):
super(GT, self).__init__()
def forward(self, x, y):
return x > y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | GT | false | 2,535 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
RpowFloat | import torch
class RpowFloat(torch.nn.Module):
def __init__(self):
super(RpowFloat, self).__init__()
def forward(self, x):
return 2.0 ** 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | RpowFloat | false | 2,536 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
ModConst | import torch
class ModConst(torch.nn.Module):
def __init__(self):
super(ModConst, self).__init__()
def forward(self, x):
return x % 2.0
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | ModConst | false | 2,537 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
MinElementwise | import torch
class MinElementwise(torch.nn.Module):
def forward(self, x, y):
return torch.min(x, y)
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 import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Ilyabasharov/torch2trt | MinElementwise | false | 2,538 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
RDivFloat | import torch
class RDivFloat(torch.nn.Module):
def __init__(self):
super(RDivFloat, self).__init__()
def forward(self, x):
return 100.0 / 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | RDivFloat | false | 2,539 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TensorSigmoid | import torch
class TensorSigmoid(torch.nn.Module):
def __init__(self):
super(TensorSigmoid, self).__init__()
def forward(self, x):
return x.sigmoid()
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | TensorSigmoid | false | 2,540 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
RpowInt | import torch
class RpowInt(torch.nn.Module):
def __init__(self):
super(RpowInt, self).__init__()
def forward(self, x):
return 2 ** 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | RpowInt | false | 2,541 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
FunctionalConv3d | import torch
class FunctionalConv3d(torch.nn.Module):
def __init__(self, *args, **kwargs):
super().__init__()
self.conv = torch.nn.Conv3d(*args, **kwargs)
def forward(self, x):
x = torch.nn.functional.conv3d(x, self.conv.weight, self.conv.bias,
self.conv.stride, self.conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
reinterpret_tens... | Ilyabasharov/torch2trt | FunctionalConv3d | false | 2,542 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
PositionwiseFeedForward | import torch
from torch import nn
import torch.nn.functional as F
class PositionwiseFeedForward(nn.Module):
""" a two layer feed forward"""
def __init__(self, model_dim=512, ffn_dim=2048, dropout=0.1):
super(PositionwiseFeedForward, self).__init__()
self.w1 = nn.Conv1d(model_dim, ffn_dim, 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.... | LinXueyuanStdio/scRNN-seq | PositionwiseFeedForward | false | 2,543 | [
"Apache-2.0"
] | 0 | 87e11a56acb18a86fa4fb309d33a1bc02bf38b39 | https://github.com/LinXueyuanStdio/scRNN-seq/tree/87e11a56acb18a86fa4fb309d33a1bc02bf38b39 |
RSubInt | import torch
class RSubInt(torch.nn.Module):
def __init__(self):
super(RSubInt, self).__init__()
def forward(self, x):
return 1 - 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | RSubInt | false | 2,544 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
ISub | import torch
class ISub(torch.nn.Module):
def __init__(self):
super(ISub, self).__init__()
def forward(self, x, y):
x -= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_sub_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | Ilyabasharov/torch2trt | ISub | false | 2,545 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
Sub | import torch
class Sub(torch.nn.Module):
def __init__(self):
super(Sub, self).__init__()
def forward(self, x, y):
return x - y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | Sub | false | 2,546 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TensorClampMax | import torch
class TensorClampMax(torch.nn.Module):
def forward(self, x):
return x.clamp_max(0.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._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Ilyabasharov/torch2trt | TensorClampMax | false | 2,547 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
RAddFloat | import torch
class RAddFloat(torch.nn.Module):
def __init__(self):
super(RAddFloat, self).__init__()
def forward(self, x):
return 1.0 + 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | RAddFloat | false | 2,548 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
RMulInt | import torch
class RMulInt(torch.nn.Module):
def __init__(self):
super(RMulInt, self).__init__()
def forward(self, x):
return 10 * 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | RMulInt | false | 2,549 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
ModAssign | import torch
class ModAssign(torch.nn.Module):
def __init__(self):
super(ModAssign, self).__init__()
def forward(self, x, y):
x %= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
d... | Ilyabasharov/torch2trt | ModAssign | false | 2,550 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
RDivInt | import torch
class RDivInt(torch.nn.Module):
def __init__(self):
super(RDivInt, self).__init__()
def forward(self, x):
return 100 / 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | RDivInt | false | 2,551 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
GeM | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.functional
from torch.nn import Parameter
from torch.nn.parameter import Parameter
import torch.nn.parallel
import torch.utils.data
import torch.optim
import torch.utils.data.distributed
import torch.autograd
class GeM(nn.Module):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import... | Liuhongzhi2018/Person_ReID | GeM | false | 2,552 | [
"MIT"
] | 0 | 51c576ed5b4ed960801669d6d59c0a77405b369d | https://github.com/Liuhongzhi2018/Person_ReID/tree/51c576ed5b4ed960801669d6d59c0a77405b369d |
RMulFloat | import torch
class RMulFloat(torch.nn.Module):
def __init__(self):
super(RMulFloat, self).__init__()
def forward(self, x):
return 10.0 * 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | RMulFloat | false | 2,553 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
NotEqual | import torch
class NotEqual(torch.nn.Module):
def __init__(self):
super(NotEqual, self).__init__()
def forward(self, x, y):
return x != y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | NotEqual | false | 2,554 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
D_DownBlock | import torch
from torchvision.transforms import *
class ConvBlock(torch.nn.Module):
def __init__(self, input_size, output_size, kernel_size=3, stride=1,
padding=1, bias=True, activation='prelu', norm=None):
super(ConvBlock, self).__init__()
self.conv = torch.nn.Conv2d(input_size, output_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 torchvision.transforms import *
assert_size_stride = torch._C._dynamo.guard... | DengZeshuai/DBPN-Pytorch | D_DownBlock | false | 2,555 | [
"MIT"
] | 0 | a90d241a1c4b07830c6d812ad8389d13e8cf05d1 | https://github.com/DengZeshuai/DBPN-Pytorch/tree/a90d241a1c4b07830c6d812ad8389d13e8cf05d1 |
NotEqualConst | import torch
class NotEqualConst(torch.nn.Module):
def __init__(self):
super(NotEqualConst, self).__init__()
def forward(self, x):
return x != 13.62
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | NotEqualConst | false | 2,556 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TorchMod | import torch
class TorchMod(torch.nn.Module):
def __init__(self):
super(TorchMod, self).__init__()
def forward(self, x, y):
return torch.fmod(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | TorchMod | false | 2,557 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TorchFloorDiv | import torch
class TorchFloorDiv(torch.nn.Module):
def __init__(self):
super(TorchFloorDiv, self).__init__()
def forward(self, x, y):
return torch.floor_divide(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | TorchFloorDiv | false | 2,558 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TorchSub | import torch
class TorchSub(torch.nn.Module):
def __init__(self):
super(TorchSub, self).__init__()
def forward(self, x, y):
return torch.sub(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | TorchSub | false | 2,559 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
RSubFloat | import torch
class RSubFloat(torch.nn.Module):
def __init__(self):
super(RSubFloat, self).__init__()
def forward(self, x):
return 1.0 - 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | RSubFloat | false | 2,560 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TorchMul | import torch
class TorchMul(torch.nn.Module):
def __init__(self):
super(TorchMul, self).__init__()
def forward(self, x, y):
return torch.mul(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | TorchMul | false | 2,561 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TorchNotEqual | import torch
class TorchNotEqual(torch.nn.Module):
def __init__(self):
super(TorchNotEqual, self).__init__()
def forward(self, x, y):
return torch.ne(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | TorchNotEqual | false | 2,562 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
Upsampler | import math
import torch
from torchvision.transforms import *
class ConvBlock(torch.nn.Module):
def __init__(self, input_size, output_size, kernel_size=3, stride=1,
padding=1, bias=True, activation='prelu', norm=None):
super(ConvBlock, self).__init__()
self.conv = torch.nn.Conv2d(input_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
import math
from torchvision.transforms import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch.... | DengZeshuai/DBPN-Pytorch | Upsampler | false | 2,563 | [
"MIT"
] | 0 | a90d241a1c4b07830c6d812ad8389d13e8cf05d1 | https://github.com/DengZeshuai/DBPN-Pytorch/tree/a90d241a1c4b07830c6d812ad8389d13e8cf05d1 |
TorchPow | import torch
class TorchPow(torch.nn.Module):
def __init__(self):
super(TorchPow, self).__init__()
def forward(self, x, y):
return torch.pow(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | TorchPow | false | 2,564 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
Mod | import torch
class Mod(torch.nn.Module):
def __init__(self):
super(Mod, self).__init__()
def forward(self, x, y):
return x % y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | Mod | false | 2,565 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
ContextGate | import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
class ContextGate(nn.Module):
"""
Context gate is a decoder module that takes as input the previous word
embedding, the current decoder state and the attention state, and
produces a gate.
The gate can be used to select t... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.cuda
import torch.distributed
assert_size_str... | LeeeeoLiu/OpenNMT-py | ContextGate | false | 2,566 | [
"MIT"
] | 0 | 9be3a8951e9181aabe5440e4ea98173b7e749b5c | https://github.com/LeeeeoLiu/OpenNMT-py/tree/9be3a8951e9181aabe5440e4ea98173b7e749b5c |
PixelShuffle | import torch
import torch.nn as nn
import torch.nn.parallel
class PixelShuffle(nn.Module):
def __init__(self, ry=2, rx=2):
super().__init__()
self.ry = ry
self.rx = rx
def forward(self, x):
ry = self.ry
rx = self.rx
[B, C, H, W] = list(x.shape)
x = x.r... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | LonglifeHyun/GANda_text-to-image | PixelShuffle | false | 2,567 | [
"MIT"
] | 0 | 095ded617e4df7d7ff7f4954381dde77db6d6883 | https://github.com/LonglifeHyun/GANda_text-to-image/tree/095ded617e4df7d7ff7f4954381dde77db6d6883 |
Mul | import torch
class Mul(torch.nn.Module):
def __init__(self):
super(Mul, self).__init__()
def forward(self, x, y):
return x * y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | Mul | false | 2,568 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
PixelUnshuffle | import torch
import torch.nn as nn
import torch.nn.parallel
class PixelUnshuffle(nn.Module):
def __init__(self, ry=2, rx=2):
super().__init__()
self.ry = ry
self.rx = rx
def forward(self, x):
ry = self.ry
rx = self.rx
[B, C, H, W] = list(x.shape)
x = x... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | LonglifeHyun/GANda_text-to-image | PixelUnshuffle | false | 2,569 | [
"MIT"
] | 0 | 095ded617e4df7d7ff7f4954381dde77db6d6883 | https://github.com/LonglifeHyun/GANda_text-to-image/tree/095ded617e4df7d7ff7f4954381dde77db6d6883 |
TorchDiv | import torch
class TorchDiv(torch.nn.Module):
def __init__(self):
super(TorchDiv, self).__init__()
def forward(self, x, y):
return torch.div(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | TorchDiv | false | 2,570 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
TorchAdd | import torch
class TorchAdd(torch.nn.Module):
def __init__(self):
super(TorchAdd, self).__init__()
def forward(self, x, y):
return torch.add(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Ilyabasharov/torch2trt | TorchAdd | false | 2,571 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
UpBlock | import torch
from torchvision.transforms import *
class ConvBlock(torch.nn.Module):
def __init__(self, input_size, output_size, kernel_size=3, stride=1,
padding=1, bias=True, activation='prelu', norm=None):
super(ConvBlock, self).__init__()
self.conv = torch.nn.Conv2d(input_size, output_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 torchvision.transforms import *
assert_size_stride = torch._C._dynamo.guard... | DengZeshuai/DBPN-Pytorch | UpBlock | false | 2,572 | [
"MIT"
] | 0 | a90d241a1c4b07830c6d812ad8389d13e8cf05d1 | https://github.com/DengZeshuai/DBPN-Pytorch/tree/a90d241a1c4b07830c6d812ad8389d13e8cf05d1 |
AtenSoftmaxRepalce | import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class AtenSoftmaxRepalce(nn.Module):
def __init__(self, dim=-1):
super(AtenSoftmaxRepalce, self).__init__()
self.softmax = torch.nn.Softmax(dim)
def forward(self, x):
return sel... | 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
... | JudeDavis1/intel-extension-for-pytorch | AtenSoftmaxRepalce | false | 2,573 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
UPChannelBAN | import torch
import torch.nn.functional as F
import torch.nn as nn
def xcorr_fast(x, kernel):
"""group conv2d to calculate cross correlation, fast version
"""
batch = kernel.size()[0]
pk = kernel.view(-1, x.size()[1], kernel.size()[2], kernel.size()[3])
px = x.view(1, -1, x.size()[2], x.size()[3])... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional as F
import torch.nn as nn
assert_size_stride = torch... | IRLSCU/siamban | UPChannelBAN | false | 2,574 | [
"Apache-2.0"
] | 0 | abb12d028e93aaee74efc5042a5bb305c7805053 | https://github.com/IRLSCU/siamban/tree/abb12d028e93aaee74efc5042a5bb305c7805053 |
inplace_softmax | import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class inplace_softmax(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
x1 = x + 1
x2 = nn.Softmax(dim=-1)(x1)
return x2
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 math as tl_math
import torch.cuda
impo... | JudeDavis1/intel-extension-for-pytorch | inplace_softmax | false | 2,575 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
CharbonnierLoss | import functools
import torch
from torch import nn as nn
from torch.nn import functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
import torch.utils.data
from torch.utils import data as data
from torch import autograd as autograd
def reduce_loss(loss, reduction):
"""Reduce ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import functools
from torch ... | Lotayou/BasicSR | CharbonnierLoss | false | 2,576 | [
"Apache-2.0",
"MIT"
] | 0 | 6cf9a706dd680d54f7dc26e87318ff79f76c0dbf | https://github.com/Lotayou/BasicSR/tree/6cf9a706dd680d54f7dc26e87318ff79f76c0dbf |
MHAScoresCalculation | import math
import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class MHAScoresCalculation(nn.Module):
def __init__(self, dim_per_head, softmax_dim=-1):
super(MHAScoresCalculation, self).__init__()
self.softmax = nn.Softmax(dim=softmax_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.... | JudeDavis1/intel-extension-for-pytorch | MHAScoresCalculation | false | 2,577 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
AddLayerNorm_v1 | import torch
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class AddLayerNorm_v1(torch.nn.Module):
def __init__(self, dim=32):
super(AddLayerNorm_v1, self).__init__()
self.layernorm = torch.nn.LayerNorm(dim)
def forward(self, x, y, z):
x = x + y + z
... | 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.cuda
import torch.backends.cudnn
import torch.backends.mkl
assert_... | JudeDavis1/intel-extension-for-pytorch | AddLayerNorm_v1 | false | 2,578 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
DistilMHAScoresCalculation_v2 | import math
import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class DistilMHAScoresCalculation_v2(nn.Module):
def __init__(self, dim_per_head):
super(DistilMHAScoresCalculation_v2, self).__init__()
self.dim_per_head = dim_per_head
def ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | JudeDavis1/intel-extension-for-pytorch | DistilMHAScoresCalculation_v2 | false | 2,579 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
DistilMHAScoresCalculation_v1 | import math
import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class DistilMHAScoresCalculation_v1(nn.Module):
def __init__(self, dim_per_head, softmax_dim=-1):
super(DistilMHAScoresCalculation_v1, self).__init__()
self.softmax = nn.Softmax(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | JudeDavis1/intel-extension-for-pytorch | DistilMHAScoresCalculation_v1 | false | 2,580 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
ConvTranspose2d | import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class ConvTranspose2d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, output_padding=0, groups=1, bias=True, dilation=1):
super(ConvTranspose2d, s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch... | JudeDavis1/intel-extension-for-pytorch | ConvTranspose2d | false | 2,581 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
LinearAdd | import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class LinearAdd(nn.Module):
def __init__(self, in_channels, out_channels, **kwargs):
super(LinearAdd, self).__init__()
seed = 2018
torch.manual_seed(seed)
self.linear = nn.Li... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.cuda
import torch.backends.cudnn
import torch... | JudeDavis1/intel-extension-for-pytorch | LinearAdd | false | 2,582 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
hsigmoid | import torch
import torch.onnx
import torch
import torch.nn as nn
import torch.nn.functional as F
class hsigmoid(nn.Module):
def forward(self, x):
out = F.relu6(x + 3, inplace=True) / 6
return out
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.onnx
import torch
import torch.nn as nn
assert_size_stride = torch._C._dynam... | LukasKratochvila/pytorch-ssd | hsigmoid | false | 2,583 | [
"MIT"
] | 0 | de6ed2be6ce0b03634d4cbf41622cfe5c87d077c | https://github.com/LukasKratochvila/pytorch-ssd/tree/de6ed2be6ce0b03634d4cbf41622cfe5c87d077c |
LinearSwish | import torch
import torch.nn as nn
import torch.cuda
import torch.nn.functional as F
import torch.backends.cudnn
import torch.backends.mkl
class LinearSwish(nn.Module):
def __init__(self, in_channels, out_channels, **kwargs):
super(LinearSwish, self).__init__()
seed = 2018
torch.manual_se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch... | JudeDavis1/intel-extension-for-pytorch | LinearSwish | false | 2,584 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
EqualLinear | from torch.autograd import Function
import math
import torch
from torch import nn as nn
from torch.nn import functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
import torch.utils.data
from torch.utils import data as data
from torch import autograd as autograd
def fused_leaky_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.autograd import Function
import math
from torch import nn as nn
from ... | Lotayou/BasicSR | EqualLinear | false | 2,585 | [
"Apache-2.0",
"MIT"
] | 0 | 6cf9a706dd680d54f7dc26e87318ff79f76c0dbf | https://github.com/Lotayou/BasicSR/tree/6cf9a706dd680d54f7dc26e87318ff79f76c0dbf |
AddLayerNorm | import torch
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class AddLayerNorm(torch.nn.Module):
def __init__(self, dim=32):
super(AddLayerNorm, self).__init__()
self.layernorm = torch.nn.LayerNorm(dim)
def forward(self, x, y):
x = torch.add(x, y)
ret... | 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.cuda
import torch.backends.cudnn
import torch.backends.mkl
assert_... | JudeDavis1/intel-extension-for-pytorch | AddLayerNorm | false | 2,586 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
Module | from torch.nn import Module
import torch
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class Module(torch.nn.Module):
def __init__(self):
super(Module, self).__init__()
self.conv = torch.nn.Conv2d(1, 10, 5, 1)
def forward(self, x):
y = self.conv(x)
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.cuda
import torch.backends.cudnn
import torch.backends.mkl
assert_s... | JudeDavis1/intel-extension-for-pytorch | Module | false | 2,587 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
Bottleneck_v1 | import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class Bottleneck_v1(nn.Module):
def __init__(self):
super(Bottleneck_v1, self).__init__()
self.conv1 = nn.Conv2d(64, 64, kernel_size=(1, 1), stride=(1, 1),
bias=True)
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
import ... | JudeDavis1/intel-extension-for-pytorch | Bottleneck_v1 | false | 2,588 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
DivLoss | import torch
from torch import nn
from torch.optim.lr_scheduler import *
class DivLoss(nn.Module):
def __init__(self):
super(DivLoss, self).__init__()
def forward(self, scores):
mu = scores.mean(0)
std = ((scores - mu) ** 2).mean(0, keepdim=True).clamp(min=1e-12).sqrt(
)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
from to... | Luxios22/IDM | DivLoss | false | 2,589 | [
"MIT"
] | 0 | 8d51103b7c252e6304e2a361976e16ed4b523944 | https://github.com/Luxios22/IDM/tree/8d51103b7c252e6304e2a361976e16ed4b523944 |
SimpleNet | import torch
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class SimpleNet(torch.nn.Module):
def __init__(self):
super(SimpleNet, self).__init__()
self.conv = torch.nn.Conv2d(64, 128, (3, 3), stride=(2, 2), padding
=(1, 1), bias=False)
def forward(self, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
assert_s... | JudeDavis1/intel-extension-for-pytorch | SimpleNet | false | 2,590 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
Swish | import torch
import torch.nn
import torch.nn as nn
class Swish(nn.Module):
"""Applies the element-wise function:
.. math::
\\text{Swish}(x) = x * \\text{Sigmoid}(\\alpha * x) for constant value alpha.
Citation: Searching for Activation Functions, Ramachandran et al., 2017, https://arxiv.org/abs/... | 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.... | LucasFidon/MONAI | Swish | false | 2,591 | [
"Apache-2.0"
] | 0 | a7ef9d567775dd7a222f93bab08191c0e3532c92 | https://github.com/LucasFidon/MONAI/tree/a7ef9d567775dd7a222f93bab08191c0e3532c92 |
DiceLoss | import collections
import torch
import warnings
from typing import Optional
from typing import Union
from typing import Any
from typing import Callable
from typing import Tuple
import torch.nn
from torch.nn.modules.loss import _Loss
from enum import Enum
import collections.abc
def issequenceiterable(obj: 'Any') ->boo... | 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 collections
from typing import Optional
from typing import Union
from typing import Any
from typing import Callable
from typing impor... | LucasFidon/MONAI | DiceLoss | false | 2,592 | [
"Apache-2.0"
] | 0 | a7ef9d567775dd7a222f93bab08191c0e3532c92 | https://github.com/LucasFidon/MONAI/tree/a7ef9d567775dd7a222f93bab08191c0e3532c92 |
softmax_with_multiuse_input | import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class softmax_with_multiuse_input(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
x1 = nn.Softmax(dim=-1)(x)
x2 = x + x1
return x1, x2
d... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.cuda
impo... | JudeDavis1/intel-extension-for-pytorch | softmax_with_multiuse_input | false | 2,593 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
ToRGB | from torch.autograd import Function
import math
import torch
from torch import nn as nn
from torch.nn import functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
import torch.utils.data
from torch.utils import data as data
from torch import autograd as autograd
def make_resample... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.autograd import Function
import math
from torch import nn as nn
from ... | Lotayou/BasicSR | ToRGB | false | 2,594 | [
"Apache-2.0",
"MIT"
] | 0 | 6cf9a706dd680d54f7dc26e87318ff79f76c0dbf | https://github.com/Lotayou/BasicSR/tree/6cf9a706dd680d54f7dc26e87318ff79f76c0dbf |
hswish | import torch
import torch.onnx
import torch
import torch.nn as nn
import torch.nn.functional as F
class hswish(nn.Module):
def forward(self, x):
out = x * F.relu6(x + 3, inplace=True) / 6
return out
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[],... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.onnx
import torch
import torch.nn as nn
assert_size_stride = torch._C._dynam... | LukasKratochvila/pytorch-ssd | hswish | false | 2,595 | [
"MIT"
] | 0 | de6ed2be6ce0b03634d4cbf41622cfe5c87d077c | https://github.com/LukasKratochvila/pytorch-ssd/tree/de6ed2be6ce0b03634d4cbf41622cfe5c87d077c |
GeneratorGCN | from torch.nn import Module
import math
import torch
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
import torch.nn as nn
from torch.nn import Parameter
from torch.nn import Module
class GraphConvolution(Module):
"""
Simple GCN layer, simila... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
i... | LinChen-65/pygcn | GeneratorGCN | false | 2,596 | [
"MIT"
] | 0 | 0a77f56fd6d5cb3edc7affc2ba3455733d7da6eb | https://github.com/LinChen-65/pygcn/tree/0a77f56fd6d5cb3edc7affc2ba3455733d7da6eb |
Bottleneck_v2 | import torch
import torch.nn as nn
import torch.cuda
import torch.backends.cudnn
import torch.backends.mkl
class Bottleneck_v2(nn.Module):
def __init__(self):
super(Bottleneck_v2, self).__init__()
self.conv = nn.Conv2d(64, 256, kernel_size=(1, 1), stride=(1, 1),
bias=True)
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
import ... | JudeDavis1/intel-extension-for-pytorch | Bottleneck_v2 | false | 2,597 | [
"Apache-2.0"
] | 0 | 364e34cb4917a709f5108c07d4005bf82f3d5067 | https://github.com/JudeDavis1/intel-extension-for-pytorch/tree/364e34cb4917a709f5108c07d4005bf82f3d5067 |
SoftEntropy | import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.nn import *
class SoftEntropy(nn.Module):
def __init__(self):
super(SoftEntropy, self).__init__()
self.logsoftmax = nn.LogSoftmax(dim=1)
def forward(self, inputs, targets):
log_probs = self.logsoftmax(input... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | LunarShen/SECRET | SoftEntropy | false | 2,598 | [
"MIT"
] | 0 | 0f652e63ce760ece8690cbad013f0d9bdb341e84 | https://github.com/LunarShen/SECRET/tree/0f652e63ce760ece8690cbad013f0d9bdb341e84 |
UPChannelRPN | import torch
import torch.nn.functional as F
import torch.nn as nn
def xcorr_fast(x, kernel):
"""group conv2d to calculate cross correlation, fast version
"""
batch = kernel.size()[0]
pk = kernel.view(-1, x.size()[1], kernel.size()[2], kernel.size()[3])
px = x.view(1, -1, x.size()[2], x.size()[3])... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional as F
import torch.nn as nn
assert_size_stride = torch... | IRASatUC/pysot | UPChannelRPN | false | 2,599 | [
"Apache-2.0"
] | 0 | 2bbc5c0938b56899e5caead84983e3311f1d1911 | https://github.com/IRASatUC/pysot/tree/2bbc5c0938b56899e5caead84983e3311f1d1911 |
MyLinear | import torch
from torch import nn
from torch.nn import functional as F
class MyLinear(nn.Module):
def __init__(self, in_units, units):
super().__init__()
self.weight = nn.Parameter(torch.randn(in_units, units))
self.bias = nn.Parameter(torch.randn(units))
def forward(self, X):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | JunoCheon/D2L | MyLinear | false | 2,600 | [
"MIT"
] | 0 | 9464709862e55151aec28fc637c5942738bdd72b | https://github.com/JunoCheon/D2L/tree/9464709862e55151aec28fc637c5942738bdd72b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.