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 |
|---|---|---|---|---|---|---|---|---|---|---|
CrossEntropyBayesRisk | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class CrossEntropyBayesRisk(Module):
"""
<a id="CrossEntropyBayesRisk"></a>
## Bayes Risk with Cross Entropy Loss
Bayes risk is the overall maximum cost of making incorrect estimates.
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import torch.utils.data
import torch.nn.functional
import torch.autograd
assert_size_stride = torch._C._dynamo.g... | techthiyanes/annotated_deep_learning_paper_implementations | CrossEntropyBayesRisk | false | 16,547 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 |
one_conv | import torch
from torch import nn
class one_conv(nn.Module):
def __init__(self, G0, G):
super(one_conv, self).__init__()
self.conv = nn.Conv2d(G0, G, kernel_size=3, stride=1, padding=1,
bias=True)
self.relu = nn.LeakyReLU(0.1, inplace=True)
def forward(self, x):
o... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | Holmes-Alan/RefVAE | one_conv | false | 8,261 | [
"MIT"
] | 13 | 836b8f1168f1b0f923b609a48e202ace7806f79c | https://github.com/Holmes-Alan/RefVAE/tree/836b8f1168f1b0f923b609a48e202ace7806f79c |
CircularPad | import torch
from torch import nn
class CircularPad(nn.Module):
def __init__(self, pad):
super(CircularPad, self).__init__()
self.pad = pad
self.zeropad = torch.nn.modules.padding.ConstantPad2d((pad, pad, 0,
0), 0)
def forward(self, x):
x = torch.cat([x[..., -self... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | daniilidis-group/emvn | CircularPad | false | 15,117 | [
"MIT"
] | 46 | 1888e2a47b02e911e08afa40ba7341662cf3d6ea | https://github.com/daniilidis-group/emvn/tree/1888e2a47b02e911e08afa40ba7341662cf3d6ea |
MyKernelTorch | # 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_... | maxpark/alibi-detect | MyKernelTorch | false | 7,176 | [
"Apache-2.0"
] | 1 | 84384297a85764c18537aa1c8699c4ad040cf7cd | https://github.com/maxpark/alibi-detect/tree/84384297a85764c18537aa1c8699c4ad040cf7cd |
SelfGating | # 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... | inbalcroitoru/Information-retrieval-Audio-retrieval-with-text-queries | SelfGating | false | 10,226 | [
"Apache-2.0"
] | 0 | d98ee159c61a8a9a1c433f0bfed14e7005215d5f | https://github.com/inbalcroitoru/Information-retrieval-Audio-retrieval-with-text-queries/tree/d98ee159c61a8a9a1c433f0bfed14e7005215d5f |
ActorNet | # 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.... | geektoni/AlphaNPI | ActorNet | false | 3,531 | [
"MIT"
] | 0 | ab48cb9cfb74f3960e264da4f3eb2d6917bfb9c9 | https://github.com/geektoni/AlphaNPI/tree/ab48cb9cfb74f3960e264da4f3eb2d6917bfb9c9 |
ResnetBlockGroupNormConv1d | # 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.... | taconite/MetaAvatar-release | ResnetBlockGroupNormConv1d | false | 16,526 | [
"MIT"
] | 60 | c9403a478ee82232633d25f65f108befd21d04e9 | https://github.com/taconite/MetaAvatar-release/tree/c9403a478ee82232633d25f65f108befd21d04e9 |
TripletLoss | import torch
import torch.nn.functional as F
import torch.nn as nn
def cosine_dist(x, y):
"""Computes Cosine Distance."""
x = F.normalize(x, dim=1)
y = F.normalize(y, dim=1)
dist = 2 - 2 * torch.mm(x, y.t())
return dist
def euclidean_dist(x, y):
"""Computes Euclidean distance."""
m, n = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | earlbabson/torchflare | TripletLoss | false | 6,638 | [
"Apache-2.0"
] | 1 | 15db06d313a53a3ec4640869335ba87730562b28 | https://github.com/earlbabson/torchflare/tree/15db06d313a53a3ec4640869335ba87730562b28 |
ConvDropoutLayerNorm | import torch
from torch import nn
import torch.utils.checkpoint
class SqueezeBertLayerNorm(nn.LayerNorm):
"""
This is a nn.LayerNorm subclass that accepts NCW data layout and performs normalization in the C dimension.
N = batch C = channels W = sequence length
"""
def __init__(self, hidden_size,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | jxhe/unify-parameter-efficient-tuning | ConvDropoutLayerNorm | false | 15,771 | [
"Apache-2.0"
] | 101 | 3222ce2c0079566a28043e22380eb4ab6ad14389 | https://github.com/jxhe/unify-parameter-efficient-tuning/tree/3222ce2c0079566a28043e22380eb4ab6ad14389 |
ContrastiveLoss | import torch
import torch.nn.functional as F
class ContrastiveLoss(torch.nn.Module):
"""
Contrastive loss function.
Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
"""
def __init__(self, margin=2.0):
super(ContrastiveLoss, self).__init__()
self.margin =... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._... | sugi-chan/project_pendragon | ContrastiveLoss | false | 16,503 | [
"MIT"
] | 56 | 267624365f25964fece1952e6dcde629bbc2ee5b | https://github.com/sugi-chan/project_pendragon/tree/267624365f25964fece1952e6dcde629bbc2ee5b |
MemoryEfficientMish | import torch
import torch.nn as nn
import torch.nn.functional as F
class MemoryEfficientMish(nn.Module):
class F(torch.autograd.Function):
@staticmethod
def forward(ctx, x):
ctx.save_for_backward(x)
return x.mul(torch.tanh(F.softplus(x)))
@staticmethod
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.triton_helpers import libdevice, math as tl_math
import torch.nn as nn
import torch.nn.functional as F
assert_s... | AkshayGanesh/yolov5processor | MemoryEfficientMish | false | 4,805 | [
"MIT"
] | 1 | 788accfa93798729c002b2c9b4f943284ff97cad | https://github.com/AkshayGanesh/yolov5processor/tree/788accfa93798729c002b2c9b4f943284ff97cad |
Classifier | import torch
import torch.nn as nn
class Classifier(nn.Module):
def __init__(self, n_hid, n_out):
super(Classifier, self).__init__()
self.n_hid = n_hid
self.n_out = n_out
self.linear = nn.Linear(n_hid, n_out)
def forward(self, x):
tx = self.linear(x)
return to... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | FengMingquan-sjtu/pyHGT | Classifier | false | 9,034 | [
"MIT"
] | 0 | 3ad1b10ee11358c02fa199667a80c291323e5e2d | https://github.com/FengMingquan-sjtu/pyHGT/tree/3ad1b10ee11358c02fa199667a80c291323e5e2d |
OneLayerFCBodyWithAction | import torch
import torch.optim
import torch.nn as nn
import torch.nn.functional as F
def layer_init(layer, w_scale=1.0):
nn.init.orthogonal_(layer.weight.data)
layer.weight.data.mul_(w_scale)
nn.init.constant_(layer.bias.data, 0)
return layer
class OneLayerFCBodyWithAction(nn.Module):
def __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
import torch.optim
import tor... | DMIU-ShELL/deeprl-shell | OneLayerFCBodyWithAction | false | 9,029 | [
"Apache-2.0"
] | 0 | a7845ab1c4967ba2af9486625086c3d0b176d293 | https://github.com/DMIU-ShELL/deeprl-shell/tree/a7845ab1c4967ba2af9486625086c3d0b176d293 |
GraphAttentionLayer | # 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.... | xlx0010/HGNN | GraphAttentionLayer | false | 4,597 | [
"MIT"
] | 0 | 219352405db021c1f435f3aa55961adcf2a6df19 | https://github.com/xlx0010/HGNN/tree/219352405db021c1f435f3aa55961adcf2a6df19 |
OutlookAttention | import math
import torch
from torch import Tensor
from torch import nn
from torch.nn import functional as F
class OutlookAttention(nn.Module):
def __init__(self, dim, num_heads, k=3, s=1, p=1):
super().__init__()
self.s = s
self.k = k
self.p = p
self.num_heads = num_heads
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 | OutlookAttention | false | 16,483 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 |
DepthWiseSeparableConv1d | import torch
import torch.nn as nn
import torch.jit
import torch.nn
class DepthWiseSeparableConv1d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, bias=True):
"""Depthwise separable 1D convolution.
Args:
in_channels (int): number ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.jit
import torch.nn
assert_size_stride = torc... | ankmathur96/torchsupport | DepthWiseSeparableConv1d | false | 3,169 | [
"MIT"
] | 0 | 77bf4a90b8770a408665e2604428808c3ed2f979 | https://github.com/ankmathur96/torchsupport/tree/77bf4a90b8770a408665e2604428808c3ed2f979 |
MaxPool2dDynamicSamePadding | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
import torchvision.transforms.functional as F
from torch.nn import functional as F
class MaxPool2dDynamicSamePadding(nn.MaxPool2d):
"""2D MaxPooling like TensorFlow's 'SAME' mode, with a dynamic image size.
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guard... | BigFishMaster/tnt | MaxPool2dDynamicSamePadding | false | 17,509 | [
"BSD-3-Clause"
] | 3 | 8b80bb3b194eb87ac18924428ef0924c2fb263c5 | https://github.com/BigFishMaster/tnt/tree/8b80bb3b194eb87ac18924428ef0924c2fb263c5 |
Network | import torch
import torch.nn as nn
class Network(nn.Module):
def __init__(self):
super().__init__()
self.conv = nn.Conv3d(in_channels=1, out_channels=3, kernel_size=3)
def forward(self, x):
return self.conv(x)
def get_inputs():
return [torch.rand([4, 1, 64, 64, 64])]
def get_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | GReguig/torchio | Network | false | 2,269 | [
"Apache-2.0"
] | 0 | 0cd4f3105408410adda4fddf4873eb8c12883ecc | https://github.com/GReguig/torchio/tree/0cd4f3105408410adda4fddf4873eb8c12883ecc |
SelfAttn | import torch
import torch.nn.functional as F
from torch import nn
class SelfAttn(nn.Module):
"""
self-attention with learnable parameters
"""
def __init__(self, dhid):
super().__init__()
self.scorer = nn.Linear(dhid, 1)
def forward(self, inp):
scores = F.softmax(self.scor... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | uyeongkim/moca | SelfAttn | false | 10,894 | [
"MIT"
] | 0 | 8a5870898b6d59258ce1064bab440b7e8107e9b4 | https://github.com/uyeongkim/moca/tree/8a5870898b6d59258ce1064bab440b7e8107e9b4 |
Conv3dMaxPool | # 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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | openclimatefix/predict_pv_yield | Conv3dMaxPool | false | 16,201 | [
"MIT"
] | 47 | 83f27bd392190f1771221e92bfebb879bf562f5d | https://github.com/openclimatefix/predict_pv_yield/tree/83f27bd392190f1771221e92bfebb879bf562f5d |
ConvBlock | import torch
class ResBlock(torch.nn.Module):
def __init__(self, num_channel):
super(ResBlock, self).__init__()
self.conv1 = torch.nn.Conv2d(num_channel, num_channel, kernel_size=
3, stride=1, padding=1)
self.conv2 = torch.nn.Conv2d(num_channel, num_channel, kernel_size=
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C... | Gregory-Eales/mban | ConvBlock | false | 5,254 | [
"Apache-2.0"
] | 1 | d8b35db51c7e601b1db777d9a80343600374250b | https://github.com/Gregory-Eales/mban/tree/d8b35db51c7e601b1db777d9a80343600374250b |
SeasonalityBasis | # 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 numpy as np
import torch as t
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.g... | TaeniKim/nbeats_reproduce | SeasonalityBasis | false | 9,545 | [
"MIT"
] | 0 | dd9375ad3fb4bb3c6c973391e250b5dd60a219ab | https://github.com/TaeniKim/nbeats_reproduce/tree/dd9375ad3fb4bb3c6c973391e250b5dd60a219ab |
AttentiveNorm2d | import torch
import torch.nn as nn
import torch.utils.data
class AttentiveNorm2d(nn.BatchNorm2d):
def __init__(self, num_features, hidden_channels=32, eps=1e-05,
momentum=0.1, track_running_stats=False):
super(AttentiveNorm2d, self).__init__(num_features, eps=eps,
momentum=momentum, a... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | ppomelo/Attentive-Transformation-Based-Normalization | AttentiveNorm2d | false | 4,131 | [
"Apache-2.0"
] | 0 | 62ad02eb025613e90f4fe0e0a9f0f85839e53092 | https://github.com/ppomelo/Attentive-Transformation-Based-Normalization/tree/62ad02eb025613e90f4fe0e0a9f0f85839e53092 |
LayerNorm | # 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | AlansBoyHeart/vit-pytorch | LayerNorm | false | 1,920 | [
"MIT"
] | 0 | 1959adae0bdd7801475bba34d7d61bdc529b4616 | https://github.com/AlansBoyHeart/vit-pytorch/tree/1959adae0bdd7801475bba34d7d61bdc529b4616 |
VAE | import torch
import numpy as np
import torch.utils.data
import torch.nn as nn
class VAE(nn.Module):
def __init__(self, input_size, latent_size):
super(VAE, self).__init__()
self.latent_size = latent_size
self.input_size = input_size
self.mu_layer = nn.Linear(self.input_size, self.... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math... | ErikHumphrey/sustain-seq2seq | VAE | false | 17,259 | [
"Apache-2.0"
] | 4 | c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4 | https://github.com/ErikHumphrey/sustain-seq2seq/tree/c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4 |
GaussianParamNet | import torch
import torch.nn as nn
import torch.nn.functional as F
class GaussianParamNet(nn.Module):
"""
Parameterise a Gaussian distributions.
"""
def __init__(self, input_dim, output_dim):
super(GaussianParamNet, self).__init__()
self.fc1 = nn.Linear(input_dim, input_dim, bias=Fals... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | pemami4911/MulMON | GaussianParamNet | false | 4,116 | [
"MIT"
] | 0 | e01438e7a9a1259dc473e7ffd20a005eeaea87cb | https://github.com/pemami4911/MulMON/tree/e01438e7a9a1259dc473e7ffd20a005eeaea87cb |
LayerNorm1d | # 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
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch
... | B0BBB/seq2seq.pytorch | LayerNorm1d | false | 109 | [
"MIT"
] | 0 | 54bb0e9f3e5c7db7f257841ed652e8ff447b8ee4 | https://github.com/B0BBB/seq2seq.pytorch/tree/54bb0e9f3e5c7db7f257841ed652e8ff447b8ee4 |
MemoryEfficientSwish | import torch
import torch.nn as nn
class MemoryEfficientSwish(nn.Module):
class F(torch.autograd.Function):
@staticmethod
def forward(ctx, x):
ctx.save_for_backward(x)
return x * torch.sigmoid(x)
@staticmethod
def backward(ctx, grad_output):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | Alex-Beh/hand_tracking | MemoryEfficientSwish | false | 11,169 | [
"Apache-2.0"
] | 0 | 40ac39e10ed5815d9400d6a87149015ad6ab9686 | https://github.com/Alex-Beh/hand_tracking/tree/40ac39e10ed5815d9400d6a87149015ad6ab9686 |
ExtResNetBlock | import torch
from torch import nn as nn
def conv3d(in_channels, out_channels, kernel_size, bias, padding):
return nn.Conv3d(in_channels, out_channels, kernel_size, padding=
padding, bias=bias)
def create_conv(in_channels, out_channels, kernel_size, order, num_groups,
padding):
"""
Create a l... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | ciubecca/3dunet-cavity | ExtResNetBlock | false | 1,716 | [
"MIT"
] | 0 | cfcc827773b18a95d221ab86c1afc5e2f7c30ecb | https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb |
Linear | import torch
class Linear(torch.nn.Module):
def __init__(self, in_size, out_size):
super().__init__()
self.weight = torch.nn.Parameter(2 * (torch.rand(in_size, out_size) -
0.5))
self.bias = torch.nn.Parameter(2 * (torch.rand(out_size) - 0.5))
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cu... | Cesarscc/MiniTorch_Clase | Linear | false | 11,297 | [
"MIT"
] | 0 | 1f159bc86f35dce170068b37dd47940ea4a4ba04 | https://github.com/Cesarscc/MiniTorch_Clase/tree/1f159bc86f35dce170068b37dd47940ea4a4ba04 |
MLPArchitecture | # 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
from co... | ivallesp/RL_Banana_Collector | MLPArchitecture | false | 12,548 | [
"MIT"
] | 0 | cf09ffa9cff8015dd47592509ae482b99339a960 | https://github.com/ivallesp/RL_Banana_Collector/tree/cf09ffa9cff8015dd47592509ae482b99339a960 |
GatedMaskedConv2d | import torch
import torch.utils.data
from torch import nn
import torch.nn.functional as F
class GatedMaskedConv2d(nn.Module):
def __init__(self, in_dim, out_dim=None, kernel_size=3, mask='B'):
super(GatedMaskedConv2d, self).__init__()
if out_dim is None:
out_dim = in_dim
self.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.... | tom-pelsmaeker/vae-lagging-encoder | GatedMaskedConv2d | false | 16,597 | [
"MIT"
] | 173 | b190239019a94c85858d188a0853886eb48ce4be | https://github.com/tom-pelsmaeker/vae-lagging-encoder/tree/b190239019a94c85858d188a0853886eb48ce4be |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self, input_dim, n_classes):
super(Net, self).__init__()
self.n_classes = n_classes
self.fc = nn.Linear(input_dim, 2048)
def _forward2(self, x):
x = self.fc(x)
x = F.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | alexanderrichard/cvpr2016_python3 | Net | false | 9,672 | [
"MIT"
] | 0 | cddd77420d1be25fe2bba3b069d2cb966c6e366a | https://github.com/alexanderrichard/cvpr2016_python3/tree/cddd77420d1be25fe2bba3b069d2cb966c6e366a |
MsgNorm | # 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 libdevice
assert_size_stride = torch._... | Dianezzy/YOLaT-VectorGraphicsRecognition | MsgNorm | false | 7,975 | [
"MIT"
] | 44 | ae21ad5850a49048f639d9b283ded927c3b367f7 | https://github.com/Dianezzy/YOLaT-VectorGraphicsRecognition/tree/ae21ad5850a49048f639d9b283ded927c3b367f7 |
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... | bunderhi/torch2trt | RDivInt | false | 1,608 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
OutputGenerator | import torch
import torch.nn as nn
class OutputGenerator(nn.Module):
def __init__(self, model_dim, tgt_vocab_size):
super().__init__()
self.tgt_vocab_size = tgt_vocab_size
self.linear = nn.Linear(model_dim, tgt_vocab_size, bias=False)
self.log_softmax = nn.LogSoftmax(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.... | guyjacoby/original-transformer-pytorch | OutputGenerator | false | 3,562 | [
"MIT"
] | 0 | 19e9ab4af3f0ee1ca81f6436eb18c36382bfbc1d | https://github.com/guyjacoby/original-transformer-pytorch/tree/19e9ab4af3f0ee1ca81f6436eb18c36382bfbc1d |
MultiHeadAttention | import math
import torch
import numpy as np
from torch import nn
class MultiHeadAttention(nn.Module):
def __init__(self, n_heads, input_dim, embed_dim, val_dim=None, key_dim
=None):
super(MultiHeadAttention, self).__init__()
if val_dim is None:
val_dim = embed_dim // n_heads
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | neo-pan/attention-learn-to-route | MultiHeadAttention | false | 10,592 | [
"MIT"
] | 0 | bb094d6e96276719ab2e379f279c614df7d822f9 | https://github.com/neo-pan/attention-learn-to-route/tree/bb094d6e96276719ab2e379f279c614df7d822f9 |
Conv2dBlock | import torch
from torch import nn
import torch.nn.functional as F
class AdaptiveInstanceNorm2d(nn.Module):
def __init__(self, num_features, eps=1e-05, momentum=0.1):
super(AdaptiveInstanceNorm2d, self).__init__()
self.num_features = num_features
self.eps = eps
self.momentum = mome... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | Arthur1511/CAD-COVID | Conv2dBlock | false | 66 | [
"MIT"
] | 0 | daab5d70b9f811da41f702e92179a15ca4809fa5 | https://github.com/Arthur1511/CAD-COVID/tree/daab5d70b9f811da41f702e92179a15ca4809fa5 |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 32, 3, 2, 1)
self.conv2 = nn.Conv2d(32, 64, 3, 2, 1)
self.conv3 = nn.Conv2d(64, 128, 3, 2, 1)
self.conv4 = nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | VincentWang001/HairNet | Net | false | 6,125 | [
"MIT"
] | 1 | 396a61dc63f09a6812cf14bd09ae52c9fd76565a | https://github.com/VincentWang001/HairNet/tree/396a61dc63f09a6812cf14bd09ae52c9fd76565a |
LinearFBSP | import torch
import numpy as np
from typing import Tuple
import torch.nn.functional as F
from typing import cast
def scale(old_value, old_min, old_max, new_min, new_max):
old_range = old_max - old_min
new_range = new_max - new_min
new_value = (old_value - old_min) * new_range / old_range + new_min
ret... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | Gikiman/executors | LinearFBSP | false | 2,379 | [
"Apache-2.0"
] | 0 | 98658b4136859164390cfccbde8cf0f7cf843593 | https://github.com/Gikiman/executors/tree/98658b4136859164390cfccbde8cf0f7cf843593 |
SmoothCrossEntropyLoss | import torch
import torch.nn.functional as F
from torch.nn.modules.loss import _WeightedLoss
import torch.utils.tensorboard
class SmoothCrossEntropyLoss(_WeightedLoss):
def __init__(self, weight=None, reduction='mean', smoothing=0.0):
super().__init__(weight=weight, reduction=reduction)
self.smoo... | 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.nn.modules.... | Dieg0Alejandr0/3D-Generative-SBDD | SmoothCrossEntropyLoss | false | 1,216 | [
"MIT"
] | 0 | 51ffd36a6cf5048eeff6e68186a4608048feea4c | https://github.com/Dieg0Alejandr0/3D-Generative-SBDD/tree/51ffd36a6cf5048eeff6e68186a4608048feea4c |
SoftTarget | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class SoftTarget(nn.Module):
"""
Distilling the Knowledge in a Neural Network
https://arxiv.org/pdf/1503.02531.pdf
"""
def __init__(self, T):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | Capetian/FaceX-Zoo | SoftTarget | false | 4,971 | [
"Apache-2.0"
] | 1 | 029786c40d8aba15d891d33973de25fcd7e5399a | https://github.com/Capetian/FaceX-Zoo/tree/029786c40d8aba15d891d33973de25fcd7e5399a |
ChannelPool | import torch
import torch.nn as nn
import torch.onnx
import torch.nn.parallel
class ChannelPool(nn.Module):
def forward(self, x):
return torch.cat((torch.max(x, 1)[0].unsqueeze(1), torch.mean(x, 1)
.unsqueeze(1)), dim=1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.onnx
import torch.nn.parallel
assert_size_stride = tor... | Ganzooo/soil_segmentation | ChannelPool | false | 2,266 | [
"MIT"
] | 0 | 56f410e3e184f24e52dd4b542ea309f0d203ca00 | https://github.com/Ganzooo/soil_segmentation/tree/56f410e3e184f24e52dd4b542ea309f0d203ca00 |
FCLayer | # 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
import torch.nn as ... | cjber/georelations | FCLayer | false | 3,296 | [
"MIT"
] | 0 | fe97e62a950b556c88be6e43fc67a55a16a65938 | https://github.com/cjber/georelations/tree/fe97e62a950b556c88be6e43fc67a55a16a65938 |
SiamFC | import torch
import torch.nn as nn
import torch.nn.functional as F
class SiamFC(nn.Module):
def __init__(self, out_scale=0.001):
super(SiamFC, self).__init__()
self.out_scale = out_scale
def forward(self, z, x):
return self._fast_xcorr(z, x) * self.out_scale
def _fast_xcorr(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.nn as nn
import torch.nn.functional as F
assert_size_stride = torch... | Kingzerd/siamfc_pytorch | SiamFC | false | 5,438 | [
"MIT"
] | 1 | fd1dbeb12dd7e2b9190876a1de7ea4b71a7a1166 | https://github.com/Kingzerd/siamfc_pytorch/tree/fd1dbeb12dd7e2b9190876a1de7ea4b71a7a1166 |
UnderfitNet | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class UnderfitNet(nn.Module):
def __init__(self):
super(UnderfitNet, self).__init__()
self.fc1 = nn.Linear(28 * 28, 64)
self.fc2 = nn.Linear(64, 10)
def forward(self, x):
x = x.view(-1,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | Lornatang/Deep-learning-with-python3 | UnderfitNet | false | 17,600 | [
"Apache-2.0"
] | 4 | 11794d871e68f8f80486a07bf5137325b4ee1526 | https://github.com/Lornatang/Deep-learning-with-python3/tree/11794d871e68f8f80486a07bf5137325b4ee1526 |
dqn_net | import torch
import torch.nn.functional as F
import torch.nn as nn
class dqn_net(nn.Module):
def __init__(self, n_states, n_actions):
super(dqn_net, self).__init__()
self.fc1 = nn.Linear(n_states, 50)
self.fc1.weight.data.normal_(0, 0.1)
self.fc2 = nn.Linear(50, 30)
self.f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | bigtreeljc/force_learning | dqn_net | false | 3,223 | [
"MIT"
] | 0 | 183a7c96c411e282966604e3cb375ba49e91a88c | https://github.com/bigtreeljc/force_learning/tree/183a7c96c411e282966604e3cb375ba49e91a88c |
TensorClampMax | # 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Akababa/torch2trt | TensorClampMax | false | 18,436 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
KdMseLoss | # 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... | lonePatient/TorchBlocks | KdMseLoss | false | 15,959 | [
"MIT"
] | 82 | 4a65d746cc8a396cb7df73ed4644d97ddf843e29 | https://github.com/lonePatient/TorchBlocks/tree/4a65d746cc8a396cb7df73ed4644d97ddf843e29 |
SampaddingMaxPool1D | # 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... | amoonfana/Knowledge_Distillation | SampaddingMaxPool1D | false | 6,195 | [
"Apache-2.0"
] | 1 | 1ee814a8f70ae00d17e1e1ee778d5420d96c43c4 | https://github.com/amoonfana/Knowledge_Distillation/tree/1ee814a8f70ae00d17e1e1ee778d5420d96c43c4 |
Probability | # 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... | ianhuang0630/CSQ | Probability | false | 15,577 | [
"MIT"
] | 98 | 5f1fe99a8d9da73692643b3911d675dce269a03d | https://github.com/ianhuang0630/CSQ/tree/5f1fe99a8d9da73692643b3911d675dce269a03d |
DSCNet | # 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 math
import torch.nn a... | qilinli/DSC-Net | DSCNet | false | 4,164 | [
"MIT"
] | 0 | c0e7a3cae3e07c34b2989234f568c7007cf0fc55 | https://github.com/qilinli/DSC-Net/tree/c0e7a3cae3e07c34b2989234f568c7007cf0fc55 |
feedforwardLayer | import torch
import torch.nn as nn
import torch.nn.functional as F
class feedforwardLayer(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_in, d_hid, dropout=0.3):
super().__init__()
self.w_1 = nn.Linear(d_in, d_hid)
self.w_2 = nn.Linear(d_hid, d_in)
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ayyyq/T-LSTM | feedforwardLayer | false | 6,320 | [
"MIT"
] | 1 | 36dbc88ac710d3925851cd87c2368ecfc7061b70 | https://github.com/ayyyq/T-LSTM/tree/36dbc88ac710d3925851cd87c2368ecfc7061b70 |
CrossEntropyLossOneHot | import torch
from torch import Tensor
from torch.nn.modules.loss import CrossEntropyLoss
class CrossEntropyLossOneHot(CrossEntropyLoss):
EPS: 'int' = 1e-07
def forward(self, input: 'Tensor', target: 'Tensor') ->Tensor:
assert self.weight is None or isinstance(self.weight, Tensor)
input = torc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch.nn.modules.... | NikolayZakharevich/music-processing | CrossEntropyLossOneHot | false | 895 | [
"MIT"
] | 0 | 516a3bca585f211d232cac7ede6cc417fb8878fe | https://github.com/NikolayZakharevich/music-processing/tree/516a3bca585f211d232cac7ede6cc417fb8878fe |
StepRankerLogistic | # 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.... | YilunZhou/wikihow-embedding | StepRankerLogistic | false | 18,140 | [
"MIT"
] | 8 | bfbcaf6aca854cd7e0dedfd5ecf77627138e8425 | https://github.com/YilunZhou/wikihow-embedding/tree/bfbcaf6aca854cd7e0dedfd5ecf77627138e8425 |
SiLU | # 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... | Aditya239233/MDP | SiLU | false | 16,909 | [
"MIT"
] | 4 | 87491e1d67e547c11f4bdd5d784d120473429eae | https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae |
Replicate_unit1d | import torch
class Replicate_unit1d(torch.nn.Module):
def __init__(self, width, height):
super(Replicate_unit1d, self).__init__()
self.width = width
self.height = height
def forward(self, x):
assert len(x.size()) == 2
batch_num = x.size()[0]
tmp = torch.cat([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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | BlackParure/AI-StarCraft-II | Replicate_unit1d | false | 17,002 | [
"Apache-2.0"
] | 7 | 7feee4addff9881b3c735791f4a43421f813fcfc | https://github.com/BlackParure/AI-StarCraft-II/tree/7feee4addff9881b3c735791f4a43421f813fcfc |
Decoder3 | import torch
import torch.nn as nn
class Decoder3(nn.Module):
def __init__(self, model=None, fixed=False):
super(Decoder3, self).__init__()
self.fixed = fixed
self.conv31 = nn.Conv2d(256, 128, 3, 1, 0)
self.conv22 = nn.Conv2d(128, 128, 3, 1, 0)
self.conv21 = nn.Conv2d(128,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | EndyWon/Texture-Reformer | Decoder3 | false | 8,124 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 |
ResidualBlock | # 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
assert_size_stride = torch._C._dyn... | JaguAroo/SRResCGAN | ResidualBlock | false | 619 | [
"MIT"
] | 0 | 9aac612aff631f7fb9142e0a36de9559cfc1a62d | https://github.com/JaguAroo/SRResCGAN/tree/9aac612aff631f7fb9142e0a36de9559cfc1a62d |
SelfAttention | import torch
class SelfAttention(torch.nn.Module):
def __init__(self, num_heads, model_dim, dropout_keep_prob):
super(SelfAttention, self).__init__()
self.num_heads = num_heads
self.model_dim = model_dim
self.dropout_keep_prob = dropout_keep_prob
self.q_layer = torch.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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | tech-srl/bottleneck | SelfAttention | false | 16,563 | [
"MIT"
] | 56 | b8c629ad25e02f53ba3389dd33a90bbeb83ea447 | https://github.com/tech-srl/bottleneck/tree/b8c629ad25e02f53ba3389dd33a90bbeb83ea447 |
CLNLayer | import torch
import torch.nn as nn
import torch.nn.functional as F
class CLN(nn.Module):
def __init__(self, in_dim, use_style_fc=False, style_dim=None,
which_linear=nn.Linear, spectral_norm=False, eps=1e-05, **kwargs):
super(CLN, self).__init__()
self.in_dim = in_dim
self.use_styl... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | justinjohn0306/CIPS-3D | CLNLayer | false | 7,007 | [
"MIT"
] | 1 | 69a910a7841846419a6b5e03182c8cf061a82584 | https://github.com/justinjohn0306/CIPS-3D/tree/69a910a7841846419a6b5e03182c8cf061a82584 |
HardSwish | import torch
import torch.nn as nn
from torch.nn import functional as F
import torch.nn.parallel
def hard_swish(x, inplace: 'bool'=False):
inner = F.relu6(x + 3.0).div_(6.0)
return x.mul_(inner) if inplace else x.mul(inner)
class HardSwish(nn.Module):
def __init__(self, inplace: 'bool'=False):
... | 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
from torch.nn import functional as F
import torch.nn.parallel
asser... | Fanzhongjie/ARFE | HardSwish | false | 458 | [
"Apache-2.0"
] | 0 | 4b96b8c5bc0895d3d30acec2a490f81a860fe860 | https://github.com/Fanzhongjie/ARFE/tree/4b96b8c5bc0895d3d30acec2a490f81a860fe860 |
AUGRUCell | # 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
import torch.nn as ... | zzz123xyz/DeepCTR-Torch | AUGRUCell | false | 4,742 | [
"Apache-2.0"
] | 0 | d6b880cc6b3761dbef90920a28182ef6737dd665 | https://github.com/zzz123xyz/DeepCTR-Torch/tree/d6b880cc6b3761dbef90920a28182ef6737dd665 |
ConvBatchNorm2d | # 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_... | pigunther/Self-Correction-Human-Parsing-Updated | ConvBatchNorm2d | false | 7,466 | [
"MIT"
] | 1 | 17331eaa5d6586a1ebb633eb61ed810d00d30a2f | https://github.com/pigunther/Self-Correction-Human-Parsing-Updated/tree/17331eaa5d6586a1ebb633eb61ed810d00d30a2f |
AndMLP | import torch
import torch.nn as nn
import torch.nn.functional as F
class AndMLP(nn.Module):
def __init__(self, n_layers, entity_dim):
super(AndMLP, self).__init__()
self.n_layers = n_layers
self.layers = []
for i in range(1, self.n_layers + 1):
setattr(self, 'and_layer... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | amayuelas/NNKGReasoning | AndMLP | false | 6,173 | [
"MIT"
] | 1 | 0e3623b344fd4e3088ece897f898ddbb1f80888d | https://github.com/amayuelas/NNKGReasoning/tree/0e3623b344fd4e3088ece897f898ddbb1f80888d |
Head | import torch
import torch.nn as nn
import torch.utils.data
class Conv(nn.Module):
def __init__(self, filters0, filters1, kernel_size, bn, bias=True):
super().__init__()
if bn:
bias = False
self.conv = nn.Conv2d(filters0, filters1, kernel_size, stride=1,
padding=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
import torch.utils.data
assert_size_stride = torch._C._dyn... | Hcnaeg/DI-engine | Head | false | 2,386 | [
"Apache-2.0"
] | 0 | aba0c629f87649854091e9e59d948f83962e3e1e | https://github.com/Hcnaeg/DI-engine/tree/aba0c629f87649854091e9e59d948f83962e3e1e |
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | adriangrepo/segmentl | DiceLoss | false | 18,238 | [
"MIT"
] | 5 | 9b520bf6cfd005eef9bba3db36ee6b3bb373b085 | https://github.com/adriangrepo/segmentl/tree/9b520bf6cfd005eef9bba3db36ee6b3bb373b085 |
MidNet4 | # 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... | DevilMayNotCry/My_curl | MidNet4 | false | 9,131 | [
"BSD-3-Clause"
] | 0 | a8f65a3e58cbdeefb4679aa2f0c3d9d800b67381 | https://github.com/DevilMayNotCry/My_curl/tree/a8f65a3e58cbdeefb4679aa2f0c3d9d800b67381 |
ResidualBlock | import torch
import torch.nn as nn
class ConvLayer(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride):
super(ConvLayer, self).__init__()
reflection_padding = kernel_size // 2
self.reflection_pad = nn.ReflectionPad2d(reflection_padding)
self.conv2d = nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | MKFMIKU/PFFNet | ResidualBlock | false | 8,503 | [
"MIT"
] | 41 | e506010a7cf00a32e77681845bdaf78ba88b027d | https://github.com/MKFMIKU/PFFNet/tree/e506010a7cf00a32e77681845bdaf78ba88b027d |
MaskedMSELoss | import torch
import torch.nn as nn
class MaskedMSELoss(nn.Module):
def __init__(self):
super(MaskedMSELoss, self).__init__()
self.loss = nn.MSELoss(reduction='sum')
def forward(self, pred, target, mask):
"""
pred -> batch*seq_len
target -> batch*seq_len
mask -... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | filkar/CASTLE | MaskedMSELoss | false | 3,521 | [
"MIT"
] | 0 | 128b316d24503875bcc298301c17b003e6d4599d | https://github.com/filkar/CASTLE/tree/128b316d24503875bcc298301c17b003e6d4599d |
TransformerDecoderLayer | import torch
from typing import Optional
from torch import nn
def _get_activation_fn(activation: 'str'):
if activation == 'relu':
return nn.functional.relu
elif activation == 'gelu':
return nn.functional.gelu
raise RuntimeError('activation should be relu/gelu, not {}'.format(
activ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | aarora8/icefall | TransformerDecoderLayer | false | 3,018 | [
"Apache-2.0"
] | 0 | 8cb7f712e413fffbcdfdd865be73d6ff43f0ce7a | https://github.com/aarora8/icefall/tree/8cb7f712e413fffbcdfdd865be73d6ff43f0ce7a |
Attention | import torch
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
import torch.nn.parallel
class Attention(nn.Module):
def __init__(self, input_dim, source_dim=None, output_dim=None, bias=False
):
super(Attention, self).__init__()
if source_dim is None:
sou... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | kcyu2014/eval-nas | Attention | false | 15,807 | [
"MIT"
] | 47 | 385376a3ef96336b54ee7e696af1d02b97aa5c32 | https://github.com/kcyu2014/eval-nas/tree/385376a3ef96336b54ee7e696af1d02b97aa5c32 |
StyleLoss | # 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 math as tl_math
import torch.... | ljrprocc/Motif-Removal | StyleLoss | false | 3,933 | [
"MIT"
] | 0 | 8979ca91398212248a2be61345c99bdec53ae37e | https://github.com/ljrprocc/Motif-Removal/tree/8979ca91398212248a2be61345c99bdec53ae37e |
WeightedSmoothL1Loss | import torch
from torch import nn as nn
class WeightedSmoothL1Loss(nn.SmoothL1Loss):
def __init__(self, threshold, initial_weight, apply_below_threshold=True):
super().__init__(reduction='none')
self.threshold = threshold
self.apply_below_threshold = apply_below_threshold
self.wei... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | ciubecca/3dunet-cavity | WeightedSmoothL1Loss | false | 1,711 | [
"MIT"
] | 0 | cfcc827773b18a95d221ab86c1afc5e2f7c30ecb | https://github.com/ciubecca/3dunet-cavity/tree/cfcc827773b18a95d221ab86c1afc5e2f7c30ecb |
SuperpointBackbone | # 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_... | wx-b/SOLD2 | SuperpointBackbone | false | 16,752 | [
"MIT"
] | 347 | 71c3243f9d3a695788d0a6bfd134b9849425900a | https://github.com/wx-b/SOLD2/tree/71c3243f9d3a695788d0a6bfd134b9849425900a |
WBCEDiceLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
def dice_loss(pred, target, smooth=1e-08):
iflat = pred.view(-1)
tflat = target.view(-1)
intersection = (iflat * tflat).sum()
return 1 - (2.0 * intersection + smooth) / (iflat.sum() + tflat.sum() +
smooth)
def weighted_binary... | 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
... | Hhhhhhhhhhao/change_detection | WBCEDiceLoss | false | 8,234 | [
"MIT"
] | 11 | 13b87c02166cc98d39d8be240a07abcf12893fe3 | https://github.com/Hhhhhhhhhhao/change_detection/tree/13b87c02166cc98d39d8be240a07abcf12893fe3 |
MeanStd | import torch
import torch.nn as nn
class MeanStd(nn.Module):
def __init__(self):
super(MeanStd, self).__init__()
def forward(self, x):
x = x.view(x.size(0), x.size(1), -1)
mean_x = torch.mean(x, dim=2)
var_x = torch.mean(x ** 2, dim=2) - mean_x * mean_x
return torch.c... | 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... | GiangHLe/pytorch_GAN_zoo | MeanStd | false | 11,474 | [
"BSD-3-Clause"
] | 0 | 7a3db2a88032f357b3f262abd6204b560caa9f2c | https://github.com/GiangHLe/pytorch_GAN_zoo/tree/7a3db2a88032f357b3f262abd6204b560caa9f2c |
KeyValueAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.nn.init
class KeyValueAttention(nn.Module):
def __init__(self, query_size, key_size, value_size, hid_size, init_range):
super(KeyValueAttention, self).__init__()
self.key2hid = nn.L... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Chenny0808/tatk | KeyValueAttention | false | 13,493 | [
"Apache-2.0"
] | 81 | 1c1a3cb557ba84bbfdbd1f6d8b8ea43ed8b9d7c5 | https://github.com/Chenny0808/tatk/tree/1c1a3cb557ba84bbfdbd1f6d8b8ea43ed8b9d7c5 |
Conv2d_spatial_sep | # 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... | maet3608/torchy | Conv2d_spatial_sep | false | 3,969 | [
"Apache-2.0"
] | 0 | 8c73732a1d4631bd97bfafdc18e52a22ff5410f7 | https://github.com/maet3608/torchy/tree/8c73732a1d4631bd97bfafdc18e52a22ff5410f7 |
Policy_Net | import torch
from torch import nn
from torch.nn import functional as F
class Policy_Net(nn.Module):
def __init__(self, observation_dim, action_dim):
super(Policy_Net, self).__init__()
self.fc1 = nn.Linear(observation_dim, 256)
self.fc2 = nn.Linear(256, 256)
self.fc3 = nn.Linear(25... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | BLUECARVIN/RL_baseline | Policy_Net | false | 135 | [
"MIT"
] | 0 | 436538f49ee505e14672a67ba3c1f60886cbbea8 | https://github.com/BLUECARVIN/RL_baseline/tree/436538f49ee505e14672a67ba3c1f60886cbbea8 |
Net | # 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... | kawano8811/deep-learning-v2-pytorch | Net | false | 13,232 | [
"MIT"
] | 0 | b7c453728cb85edf3b30e0aeb66b3861747bc043 | https://github.com/kawano8811/deep-learning-v2-pytorch/tree/b7c453728cb85edf3b30e0aeb66b3861747bc043 |
CNN | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNN(nn.Module):
def __init__(self, input_size=50, hidden_size=256, dropout=0,
kernel_size=3, padding=1, activation_function=F.relu):
"""
Args:
input_size: dimention of input embedding
kernel_s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | Fatead/NER | CNN | false | 454 | [
"MIT"
] | 0 | 142fabb2fcb1b730042da7acfde10199c62537d5 | https://github.com/Fatead/NER/tree/142fabb2fcb1b730042da7acfde10199c62537d5 |
MaxPoolWithMask | import torch
import torch.nn as nn
class MaxPoolWithMask(nn.Module):
"""
带mask矩阵的max pooling。在做max-pooling的时候不会考虑mask值为0的位置。
"""
def __init__(self):
super(MaxPoolWithMask, self).__init__()
self.inf = 10000000000000.0
def forward(self, tensor, mask, dim=1):
"""
:pa... | 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... | Raiselimit/TorchBlocks | MaxPoolWithMask | false | 5,734 | [
"MIT"
] | 1 | a5baecb9a2470ff175087475630f2b7db3f7ef51 | https://github.com/Raiselimit/TorchBlocks/tree/a5baecb9a2470ff175087475630f2b7db3f7ef51 |
FourierFeatures | import math
import torch
from torch import nn
class FourierFeatures(nn.Module):
def __init__(self, in_features, out_features, std=1.0):
super().__init__()
assert out_features % 2 == 0
self.weight = nn.Parameter(torch.randn([out_features // 2,
in_features]) * std)
def forw... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch im... | cansakirt/disco-diffusion | FourierFeatures | false | 3,262 | [
"MIT"
] | 0 | a7e9cfc098e1c216f8ab04901e3e9c6dc9ca4edb | https://github.com/cansakirt/disco-diffusion/tree/a7e9cfc098e1c216f8ab04901e3e9c6dc9ca4edb |
HuberLoss | # 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
... | AndrewPaulChester/sage-code | HuberLoss | false | 20 | [
"MIT"
] | 0 | 9fe676bfbcbc6f642eca29b30a1027fba2a426a0 | https://github.com/AndrewPaulChester/sage-code/tree/9fe676bfbcbc6f642eca29b30a1027fba2a426a0 |
BellMembFunc | import torch
def _mk_param(val):
"""Make a torch parameter from a scalar value"""
if isinstance(val, torch.Tensor):
val = val.item()
return torch.nn.Parameter(torch.tensor(val, dtype=torch.float))
class BellMembFunc(torch.nn.Module):
"""
Generalised Bell membership function; defined ... | 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... | trituenhantaoio/anfis-pytorch | BellMembFunc | false | 16,618 | [
"MIT"
] | 66 | 7a6bf123d69b550e46abeddd5b4a776243d43aa6 | https://github.com/trituenhantaoio/anfis-pytorch/tree/7a6bf123d69b550e46abeddd5b4a776243d43aa6 |
FourierConv1d | # 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 import device
import 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... | julian-parker/DAFX22_FNO | FourierConv1d | false | 3,782 | [
"MIT"
] | 0 | 72f30144317a3f8ba8ea23ecf9a0333c81fc87db | https://github.com/julian-parker/DAFX22_FNO/tree/72f30144317a3f8ba8ea23ecf9a0333c81fc87db |
TorchEntityRecognizer | # 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.... | apjanco/projects | TorchEntityRecognizer | false | 14,891 | [
"MIT"
] | 823 | 2f8850140ba13ab18b9cf622e46e79013d41701f | https://github.com/apjanco/projects/tree/2f8850140ba13ab18b9cf622e46e79013d41701f |
BertOutput | from _paritybench_helpers import _mock_config
import torch
import torch.nn
import torch.nn as nn
class BertOutput(nn.Module):
"""BERT output layer.
Based on: BERT (pytorch-transformer)
https://github.com/huggingface/transformers
"""
def __init__(self, config) ->None:
super().__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
imp... | bamf-health/MONAI | BertOutput | false | 1,525 | [
"Apache-2.0"
] | 0 | 6a2086d21baf4b60c2ab3d400ed5c97cf24a0da9 | https://github.com/bamf-health/MONAI/tree/6a2086d21baf4b60c2ab3d400ed5c97cf24a0da9 |
TV_L1LOSS | # 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 math as tl_math
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch.... | alsgkals2/SRResCGAN | TV_L1LOSS | false | 14,813 | [
"MIT"
] | 81 | a71201a93e1819045f9c7711743812546d3a1f31 | https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31 |
MLP | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
from torch.nn import Parameter
from torch.nn.parameter import Parameter
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class Conv1D(nn.Module):
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.triton_helpers import libdevice
import math
from to... | mandaltanmoy1938/VisualGPT | MLP | false | 15,988 | [
"MIT"
] | 86 | 9ba78948282fdca502d5030f4eccc3df562982c3 | https://github.com/mandaltanmoy1938/VisualGPT/tree/9ba78948282fdca502d5030f4eccc3df562982c3 |
HardSwish | # 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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | Cris-zj/mmdetection | HardSwish | false | 8,915 | [
"Apache-2.0"
] | 0 | ede648b93e7ba2562f835f338b778f3e705f7119 | https://github.com/Cris-zj/mmdetection/tree/ede648b93e7ba2562f835f338b778f3e705f7119 |
ResidualDenseBlock_3C | # 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.nn.init as init
assert_size_stride = torch._C... | wsdea/EfficientSR | ResidualDenseBlock_3C | false | 4,554 | [
"MIT"
] | 0 | 077dea18c90e0d5bed722c609a776033c09f80e6 | https://github.com/wsdea/EfficientSR/tree/077dea18c90e0d5bed722c609a776033c09f80e6 |
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... | QiangliangHuang/siamban | UPChannelBAN | false | 14,334 | [
"Apache-2.0"
] | 216 | 940208cb26f8146f87f7534d1674791dcb62468a | https://github.com/QiangliangHuang/siamban/tree/940208cb26f8146f87f7534d1674791dcb62468a |
AUXModule | import torch
import torch.nn as nn
import torch.nn.functional as F
class AUXModule(nn.Module):
def __init__(self, in_features, out_features):
super().__init__()
self.linear = nn.Linear(in_features, out_features)
def forward(self, x):
x = F.adaptive_max_pool2d(x, output_size=(1, 1))
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Soo95/segmentation_models.pytorch | AUXModule | false | 2,844 | [
"MIT"
] | 0 | 9131b336d6939dfabbadecd0d56d382283f46803 | https://github.com/Soo95/segmentation_models.pytorch/tree/9131b336d6939dfabbadecd0d56d382283f46803 |
L1Loss | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.nn.functional as F
class L1Loss(nn.Module):
def __init__(self, size_average=None, reduce=None, reduction='mean'):
super(L1Loss, self).__init__()
self.size_average = size_average
... | 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
... | Dogacel/mmfashion | L1Loss | false | 11,409 | [
"Apache-2.0"
] | 0 | e49613245c8501042edd7aeeaa8fb93e5ea13238 | https://github.com/Dogacel/mmfashion/tree/e49613245c8501042edd7aeeaa8fb93e5ea13238 |
Network | # 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_... | noureldinalaa/monocular_visual_odometry-_DuckieTown | Network | false | 12,841 | [
"MIT"
] | 0 | 6b65e4fb9918dbf435133a9dd608c58cfb12b44b | https://github.com/noureldinalaa/monocular_visual_odometry-_DuckieTown/tree/6b65e4fb9918dbf435133a9dd608c58cfb12b44b |
MAPELoss | import torch
import torch.nn as nn
class MAPELoss(nn.Module):
def forward(self, input, target):
return (torch.abs(input - target) / (torch.abs(target) + 0.01)).mean()
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
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | arpan-dhatt/oidn | MAPELoss | false | 14,894 | [
"Apache-2.0"
] | 1,206 | 9419411ba4b343b475b53587cadd44c83d68dc2a | https://github.com/arpan-dhatt/oidn/tree/9419411ba4b343b475b53587cadd44c83d68dc2a |
Decoder | import torch
import torch.nn as nn
class Decoder(nn.Module):
def __init__(self, n_features, n_modes, T):
super(Decoder, self).__init__()
self.n_modes = n_modes
self.T = T
self.linear1 = nn.Linear(n_features, 4096)
self.linear2 = nn.Linear(512, n_modes * T * 2)
self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | SambaranRepo/VectorNet_Waymo | Decoder | false | 17,896 | [
"MIT"
] | 4 | 454016a5020444e78943786c14e4e12a75ce052e | https://github.com/SambaranRepo/VectorNet_Waymo/tree/454016a5020444e78943786c14e4e12a75ce052e |
conv_head_pooling | import torch
import torch.nn as nn
import torch.utils.data
class conv_head_pooling(nn.Module):
def __init__(self, in_feature, out_feature, stride, conv_type,
padding_mode='zeros', dilation=1):
super(conv_head_pooling, self).__init__()
if conv_type == 'depthwise':
_groups = 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
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | newstzpz/d2go | conv_head_pooling | false | 12,830 | [
"Apache-2.0"
] | 0 | fcd511714ec4e34040d35379cb0382b70fb58c70 | https://github.com/newstzpz/d2go/tree/fcd511714ec4e34040d35379cb0382b70fb58c70 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.