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 |
|---|---|---|---|---|---|---|---|---|---|---|
down_right_shifted_conv2d | import torch
import torch.nn as nn
from torch.nn.utils import weight_norm as wn
def right_shift(x, pad=None):
xs = [int(y) for y in x.size()]
x = x[:, :, :, :xs[3] - 1]
pad = nn.ZeroPad2d((1, 0, 0, 0)) if pad is None else pad
return pad(x)
class down_right_shifted_conv2d(nn.Module):
def __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
import torch.nn as ... | andiac/pixel-cnn-pp | down_right_shifted_conv2d | false | 6,205 | [
"MIT"
] | 1 | 3ba856320e40208cbb6e9cac3e66a739f148903e | https://github.com/andiac/pixel-cnn-pp/tree/3ba856320e40208cbb6e9cac3e66a739f148903e |
StddevLayer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | dubtor/EditGAN-Robert | StddevLayer | false | 15,231 | [
"BSD-2-Clause"
] | 110 | 8e6d80e7647c3536827f11cf0a9abf51c42794b2 | https://github.com/dubtor/EditGAN-Robert/tree/8e6d80e7647c3536827f11cf0a9abf51c42794b2 |
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... | NVIDIA-AI-IOT-private/torch2trt | TorchAdd | false | 10,551 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
FocalTverskyLoss | import torch
import torch.nn as nn
class TverskyLoss(nn.Module):
"""Tversky Loss.
.. seealso::
Salehi, Seyed Sadegh Mohseni, Deniz Erdogmus, and Ali Gholipour. "Tversky loss function for image segmentation
using 3D fully convolutional deep networks." International Workshop on Machine Learning... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | ivadomed-profile-analysis-project/ivadomed | FocalTverskyLoss | false | 15,659 | [
"MIT"
] | 87 | 3b53e2cb2b210511943da439401e2471fd387876 | https://github.com/ivadomed-profile-analysis-project/ivadomed/tree/3b53e2cb2b210511943da439401e2471fd387876 |
PixelwiseNorm | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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
from torch import nn
import torch.nn.parallel
import torch.utils.data
assert_si... | RuslanKhalitov/gan_dogs | PixelwiseNorm | false | 2,780 | [
"MIT"
] | 0 | f11829d6d8d02e3c834061d7326b270ef2503108 | https://github.com/RuslanKhalitov/gan_dogs/tree/f11829d6d8d02e3c834061d7326b270ef2503108 |
MatchRNNAttention | import torch
import torch.utils.data
import torch.nn.functional as F
def masked_softmax(x, m=None, dim=-1):
"""
Softmax with mask
:param x:
:param m:
:param dim:
:return:
"""
if m is not None:
m = m.float()
x = x * m
e_x = torch.exp(x - torch.max(x, dim=dim, keepdim... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | jamaalhay/Final_Proj | MatchRNNAttention | false | 15,673 | [
"MIT"
] | 104 | 3f524a90fee5a3cb21466ab76f630d060792045d | https://github.com/jamaalhay/Final_Proj/tree/3f524a90fee5a3cb21466ab76f630d060792045d |
NodeClassifier | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | BigkoalaZhu/SCORES | NodeClassifier | false | 7,787 | [
"MIT"
] | 16 | 8332733c375ee85c02bd34c2adce6a3213aad3c4 | https://github.com/BigkoalaZhu/SCORES/tree/8332733c375ee85c02bd34c2adce6a3213aad3c4 |
SymLinear | import math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
import torch.nn.init as init
class SymLinear(nn.Module):
"""Linear with symmetric weight matrices"""
def __init__(self, in_features, out_features, bias=True):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.utils.data
import torch.nn as nn
from torch.nn.paramete... | Waasem/graph2nn | SymLinear | false | 14,563 | [
"MIT"
] | 133 | b112eb6c6805a1813e433442b0b1f5cabb4ad1a2 | https://github.com/Waasem/graph2nn/tree/b112eb6c6805a1813e433442b0b1f5cabb4ad1a2 |
IndepAnisotropicGaussianUVLoss | import math
import torch
import torch.utils.data
import torch.nn.functional as F
from torch import nn
class IndepAnisotropicGaussianUVLoss(nn.Module):
"""
Loss for the case of independent residuals with anisotropic covariances:
$Sigma_i = sigma_i^2 I + r_i r_i^T$
The loss (negative log likelihood) is ... | 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 math... | AbirKhan96/facebook-detectron2 | IndepAnisotropicGaussianUVLoss | false | 16,867 | [
"Apache-2.0"
] | 5 | 6a3bf813353d74bbeb8674e3566e7bbb33eb5c87 | https://github.com/AbirKhan96/facebook-detectron2/tree/6a3bf813353d74bbeb8674e3566e7bbb33eb5c87 |
LinearAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | MarvinLvn/platalea | LinearAttention | false | 820 | [
"Apache-2.0"
] | 0 | 31def0813c90a3259f86f7d86cb576cd66dca3fe | https://github.com/MarvinLvn/platalea/tree/31def0813c90a3259f86f7d86cb576cd66dca3fe |
MultiAttributeLoss | import torch
import torch.nn.functional as F
class MultiAttributeLoss(torch.nn.Module):
def __init__(self):
super(MultiAttributeLoss, self).__init__()
def forward(self, input, target):
product = 1
count = len(input)
for i in range(count):
attribute_loss = F.cross_... | 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
assert_size_stride = t... | Spandan-Madan/generalization_biased_category_pose | MultiAttributeLoss | false | 11,888 | [
"MIT"
] | 0 | c7c289c9a75544782d5240af2286cfdd03c4b35e | https://github.com/Spandan-Madan/generalization_biased_category_pose/tree/c7c289c9a75544782d5240af2286cfdd03c4b35e |
M2 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Conv2D(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, same_padding
=False, stride=1, relu=True, bn=False):
super(Conv2D, self).__init__()
padding = int((kernel_size - 1) / 2) if same_padding 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
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Juggernaut93/SSH-pytorch | M2 | false | 13,941 | [
"MIT"
] | 63 | 8ea205fb1a3adfc32b5a4e35f68ed4d385ddbc31 | https://github.com/Juggernaut93/SSH-pytorch/tree/8ea205fb1a3adfc32b5a4e35f68ed4d385ddbc31 |
Message_Passing_Unit_v2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
from ... | champon1020/scene_graph_benchmark | Message_Passing_Unit_v2 | false | 9,977 | [
"MIT"
] | 0 | 970a7499f8fa2854810bd650f6c991bcad5748db | https://github.com/champon1020/scene_graph_benchmark/tree/970a7499f8fa2854810bd650f6c991bcad5748db |
Conv2d | from torch.autograd import Function
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def _setup_kernel(k):
k = np.asarray(k, dtype=np.float32)
if k.ndim == 1:
k = np.outer(k, k)
k /= np.sum(k)
assert k.ndim == 2
assert k.shape[0] == k.shape[1]
retur... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.autograd import Function
import numpy as np
import torch.nn as nn
imp... | samsartor/score_sde | Conv2d | false | 7,612 | [
"Apache-2.0"
] | 1 | d25c8d092a68d643c796d771c55f80075aa041d1 | https://github.com/samsartor/score_sde/tree/d25c8d092a68d643c796d771c55f80075aa041d1 |
SqueezeAndExcitationModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | debasish-mihup/EfficientConformer | SqueezeAndExcitationModule | false | 10,361 | [
"Apache-2.0"
] | 0 | bddd927cebcde044a999aaa7766fa6d44dc20576 | https://github.com/debasish-mihup/EfficientConformer/tree/bddd927cebcde044a999aaa7766fa6d44dc20576 |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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 typing import *
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | abbiyanaila/torchwisdom | DiceLoss | false | 6,047 | [
"MIT"
] | 1 | 56dc95ebca3f6861c7009cb4fa0c034e260236b1 | https://github.com/abbiyanaila/torchwisdom/tree/56dc95ebca3f6861c7009cb4fa0c034e260236b1 |
CausalConv1d | import torch
from torch import nn
class CausalConv1d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=2, dilation=2):
super(CausalConv1d, self).__init__()
self.padding = dilation
self.causal_conv = nn.Conv1d(in_channels, out_channels, kernel_size,
padding=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | yuwl798180/FewRel | CausalConv1d | false | 4,646 | [
"MIT"
] | 0 | 8126e440b5d5d178e221cfb4a97a69cabd771fa4 | https://github.com/yuwl798180/FewRel/tree/8126e440b5d5d178e221cfb4a97a69cabd771fa4 |
GraphConv | import torch
import torch.nn as nn
import torch.utils.data
from torch.nn import init
import torch.nn.functional as F
class MLP(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim, act=nn.ReLU(),
normalize_input=True):
super(MLP, self).__init__()
self.linear_1 = nn.Linear(inpu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | JiaxuanYou/graph-pooling | GraphConv | false | 17,476 | [
"MIT"
] | 5 | e6237f03a72ac55d8a10192ca36fa596973461f5 | https://github.com/JiaxuanYou/graph-pooling/tree/e6237f03a72ac55d8a10192ca36fa596973461f5 |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | bstee615/ReVeal | Attention | false | 14,982 | [
"MIT"
] | 63 | fc22d0d54a3a23d4e0bc45a249b7eea22749685e | https://github.com/bstee615/ReVeal/tree/fc22d0d54a3a23d4e0bc45a249b7eea22749685e |
HighwayLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Ayansam1152/translate | HighwayLayer | false | 13,396 | [
"BSD-3-Clause"
] | 748 | 33d397fc25fb1072abd2975c77c602a2d031c6c4 | https://github.com/Ayansam1152/translate/tree/33d397fc25fb1072abd2975c77c602a2d031c6c4 |
ResNetBlock | from torch.nn import Module
import torch
import torch.onnx
from torch.nn import Conv2d
from torch.nn import InstanceNorm2d
from torch.nn.init import kaiming_normal_
from torch.nn.init import xavier_normal_
from torch import relu
def create_init_function(method: 'str'='none'):
def init(module: 'Module'):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | XiaoSanGit/talking-head-anime-landing | ResNetBlock | false | 6,004 | [
"MIT"
] | 1 | 36dbf1b8aef7357cda2a3524cb0c533f32670394 | https://github.com/XiaoSanGit/talking-head-anime-landing/tree/36dbf1b8aef7357cda2a3524cb0c533f32670394 |
GINPreTransition | import torch
import typing
import torch.nn as nn
class MLP(nn.Module):
def __init__(self, input_dim, hidden_sizes: 'typing.Iterable[int]',
out_dim, activation_function=nn.Sigmoid(), activation_out=None):
super(MLP, self).__init__()
i_h_sizes = [input_dim] + hidden_sizes
self.mlp =... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 typing
impor... | FaezehAmou2020/torch_gnn | GINPreTransition | false | 9,049 | [
"BSD-3-Clause"
] | 0 | 996a7f94259e718c625c6b4594729f025c4e4f14 | https://github.com/FaezehAmou2020/torch_gnn/tree/996a7f94259e718c625c6b4594729f025c4e4f14 |
TransformerDecoderLayer | from torch.nn import Module
import torch
from torch.nn import functional as F
from torch.nn import MultiheadAttention
from torch.nn import Dropout
from torch.nn import Linear
from torch.nn import LayerNorm
def _get_activation_fn(activation):
if activation == 'relu':
return F.relu
elif activation == 'g... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | M4rt1nM4yr/recipient_line_detection_DAS22 | TransformerDecoderLayer | false | 823 | [
"MIT"
] | 0 | be5ed87940ff2c2740cf86130743538a2ba6ac4b | https://github.com/M4rt1nM4yr/recipient_line_detection_DAS22/tree/be5ed87940ff2c2740cf86130743538a2ba6ac4b |
XCA | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | sithu31296/image_classification | XCA | false | 16,474 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 |
RNNModel | import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def initialize(dims, connection_prob=1.0, shape=0.1, scale=1.0):
w = np.random.gamma(shape, scale, size=dims)
w *= np.random.rand(*dims) < connection_prob
return np.float32(w)
class VanillaRNNCell(nn.Module... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | YuXie96/time | RNNModel | false | 1,279 | [
"MIT"
] | 0 | 8539d55d2449c712f54331b06720ab7faf3593df | https://github.com/YuXie96/time/tree/8539d55d2449c712f54331b06720ab7faf3593df |
CondInjection | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.cpp_extension
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = ... | crobbins327/semanticGAN_WSI | CondInjection | false | 1,752 | [
"BSD-2-Clause",
"MIT"
] | 0 | 4046ddc822f463e03952402247f79d540bf7be95 | https://github.com/crobbins327/semanticGAN_WSI/tree/4046ddc822f463e03952402247f79d540bf7be95 |
TensorClampOptionMin | import torch
class TensorClampOptionMin(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... | PogChamper/torch2trt | TensorClampOptionMin | false | 14,218 | [
"MIT"
] | 3,363 | 43b12627ec0de4d212efb6d02b07570205085ccc | https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc |
Gradient | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | YDDDDG/3D2Unet | Gradient | false | 6,008 | [
"MIT"
] | 1 | daca056958fb2ae319dc18a350e04b3cefe0d99f | https://github.com/YDDDDG/3D2Unet/tree/daca056958fb2ae319dc18a350e04b3cefe0d99f |
ToTensor | from torch.nn import Module
import torch
class ToTensor(Module):
def __init__(self):
super(ToTensor, self).__init__()
def forward(self, x):
x = x / 255
return 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.nn import Module
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._em... | AlexMontgomerie/finn | ToTensor | false | 13,238 | [
"BSD-3-Clause"
] | 283 | ec5f67b333ad4db4acf6191c3b5ab5e9067347aa | https://github.com/AlexMontgomerie/finn/tree/ec5f67b333ad4db4acf6191c3b5ab5e9067347aa |
PDF | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | wangxuuu/Demo | PDF | false | 13,096 | [
"MIT"
] | 0 | f1d85a55525a4199d63ee7dfe0ae2f21d3066c7c | https://github.com/wangxuuu/Demo/tree/f1d85a55525a4199d63ee7dfe0ae2f21d3066c7c |
LogitsSelfAttention | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
class LogitsSelfAttention(nn.Module):
def __init__(self, config):
super().__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
import torch.nn as nn
import torch.cuda
import torch.distributed
assert_size_str... | KaijuML/dtt-multi-branch | LogitsSelfAttention | false | 18,360 | [
"Apache-2.0"
] | 8 | a49850a95034e58d387b9d48c647cfc2b83c45b5 | https://github.com/KaijuML/dtt-multi-branch/tree/a49850a95034e58d387b9d48c647cfc2b83c45b5 |
ConvEncoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | crysoberil/ObjectReconstruction_ONetBased | ConvEncoder | false | 12,242 | [
"MIT"
] | 0 | 7c15ea8a64ee3647c86b57b16f0c85bd51ccdd47 | https://github.com/crysoberil/ObjectReconstruction_ONetBased/tree/7c15ea8a64ee3647c86b57b16f0c85bd51ccdd47 |
QuantMeasure | import torch
from torch import nn
from torch.autograd.function import InplaceFunction
def quantize(x, num_bits=8, min_value=None, max_value=None, num_chunks=None,
stochastic=False, inplace=False, quantize=False, layer_num=-1, multi=
False, index=[], is_act=False):
return UniformQuantize().apply(x, num_bit... | 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... | hoseung2/DNAS-Compression | QuantMeasure | false | 6,815 | [
"MIT"
] | 1 | 645407fc572045f33278c935091a07e0ccfce87f | https://github.com/hoseung2/DNAS-Compression/tree/645407fc572045f33278c935091a07e0ccfce87f |
Critic | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
import torch.distributions
class Critic(nn.Module):
def __init__(self, num_inputs, num_outputs):
super(Critic, self).__init__()
self.linear = nn.Linear(num_inputs, num_outputs)
def forward(self, x):
x... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | cjlovering/EGG | Critic | false | 10,055 | [
"MIT"
] | 0 | cce146e035decbc410e981f8bc7ada32979f3b6d | https://github.com/cjlovering/EGG/tree/cce146e035decbc410e981f8bc7ada32979f3b6d |
L1DepthLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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... | AnReu/structural-probes | L1DepthLoss | false | 1,880 | [
"Apache-2.0"
] | 0 | fdc99dc124fa6df3dbdd5ba48a90f08bb6bf37b7 | https://github.com/AnReu/structural-probes/tree/fdc99dc124fa6df3dbdd5ba48a90f08bb6bf37b7 |
convTranspose23DUnit | import torch
import numpy as np
import torch.nn as nn
import torch.nn.init as init
import torch.nn.init
class convTranspose23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, output_padding=0, groups=1, bias=True, dilation=1, nd=2):
super(convTransp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
import torch.nn.init as init
import tor... | navid0308/medSynthesisV1 | convTranspose23DUnit | false | 10,685 | [
"MIT"
] | 0 | 6731a67d0eb9bb3e0c1646f01feb24229aa4fe30 | https://github.com/navid0308/medSynthesisV1/tree/6731a67d0eb9bb3e0c1646f01feb24229aa4fe30 |
SamePadConvTranspose3d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | pointoflight/VideoGPT | SamePadConvTranspose3d | false | 7,486 | [
"MIT"
] | 1 | 85f19d8cb0d251238f295f0294e69b9299c13e21 | https://github.com/pointoflight/VideoGPT/tree/85f19d8cb0d251238f295f0294e69b9299c13e21 |
upsampleLayer | import torch
import torch.nn as nn
class upsampleLayer(nn.Module):
"""
A upsample layer of UNet. ReLU is the activation func. The skip connection
can be cutted if not given. Because RGB-UV is not a completion task but a
image transition task.
"""
def __init__(self, infeature, outfeature, ker... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | GentleDell/DEBOR | upsampleLayer | false | 17,297 | [
"BSD-3-Clause"
] | 4 | cd566f173599fe7419e7baf312f63830c28d5de2 | https://github.com/GentleDell/DEBOR/tree/cd566f173599fe7419e7baf312f63830c28d5de2 |
SoftGeneratorAttention | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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 |
ShiftedSoftplus | import torch
import torch.nn.functional as F
import torch.utils.data
class ShiftedSoftplus(torch.nn.Module):
def __init__(self):
super(ShiftedSoftplus, self).__init__()
self.shift = torch.log(torch.tensor(2.0)).item()
def forward(self, x):
return F.softplus(x) - self.shift
def get_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torch.utils.data
assert_size_stride = torch._C._dynamo.... | THinnerichs/pytorch_geometric | ShiftedSoftplus | false | 11,910 | [
"MIT"
] | 0 | 90c2126895b21313a23657f4e845acc782d11bf5 | https://github.com/THinnerichs/pytorch_geometric/tree/90c2126895b21313a23657f4e845acc782d11bf5 |
PA | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | grofit/traiNNer | PA | false | 15,468 | [
"Apache-2.0"
] | 78 | 12d006fd44ed304e4178839c53b1f3d95ca25dcb | https://github.com/grofit/traiNNer/tree/12d006fd44ed304e4178839c53b1f3d95ca25dcb |
HistogramLayerUNET | import torch
import numpy as np
import torch.nn as nn
class HistogramLayerUNET(nn.Module):
def __init__(self, in_channels, kernel_size, dim=2, num_bins=4, stride=
None, padding=0, normalize_count=True, normalize_bins=True,
count_include_pad=False, ceil_mode=False, skip_connection=False):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | GatorSense/Histological_Segmentation | HistogramLayerUNET | false | 487 | [
"MIT"
] | 0 | 12849fff3d9d58c1fe419b18dba49294db375488 | https://github.com/GatorSense/Histological_Segmentation/tree/12849fff3d9d58c1fe419b18dba49294db375488 |
Rot180 | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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... | NickleDave/kornia | Rot180 | false | 2,674 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd |
HingeLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributions
import torch.utils.data
class HingeLoss(nn.Module):
def __init__(self, margin=1.0):
super().__init__()
self.margin = margin
def forward(self, output):
return F.relu(self.margin - output)
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
import torch.nn as nn
import torch.distributions
import torch.utils.data
assert_size_stri... | AlexMeinke/Provable-OOD-Detection | HingeLoss | false | 7,704 | [
"MIT"
] | 21 | 9a132aec994ff718c96b81885736ab866df60d87 | https://github.com/AlexMeinke/Provable-OOD-Detection/tree/9a132aec994ff718c96b81885736ab866df60d87 |
QNetwork | import torch
import torch.nn.functional as F
import torch.nn as nn
class QNetwork(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc1_units=37,
fc2_units=64):
"""Initialize parameters and build model.
Params
======
state_si... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | deeplearningrobotics/p1nav | QNetwork | false | 9,978 | [
"Apache-2.0"
] | 0 | 433ff8d8b5fec6c8bb3c346e5b8dfff2865f4a55 | https://github.com/deeplearningrobotics/p1nav/tree/433ff8d8b5fec6c8bb3c346e5b8dfff2865f4a55 |
UpsampleConvLayer | import torch
import torch.nn as nn
class UpsampleConvLayer(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride,
scale_factor):
super(UpsampleConvLayer, self).__init__()
self._scale_factor = scale_factor
self._reflection_pad = nn.ReflectionPad2d(kernel_siz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | ThomasRanvier/cnn_style_transfer | UpsampleConvLayer | false | 1,139 | [
"MIT"
] | 0 | 90b6c76c20263c22f4e45184d572284726ecbd7b | https://github.com/ThomasRanvier/cnn_style_transfer/tree/90b6c76c20263c22f4e45184d572284726ecbd7b |
RegWeightedL1Loss | import torch
from torch import nn
import torch.onnx
from torch.nn.parallel.scatter_gather import gather
import torch.nn.functional as F
import torch.utils.data
def _gather_feat(feat, ind, mask=None, trt=False):
dim = feat.size(2)
ind = ind.unsqueeze(2).expand(ind.size(0), ind.size(1), dim)
if trt:
... | 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
i... | kuanhungchen/CenterNet-HarDNet | RegWeightedL1Loss | false | 15,868 | [
"MIT"
] | 164 | 050d55a532706d989105982c5bc10f1c89edc8d2 | https://github.com/kuanhungchen/CenterNet-HarDNet/tree/050d55a532706d989105982c5bc10f1c89edc8d2 |
NN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | Meydand2001/Machine-Learning-project | NN | false | 11,705 | [
"MIT"
] | 0 | dc73bc3820024939ba66a1a3e2ae130d6bf35f9a | https://github.com/Meydand2001/Machine-Learning-project/tree/dc73bc3820024939ba66a1a3e2ae130d6bf35f9a |
ConvReLUNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | AstraliteHeart/cookietts | ConvReLUNorm | false | 7,743 | [
"BSD-3-Clause"
] | 25 | c871f5f7b5790656d5b57bcd9e63946a2da52f0f | https://github.com/AstraliteHeart/cookietts/tree/c871f5f7b5790656d5b57bcd9e63946a2da52f0f |
MultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | MadanMl/PyTorch-Transformer-for-RUL-Prediction | MultiHeadAttention | false | 8,514 | [
"Apache-2.0"
] | 25 | 5bf0a4739abdecbbc88118ea413393997bdc1e24 | https://github.com/MadanMl/PyTorch-Transformer-for-RUL-Prediction/tree/5bf0a4739abdecbbc88118ea413393997bdc1e24 |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ahmed563/Group14_Project_DLSpring2021 | Attention | false | 3,050 | [
"MIT"
] | 0 | d2b03555cadb483ae472b613f107173f89c07d9b | https://github.com/ahmed563/Group14_Project_DLSpring2021/tree/d2b03555cadb483ae472b613f107173f89c07d9b |
CMVN | import torch
import torch.onnx
class CMVN(torch.nn.Module):
eps = 1e-05
@torch.no_grad()
def forward(self, feat):
mean = feat.mean(dim=2, keepdim=True)
std = feat.std(dim=2, keepdim=True)
feat = (feat - mean) / (std + CMVN.eps)
return feat
def get_inputs():
return [t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.onnx
assert_size_stride = torch._C._dynamo.guards.assert_size_stri... | entn-at/Online-Speech-Recognition | CMVN | false | 15,300 | [
"Apache-2.0"
] | 201 | 75680cef38c57d0ac60f5e23c90d24bb3046e4e7 | https://github.com/entn-at/Online-Speech-Recognition/tree/75680cef38c57d0ac60f5e23c90d24bb3046e4e7 |
CrossEntropy | import torch
from torch.nn.functional import cross_entropy
import torch.nn as nn
import torch.optim
class CrossEntropy(nn.Module):
def __init__(self, reduce):
super().__init__()
self.reduce = reduce
def forward(self, y, target, mask=None, *args, **kwargs):
return cross_entropy(y, tar... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | gsaiabhishek/AUTOMATA | CrossEntropy | false | 12,469 | [
"MIT"
] | 0 | e944992a7bf3a50bc8951a303294b3a798822176 | https://github.com/gsaiabhishek/AUTOMATA/tree/e944992a7bf3a50bc8951a303294b3a798822176 |
Decoder | import torch
import torch.nn as nn
class INConv(nn.Module):
def __init__(self, in_planes, out_planes, kernel_size, stride=1,
padding=0, dilation=1, groups=1, relu=True, ins_n=True, bias=False):
super(INConv, self).__init__()
self.out_channels = out_planes
self.conv = nn.Conv2d(in_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | samsgood0310/Unsupervised-Defect-Segmentation | Decoder | false | 7,615 | [
"Apache-2.0"
] | 1 | 66af32506cd6e60c356890616e28d679622fd8e6 | https://github.com/samsgood0310/Unsupervised-Defect-Segmentation/tree/66af32506cd6e60c356890616e28d679622fd8e6 |
RelationCrossing | import torch
import torch.nn as nn
import torch.nn.functional as F
class RelationCrossing(nn.Module):
def __init__(self, in_feats: 'int', out_feats: 'int', num_heads: 'int',
dropout: 'float'=0.0, negative_slope: 'float'=0.2):
"""
Description
----------
Relation crossing l... | 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
... | BUPT-GAMMA/OpenHGNN | RelationCrossing | false | 13,367 | [
"Apache-2.0"
] | 235 | 5f218dad4ed1415aa6d842bc20785c61e74e5405 | https://github.com/BUPT-GAMMA/OpenHGNN/tree/5f218dad4ed1415aa6d842bc20785c61e74e5405 |
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency | import torch
import torch.nn
import torch.onnx
class NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency(torch
.nn.Module):
def __init__(self, input_size, hidden_size, num_classes):
super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
, 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 import triton_helpers
from torch._inductor.runtime.... | RyanUnderhill/onnxruntime | NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency | false | 11,823 | [
"MIT"
] | 0 | 6df4e293ffbb47d739d2dedfbb87fa6234b8c37c | https://github.com/RyanUnderhill/onnxruntime/tree/6df4e293ffbb47d739d2dedfbb87fa6234b8c37c |
FCDiscriminator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | EvanfanBao/Adversarial_DA_Exp | FCDiscriminator | false | 5,154 | [
"MIT"
] | 1 | 09979742d83fe6fd5de9b9f3aa6aa5fe9a44ea54 | https://github.com/EvanfanBao/Adversarial_DA_Exp/tree/09979742d83fe6fd5de9b9f3aa6aa5fe9a44ea54 |
SimpleStackModel | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleStackModel(torch.nn.Module):
def __init__(self, dim):
super(SimpleStackModel, self).__init__()
self.dim = dim
def forward(self, a, b):
c = b + b
return torch.stack((a, c), dim=self.dim)
def get_inpu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | briancoutinho/glow | SimpleStackModel | false | 12,590 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
Highway | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | CookiePPP/mellotron | Highway | false | 9,054 | [
"BSD-3-Clause"
] | 0 | 488425981c19cd0eddddea13d1348da4bfef8d26 | https://github.com/CookiePPP/mellotron/tree/488425981c19cd0eddddea13d1348da4bfef8d26 |
EDMLoss | import torch
import torch.nn as nn
from torch.autograd import Variable
class EDMLoss(nn.Module):
def __init__(self):
super(EDMLoss, self).__init__()
def forward(self, p_target: 'Variable', p_estimate: 'Variable'):
assert p_target.shape == p_estimate.shape
cdf_target = torch.cumsum(p_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | DazhiZhong/NIMA | EDMLoss | false | 8,999 | [
"MIT"
] | 0 | 82655ac762414ef2a980feba8b6978c605c66a4d | https://github.com/DazhiZhong/NIMA/tree/82655ac762414ef2a980feba8b6978c605c66a4d |
OuterProductLayer | import torch
import torch.nn as nn
class OuterProductLayer(nn.Module):
"""OuterProduct Layer used in PNN. This implementation is
adapted from code that the author of the paper published on https://github.com/Atomu2014/product-nets.
"""
def __init__(self, num_feature_field, embedding_size, device):
... | 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... | MIracleyin/RecBole-notebook | OuterProductLayer | false | 9,582 | [
"MIT"
] | 0 | ef32b3e57a297ff4889dec1f63c7984f8f901a23 | https://github.com/MIracleyin/RecBole-notebook/tree/ef32b3e57a297ff4889dec1f63c7984f8f901a23 |
SpatialAttention | import torch
from torch import nn
from torchvision import models as models
import torch.onnx
import torch.nn
class SpatialAttention(nn.Module):
def __init__(self, in_channels):
super().__init__()
self.activation = nn.Sigmoid()
self.maxpool = nn.MaxPool2d((1, in_channels))
self.avg... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from tor... | dqawami/openvino_training_extensions | SpatialAttention | false | 15,218 | [
"Apache-2.0"
] | 256 | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | https://github.com/dqawami/openvino_training_extensions/tree/dddda1dfd651eaae2d59cecda84275b1b03bd0ad |
TemporalDecay | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
class TemporalDecay(nn.Module):
def __init__(self, input_size, rnn_hid_size):
super(TemporalDecay, self).__init__()
self.rnn_hid_size = rnn_hid_size
self.build(input_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
from torch._inductor.runtime.... | LyapunovStability/BRITS | TemporalDecay | false | 11,666 | [
"MIT"
] | 0 | 92a889dd5946aae215d61b1854d9767c6f7fcf2c | https://github.com/LyapunovStability/BRITS/tree/92a889dd5946aae215d61b1854d9767c6f7fcf2c |
MyConv1dPadSame | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
from itertools import product as p... | WFDetector/WFDetection | MyConv1dPadSame | false | 2,949 | [
"Apache-2.0"
] | 0 | b16d35b3a3a5de62de9e0bac83eccd21b6358b53 | https://github.com/WFDetector/WFDetection/tree/b16d35b3a3a5de62de9e0bac83eccd21b6358b53 |
PolicyNetworkGridworld | import torch
import torch.nn as nn
import torch.nn.functional as F
class PolicyNetworkGridworld(nn.Module):
"""
Deep neural network which represents policy network.
"""
def __init__(self, input_size, num_actions):
super(PolicyNetworkGridworld, self).__init__()
self.linear1 = nn.Linear... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | jlebensold/flrl-ddpg | PolicyNetworkGridworld | false | 6,961 | [
"MIT"
] | 1 | d91e9f4aedf48d0614e33bd22c7f684ecda089b1 | https://github.com/jlebensold/flrl-ddpg/tree/d91e9f4aedf48d0614e33bd22c7f684ecda089b1 |
OutlookAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Inch-Z/volo | OutlookAttention | false | 11,515 | [
"Apache-2.0"
] | 0 | 8bbb40838f5cc889ccae26b97438ea73cb1b4e07 | https://github.com/Inch-Z/volo/tree/8bbb40838f5cc889ccae26b97438ea73cb1b4e07 |
Vflip | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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... | NickleDave/kornia | Vflip | false | 2,691 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd |
Biaffine | import torch
import torch.nn as nn
import torch.utils.checkpoint
class Biaffine(nn.Module):
def __init__(self, n_in, n_out=1, bias_x=True, bias_y=True):
super(Biaffine, self).__init__()
self.n_in = n_in
self.n_out = n_out
self.bias_x = bias_x
self.bias_y = bias_y
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.utils.checkpoint
assert_size_stride = torch._... | benjamin-mlr/lightning-language-modeling | Biaffine | false | 3,206 | [
"Apache-2.0"
] | 0 | 62b497cc2a01bdae0451ebe0f314f7fcb0f7eef3 | https://github.com/benjamin-mlr/lightning-language-modeling/tree/62b497cc2a01bdae0451ebe0f314f7fcb0f7eef3 |
SimpleASinModule | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | briancoutinho/glow | SimpleASinModule | false | 12,560 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
SpectralEigenConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | EdisonLeeeee/GraphGallery | SpectralEigenConv | false | 13,650 | [
"MIT"
] | 300 | 4eec9c5136bda14809bd22584b26cc346cdb633b | https://github.com/EdisonLeeeee/GraphGallery/tree/4eec9c5136bda14809bd22584b26cc346cdb633b |
VectorQuantizer | import torch
from torch import Tensor
from torch import nn
from torch.nn import functional as F
class VectorQuantizer(nn.Module):
"""
Reference:
[1] https://github.com/deepmind/sonnet/blob/v2/sonnet/src/nets/vqvae.py
"""
def __init__(self, num_embeddings: 'int', embedding_dim: 'int', beta:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | mateoIdemia/PyTorch-VAE | VectorQuantizer | false | 12,766 | [
"Apache-2.0"
] | 0 | b485924182e62843aae1955fcaf0886ac8492295 | https://github.com/mateoIdemia/PyTorch-VAE/tree/b485924182e62843aae1955fcaf0886ac8492295 |
ChannelNorm2D | import torch
import torch.nn as nn
class ChannelNorm2D(nn.Module):
"""
Similar to default Torch instanceNorm2D but calculates
moments over channel dimension instead of spatial dims.
Expects input_dim in format (B,C,H,W)
"""
def __init__(self, input_channels, momentum=0.1, eps=0.001, affine=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.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | sedrickkeh/high-fidelity-dual-image | ChannelNorm2D | false | 16,375 | [
"Apache-2.0"
] | 266 | 9cefd378467826b91596653df38666e469bb23e0 | https://github.com/sedrickkeh/high-fidelity-dual-image/tree/9cefd378467826b91596653df38666e469bb23e0 |
AvgConsensus | import torch
import torch.nn as nn
class AvgConsensus(nn.Module):
"""Average consensus module.
Args:
dim (int): Decide which dim consensus function to apply.
Default: 1.
"""
def __init__(self, dim=1):
super().__init__()
self.dim = dim
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... | scenarios/dev | AvgConsensus | false | 4,453 | [
"Apache-2.0"
] | 0 | 9f91ebc142cea1c31231d233571ad59460ab6fba | https://github.com/scenarios/dev/tree/9f91ebc142cea1c31231d233571ad59460ab6fba |
Sigmoid | import torch
import torch.nn as nn
class ActivationFunction(nn.Module):
def __init__(self):
super().__init__()
self.name = self.__class__.__name__
self.config = {'name': self.name}
class Sigmoid(ActivationFunction):
def forward(self, x):
return 1 / (1 + torch.exp(-x))
def... | 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... | jiwidi/lightning-tutorials | Sigmoid | false | 15,700 | [
"Apache-2.0"
] | 114 | 70ba437447f345d4d6ba089d5b30fd1da2cbc04b | https://github.com/jiwidi/lightning-tutorials/tree/70ba437447f345d4d6ba089d5b30fd1da2cbc04b |
EncoderLayer | import math
import torch
from torch import nn
from torch.nn import functional as F
def attention(q, k, v, d_k, mask=None, dropout=None):
scores = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(d_k)
if mask is not None:
mask = mask.unsqueeze(1)
scores = scores.masked_fill(mask == 0, -10000000... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | aim-uofa/DyCo3D | EncoderLayer | false | 14,774 | [
"BSD-2-Clause"
] | 100 | 17d22c2d839c0a1043fb72df301e3935af5ca0e9 | https://github.com/aim-uofa/DyCo3D/tree/17d22c2d839c0a1043fb72df301e3935af5ca0e9 |
CombinedTargetMSELoss | import torch
import torch.nn as nn
class CombinedTargetMSELoss(nn.Module):
"""MSE loss for combined target.
CombinedTarget: The combination of classification target
(response map) and regression target (offset map).
Paper ref: Huang et al. The Devil is in the Details: Delving into
... | 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... | WangXin93/mmpose | CombinedTargetMSELoss | false | 1,199 | [
"Apache-2.0"
] | 0 | 28b6e9ac2f6ed195ab27fb04da2213fc885a5994 | https://github.com/WangXin93/mmpose/tree/28b6e9ac2f6ed195ab27fb04da2213fc885a5994 |
FullSelfAttn | import torch
import torch.nn as nn
import torch.utils.data
class FullSelfAttn(nn.Module):
""" Self attention Layer"""
def __init__(self, in_dim):
super().__init__()
self.query_conv = nn.Conv2d(in_channels=in_dim, out_channels=in_dim //
2, kernel_size=1)
self.key_conv = nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ilyak93/SinGanF2 | FullSelfAttn | false | 12,534 | [
"MIT"
] | 0 | fa6b135ef4699626ce450afd02ed3b269e4ca16d | https://github.com/ilyak93/SinGanF2/tree/fa6b135ef4699626ce450afd02ed3b269e4ca16d |
NeuralNerwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | jf20541/NeuralNetworks | NeuralNerwork | false | 3,714 | [
"MIT"
] | 0 | ee36b734880f30d9e8691205dadcd074795bdff3 | https://github.com/jf20541/NeuralNetworks/tree/ee36b734880f30d9e8691205dadcd074795bdff3 |
MDN | from torch.nn import Module
import torch
from torch.nn.modules import Module
from torch.nn.modules import Linear
class MDN(Module):
def __init__(self, input_size, num_mixtures):
super(MDN, self).__init__()
self.input_size = input_size
self.num_mixtures = num_mixtures
self.paramete... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | AnesBenmerzoug/Handwriting-Model | MDN | false | 16,894 | [
"MIT"
] | 7 | 925a8d43174cccd58e01d41fdc513343df09d000 | https://github.com/AnesBenmerzoug/Handwriting-Model/tree/925a8d43174cccd58e01d41fdc513343df09d000 |
SimpleMaxModule | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | andreas-hommel/glow | SimpleMaxModule | false | 3,338 | [
"Apache-2.0"
] | 0 | 2bbbf8188a2a941e85677c83f2146bbd076a262e | https://github.com/andreas-hommel/glow/tree/2bbbf8188a2a941e85677c83f2146bbd076a262e |
PrimaryCaps | import torch
from torch import nn
def squash(x, dim=-1):
squared_norm = (x ** 2).sum(dim=dim, keepdim=True)
scale = squared_norm / (1 + squared_norm)
return scale * x / (squared_norm.sqrt() + 1e-08)
class PrimaryCaps(nn.Module):
"""Primary capsule layer."""
def __init__(self, num_conv_units, in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | Xiangs18/CapsNet | PrimaryCaps | false | 2,964 | [
"MIT"
] | 0 | 79cd0ed1e726750968cd8658370f78aa86a62170 | https://github.com/Xiangs18/CapsNet/tree/79cd0ed1e726750968cd8658370f78aa86a62170 |
ProjectionInputDepth | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | aliyun/dro-sfm | ProjectionInputDepth | false | 14,805 | [
"MIT"
] | 147 | 8707e2e0ef799d7d47418a018060f503ef449fe3 | https://github.com/aliyun/dro-sfm/tree/8707e2e0ef799d7d47418a018060f503ef449fe3 |
eSEModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
import t... | Tanveer81/BoxVOS | eSEModule | false | 17,983 | [
"BSD-2-Clause"
] | 4 | c30aa319f18f3fbee2a25e0ed25cb006a4598300 | https://github.com/Tanveer81/BoxVOS/tree/c30aa319f18f3fbee2a25e0ed25cb006a4598300 |
GeCEmbeddings | from _paritybench_helpers import _mock_config
import torch
import typing
from torch import nn
def create_sinusoidal_embeddings(n_pos, dim, out):
out.requires_grad = False
positions = torch.arange(0, n_pos)[:, None]
dimensions = torch.arange(0, dim)
position_enc = positions / torch.pow(10000, 2 * (dime... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | jgoodson/TraGeC | GeCEmbeddings | false | 6,947 | [
"BSD-3-Clause"
] | 1 | 3370e29ba0639745055cbee726a40181a4dd61df | https://github.com/jgoodson/TraGeC/tree/3370e29ba0639745055cbee726a40181a4dd61df |
ConvD | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.optim
def normalization(planes, norm='gn'):
if norm == 'bn':
m = nn.BatchNorm3d(planes)
elif norm == 'gn':
m = nn.GroupNorm(4, planes)
elif norm == 'in':
m = nn.InstanceNorm3d(p... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ieee820/BraTS2018-tumor-segmentation | ConvD | false | 15,602 | [
"MIT"
] | 157 | 22e1a22909a0c21503b5ef5fc6860a1e1131e851 | https://github.com/ieee820/BraTS2018-tumor-segmentation/tree/22e1a22909a0c21503b5ef5fc6860a1e1131e851 |
KDLoss_source_code | import torch
import torch.nn.functional as F
from torch import nn
class KDLoss_source_code(nn.Module):
def __init__(self, temp: 'float', reduction: 'str'):
super(KDLoss_source_code, self).__init__()
self.temp = temp
self.reduction = reduction
self.kl_loss = nn.KLDivLoss(reduction=... | 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 ... | PangJian123/ISM-ReID | KDLoss_source_code | false | 17,817 | [
"Apache-2.0"
] | 8 | 4c8e4b4ae591add83e1e6ba0b4b7d2750eeb9ee9 | https://github.com/PangJian123/ISM-ReID/tree/4c8e4b4ae591add83e1e6ba0b4b7d2750eeb9ee9 |
MeanAct | import torch
import torch.nn as nn
class MeanAct(nn.Module):
def __init__(self):
super(MeanAct, self).__init__()
def forward(self, x):
return torch.clamp(torch.exp(x), min=1e-05, max=1000000.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 import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | jdasam/scDCC | MeanAct | false | 10,232 | [
"Apache-2.0"
] | 0 | 8ebaed766db5ad56021983ebc13e9a60b6c7b453 | https://github.com/jdasam/scDCC/tree/8ebaed766db5ad56021983ebc13e9a60b6c7b453 |
LayerNormConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | 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
from torchvision.transforms import *
import torch.nn
import torch
import torch.... | COMHTVM/lensless | LayerNormConv2d | false | 17,339 | [
"MIT"
] | 6 | 0d67a310bab08551d7422fa792f3422a7ee7d9cb | https://github.com/COMHTVM/lensless/tree/0d67a310bab08551d7422fa792f3422a7ee7d9cb |
DocUnetLoss_DL_batch | import torch
import torch.nn as nn
import torch.nn.functional as F
class DocUnetLoss_DL_batch(nn.Module):
"""
只使用一个unet的loss 目前使用这个loss训练的比较好
"""
def __init__(self, r=0.0, reduction='mean'):
super(DocUnetLoss_DL_batch, self).__init__()
assert reduction in ['mean', 'sum'
],... | 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
... | hologerry/DewarpNet | DocUnetLoss_DL_batch | false | 3,625 | [
"MIT"
] | 0 | b0a11b9fbb98bd124e65d3165ce177d9ebf2e836 | https://github.com/hologerry/DewarpNet/tree/b0a11b9fbb98bd124e65d3165ce177d9ebf2e836 |
NAC | from torch.nn import Module
import math
import torch
from torch.nn.parameter import Parameter
import torch.nn.functional as F
class NAC(Module):
"""Neural Accumulator: :math:`y = Wx` where :math:`W = \\tanh(\\hat{W}) * \\sigma(\\hat{M})`
Args:
in_features: size of each input sample
out_featur... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn impor... | tanbur/pytorch-nalu | NAC | false | 10,845 | [
"MIT"
] | 0 | 91cb036230144b166137a8f3533850f2d4123d4f | https://github.com/tanbur/pytorch-nalu/tree/91cb036230144b166137a8f3533850f2d4123d4f |
CumulativeLinkLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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 numpy as np
fro... | Ramstein/Retinopathy2 | CumulativeLinkLoss | false | 972 | [
"MIT"
] | 0 | 669e74206c466e6351d4e3df6087c6aa39b5c6c2 | https://github.com/Ramstein/Retinopathy2/tree/669e74206c466e6351d4e3df6087c6aa39b5c6c2 |
Asinh | import torch
import torch.onnx
import torch.nn as nn
class Asinh(nn.Module):
def forward(self, x):
return torch.asinh(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.onnx
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | mil-tokyo/webdnn | Asinh | false | 16,070 | [
"MIT"
] | 1,967 | 38a60fd3e1a4e72bc01108189a3aa51e0752aecd | https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd |
FEM | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from math import sqrt as sqrt
from itertools import product as product
import torchvision.transforms.functional as F
from torch.nn import functional ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | RedHenLab/RedHenAnonymizer | FEM | false | 5,782 | [
"MIT"
] | 1 | 3560f1ac5cd5b9c6c7ed8bf322b807d57aedc06a | https://github.com/RedHenLab/RedHenAnonymizer/tree/3560f1ac5cd5b9c6c7ed8bf322b807d57aedc06a |
MyBatchNorm | import torch
import torch.nn as nn
class MyBatchNorm(nn.Module):
def __init__(self, size, epsilon=1e-05):
super(MyBatchNorm, self).__init__()
self.gamma = nn.Parameter(torch.ones(size))
self.beta = nn.Parameter(torch.zeros(size))
self.epsilon = epsilon
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.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | shohamda/deep-learning | MyBatchNorm | false | 4,319 | [
"MIT"
] | 0 | 160296c403cefd5351ffe5161e07789c22637284 | https://github.com/shohamda/deep-learning/tree/160296c403cefd5351ffe5161e07789c22637284 |
MultiheadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Ayansam1152/translate | MultiheadAttention | false | 13,398 | [
"BSD-3-Clause"
] | 748 | 33d397fc25fb1072abd2975c77c602a2d031c6c4 | https://github.com/Ayansam1152/translate/tree/33d397fc25fb1072abd2975c77c602a2d031c6c4 |
CategoricalAccuracy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | 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
assert_size_stride = t... | NestLakerJasonLIN/MusicTransformer-pytorch | CategoricalAccuracy | false | 5,656 | [
"MIT"
] | 1 | 5f183374833ff6b7e17f3a24e3594dedd93a5fe5 | https://github.com/NestLakerJasonLIN/MusicTransformer-pytorch/tree/5f183374833ff6b7e17f3a24e3594dedd93a5fe5 |
CenterIntersection | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | google-research/smore | CenterIntersection | false | 15,454 | [
"Apache-2.0"
] | 78 | e4ba95a7466ef7d018987bce7688b77bf2ea7e4f | https://github.com/google-research/smore/tree/e4ba95a7466ef7d018987bce7688b77bf2ea7e4f |
PixelNormLayer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | CV-IP/interfacegan | PixelNormLayer | false | 13,441 | [
"MIT"
] | 855 | 5a556b8e693f6e1888f769f653aaafaaccca5dc2 | https://github.com/CV-IP/interfacegan/tree/5a556b8e693f6e1888f769f653aaafaaccca5dc2 |
AvgPool2d | import torch
import torch.nn as nn
import torch.nn.functional as F
def keep_variance_fn(x):
return x + 0.001
class AvgPool2d(nn.Module):
def __init__(self, keep_variance_fn=None, kernel_size=2):
super(AvgPool2d, self).__init__()
self._keep_variance_fn = keep_variance_fn
self.kernel_... | 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... | THAKAORI/SalsaNext | AvgPool2d | false | 11,920 | [
"MIT"
] | 0 | 855cd7e9ebb83ee62538ba4753a011ada7bbfb6c | https://github.com/THAKAORI/SalsaNext/tree/855cd7e9ebb83ee62538ba4753a011ada7bbfb6c |
PositionwiseFeedForward | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | awesome-archive/attention-is-all-you-need-pytorch | PositionwiseFeedForward | false | 9,847 | [
"MIT"
] | 0 | d1fb26fafaf7170a7c3a45968cd555f3c6aeb3bc | https://github.com/awesome-archive/attention-is-all-you-need-pytorch/tree/d1fb26fafaf7170a7c3a45968cd555f3c6aeb3bc |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.