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 |
|---|---|---|---|---|---|---|---|---|---|---|
MedianPool2d | import torch
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from torch.nn.modules.utils import _quadruple
from torch import optim as optim
import torch.nn.parallel
class MedianPool2d(nn.Module):
"... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.utils.data
import torch.nn as nn
from torch.nn.modules.utils... | Exir-lxr/crldr-prune-pytorch | MedianPool2d | false | 2,700 | [
"Apache-2.0"
] | 0 | adeb5e0b24ce66ff9531d4d947f72412c1b5c033 | https://github.com/Exir-lxr/crldr-prune-pytorch/tree/adeb5e0b24ce66ff9531d4d947f72412c1b5c033 |
CPUForgetMult | import torch
from typing import *
class CPUForgetMult(torch.nn.Module):
def __init__(self):
super(CPUForgetMult, self).__init__()
def forward(self, f, x, hidden_init=None):
result = []
forgets = f.split(1, dim=0)
prev_h = hidden_init
for i, h in enumerate((f * x).spli... | 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 typing import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | WittmannF/fastai_docs | CPUForgetMult | false | 5,976 | [
"Apache-2.0"
] | 1 | 03ecae01557a5e4a196dd858b10a57b224df52cd | https://github.com/WittmannF/fastai_docs/tree/03ecae01557a5e4a196dd858b10a57b224df52cd |
FunctionalRelu6 | import torch
class FunctionalRelu6(torch.nn.Module):
def forward(self, x):
return torch.nn.functional.relu6(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | NVIDIA-AI-IOT-private/torch2trt | FunctionalRelu6 | false | 10,504 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
RankCrossEntropyLoss | # 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
... | Ambitioner-c/MatchZoo-py | RankCrossEntropyLoss | false | 13,242 | [
"Apache-2.0"
] | 468 | bb088edce8e01c2c2326ca1a8ac647f0d23f088d | https://github.com/Ambitioner-c/MatchZoo-py/tree/bb088edce8e01c2c2326ca1a8ac647f0d23f088d |
CNNCifar | # 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.... | Joey61Liuyi/Federated-Learning-PyTorch | CNNCifar | false | 1,641 | [
"MIT"
] | 0 | e95f096b18c5a1bf30fc0485acd5a15c84327f2e | https://github.com/Joey61Liuyi/Federated-Learning-PyTorch/tree/e95f096b18c5a1bf30fc0485acd5a15c84327f2e |
SelfAttention | import torch
from torch import nn
class SelfAttention(nn.Module):
"""Self attention layer, cited from https://github.com/heykeetae/Self-Attention-GAN/blob/master/sagan_models.py"""
def __init__(self, in_dim, activation='relu', k=2):
super().__init__()
self.chanel_in = in_dim
self.acti... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | jscarlson/zi2zi-pytorch | SelfAttention | false | 15,755 | [
"Apache-2.0"
] | 81 | 3409165b304ccf1d5a5c2329a9f0f0897b3495dc | https://github.com/jscarlson/zi2zi-pytorch/tree/3409165b304ccf1d5a5c2329a9f0f0897b3495dc |
TorchMod | import torch
class TorchMod(torch.nn.Module):
def __init__(self):
super(TorchMod, self).__init__()
def forward(self, x, y):
return torch.fmod(x, y)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Ilyabasharov/torch2trt | TorchMod | false | 2,557 | [
"MIT"
] | 0 | 76bf298b3da408509665e23e2494922b131afb10 | https://github.com/Ilyabasharov/torch2trt/tree/76bf298b3da408509665e23e2494922b131afb10 |
FFChessNet | import torch
import torch.nn as nn
import torch.nn.functional as F
class FFChessNet(nn.Module):
"""Modified ResidualNetworkSegment model class"""
def __init__(self, block, num_blocks, width, depth):
super(FFChessNet, self).__init__()
assert (depth - 4
) % 4 == 0, 'Depth not compat... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | Maosef/easy-to-hard | FFChessNet | false | 8,542 | [
"MIT"
] | 44 | 711ec0965229444a6c51b1b06a4e2cad3e32d02e | https://github.com/Maosef/easy-to-hard/tree/711ec0965229444a6c51b1b06a4e2cad3e32d02e |
LayerNorm | import torch
from torch import Tensor
from torch.nn import Parameter
from torch.nn import LayerNorm
from typing import Optional
import torch.fx
from typing import Any
import torch.utils.data
from inspect import Parameter
from torch.nn.parameter import Parameter
def maybe_num_nodes(edge_index, num_nodes=None):
if ... | 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 Tensor
fro... | camus1337/pytorch_geometric | LayerNorm | false | 6,382 | [
"MIT"
] | 1 | 38514197a327541eb47abb69d4ab224910852605 | https://github.com/camus1337/pytorch_geometric/tree/38514197a327541eb47abb69d4ab224910852605 |
DeiTAttention | # 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.... | ncoop57/transformers | DeiTAttention | false | 4,082 | [
"Apache-2.0"
] | 0 | d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | https://github.com/ncoop57/transformers/tree/d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee |
DropoutModel8x8 | import torch
import torch.nn as nn
import torch.nn.functional as func
class DropoutModel8x8(nn.Module):
def __init__(self, channel):
"""
Define useful layers
Argument:
channel: number of channel, or depth or number of different sprite types
"""
super(DropoutModel8x... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | mwxely/Cross-domain-PCGML-Level-Generator | DropoutModel8x8 | false | 7,321 | [
"MIT"
] | 1 | baa5d214d6cf22272d144aa6c444a778ac202afe | https://github.com/mwxely/Cross-domain-PCGML-Level-Generator/tree/baa5d214d6cf22272d144aa6c444a778ac202afe |
Gaussian | import torch
import torch.utils.tensorboard
import torch.utils.data
class Gaussian(torch.nn.Module):
"""Gaussian activation"""
def forward(self, x):
return torch.exp(-x * x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.utils.tensorboard
import torch.utils.data
assert_size_stride... | chc273/torchani | Gaussian | false | 10,024 | [
"MIT"
] | 0 | bbcd7bedc254796f0c2f839c4868ac211ad9078d | https://github.com/chc273/torchani/tree/bbcd7bedc254796f0c2f839c4868ac211ad9078d |
DiceLoss | import torch
import torch.nn as nn
import torch.utils.data
import torch
class DiceLoss(nn.Module):
def __init__(self):
super(DiceLoss, self).__init__()
def forward(self, pred, target):
pred = pred.squeeze(dim=1)
dice = 2 * (pred * target).sum(dim=1).sum(dim=1).sum(dim=1) / (pred
... | 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.data
import torch
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cud... | ayanglab/HDL | DiceLoss | false | 6,305 | [
"Apache-2.0"
] | 1 | 5ff778d713331671ffa85e9fb63378d8c0a57769 | https://github.com/ayanglab/HDL/tree/5ff778d713331671ffa85e9fb63378d8c0a57769 |
GlobalAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.cuda
import torch.distributed
def aeq(*args):
"""
Assert all arguments have the same value
"""
arguments = (arg for arg in args)
first = next(arguments)
assert all(arg == first for arg in arguments
), 'Not ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ESCM-summarization/ESCM-summary-evaluation | GlobalAttention | false | 9,120 | [
"MIT"
] | 0 | 3780b51f0ed44cbbea3f163a871d875f1e5e9393 | https://github.com/ESCM-summarization/ESCM-summary-evaluation/tree/3780b51f0ed44cbbea3f163a871d875f1e5e9393 |
TransformerEncoderLayer_MLP | from torch.nn import Module
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Linear
from torch.nn import Dropout
from torch.nn import LayerNorm
from torch.nn import Identity
def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False):
"""Drop paths (Stochastic Depth) pe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | yifanc96/yifanc-DL | TransformerEncoderLayer_MLP | false | 11,092 | [
"MIT"
] | 0 | 25d56cec776fb151c8f6bcbd997bca94f07f3597 | https://github.com/yifanc96/yifanc-DL/tree/25d56cec776fb151c8f6bcbd997bca94f07f3597 |
decoder3 | import torch
import torch.nn
import torch
import torch.nn as nn
class decoder3(nn.Module):
def __init__(self, W, v2):
super(decoder3, self).__init__()
self.reflecPad7 = nn.ZeroPad2d((1, 1, 1, 1))
self.conv7 = nn.Conv2d(int(256 * W), int(128 * W), 3, 1, 0)
self.relu7 = nn.ReLU(inpl... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
import torch
... | kamieen03/style-transfer-server | decoder3 | false | 3,834 | [
"BSD-2-Clause"
] | 0 | 91727ec62080215a0b870ce043faf0657137b84b | https://github.com/kamieen03/style-transfer-server/tree/91727ec62080215a0b870ce043faf0657137b84b |
ABS_disc_sm_v3 | import torch
import torch.nn as nn
class ABS_disc_sm_v3(nn.Module):
def __init__(self, weight_list=None, lb_sm=0.2):
super(ABS_disc_sm_v3, self).__init__()
self.weight_list = weight_list
self.lb_sm = lb_sm
def forward(self, x, labels):
assert (x >= 0).all() and (x <= 1).all()... | 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... | Sampson-Lee/SIB-Net | ABS_disc_sm_v3 | false | 2,800 | [
"MIT"
] | 0 | 650399082e9237327fa38168ccfc7d48153a1db5 | https://github.com/Sampson-Lee/SIB-Net/tree/650399082e9237327fa38168ccfc7d48153a1db5 |
rSoftMax | # 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
... | XuYongi/KiNet | rSoftMax | false | 11,978 | [
"MIT"
] | 0 | fab8865a09e3779baf0daf1db1bf59a9cfbde450 | https://github.com/XuYongi/KiNet/tree/fab8865a09e3779baf0daf1db1bf59a9cfbde450 |
ScaledDotProductAttention | import torch
from torch import nn
from typing import Optional
class ScaledDotProductAttention(nn.Module):
def __init__(self, dropout: 'Optional[float]'=None, scale: 'bool'=True):
super(ScaledDotProductAttention, self).__init__()
if dropout is not None:
self.dropout = nn.Dropout(p=drop... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | IusztinPaul/yacht | ScaledDotProductAttention | false | 17,441 | [
"Apache-2.0"
] | 5 | c68ab7c66bde860bb91534c29e97772ba328adb5 | https://github.com/IusztinPaul/yacht/tree/c68ab7c66bde860bb91534c29e97772ba328adb5 |
NCCLoss | import torch
import torch.nn as nn
class NCCLoss(nn.Module):
"""
A implementation of the normalized cross correlation (NCC)
"""
def forward(self, input, target):
input = input.view(input.shape[0], -1)
target = target.view(target.shape[0], -1)
input_minus_mean = input - torch.m... | 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_... | norveclibalikci/easyreg-mirror | NCCLoss | false | 10,617 | [
"Apache-2.0"
] | 0 | a16254733fe957cc4024923f8dce91412966a189 | https://github.com/norveclibalikci/easyreg-mirror/tree/a16254733fe957cc4024923f8dce91412966a189 |
Bottleneck | # 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
from col... | nivedk/SPANet | Bottleneck | false | 10,621 | [
"BSD-3-Clause"
] | 0 | 1bd84ae67732f9885af65dcbd286075008d46e91 | https://github.com/nivedk/SPANet/tree/1bd84ae67732f9885af65dcbd286075008d46e91 |
SqueezeExcite | # 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 ... | chuanli11/SynergyNet | SqueezeExcite | false | 15,034 | [
"MIT"
] | 82 | a8044d8dabbfb811d4299f59e64e0fb749027e86 | https://github.com/chuanli11/SynergyNet/tree/a8044d8dabbfb811d4299f59e64e0fb749027e86 |
PFLDLoss | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
from typing import *
class PFLDLoss(nn.Module):
"""Weighted loss of L2 distance with the pose angle for PFLD."""
def __init__(self):
super(PFLDLoss, self).__init__()
def forward(self, landmark_... | 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.nn.parallel
import torch.optim
import ... | rmfan/nni | PFLDLoss | false | 10,937 | [
"MIT"
] | 0 | 727ee1ce47e070061fe3dab8a2da5d3cd5e55546 | https://github.com/rmfan/nni/tree/727ee1ce47e070061fe3dab8a2da5d3cd5e55546 |
GatedResUnit | # 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
import torch.utils.data
assert_size_stride = torch._C._dyna... | RobertYCXu/vae_vampprior | GatedResUnit | false | 9,589 | [
"MIT"
] | 0 | edcec4f5f7af673172c5b5b9aa2a22f993564fab | https://github.com/RobertYCXu/vae_vampprior/tree/edcec4f5f7af673172c5b5b9aa2a22f993564fab |
BiaffineAttention | # 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.... | db-bionlp/CLNER | BiaffineAttention | false | 15,157 | [
"MIT"
] | 46 | 77910311acf0411252b9fea8c3e6efb7175eb21f | https://github.com/db-bionlp/CLNER/tree/77910311acf0411252b9fea8c3e6efb7175eb21f |
PairwiseRankingLoss | import torch
import torch.nn as nn
class PairwiseRankingLoss(nn.Module):
"""
Pairwise ranking loss
"""
def __init__(self, margin):
super(PairwiseRankingLoss, self).__init__()
self.margin = margin
def forward(self, anchor1, anchor2, img_sentc, sent_imgc):
cost_sent = torch... | 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... | SilanHe/e-SNLI | PairwiseRankingLoss | false | 14,420 | [
"MIT"
] | 125 | 1c38981f50f931e45cf06146e693c588bc89b78d | https://github.com/SilanHe/e-SNLI/tree/1c38981f50f931e45cf06146e693c588bc89b78d |
LossFunction | # 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
from torch.autograd import Variable
import torch.nn.functional as F
assert_size_stride = torch._C._dynamo.guards.asser... | hungthanhpham94/GRU4REC-pytorch | LossFunction | false | 15,572 | [
"Apache-2.0"
] | 184 | 666b84264c4afae757fe55c6997dcf0a4da1d44e | https://github.com/hungthanhpham94/GRU4REC-pytorch/tree/666b84264c4afae757fe55c6997dcf0a4da1d44e |
DiffLoss | # 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
assert_size_stride ... | CZSLwithCVAE/CZSL_CVAE | DiffLoss | false | 17,060 | [
"MIT"
] | 5 | b77d40f7efde96d2512ac15ebe592ef56b13f2e3 | https://github.com/CZSLwithCVAE/CZSL_CVAE/tree/b77d40f7efde96d2512ac15ebe592ef56b13f2e3 |
TripletLoss | import torch
from torch import nn
class TripletLoss(nn.Module):
def __init__(self, margin):
super(TripletLoss, self).__init__()
self.margin = margin
self.relu = nn.ReLU()
def forward(self, anchor, positive, negative, size_average=True):
cosine_positive = nn.CosineSimilarity(d... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_... | SeungHeonDoh/music_zeroshot_models | TripletLoss | false | 5,823 | [
"MIT"
] | 1 | 38f80df868da357f3cb30522ad2e2031f0bc184e | https://github.com/SeungHeonDoh/music_zeroshot_models/tree/38f80df868da357f3cb30522ad2e2031f0bc184e |
CrossEn | # 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
from torch import nn
i... | LoveEachDay/towhee | CrossEn | false | 11,651 | [
"Apache-2.0"
] | 0 | 513c9c2626676cadaaf0a16ac3c828d96bec91a1 | https://github.com/LoveEachDay/towhee/tree/513c9c2626676cadaaf0a16ac3c828d96bec91a1 |
DiceLoss | import functools
import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
import torch._C
import torch.serialization
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "... | 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 functools
impor... | CuttlefishXuan/mmsegmentation-1 | DiceLoss | false | 13,538 | [
"Apache-2.0"
] | 789 | 13771312da1a66d5cd642df6aa370affd3f5ceac | https://github.com/CuttlefishXuan/mmsegmentation-1/tree/13771312da1a66d5cd642df6aa370affd3f5ceac |
MeanPoolingLayer | import torch
class BaseLayer(torch.nn.Module):
def __repr__(self):
return self.__class__.__name__ + '()'
class MeanPoolingLayer(BaseLayer):
def __init__(self):
super(MeanPoolingLayer, self).__init__()
def forward(self, input, dim=2):
length = input.shape[2]
return torc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Otybrian/blogpost | MeanPoolingLayer | false | 2,708 | [
"MIT"
] | 0 | 518599019e11cd7ee11e01470c4d51dfb4583274 | https://github.com/Otybrian/blogpost/tree/518599019e11cd7ee11e01470c4d51dfb4583274 |
SomeQNet | import torch
import torch as t
import torch.nn as nn
class SomeQNet(nn.Module):
def __init__(self, state_dim, action_num):
super().__init__()
self.fc1 = nn.Linear(state_dim, 16)
self.fc2 = nn.Linear(16, 16)
self.fc3 = nn.Linear(16, action_num)
def forward(self, state):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | iffiX/machin | SomeQNet | false | 15,592 | [
"MIT"
] | 287 | 7fa986b1bafdefff117d6ff73d14644a5488de9d | https://github.com/iffiX/machin/tree/7fa986b1bafdefff117d6ff73d14644a5488de9d |
_Classifier | # 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 ... | mori97/revae | _Classifier | false | 4,031 | [
"MIT"
] | 0 | 465009076a9be78e8ddb9021a0699b32fc695f30 | https://github.com/mori97/revae/tree/465009076a9be78e8ddb9021a0699b32fc695f30 |
WeightedBCELoss | # 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, math as tl_math
import torc... | CarlosPena00/pytorch-unet | WeightedBCELoss | false | 219 | [
"MIT"
] | 0 | 8365bace23e4b04b9c5b75cd6720807ea8cac5ab | https://github.com/CarlosPena00/pytorch-unet/tree/8365bace23e4b04b9c5b75cd6720807ea8cac5ab |
L1Norm | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.init
class L1Norm(nn.Module):
def __init__(self):
super(L1Norm, self).__init__()
self.eps = 1e-10
def forward(self, x):
norm = to... | 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.nn.parallel
import torch.optim
import ... | oskyhn/CNNs-Without-Borders | L1Norm | false | 16,207 | [
"BSD-3-Clause"
] | 74 | 4fae1d8fd64c3c917f5c78c3513a60572af961b1 | https://github.com/oskyhn/CNNs-Without-Borders/tree/4fae1d8fd64c3c917f5c78c3513a60572af961b1 |
FeatureEncoder | import torch
import torch.nn as nn
class ResBlock(nn.Module):
def __init__(self, in_ch, hid_ch):
super(ResBlock, self).__init__()
self.act = nn.ReLU()
self.conv1 = nn.Conv2d(in_ch, hid_ch, kernel_size=3, padding=1)
self.conv2 = nn.Conv2d(hid_ch, hid_ch, kernel_size=3, padding=1)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | qbhan/pathembed | FeatureEncoder | false | 7,509 | [
"MIT"
] | 1 | c21823529840593bf606e10696f5879e5adb51b2 | https://github.com/qbhan/pathembed/tree/c21823529840593bf606e10696f5879e5adb51b2 |
AMSoftmaxLoss | # 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.... | B06901052/s3prl | AMSoftmaxLoss | false | 113 | [
"MIT"
] | 0 | 5f63d2df043d2d7c81580cd042fa2cea34746f48 | https://github.com/B06901052/s3prl/tree/5f63d2df043d2d7c81580cd042fa2cea34746f48 |
BertSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super(BertSe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | sermolin/amazon-sagemaker-examples | BertSelfAttention | false | 4,300 | [
"Apache-2.0"
] | 0 | 3e6083d1b53cb718893a04c46513a9482a17bd6b | https://github.com/sermolin/amazon-sagemaker-examples/tree/3e6083d1b53cb718893a04c46513a9482a17bd6b |
Fp32LayerNorm | # 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.utils.data
import torch.onnx.operators
impor... | AppleHolic/fairseq | Fp32LayerNorm | false | 13,319 | [
"MIT"
] | 429 | c5b32cb2bde59a7bb7987b22864731fe927523d4 | https://github.com/AppleHolic/fairseq/tree/c5b32cb2bde59a7bb7987b22864731fe927523d4 |
AdaptiveConcatPool2d | # 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 Optional
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | Erlemar/kekas | AdaptiveConcatPool2d | false | 2,205 | [
"MIT"
] | 0 | 6fd8413f15390bf079bdb57a38a7094a5c53ab0f | https://github.com/Erlemar/kekas/tree/6fd8413f15390bf079bdb57a38a7094a5c53ab0f |
L0Loss | # 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... | martius-lab/CombOptNet | L0Loss | false | 16,016 | [
"MIT"
] | 46 | d563d31a95dce35a365d50b81f932c27531ae09b | https://github.com/martius-lab/CombOptNet/tree/d563d31a95dce35a365d50b81f932c27531ae09b |
Actor | # 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.... | FranckNdame/drlkit | Actor | false | 8,137 | [
"MIT"
] | 33 | 698f3c182036cc5eed68f2a05b53a3e3670146bf | https://github.com/FranckNdame/drlkit/tree/698f3c182036cc5eed68f2a05b53a3e3670146bf |
TSA_Fusion | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class TSA_Fusion(nn.Module):
""" Temporal Spatial Attention fusion module
Temporal: correlation;
Spatial: 3 pyramid levels.
"""
def __init__(self, nf=64, nframes=5, center=2):
super(TSA_Fusion, 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
import torch.utils.data
impor... | WenlongZhang0724/mmsr | TSA_Fusion | false | 12,004 | [
"Apache-2.0"
] | 0 | 375ce9207c2b8586101406577faea285885b8009 | https://github.com/WenlongZhang0724/mmsr/tree/375ce9207c2b8586101406577faea285885b8009 |
VAE | # 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
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | Arjuna197/examples | VAE | false | 11,381 | [
"BSD-3-Clause"
] | 0 | f504ea2aafc8a8baa5effb659fc1c20a70aabdda | https://github.com/Arjuna197/examples/tree/f504ea2aafc8a8baa5effb659fc1c20a70aabdda |
Swish | # 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
@triton.jit
def triton_poi_fused_mul_sigmoid_0(in_pt... | absallh/A_yolov3 | Swish | false | 18,206 | [
"Apache-2.0"
] | 6 | 550ec41de42b8efe638e887c51a568189947e049 | https://github.com/absallh/A_yolov3/tree/550ec41de42b8efe638e887c51a568189947e049 |
Lambda3 | # 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 typing import Tuple
from torch import nn
from abc import ABC
from abc impo... | apoorvumang/Temporal_KGQA | Lambda3 | false | 14,885 | [
"MIT"
] | 49 | 3e2a7c31865235ee2511a7ae0ea0701c12896327 | https://github.com/apoorvumang/Temporal_KGQA/tree/3e2a7c31865235ee2511a7ae0ea0701c12896327 |
FPNOutput | import torch
import torch.nn as nn
class ConvBNReLU(nn.Module):
def __init__(self, in_chan, out_chan, ks=1, stride=1, padding=0,
norm_layer=None, bias=True, *args, **kwargs):
super(ConvBNReLU, self).__init__()
self.conv = nn.Conv2d(in_chan, out_chan, kernel_size=ks, stride=
st... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Xlinford/TDNet | FPNOutput | false | 2,974 | [
"MIT"
] | 0 | e7cb59c40b8751b6dab9691d26ad224fd61c24d1 | https://github.com/Xlinford/TDNet/tree/e7cb59c40b8751b6dab9691d26ad224fd61c24d1 |
Tanh | # 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_... | dustlrdk/noise2self | Tanh | false | 3,442 | [
"MIT"
] | 0 | 46e8c4650f7ec4f664448417fecd39b4cae477f7 | https://github.com/dustlrdk/noise2self/tree/46e8c4650f7ec4f664448417fecd39b4cae477f7 |
Squash | import torch
from torch import nn
class Squash(nn.Module):
def __init__(self, num_C, num_D, eps=0.0001):
super(Squash, self).__init__()
self.num_C = num_C
self.num_D = num_D
self.eps = eps
def forward(self, x):
x_caps = x.view(x.shape[0], self.num_C, self.num_D, x.sha... | 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... | WdBlink/AugMix-3DOCUNet-Brats2019 | Squash | false | 5,963 | [
"MIT"
] | 1 | 125c6c8682b51a550eeac9173d13d0a211576abc | https://github.com/WdBlink/AugMix-3DOCUNet-Brats2019/tree/125c6c8682b51a550eeac9173d13d0a211576abc |
_nms | import torch
import torch.utils.data
import torch
import torch.nn as nn
class _nms(nn.Module):
def __init__(self):
super(_nms, self).__init__()
kernel = 3
pad = (kernel - 1) // 2
self.maxpool = nn.MaxPool2d(kernel_size=kernel, stride=1, padding=pad)
def forward(self, heat):
... | 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.utils.data
import torch
import torch.nn as nn
assert_size_stride = torch._C.... | donnyyou/centerX | _nms | false | 15,204 | [
"Apache-2.0"
] | 350 | 6e381cb669a6014d02e31a43915271237690531c | https://github.com/donnyyou/centerX/tree/6e381cb669a6014d02e31a43915271237690531c |
PrimaryCapsules | # 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 ... | ashawkey/CapsNet.pytorch | PrimaryCapsules | false | 6,235 | [
"MIT"
] | 1 | 3b796b572bbabe79cc445c35913cd3584733aedf | https://github.com/ashawkey/CapsNet.pytorch/tree/3b796b572bbabe79cc445c35913cd3584733aedf |
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.... | cpmolnar/gMLP-Disaster-Tweets | Attention | false | 9,914 | [
"MIT"
] | 0 | 7b13651c2260bc112d706a99466c069fb9348205 | https://github.com/cpmolnar/gMLP-Disaster-Tweets/tree/7b13651c2260bc112d706a99466c069fb9348205 |
Conv2dTime | import torch
import torch.utils.data
import torch.nn as nn
class Conv2dTime(nn.Conv2d):
"""
Implements time dependent 2d convolutions, by appending the time variable as
an extra channel.
"""
def __init__(self, in_channels, *args, **kwargs):
super(Conv2dTime, self).__init__(in_channels + 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
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dyn... | TevenLeScao/BasicSR | Conv2dTime | false | 18,004 | [
"Apache-2.0"
] | 4 | 1a7bd8754de00f3a9c9f2031acfc447350459ea0 | https://github.com/TevenLeScao/BasicSR/tree/1a7bd8754de00f3a9c9f2031acfc447350459ea0 |
Q | import torch
import torch.nn as nn
import torch.nn.functional as F
class Q(nn.Module):
def __init__(self, state_dim, action_dim, hidden):
super(Q, self).__init__()
self.fc1 = nn.Linear(state_dim + action_dim, hidden)
self.fc2 = nn.Linear(hidden, hidden)
self.fc3 = nn.Linear(hidden... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | crislmfroes/Parallel-Manipulation-DRL | Q | false | 1,742 | [
"MIT"
] | 0 | b63bd17b933feb5d2844f1db596cd4126380244b | https://github.com/crislmfroes/Parallel-Manipulation-DRL/tree/b63bd17b933feb5d2844f1db596cd4126380244b |
PostGCN | import math
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
class GraphConvolution(nn.Module):
"""
adapted from : https://github.com/tkipf/gcn/blob/92600c39797c2bfb61a508e52b88fb554df30177/gcn/layers.py#L132
"""
def __init__(self, in_features, out_features, bias=True, node... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
from torch.nn.parameter import Parameter
asser... | Droliven/MSRGCN | PostGCN | false | 8,018 | [
"MIT"
] | 28 | 5d8d8e3365d3b23ca2ac734ace7e84135a6e3a9e | https://github.com/Droliven/MSRGCN/tree/5d8d8e3365d3b23ca2ac734ace7e84135a6e3a9e |
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | ydai94/TextWorld-Coin-Collector | LayerNorm | false | 4,627 | [
"MIT"
] | 0 | 71d5c535b1ab60636d941fba9061e4066772bc40 | https://github.com/ydai94/TextWorld-Coin-Collector/tree/71d5c535b1ab60636d941fba9061e4066772bc40 |
ResNetBlockGroupNorm | import torch
import torch.nn as nn
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class ResNetBlockGroupNorm(nn.Module):
def __init__(self, inplanes, planes, num_groups... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | wp03052/wolf | ResNetBlockGroupNorm | false | 13,193 | [
"Apache-2.0"
] | 0 | 49a582cafb829a2642db360c7d94c21439247ec7 | https://github.com/wp03052/wolf/tree/49a582cafb829a2642db360c7d94c21439247ec7 |
DepthGTLoss | import torch
import numpy as np
class DepthGTLoss(torch.nn.Module):
"""
A simple L1 loss, but restricted to the cropped center of the image.
It also does not count pixels outside of a given range of values (in target).
Additionally, there is also an L1 loss on the gradient.
"""
def __init__(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
from torch._inductor.runtime.... | simon-donne/defusr | DepthGTLoss | false | 16,469 | [
"MIT"
] | 65 | fa4275070af4024eea128e99d7c6df2358d129a5 | https://github.com/simon-donne/defusr/tree/fa4275070af4024eea128e99d7c6df2358d129a5 |
GraphLinear | # 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... | GentleDell/DEBOR | GraphLinear | false | 17,295 | [
"BSD-3-Clause"
] | 4 | cd566f173599fe7419e7baf312f63830c28d5de2 | https://github.com/GentleDell/DEBOR/tree/cd566f173599fe7419e7baf312f63830c28d5de2 |
TinyConvNet2d | import torch
class TinyConvNet2d(torch.nn.Module):
def __init__(self, in_channels=1, out_channels=1):
super().__init__()
self.conv1 = torch.nn.Conv2d(in_channels, 16, 1)
self.nlin1 = torch.nn.ReLU()
self.conv2 = torch.nn.Conv2d(16, 64, 1)
self.nlin2 = torch.nn.ReLU()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | Tomaz-Vieira/tiktorch | TinyConvNet2d | false | 18,016 | [
"MIT"
] | 8 | 2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 | https://github.com/Tomaz-Vieira/tiktorch/tree/2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 |
ConvNet | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.conv1 = nn.Conv2d(1, 3, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Fanxingye/AutoDL | ConvNet | false | 5,155 | [
"Apache-2.0"
] | 1 | 6f409aefc8b81e5fe47df57b82332c8df427875d | https://github.com/Fanxingye/AutoDL/tree/6f409aefc8b81e5fe47df57b82332c8df427875d |
IBLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class EntropyLoss(nn.Module):
def __init__(self):
super(EntropyLoss, self).__init__()
def forward(self, x):
out = F.softmax(x, dim=1) * F.log_softmax(x, dim=1)
out = -1.0 * out.sum(dim=1)
return out.mean()
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | NYCU-MLLab/Strategic-Optimization-for-Worst-case-Augmentation | IBLoss | false | 17,743 | [
"MIT"
] | 3 | fd0feab42151c0bae60712480301ea26f627a81d | https://github.com/NYCU-MLLab/Strategic-Optimization-for-Worst-case-Augmentation/tree/fd0feab42151c0bae60712480301ea26f627a81d |
Tan | # 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.onnx
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | mil-tokyo/webdnn | Tan | false | 16,089 | [
"MIT"
] | 1,967 | 38a60fd3e1a4e72bc01108189a3aa51e0752aecd | https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd |
TrajectoryPredictor | import torch
import torch.nn as nn
class TrajectoryPredictor(nn.Module):
def __init__(self, pose_size, trajectory_size, hidden_size):
super(TrajectoryPredictor, self).__init__()
self.lp = nn.Linear(hidden_size, pose_size)
self.fc = nn.Linear(pose_size + hidden_size, trajectory_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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | CMU-MultiComp-Lab/language2pose | TrajectoryPredictor | false | 4,931 | [
"MIT"
] | 1 | b32199ae5b2b80087411504afef384e0fa689d04 | https://github.com/CMU-MultiComp-Lab/language2pose/tree/b32199ae5b2b80087411504afef384e0fa689d04 |
BertSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
class BertSelfAttention(nn.Module):
def __init__(self, config):
super(BertSelfAttention, self).__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise ValueError(
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Georgetown-IR-Lab/OpenNIR | BertSelfAttention | false | 15,606 | [
"MIT"
] | 140 | 7d93e8643fe311e3e9c7a0678efe9775fd80485e | https://github.com/Georgetown-IR-Lab/OpenNIR/tree/7d93e8643fe311e3e9c7a0678efe9775fd80485e |
TripletLoss | import torch
from torch import nn
from torch.nn.modules.distance import PairwiseDistance
class TripletLoss(nn.Module):
def __init__(self, margin=5.0):
super(TripletLoss, self).__init__()
self.margin = margin
self.pdist = PairwiseDistance(2)
def forward(self, anchor, negative, positiv... | 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... | shuuchen/siamese_network | TripletLoss | false | 4,328 | [
"Apache-2.0"
] | 0 | 54a952d320800c6bb5618cb40386e4c25bdde6fb | https://github.com/shuuchen/siamese_network/tree/54a952d320800c6bb5618cb40386e4c25bdde6fb |
QNetwork | # 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... | SINGROUP/Atom_manipulation_with_RL | QNetwork | false | 2,810 | [
"MIT"
] | 0 | 428e05459ed395f1a5fc00a7c65a9b0c26210ee8 | https://github.com/SINGROUP/Atom_manipulation_with_RL/tree/428e05459ed395f1a5fc00a7c65a9b0c26210ee8 |
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.triton_helpers import libdevice
import torch.nn as ... | alipay/Pyraformer | PositionwiseFeedForward | false | 18,273 | [
"Apache-2.0"
] | 7 | 84af4dbd93b7b96975b5034f0dde412005260123 | https://github.com/alipay/Pyraformer/tree/84af4dbd93b7b96975b5034f0dde412005260123 |
LNN | # 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.... | JazonJiao/pytorch-fm | LNN | false | 13,879 | [
"MIT"
] | 734 | 7192e7861fa54341d5b2df995f92858f583ea09e | https://github.com/JazonJiao/pytorch-fm/tree/7192e7861fa54341d5b2df995f92858f583ea09e |
RMulInt | # 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | RMulInt | false | 1,605 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
DQNMLPBase | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def init(module, weight_init, bias_init, gain=1):
weight_init(module.weight.data, gain=gain)
bias_init(module.bias.data)
return module
def init_normc_(weight, gain=1):
weight.normal_(0, 1)
weight *= gain / torch.sqr... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | KMarino/hrl-ep3 | DQNMLPBase | false | 8,791 | [
"MIT"
] | 17 | f1ad0c936d271955f4899a3a830023e1a2cffda3 | https://github.com/KMarino/hrl-ep3/tree/f1ad0c936d271955f4899a3a830023e1a2cffda3 |
Discriminator | import math
import torch
import torch.nn as nn
import torch.utils.data
from collections import *
class Discriminator(nn.Module):
def __init__(self, n_hidden):
super(Discriminator, self).__init__()
self.weight = nn.Parameter(torch.Tensor(n_hidden, n_hidden))
self.reset_parameters()
de... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
import torch.utils.data
from collections impor... | pgplus1628/dgl | Discriminator | false | 7,453 | [
"Apache-2.0"
] | 1 | bf3994eea68b5841349f1616f41d0f70123a11ec | https://github.com/pgplus1628/dgl/tree/bf3994eea68b5841349f1616f41d0f70123a11ec |
FastGRNNCell | import torch
import torch.nn as nn
import torch.onnx
from itertools import product as product
def gen_nonlinearity(A, nonlinearity):
"""
Returns required activation for a tensor based on the inputs
nonlinearity is either a callable or a value in
['tanh', 'sigmoid', 'relu', 'quantTanh', 'quantSigm... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Shenzhen-Cloudatawalk-Technology-Co-Ltd/EdgeML | FastGRNNCell | false | 14,416 | [
"MIT"
] | 719 | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | https://github.com/Shenzhen-Cloudatawalk-Technology-Co-Ltd/EdgeML/tree/ef9f8a77f096acbdeb941014791f8eda1c1bc35b |
PriorDiscriminator | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class PriorDiscriminator(nn.Module):
def __init__(self, input_dim):
super().__init__()
self.l0 = nn.Linear(input_dim, input_dim)
self.l1 = nn.Linear(input_dim, input_dim)
self.l2 = 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
import torch.utils.data
impor... | XrosLiang/GraphCL | PriorDiscriminator | false | 6,000 | [
"MIT"
] | 1 | fdf9fabcdaddbc17e5c8b7ac9e9d2bdfe4acc56c | https://github.com/XrosLiang/GraphCL/tree/fdf9fabcdaddbc17e5c8b7ac9e9d2bdfe4acc56c |
InteractingLayer | import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import *
class InteractingLayer(nn.Module):
"""A Layer used in AutoInt that model the correlations between different feature fields by multi-head self-attention mechanism.
Input shape
- A 3D tensor with shape... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Ulian7/DeepCTR | InteractingLayer | false | 1,198 | [
"Apache-2.0"
] | 0 | d8f519a722a4d6a4f1fe18e04af54cfd1369c9a5 | https://github.com/Ulian7/DeepCTR/tree/d8f519a722a4d6a4f1fe18e04af54cfd1369c9a5 |
TripletLoss | import torch
from torch.nn.modules.distance import PairwiseDistance
class TripletLoss(torch.nn.Module):
def __init__(self, margin):
super(TripletLoss, self).__init__()
self.margin = margin
self.pdist = PairwiseDistance(2)
def forward(self, anchor, positive, negative):
pos_dis... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn.modules.distan... | tbmoon/facenet | TripletLoss | false | 16,536 | [
"MIT"
] | 231 | b3aec1a930f22a5a9597efa7072373c0ff93663f | https://github.com/tbmoon/facenet/tree/b3aec1a930f22a5a9597efa7072373c0ff93663f |
SE_layer_3d | # 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 ... | vinbigdata-medical/abdomen-phases | SE_layer_3d | false | 4,495 | [
"MIT"
] | 0 | 4adf5b8bf13aec85247d74e3cd3789c52cb88b92 | https://github.com/vinbigdata-medical/abdomen-phases/tree/4adf5b8bf13aec85247d74e3cd3789c52cb88b92 |
FeedForward | import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class FeedForward(nn.Module):
"""
### Position-wise Feed Forward Layer $ ext{F\\small{FW}}$
This consists of two linear layers and an activation in the middle.
"""
def __init__(self, d_mode... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | mcx/annotated_deep_learning_paper_implementations | FeedForward | false | 7,208 | [
"MIT"
] | 1 | f169f3a71dd2d36eb28ad31062d3475efa367b88 | https://github.com/mcx/annotated_deep_learning_paper_implementations/tree/f169f3a71dd2d36eb28ad31062d3475efa367b88 |
SA_Module | import torch
import torch.nn as nn
class SA_Module(nn.Module):
""" Self attention Layer"""
def __init__(self, in_dim, activation):
super(SA_Module, self).__init__()
self.chanel_in = in_dim
self.activation = activation
self.query_conv = nn.Conv2d(in_channels=in_dim, out_channel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | KonarkPaul/COVID_Adv_attack_vulnerability_study | SA_Module | false | 5,455 | [
"MIT"
] | 1 | f0d1256d0d57a933dd86ccd5fe12d83f9f79ca9c | https://github.com/KonarkPaul/COVID_Adv_attack_vulnerability_study/tree/f0d1256d0d57a933dd86ccd5fe12d83f9f79ca9c |
LeNetPP | import torch
import torch.nn as nn
import torch.nn.functional as F
class LeNetPP(nn.Module):
def __init__(self, dim_hidden=2, num_classes=10):
super(LeNetPP, self).__init__()
self.num_classes = num_classes
self.conv1_1 = nn.Conv2d(1, 32, kernel_size=5, padding=2)
self.prelu1_1 = 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.... | lyakaap/image-feature-learning-pytorch | LeNetPP | false | 16,004 | [
"MIT"
] | 55 | 241ed10d4312fedfb23015f6a50cdca8f2b0ad9e | https://github.com/lyakaap/image-feature-learning-pytorch/tree/241ed10d4312fedfb23015f6a50cdca8f2b0ad9e |
ActionScoring | import torch
import torch.nn as nn
class ActionScoring(nn.Module):
""" Linearly mapping h and v to the same dimension,
and do a elementwise multiplication and a linear scoring. """
def __init__(self, action_size, hidden_size, dot_size: 'int'=256):
super(ActionScoring, 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | IMNearth/Curriculum-Learning-For-VLN | ActionScoring | false | 17,475 | [
"MIT"
] | 8 | d2fe1286eb295dc8c63a0c886b35883f32481d85 | https://github.com/IMNearth/Curriculum-Learning-For-VLN/tree/d2fe1286eb295dc8c63a0c886b35883f32481d85 |
SimpleFloorModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleFloorModule(torch.nn.Module):
def forward(self, a, b):
c = a + b
return torch.floor(c)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | YaronBenAtar/glow | SimpleFloorModule | false | 14,661 | [
"Apache-2.0"
] | 2,838 | a13706a4239fa7eaf059c670dc573e3eb0768f86 | https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86 |
Normalize | # 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.utils.data
import torch
import torch.nn as nn
assert_size_stride =... | bomtorazek/contrastive-unpaired-translation | Normalize | false | 12,185 | [
"BSD-3-Clause"
] | 0 | 07c048038375e1b9a4e464154b8dbc49f5e16ede | https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede |
FCLateActionSAQFunction | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from abc import ABCMeta
from abc import abstractmethod
def init_lecun_normal(tensor, scale=1.0):
"""Initializes the tensor with LeCunNormal."""
fan_in = torch.nn.init._calculate_correct_fan(tensor, 'fan_in')
std = scale ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 numpy as np
import tor... | imatge-upc/pixelcoordEDL | FCLateActionSAQFunction | false | 6,871 | [
"MIT"
] | 1 | 353632feed6ac8c93758c1a2a1b7a477e7ff053c | https://github.com/imatge-upc/pixelcoordEDL/tree/353632feed6ac8c93758c1a2a1b7a477e7ff053c |
Dunet_2levels | import torch
import torch.nn as nn
class Unet_2levels(nn.Module):
def __init__(self):
super().__init__()
self.relu = nn.ReLU()
self.sigmoid = nn.Sigmoid()
self.upsample = nn.Upsample(scale_factor=2, mode='bilinear',
align_corners=True)
self.maxpool = nn.MaxPool... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | MuhammadIbrahim0/dvae-refiner | Dunet_2levels | false | 9,369 | [
"MIT"
] | 0 | 034241ce6a5aeb19e9f8952ee996b56412a1f95a | https://github.com/MuhammadIbrahim0/dvae-refiner/tree/034241ce6a5aeb19e9f8952ee996b56412a1f95a |
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._inductor.runtime.... | generall/Torchlite | Net | false | 6,752 | [
"MIT"
] | 1 | 2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a | https://github.com/generall/Torchlite/tree/2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a |
TransformerEncoderLayerWithConv1d | import torch
import torch.nn as nn
import torch.nn.functional as F
class TransformerEncoderLayerWithConv1d(nn.Module):
"""
Input and output shape: seqlen x batch_size x dim
"""
def __init__(self, dim_model, nheads, dim_feedforward, dropout,
kernel_size, stride):
super(TransformerEnc... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | bliunlpr/pykaldi2 | TransformerEncoderLayerWithConv1d | false | 1,617 | [
"MIT"
] | 0 | f6020b5dd9900f97ab69c97442a91196a03dd93b | https://github.com/bliunlpr/pykaldi2/tree/f6020b5dd9900f97ab69c97442a91196a03dd93b |
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.... | neo-pan/attention-learn-to-route | MultiHeadAttention | false | 10,592 | [
"MIT"
] | 0 | bb094d6e96276719ab2e379f279c614df7d822f9 | https://github.com/neo-pan/attention-learn-to-route/tree/bb094d6e96276719ab2e379f279c614df7d822f9 |
CorrelationVolume | import torch
import torch.nn as nn
import torch.nn
class CorrelationVolume(nn.Module):
"""
Implementation by Ignacio Rocco
paper: https://arxiv.org/abs/1703.05593
project: https://github.com/ignacio-rocco/cnngeometric_pytorch
"""
def __init__(self):
super(CorrelationVolume, self).__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.nn
assert_size_stride = torch._C._dynamo.guar... | JiwonCocoder/-Joint-Learning-of-Feature-Extraction-and-Cost-Aggregation-for-Semantic-Matching | CorrelationVolume | false | 5,407 | [
"MIT"
] | 1 | b79e0e20fd5a1a9ddc0ffa9d7a92e0ebd21018b9 | https://github.com/JiwonCocoder/-Joint-Learning-of-Feature-Extraction-and-Cost-Aggregation-for-Semantic-Matching/tree/b79e0e20fd5a1a9ddc0ffa9d7a92e0ebd21018b9 |
Foo | # 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.parallel
import torch.utils.data
import torch.onnx
import torch.fx
import torch.optim
import torch.utils.data.distributed
as... | goytoom/examples | Foo | false | 12,460 | [
"BSD-3-Clause"
] | 0 | 50b2a74dba897a1a98c8276043a3f5c6910c453a | https://github.com/goytoom/examples/tree/50b2a74dba897a1a98c8276043a3f5c6910c453a |
StatsPool | import torch
import warnings
import torch.nn as nn
from typing import Optional
import torch.optim
import torch.nn.functional as F
class StatsPool(nn.Module):
"""Statistics pooling
Compute temporal mean and (unbiased) standard deviation
and returns their concatenation.
Reference
---------
htt... | 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.optim
assert_size_stride = torch._C._dynamo.... | suissemaxx/pyannote-audio-develop_colab | StatsPool | false | 4,386 | [
"MIT"
] | 0 | e9499372a1771c21e1604424a6dd041337111093 | https://github.com/suissemaxx/pyannote-audio-develop_colab/tree/e9499372a1771c21e1604424a6dd041337111093 |
AttentionUnit | # 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.... | DimplesL/aster.pytorch | AttentionUnit | false | 11,363 | [
"MIT"
] | 0 | c28f3438e0e398958fa54a804db83c819fb3d9b3 | https://github.com/DimplesL/aster.pytorch/tree/c28f3438e0e398958fa54a804db83c819fb3d9b3 |
Square | # 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... | carlzhangweiwen/gazelle_mpc | Square | false | 15,002 | [
"MIT"
] | 50 | 45818ccf6375100a8fe2680f44f37d713380aa5c | https://github.com/carlzhangweiwen/gazelle_mpc/tree/45818ccf6375100a8fe2680f44f37d713380aa5c |
Hswish | # 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
import torch.utils.data
import torch.nn.parallel
import torch.optim... | AlbertiPot/once-for-all | Hswish | false | 8,947 | [
"MIT"
] | 0 | 092b9e6184be353383396761ea5ec61d67152645 | https://github.com/AlbertiPot/once-for-all/tree/092b9e6184be353383396761ea5ec61d67152645 |
Encoder | import torch
import torch.nn as nn
class Encoder(nn.Module):
def __init__(self, input_dim, hidden_dim, latent_dim):
super(Encoder, self).__init__()
self.FC_input = nn.Linear(input_dim, hidden_dim)
self.FC_mean = nn.Linear(hidden_dim, latent_dim)
self.FC_var = nn.Linear(hidden_dim,... | 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 import triton_helpers
from... | TeoAndB/dtu_mlops | Encoder | false | 2,889 | [
"Apache-2.0"
] | 0 | 671d8922298554659fd9697f0ebca7e8bfa0e8c2 | https://github.com/TeoAndB/dtu_mlops/tree/671d8922298554659fd9697f0ebca7e8bfa0e8c2 |
SelfAttention | import torch
import torch.nn as nn
class SelfAttention(nn.Module):
def __init__(self, *args, **kargs):
super().__init__()
self.attention = nn.MultiheadAttention(*args, **kargs)
def forward(self, x):
return self.attention(x, x, x)[0]
def get_inputs():
return [torch.rand([4, 4])]... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | eitin-infant/FinRL-Meta | SelfAttention | false | 15,295 | [
"MIT"
] | 214 | 4c94011e58425796e7e2e5c1bf848afd65c828d6 | https://github.com/eitin-infant/FinRL-Meta/tree/4c94011e58425796e7e2e5c1bf848afd65c828d6 |
RewardCriterion | import torch
import torch.nn as nn
from torch.autograd import *
def to_contiguous(tensor):
if tensor.is_contiguous():
return tensor
else:
return tensor.contiguous()
class RewardCriterion(nn.Module):
def __init__(self):
super(RewardCriterion, self).__init__()
def forward(sel... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torch.autograd import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | anonymous2021hello/transformer-cil | RewardCriterion | false | 3,114 | [
"MIT"
] | 0 | aed4017b61afaf4d9d21d40a078eefb4c7031cd1 | https://github.com/anonymous2021hello/transformer-cil/tree/aed4017b61afaf4d9d21d40a078eefb4c7031cd1 |
Conv_Block | import torch
from torchvision.transforms import *
import torch.nn as nn
class Conv_Block(nn.Module):
def __init__(self):
super(Conv_Block, self).__init__()
self.conv = nn.Conv2d(in_channels=64, out_channels=64, kernel_size=
3, stride=1, padding=1, bias=False)
nn.init.xavier_un... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 torchvision.transforms i... | FYLSunghwan/VDSR-pytorch | Conv_Block | false | 2,671 | [
"MIT"
] | 0 | fb862e97756078db2d5def095d46cc22a07cd014 | https://github.com/FYLSunghwan/VDSR-pytorch/tree/fb862e97756078db2d5def095d46cc22a07cd014 |
SpatialTemporalConv3D | # 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... | Tencent/DVQA | SpatialTemporalConv3D | false | 14,489 | [
"BSD-3-Clause"
] | 408 | 21727333a6b41d54ad1a8beca1fcbe00a69ed347 | https://github.com/Tencent/DVQA/tree/21727333a6b41d54ad1a8beca1fcbe00a69ed347 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.