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 |
|---|---|---|---|---|---|---|---|---|---|---|
TransformerDecoderLayer | # 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.... | OneDirection9/Persona-Dialogue-Generation | TransformerDecoderLayer | false | 11,791 | [
"MIT"
] | 0 | 9696659efe668177bb775dc4192b4b6dd41a9ce1 | https://github.com/OneDirection9/Persona-Dialogue-Generation/tree/9696659efe668177bb775dc4192b4b6dd41a9ce1 |
StdLoss | # 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
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | GuYuanjie/DeepFusionPrior | StdLoss | false | 5,246 | [
"MIT"
] | 1 | a7126e073ed8c49b6a9a662492b64aaeee56cc01 | https://github.com/GuYuanjie/DeepFusionPrior/tree/a7126e073ed8c49b6a9a662492b64aaeee56cc01 |
duelingdqnNet | # 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 ... | ChangQingAAS/Deep-Reinforcement-Learning | duelingdqnNet | false | 251 | [
"MIT"
] | 0 | 3bc1381c632b1730a48e63e972aea62086c4287c | https://github.com/ChangQingAAS/Deep-Reinforcement-Learning/tree/3bc1381c632b1730a48e63e972aea62086c4287c |
ConstantODE | import torch
class ConstantODE(torch.nn.Module):
def __init__(self, device):
super(ConstantODE, self).__init__()
self.a = torch.nn.Parameter(torch.tensor(0.2))
self.b = torch.nn.Parameter(torch.tensor(3.0))
def forward(self, t, y):
return self.a + (y - (self.a * t + self.b)) ... | 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... | BoyanJIANG/4D-Compositional-Representation | ConstantODE | false | 7,826 | [
"Apache-2.0"
] | 12 | 64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c | https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c |
DoubleSwish | import torch
from torch import Tensor
class DoubleSwishFunction(torch.autograd.Function):
"""
double_swish(x) = x * torch.sigmoid(x-1)
This is a definition, originally motivated by its close numerical
similarity to swish(swish(x)), where swish(x) = x * sigmoid(x).
Memory-efficient derivative 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 import Tensor
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty... | glynpu/icefall | DoubleSwish | false | 3,546 | [
"Apache-2.0"
] | 0 | d766dc5aeea1a8aefab033e581948b07c4ac4bc0 | https://github.com/glynpu/icefall/tree/d766dc5aeea1a8aefab033e581948b07c4ac4bc0 |
MultiheadAttentionWrapper | # 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
import torch.nn.functional as F
from torch.nn.utils import weight_norm
from torch.optim.lr_scheduler import *
import t... | brightgems/BartWithRL | MultiheadAttentionWrapper | false | 6,368 | [
"MIT"
] | 1 | 17614c4009ec976cdc73dacaf94573a6d8f6d529 | https://github.com/brightgems/BartWithRL/tree/17614c4009ec976cdc73dacaf94573a6d8f6d529 |
Highway | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C... | aflorithmic/DurIAN | Highway | false | 14,753 | [
"BSD-3-Clause"
] | 158 | a708e9c5bb89895ddf08ca1a13bc8fd683b1e23f | https://github.com/aflorithmic/DurIAN/tree/a708e9c5bb89895ddf08ca1a13bc8fd683b1e23f |
SeqAttnMatch | import torch
import torch.nn as nn
import torch.nn.functional as F
class SeqAttnMatch(nn.Module):
"""
Given sequences X and Y, match sequence Y to each element in X.
* o_i = sum(alpha_j * y_j) for i in X
* alpha_j = softmax(y_j * x_i)
"""
def __init__(self, embed_dim, identity=False):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | srlee-ai/claf | SeqAttnMatch | false | 10,895 | [
"MIT"
] | 0 | 89b3e5c5ec0486886876ea3bac381508c6a6bf58 | https://github.com/srlee-ai/claf/tree/89b3e5c5ec0486886876ea3bac381508c6a6bf58 |
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.... | YacobBY/ICDAR2019-ArT-Recognition-Alchemy | AttentionUnit | false | 14,625 | [
"MIT"
] | 209 | 911c572c2aff4599a74b7974d46ef4cfb17078b9 | https://github.com/YacobBY/ICDAR2019-ArT-Recognition-Alchemy/tree/911c572c2aff4599a74b7974d46ef4cfb17078b9 |
DiagonalQuantizer | # 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 nump... | JeremieMelo/pytorch-onn | DiagonalQuantizer | false | 8,328 | [
"MIT"
] | 16 | 670996112277a6c19c7da400afbe0a4ce45ad5de | https://github.com/JeremieMelo/pytorch-onn/tree/670996112277a6c19c7da400afbe0a4ce45ad5de |
GCN | import torch
import torch.nn.functional as F
import torch.autograd
import torch.nn as nn
class GraphConv(nn.Module):
def __init__(self, in_features, out_features, bias=False):
super(GraphConv, self).__init__()
self.in_features = in_features
self.out_features = out_features
self.W ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | SsGood/MMGL | GCN | false | 17,975 | [
"MIT"
] | 6 | ea769e46fffb42559e764e2912c5b1dc17c10af2 | https://github.com/SsGood/MMGL/tree/ea769e46fffb42559e764e2912c5b1dc17c10af2 |
ConcatConv1d | import torch
import torch.nn as nn
class ConcatConv1d(nn.Module):
"""
1d convolution concatenated with time for usage in ODENet.
"""
def __init__(self, dim_in, dim_out, kernel_size=3, stride=1, padding=0,
bias=True, transpose=False):
super(ConcatConv1d, self).__init__()
module... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | puneat/SS-using-NODE | ConcatConv1d | false | 4,147 | [
"MIT"
] | 0 | 29f053769420a2d1cab1ad45f59a912c2ac737da | https://github.com/puneat/SS-using-NODE/tree/29f053769420a2d1cab1ad45f59a912c2ac737da |
UpsampleConvLayer | import torch
class UpsampleConvLayer(torch.nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride,
upsample=None):
super().__init__()
self.upsample = upsample
reflectpad = kernel_size // 2
self.reflectionpad = torch.nn.ReflectionPad2d(reflectpad)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | bruchano/ImageStyler | UpsampleConvLayer | false | 9,919 | [
"MIT"
] | 0 | 7bde13bc954566088c477065adb5c4e4214c28bb | https://github.com/bruchano/ImageStyler/tree/7bde13bc954566088c477065adb5c4e4214c28bb |
SigmoidCrossEntropyLoss | # 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
from torch ... | jimthompson5802/ludwig | SigmoidCrossEntropyLoss | false | 3,865 | [
"Apache-2.0"
] | 0 | 8a369328a3f839d9cdb3710be315952c7891d7c0 | https://github.com/jimthompson5802/ludwig/tree/8a369328a3f839d9cdb3710be315952c7891d7c0 |
LearnedPositionalEmbedding | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._... | awslabs/gap-text2sql | LearnedPositionalEmbedding | false | 14,935 | [
"Apache-2.0"
] | 75 | 83af3f08a6c108f7cbacb8125e2a7ec9255c81b0 | https://github.com/awslabs/gap-text2sql/tree/83af3f08a6c108f7cbacb8125e2a7ec9255c81b0 |
TripletLoss | # 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... | kmi-robots/object_reasoner | TripletLoss | false | 3,836 | [
"Apache-2.0"
] | 0 | 2d45bdb3ee745e0d866a152e8d81cbb375fa2985 | https://github.com/kmi-robots/object_reasoner/tree/2d45bdb3ee745e0d866a152e8d81cbb375fa2985 |
ConvertTCHWtoCTHW | import torch
import torch.utils.data
class ConvertTCHWtoCTHW(torch.nn.Module):
"""
Convert a torch.FloatTensor of shape (TIME x CHANNELS x HEIGHT x WIDTH) to
a torch.FloatTensor of shape (CHANNELS x TIME x HEIGHT x WIDTH).
"""
def forward(self, tensor):
return tensor.permute(1, 0, 2, 3).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.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_... | XianyuanLiu/Transfer-Learning-Library | ConvertTCHWtoCTHW | false | 10,126 | [
"MIT"
] | 0 | 25f83f32437032df88ca6101ecd1f63ec7a0aa2c | https://github.com/XianyuanLiu/Transfer-Learning-Library/tree/25f83f32437032df88ca6101ecd1f63ec7a0aa2c |
HorizontalMaxPool2d | # 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... | linkserendipity/AlignedReID | HorizontalMaxPool2d | false | 3,910 | [
"MIT"
] | 0 | 142a9ebdc200ef4da001f91c1f592e4ff02b2f77 | https://github.com/linkserendipity/AlignedReID/tree/142a9ebdc200ef4da001f91c1f592e4ff02b2f77 |
L2Norm | import torch
import torch.nn as nn
class L2Norm(nn.Module):
def __init__(self):
super(L2Norm, self).__init__()
self.eps = 1e-10
def forward(self, x):
norm = torch.sqrt(torch.sum(x * x, dim=1) + self.eps)
x = x / norm.unsqueeze(-1).expand_as(x)
return x
def get_input... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | albutko/vlb | L2Norm | false | 6,153 | [
"BSD-2-Clause"
] | 1 | 437245c0991948eeb36a277937a7e67d389041e4 | https://github.com/albutko/vlb/tree/437245c0991948eeb36a277937a7e67d389041e4 |
SimpleSSM | import math
import torch
import torch.nn as nn
class MatrixMultiplication(nn.Module):
"""
batch operation supporting matrix multiplication layer
"""
def __init__(self, in_features: 'int', out_features: 'int'):
super(MatrixMultiplication, self).__init__()
self.in_features = in_feat... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | Junyoungpark/2021-lg-AI-camp | SimpleSSM | false | 17,521 | [
"MIT"
] | 4 | 3c0e5dd689e8e3dd61cc80243ad90cab951c06de | https://github.com/Junyoungpark/2021-lg-AI-camp/tree/3c0e5dd689e8e3dd61cc80243ad90cab951c06de |
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
import torch.nn as nn
assert_... | KarthikGanesan88/stonne | Net | false | 9,270 | [
"MIT"
] | 0 | f228ade67120b9dafac8ea99d201e269b2ad7099 | https://github.com/KarthikGanesan88/stonne/tree/f228ade67120b9dafac8ea99d201e269b2ad7099 |
TLU | # 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 import triton_helpers
from torch import nn
from torch.nn import Parameter
from torch.nn.parameter import Parame... | gmt710/fast-reid | TLU | false | 12,444 | [
"Apache-2.0"
] | 0 | 44a609280013eb6928f67c418c7212d67e40fb5d | https://github.com/gmt710/fast-reid/tree/44a609280013eb6928f67c418c7212d67e40fb5d |
MaxPoolStride1 | import torch
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.functional as F
import torch._utils
class MaxPoolStride1(nn.Module):
def __init__(self, kernel_size):
super(MaxPoolStride1, self).__init__()
self.kernel_size = kernel_size
self.p... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import ... | Minipeps/betapose | MaxPoolStride1 | false | 14,025 | [
"MIT"
] | 66 | 11f2cc4ca0711ac8ce8e5b72ce9eef583b179eaa | https://github.com/Minipeps/betapose/tree/11f2cc4ca0711ac8ce8e5b72ce9eef583b179eaa |
SEModule | import torch
import torch.nn as nn
import torch.nn.functional as F
class SEModule(nn.Module):
def __init__(self, planes, compress_rate):
super(SEModule, self).__init__()
self.conv1 = nn.Conv2d(planes, planes // compress_rate, kernel_size
=1, stride=1, bias=True)
self.conv2 = 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
import torch.nn as nn
assert_... | xuehaouwa/VGGFace2-pytorch | SEModule | false | 4,594 | [
"MIT"
] | 0 | c38e11f893e5bcc273a9b847530cd619019b636c | https://github.com/xuehaouwa/VGGFace2-pytorch/tree/c38e11f893e5bcc273a9b847530cd619019b636c |
NormedResidualLayer | from torch.nn import Module
import torch
from torch.nn import Dropout
from torch.nn import LayerNorm
from torch.nn import Linear
from torch.nn.functional import gelu
class NormedResidualLayer(Module):
def __init__(self, size, intermediate_size, dropout):
super(NormedResidualLayer, self).__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn impor... | yulonglin/bert | NormedResidualLayer | false | 13,168 | [
"MIT"
] | 0 | 7f992e88f109e4267b0e84f8398cab0561a67f4f | https://github.com/yulonglin/bert/tree/7f992e88f109e4267b0e84f8398cab0561a67f4f |
FocalLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
... | 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... | Chrisfsj2051/my_tools | FocalLoss | false | 8,916 | [
"MIT"
] | 0 | 67355a46df6290aa2fdc1e0266c61daacced3ba1 | https://github.com/Chrisfsj2051/my_tools/tree/67355a46df6290aa2fdc1e0266c61daacced3ba1 |
BasicModel6_MultiTensor | # 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... | YNNEKUW/captum | BasicModel6_MultiTensor | false | 11,991 | [
"BSD-3-Clause"
] | 0 | c8b5357b21f2ddf440e5f0ce25635977292aa5d1 | https://github.com/YNNEKUW/captum/tree/c8b5357b21f2ddf440e5f0ce25635977292aa5d1 |
Norm | import torch
import torch.fx
class Norm(torch.nn.Module):
def __init__(self):
super(Norm, self).__init__()
def forward(self, x):
return torch.norm(x, 2, None, False)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.fx
assert_size_... | NVIDIA/Torch-TensorRT | Norm | false | 14,083 | [
"BSD-3-Clause"
] | 430 | 1a22204fecec690bc3c2a318dab4f57b98c57f05 | https://github.com/NVIDIA/Torch-TensorRT/tree/1a22204fecec690bc3c2a318dab4f57b98c57f05 |
ClassBlock | import torch
import torch.nn as nn
import torch.nn.parallel
class Mlp(nn.Module):
"""Implementation of MLP"""
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | QLSong/cv-classify | ClassBlock | false | 2,751 | [
"Apache-2.0"
] | 0 | 02f53d03868f299a08b5c97a266b50a7fdcd3f2b | https://github.com/QLSong/cv-classify/tree/02f53d03868f299a08b5c97a266b50a7fdcd3f2b |
GeneratorLoss | # 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
from torch ... | akanametov/pathgan | GeneratorLoss | false | 18,283 | [
"MIT"
] | 8 | d93464a9c2490532afdf7bbc0f60decdf2d0767d | https://github.com/akanametov/pathgan/tree/d93464a9c2490532afdf7bbc0f60decdf2d0767d |
WaveletConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | EdisonLeeeee/Graphgallery | WaveletConv | false | 5,112 | [
"MIT"
] | 1 | 8ae9ef57d44f073d0ceaf3f33a3a998546f960a8 | https://github.com/EdisonLeeeee/Graphgallery/tree/8ae9ef57d44f073d0ceaf3f33a3a998546f960a8 |
PetarVGAT | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional
from typing import Type
from typing import Any
from abc import ABC
from abc import abstractmethod
class BaseTrainer(ABC):
@classmethod
@abstractmethod
def build_trainer_from_args(cls, ar... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | ChengzhiPiao/cogdl | PetarVGAT | false | 5,029 | [
"MIT"
] | 1 | 182e0b95b3dfbe771570037c58aacd8f677b6500 | https://github.com/ChengzhiPiao/cogdl/tree/182e0b95b3dfbe771570037c58aacd8f677b6500 |
BertSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
import torch.utils.data
class BertSelfAttention(nn.Module):
def __init__(self, config):
super(BertSelfAttention, self).__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | SofanHe/UnilmChatchitRobot | BertSelfAttention | false | 14,437 | [
"Apache-2.0"
] | 115 | 7232d01326ed04ae17cbeb73ce681f30b4391933 | https://github.com/SofanHe/UnilmChatchitRobot/tree/7232d01326ed04ae17cbeb73ce681f30b4391933 |
PerceptronTanh | # 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.... | negotiatorvivian/SAT-Solver | PerceptronTanh | false | 7,326 | [
"MIT"
] | 1 | acbf375ce73103e945aee3e2a225126684a19076 | https://github.com/negotiatorvivian/SAT-Solver/tree/acbf375ce73103e945aee3e2a225126684a19076 |
PointwiseConvolutionLayer | import torch
class PointwiseConvolutionLayer(torch.nn.Module):
def __init__(self, N, F, F_prime):
super().__init__()
self.f1 = torch.nn.Linear(F, 128)
self.f2 = torch.nn.Linear(128, F_prime)
def forward(self, f_bar_batch):
output = torch.nn.functional.softplus(self.f1(f_bar_b... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
as... | slgao/FU-DeepLearningCourse | PointwiseConvolutionLayer | false | 4,360 | [
"MIT"
] | 0 | 2300e8bdaa2afb4c73535d5de80874f6103af6f2 | https://github.com/slgao/FU-DeepLearningCourse/tree/2300e8bdaa2afb4c73535d5de80874f6103af6f2 |
FC_Block | import math
import torch
import torch.nn as nn
import torch.optim
import torch.multiprocessing
from torch.nn.parameter import Parameter
class FullyConnected(nn.Module):
def __init__(self, in_features, out_features, bias=True):
"""
Fully connected layer of learnable weights with learnable bias
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
import torch.optim
import torch.multiprocessin... | bouracha/Gen_Motion | FC_Block | false | 9,929 | [
"MIT"
] | 0 | 873caa496d14c9a9723581cdf1464f44db4cf358 | https://github.com/bouracha/Gen_Motion/tree/873caa496d14c9a9723581cdf1464f44db4cf358 |
PositionalEncoding | import math
import torch
from torch import nn
class PositionalEncoding(nn.Module):
"""Implement the PE function."""
def __init__(self, d_model, dropout, max_len=5000):
super(PositionalEncoding, self).__init__()
self.dropout = nn.Dropout(p=dropout)
pe = torch.zeros(max_len, d_model)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guard... | OpenNLPhub/MRC_NER | PositionalEncoding | false | 17,769 | [
"MIT"
] | 4 | 27ca063764aed9eb5f2ac672bb10052acbf374a5 | https://github.com/OpenNLPhub/MRC_NER/tree/27ca063764aed9eb5f2ac672bb10052acbf374a5 |
SimpleSoftmaxModel | # 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.jit
impor... | opti-mix/glow | SimpleSoftmaxModel | false | 7,421 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
L2Norm | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class L2Norm(nn.Module):
"""
Scale shall be learnable according to original paper
scale: initial scale number
chan_num: L2Norm channel number (norm over a... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import... | rotorliu/DALI | L2Norm | false | 7,578 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 4ea3529fc9b35cbdf09b260ec95197cfd52c0395 | https://github.com/rotorliu/DALI/tree/4ea3529fc9b35cbdf09b260ec95197cfd52c0395 |
ImgPatches | # 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... | ch0n9waiu/TransCycleGAN | ImgPatches | false | 6,417 | [
"MIT"
] | 1 | a3e846e21101400282a9f1393c1f8d150a3d92c9 | https://github.com/ch0n9waiu/TransCycleGAN/tree/a3e846e21101400282a9f1393c1f8d150a3d92c9 |
FeaturewiseAffine | import torch
from typing import Union
import torch.nn as nn
class FeaturewiseAffine(nn.Module):
"""Feature-wise affine layer."""
def __init__(self):
super().__init__()
def forward(self, x, scale: 'Union[float, torch.Tensor]', shift:
'Union[float, torch.Tensor]'):
res = scale * x ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | ketan0/ddim | FeaturewiseAffine | false | 3,822 | [
"MIT"
] | 0 | 26f2de1107885a3f332dd8435b73a1eaedbe10a8 | https://github.com/ketan0/ddim/tree/26f2de1107885a3f332dd8435b73a1eaedbe10a8 |
Critic | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
def __init__(self, input_dim):
super(Critic, self).__init__()
self.fc1 = nn.Linear(input_dim, 128)
self.fc2 = nn.Linear(128, 1)
def forward(self, x):
x = F.relu(self.fc1(x))
x ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | PaulPan00/donkey_wrapper | Critic | false | 17,806 | [
"MIT"
] | 6 | a03cf0f42f65625fbce792b06c98acd153c5d6c8 | https://github.com/PaulPan00/donkey_wrapper/tree/a03cf0f42f65625fbce792b06c98acd153c5d6c8 |
LabelSmoothCELoss | # 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
... | Weiyuhong-1998/DI-engine | LabelSmoothCELoss | false | 14,569 | [
"Apache-2.0"
] | 464 | 88658ea358298c6e61e95a454284b8853a3e9484 | https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484 |
TreeLSTM | import torch
import torch.nn as nn
class TreeLSTM(nn.Module):
def __init__(self, num_units):
super(TreeLSTM, self).__init__()
self.num_units = num_units
self.left = nn.Linear(num_units, 5 * num_units)
self.right = nn.Linear(num_units, 5 * num_units)
def forward(self, left_in,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | mhoangvslev/torchfold | TreeLSTM | false | 16,040 | [
"Apache-2.0"
] | 160 | 9285c7889f2e1966fb94c4b8a3e91bcd60e40ab2 | https://github.com/mhoangvslev/torchfold/tree/9285c7889f2e1966fb94c4b8a3e91bcd60e40ab2 |
ReshapeF | import torch
import torch.utils.data
import torch
import torch.nn as nn
class Normalize(nn.Module):
def __init__(self, power=2):
super(Normalize, self).__init__()
self.power = power
def forward(self, x):
norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power)
out ... | 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 | ReshapeF | false | 12,210 | [
"BSD-3-Clause"
] | 0 | 07c048038375e1b9a4e464154b8dbc49f5e16ede | https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede |
RingLoss | import torch
import torch.nn as nn
class RingLoss(nn.Module):
"""Ring loss.
Reference:
Zheng et al. Ring loss: Convex Feature Normalization for Face Recognition. CVPR 2018.
"""
def __init__(self, weight_ring=1.0):
super(RingLoss, self).__init__()
self.radius = nn.Parameter(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 libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | FEIfei-coder/circle-loss-for-reid | RingLoss | false | 5,151 | [
"MIT"
] | 1 | fbb3be087a6c390fb7f8c000eebb63aa27179a13 | https://github.com/FEIfei-coder/circle-loss-for-reid/tree/fbb3be087a6c390fb7f8c000eebb63aa27179a13 |
GELU | import math
import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
class GELU(nn.Module):
""" Implementation of the gelu activation function
:cite:`DBLP:journals/corr/HendrycksG16`
For information: OpenAI GPT's gelu is slightly different
(and gives slightly differen... | 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.cuda
import torch.distributed
assert_size_st... | SivilTaram/dialogue-utterance-rewriter-pytorch | GELU | false | 2,917 | [
"MIT"
] | 0 | 92c2254958b7a1ee9199836f7f2236575270983f | https://github.com/SivilTaram/dialogue-utterance-rewriter-pytorch/tree/92c2254958b7a1ee9199836f7f2236575270983f |
UpsamplerModel | # 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 import triton_helpers
import numpy as np
from torch import nn
assert_size_stride = torch._C._dynamo.guards.asse... | GuYuanjie/Deep-Retinex-fusion | UpsamplerModel | false | 17,355 | [
"MIT"
] | 5 | ffa2a1689fd512c8820fd87cbf665c09bcb142b4 | https://github.com/GuYuanjie/Deep-Retinex-fusion/tree/ffa2a1689fd512c8820fd87cbf665c09bcb142b4 |
ResNetV2 | import torch
import torch.nn as nn
from collections import OrderedDict
import torch.nn.functional as F
def conv1x1(cin, cout, stride=1, bias=False):
return StdConv2d(cin, cout, kernel_size=1, stride=stride, padding=0,
bias=bias)
def conv3x3(cin, cout, stride=1, groups=1, bias=False):
return StdConv2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | Yifanfanfanfan/ViT-pytorch | ResNetV2 | false | 12,309 | [
"MIT"
] | 0 | 0f975aa7d3fd0aba6f74260c2b5a91786f1211ba | https://github.com/Yifanfanfanfan/ViT-pytorch/tree/0f975aa7d3fd0aba6f74260c2b5a91786f1211ba |
HanoiEnvEncoder | # 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_... | geektoni/AlphaNPI | HanoiEnvEncoder | false | 3,535 | [
"MIT"
] | 0 | ab48cb9cfb74f3960e264da4f3eb2d6917bfb9c9 | https://github.com/geektoni/AlphaNPI/tree/ab48cb9cfb74f3960e264da4f3eb2d6917bfb9c9 |
NoiseInjection | import torch
import torch.nn as nn
import torch.utils.model_zoo
class NoiseInjection(nn.Module):
def __init__(self):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1))
def forward(self, image, noise=None):
if noise is None:
batch, _, height, width = image.shape... | 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.model_zoo
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Aitical/ADspeech2face | NoiseInjection | false | 4,795 | [
"MIT"
] | 1 | 2e811ff8cc7333729f4b77d1b1067296253e8e38 | https://github.com/Aitical/ADspeech2face/tree/2e811ff8cc7333729f4b77d1b1067296253e8e38 |
BahdanauAttn | import torch
import torch.nn as nn
class BahdanauAttn(nn.Module):
"""Bahdabau attention mechanism"""
def __init__(self, size):
super(BahdanauAttn, self).__init__()
self.query_layer = nn.Linear(size, size, bias=False)
self.tanh = nn.Tanh()
self.v = nn.Linear(size, 1, bias=False... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | seo3650/Tacotron-pytorch | BahdanauAttn | false | 10,841 | [
"MIT"
] | 0 | 223e4f39a3624c409484a1ad55edab1563cf8c87 | https://github.com/seo3650/Tacotron-pytorch/tree/223e4f39a3624c409484a1ad55edab1563cf8c87 |
EqualizedLinear | # 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 math
import numpy as np
from torch import nn
import torch.utils.data
impo... | Aarsh2001/annotated_deep_learning_paper_implementations | EqualizedLinear | false | 4,762 | [
"MIT"
] | 1 | ff0d5c065da1a46769f5f66fddc252c178f8fa37 | https://github.com/Aarsh2001/annotated_deep_learning_paper_implementations/tree/ff0d5c065da1a46769f5f66fddc252c178f8fa37 |
AsymmetricLossOptimized | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class AsymmetricLossOptimized(nn.Module):
""" Notice - optimized version, minimizes memory allocation and gpu uploading,
favors inplace operations"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torchv... | MinliangLin/ASL | AsymmetricLossOptimized | false | 2,655 | [
"MIT"
] | 0 | beda0989a8e30ac51a7ce9f9e247a12bbe84ec96 | https://github.com/MinliangLin/ASL/tree/beda0989a8e30ac51a7ce9f9e247a12bbe84ec96 |
Add | import torch
from typing import List
from torch import nn
from typing import Tuple
from typing import Union
class Add(nn.Module):
"""Add module for Kindle."""
def __init_(self):
"""Initialize module."""
super().__init__()
@classmethod
def forward(cls, x: 'Union[Tuple[torch.Tensor, ..... | 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... | Anon-Artist/kindle | Add | false | 1,947 | [
"MIT"
] | 0 | 7e62e370e0130e6c61db6cdd339a451d5f1f8985 | https://github.com/Anon-Artist/kindle/tree/7e62e370e0130e6c61db6cdd339a451d5f1f8985 |
CosineLinearLayer | # 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.... | SecretKeyTeam/voxceleb_trainer | CosineLinearLayer | false | 9,553 | [
"MIT"
] | 0 | e235cbc2961d32395d30cf606ee830cd47716383 | https://github.com/SecretKeyTeam/voxceleb_trainer/tree/e235cbc2961d32395d30cf606ee830cd47716383 |
TransposedConv3d | import torch
import torch.nn as nn
import torch.nn.functional as F
class TransposedConv3d(nn.Module):
def __init__(self, in_channels, output_channels, kernel_shape=(3, 3, 3),
stride=(2, 1, 1), padding=(1, 1, 1), output_padding=(1, 0, 0),
activation_fn=F.relu, use_batch_norm=False, use_bias=True):... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | Cogito2012/OpenTAL | TransposedConv3d | false | 7,898 | [
"BSD-3-Clause"
] | 16 | a7ab938a52b3fb82163eb1ba5403888359eb7e6a | https://github.com/Cogito2012/OpenTAL/tree/a7ab938a52b3fb82163eb1ba5403888359eb7e6a |
GeneratorLoss | import torch
from torch import nn
class GeneratorLoss(nn.Module):
"""
Generator (BCE) loss function
Args:
alpha (default: int=1): Coefficient by which map loss will be multiplied
beta (default: int=1): Coefficient by which point loss will be multiplied
"""
def __init__(self, alph... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | akanametov/pathgan | GeneratorLoss | false | 18,283 | [
"MIT"
] | 8 | d93464a9c2490532afdf7bbc0f60decdf2d0767d | https://github.com/akanametov/pathgan/tree/d93464a9c2490532afdf7bbc0f60decdf2d0767d |
UpsampleBlock | # 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... | miguel-fc/atomai | UpsampleBlock | false | 10,665 | [
"MIT"
] | 0 | f51699ef5e1bfc577781977d38f7414b1b51449d | https://github.com/miguel-fc/atomai/tree/f51699ef5e1bfc577781977d38f7414b1b51449d |
NormKLLoss | # 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.utils.data
import torch.nn.init
from torch.nn.modules.loss i... | ChrisGeishauser/ConvLab-2 | NormKLLoss | false | 2,234 | [
"Apache-2.0"
] | 0 | 8f55d033c6e2453fdc092c4f504be3973a55e7ea | https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea |
ConvLayer | import torch
import torch.nn as nn
class ConvLayer(nn.Module):
"""1-D Convolution layer to extract high-level features of each time-series input
:param n_features: Number of input features/nodes
:param window_size: length of the input sequence
:param kernel_size: size of kernel to use in the convoluti... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | lawson-source/mtad-gat-pytorch | ConvLayer | false | 15,876 | [
"MIT"
] | 93 | 9e671ea99dedd82ac55f53e53af1d1b56c13ebff | https://github.com/lawson-source/mtad-gat-pytorch/tree/9e671ea99dedd82ac55f53e53af1d1b56c13ebff |
TrTimeInvFIRFilter | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | oatsu-gh/nnsvs | TrTimeInvFIRFilter | false | 16,195 | [
"MIT"
] | 298 | 510f37bc1d1f15282646e4d34435b5d63686cf40 | https://github.com/oatsu-gh/nnsvs/tree/510f37bc1d1f15282646e4d34435b5d63686cf40 |
Attention | import torch
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
def __init__(self, nf=64):
super(Attention, self).__init__()
self.sAtt_1 = nn.Conv2d(nf, nf, 1, 1, bias=True)
self.max_pool = nn.MaxPool2d(3, stride=2, padding=1)
self.avg_pool = nn.AvgP... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | myeldib/Simple-SR | Attention | false | 12,836 | [
"MIT"
] | 0 | 583456b1f231574d9e0b45c29266cf41603d161d | https://github.com/myeldib/Simple-SR/tree/583456b1f231574d9e0b45c29266cf41603d161d |
ConvSample | # 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
assert_size_stride = torch._C... | ahgamut/torchrecord | ConvSample | false | 6,126 | [
"MIT"
] | 1 | 6ab623776d12e0ae6497c34e93d16407e0a9c9c2 | https://github.com/ahgamut/torchrecord/tree/6ab623776d12e0ae6497c34e93d16407e0a9c9c2 |
KeyValueAttention | # 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.... | msft-shahins/ConvLab-2 | KeyValueAttention | false | 12,818 | [
"Apache-2.0"
] | 0 | ad74c0e9e021916f9330af11e046ed72914b7740 | https://github.com/msft-shahins/ConvLab-2/tree/ad74c0e9e021916f9330af11e046ed72914b7740 |
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
from torch.nn import Parameter
from torch.nn.parameter im... | anlewy/mt-dnn | LayerNorm | false | 14,879 | [
"MIT"
] | 2,075 | eeb6f01ce0630e61a52b8c9c6f7537cd34978e45 | https://github.com/anlewy/mt-dnn/tree/eeb6f01ce0630e61a52b8c9c6f7537cd34978e45 |
DC_layer | import torch
import torch.nn as nn
def Maxout(x1, x2, x3, x4):
mask_1 = torch.ge(x1, x2)
mask_1 = mask_1.float()
x = mask_1 * x1 + (1 - mask_1) * x2
mask_2 = torch.ge(x, x3)
mask_2 = mask_2.float()
x = mask_2 * x + (1 - mask_2) * x3
mask_3 = torch.ge(x, x4)
mask_3 = mask_3.float()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Min-Sheng/Local-Crowd-Counting | DC_layer | false | 14,103 | [
"MIT"
] | 75 | 388343d3ec2d08747d537437e4c880fd0047df83 | https://github.com/Min-Sheng/Local-Crowd-Counting/tree/388343d3ec2d08747d537437e4c880fd0047df83 |
Normal_Model | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | ExamDay/InfoTorch | Normal_Model | false | 9,013 | [
"MIT"
] | 0 | ef13acce5bd8e76f9c3c8aadd1ab804dda9202e7 | https://github.com/ExamDay/InfoTorch/tree/ef13acce5bd8e76f9c3c8aadd1ab804dda9202e7 |
MegatronBertOutput | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.checkpoint
class MegatronBertOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.intermediate_size, config.hidden_size)
self.dropout = nn.Dropout(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.utils.checkpoint
assert_size_stride = torch._C... | Clemens123/transformers | MegatronBertOutput | false | 11,813 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
SpatialGatingUnit | import torch
import torch.nn as nn
class SpatialGatingUnit(nn.Module):
def __init__(self, dim_seq, dim_ff):
super().__init__()
self.proj = nn.Linear(dim_seq, dim_seq)
nn.init.zeros_(self.proj.weight)
nn.init.ones_(self.proj.bias)
self.norm = nn.LayerNorm(normalized_shape=d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | nima1999nikkhah/SimCLR_gMLP | SpatialGatingUnit | false | 4,096 | [
"MIT"
] | 0 | 32cca4764d4266493cb7d141eb9ef01a91f63996 | https://github.com/nima1999nikkhah/SimCLR_gMLP/tree/32cca4764d4266493cb7d141eb9ef01a91f63996 |
BinaryFocalLoss | import torch
import torch as th
import torch.nn as nn
class BinaryFocalLoss(nn.Module):
def __init__(self, gamma=2.0, alpha=0.25, size_average=True):
super(BinaryFocalLoss, self).__init__()
self.gamma = gamma
self.alpha = alpha
self.size_average = size_average
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | cumtchenchang/PPGNet | BinaryFocalLoss | false | 15,088 | [
"MIT"
] | 171 | 9b280aacb887ec584e905b9f9ab006b4f4cb2cc3 | https://github.com/cumtchenchang/PPGNet/tree/9b280aacb887ec584e905b9f9ab006b4f4cb2cc3 |
AverageRC | import torch
import torch.nn as nn
class AverageRC(nn.Module):
def __init__(self):
super(AverageRC, self).__init__()
def forward(self, input):
input = input[:int(input.shape[0] / 2)] / 2 + input[int(input.shape
[0] / 2):] / 2
return input
def get_inputs():
return [t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | Luma-1994/lama | AverageRC | false | 13,996 | [
"MIT"
] | 137 | 60d802e2e4cce789f03eea11b038212ba5f7fd1b | https://github.com/Luma-1994/lama/tree/60d802e2e4cce789f03eea11b038212ba5f7fd1b |
WSLinear | # 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... | jiazhi412/Machine-Learning-Collection | WSLinear | false | 3,733 | [
"MIT"
] | 0 | 1c30faf1e27a79eeca966c017e956df8f7f6ef17 | https://github.com/jiazhi412/Machine-Learning-Collection/tree/1c30faf1e27a79eeca966c017e956df8f7f6ef17 |
IOU | import torch
def _iou(pred, target, size_average=True):
b = pred.shape[0]
IoU = 0.0
for i in range(0, b):
Iand1 = torch.sum(target[i, :, :, :] * pred[i, :, :, :])
Ior1 = torch.sum(target[i, :, :, :]) + torch.sum(pred[i, :, :, :]
) - Iand1
IoU1 = Iand1 / Ior1
IoU... | 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... | AlvinWen428/BASNet | IOU | false | 11,186 | [
"MIT"
] | 0 | 2af21e0333204b8adcb9565b33a0bf72f5471db5 | https://github.com/AlvinWen428/BASNet/tree/2af21e0333204b8adcb9565b33a0bf72f5471db5 |
ConformerFeedForward | import torch
from torch import nn
import torch.utils.data
import torch.optim
class Swish(nn.Module):
"""
Swish activation function introduced in 'https://arxiv.org/abs/1710.05941'
"""
def forward(self, x):
return x * torch.sigmoid(x)
class ConformerFeedForward(nn.Module):
"""
feed-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 import nn
import torch.utils.data
import torch.optim
assert_size_stri... | JINHXu/NeMo | ConformerFeedForward | false | 11,615 | [
"Apache-2.0"
] | 0 | 835db62e39919436824ce022fd3b3f6bac301cd6 | https://github.com/JINHXu/NeMo/tree/835db62e39919436824ce022fd3b3f6bac301cd6 |
ShuffleBlock | import torch
import torch.nn as nn
class ShuffleBlock(nn.Module):
def __init__(self, groups=2):
super(ShuffleBlock, self).__init__()
self.groups = groups
def forward(self, x):
"""Channel shuffle: [N,C,H,W] -> [N,g,C/g,H,W] -> [N,C/g,g,H,w] -> [N,C,H,W]"""
N, C, H, W = x.size(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | P2333/Bag-of-Tricks-for-AT | ShuffleBlock | false | 14,122 | [
"Apache-2.0"
] | 192 | 314683adcfe9ea7c7bfbff50007da510b21f56e1 | https://github.com/P2333/Bag-of-Tricks-for-AT/tree/314683adcfe9ea7c7bfbff50007da510b21f56e1 |
ReadUnit | import torch
from torch import nn
import torch.nn.functional as F
from torch.nn.init import xavier_uniform_
def linear(in_dim, out_dim, bias=True):
lin = nn.Linear(in_dim, out_dim, bias=bias)
xavier_uniform_(lin.weight)
if bias:
lin.bias.data.zero_()
return lin
class ReadUnit(nn.Module):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | zorache/mac-network-pytorch-gqa | ReadUnit | false | 4,676 | [
"MIT"
] | 0 | 5de0a906410af0596f7b5dc159ce7db82bd37418 | https://github.com/zorache/mac-network-pytorch-gqa/tree/5de0a906410af0596f7b5dc159ce7db82bd37418 |
Scaled_Dot_Product_Attention | import torch
import torch.nn as nn
import torch.nn.functional as F
class Scaled_Dot_Product_Attention(nn.Module):
"""Scaled Dot-Product Attention """
def __init__(self):
super(Scaled_Dot_Product_Attention, self).__init__()
def forward(self, Q, K, V, scale=None):
"""
Args:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Ergtou/TextWord | Scaled_Dot_Product_Attention | false | 2,194 | [
"MIT"
] | 0 | f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30 | https://github.com/Ergtou/TextWord/tree/f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30 |
BertLayerNormNoVar | import torch
import torch.nn as nn
class BertLayerNormNoVar(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
super(BertLayerNormNoVar, self).__init__()
self.weight = nn.Parameter(torch.ones(hidden_size))
self.bias = nn.Parameter(torch.zeros(hidden_size))
self.variance_epsil... | 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... | mnmueller/auto_LiRPA | BertLayerNormNoVar | false | 7,258 | [
"BSD-3-Clause"
] | 1 | 55cb270b0b99f07b74541d55706c69fbb9daff66 | https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66 |
RelPositionMultiHeadedAttention | import math
import torch
from typing import Optional
from typing import Tuple
from torch import nn
class MultiHeadedAttention(nn.Module):
"""Multi-Head Attention layer.
Args:
n_head (int): The number of heads.
n_feat (int): The number of features.
dropout_rate (float): Dropout rate.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | pengchengguo/wenet | RelPositionMultiHeadedAttention | false | 16,254 | [
"Apache-2.0"
] | 1,166 | 940dc164e5cfa9b8c0131688f0f9457af9563892 | https://github.com/pengchengguo/wenet/tree/940dc164e5cfa9b8c0131688f0f9457af9563892 |
SpatialRescaler | import torch
from functools import partial
import torch.nn as nn
class SpatialRescaler(nn.Module):
def __init__(self, n_stages=1, method='bilinear', multiplier=0.5,
in_channels=3, out_channels=None, bias=False):
super().__init__()
self.n_stages = n_stages
assert self.n_stages >= 0... | 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 functools import partial
import torch.nn as nn
assert_size_stride = torch._C._dynamo... | samedii/latent-diffusion | SpatialRescaler | false | 16,357 | [
"MIT"
] | 563 | f13bf9bf463d95b5a16aeadd2b02abde31f769f8 | https://github.com/samedii/latent-diffusion/tree/f13bf9bf463d95b5a16aeadd2b02abde31f769f8 |
EALSTM | # 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 ... | bernharl/CamelsML | EALSTM | false | 3,278 | [
"Apache-2.0"
] | 0 | 4ec3ea231ba6ed8c9db68f0aa61aba8da32652b8 | https://github.com/bernharl/CamelsML/tree/4ec3ea231ba6ed8c9db68f0aa61aba8da32652b8 |
DiscreteCriticNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
class DiscreteCriticNetwork(nn.Module):
def __init__(self, obs_dim, act_dim, hidden_size=256):
super(DiscreteCriticNetwork, self).__init__()
self._l1 = nn.Linear(obs_dim, hidden_size)
self._l2 = nn.Linear(hidden_size, hidd... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | harwiltz/sac | DiscreteCriticNetwork | false | 3,584 | [
"MIT"
] | 0 | 076e01e63d8933665fbf4038513f163bbfd62800 | https://github.com/harwiltz/sac/tree/076e01e63d8933665fbf4038513f163bbfd62800 |
ChannelSELayer3D | # 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_... | EmmanuelleB985/Head-and-Neck-Tumour-Segmentation-and-Prediction-of-Patient-Survival | ChannelSELayer3D | false | 11,401 | [
"MIT"
] | 0 | 347883eb6dd5daebba091119ede7a9f5b78076d1 | https://github.com/EmmanuelleB985/Head-and-Neck-Tumour-Segmentation-and-Prediction-of-Patient-Survival/tree/347883eb6dd5daebba091119ede7a9f5b78076d1 |
Joiner | # 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... | desh2608/icefall | Joiner | false | 3,405 | [
"Apache-2.0"
] | 0 | 1603744469d167d848e074f2ea98c587153205fa | https://github.com/desh2608/icefall/tree/1603744469d167d848e074f2ea98c587153205fa |
FeedForward | import torch
import torch.cuda
import torch.distributed
class FeedForward(torch.nn.Module):
def __init__(self, input_size, hidden_size, dropout):
super().__init__()
self.linear1 = torch.nn.Linear(input_size, hidden_size)
self.linear2 = torch.nn.Linear(hidden_size, input_size)
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.... | sakrnference/data-to-text-hierarchical | FeedForward | false | 16,366 | [
"Apache-2.0"
] | 82 | 09b8fa8bf85385f25348378a30e830d425c93db3 | https://github.com/sakrnference/data-to-text-hierarchical/tree/09b8fa8bf85385f25348378a30e830d425c93db3 |
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 import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn.parallel
imp... | dineenai/pytorch_untrained_models | Normalize | false | 12,287 | [
"BSD-3-Clause"
] | 0 | eb301d3b8e3e87b8a79cd8cb4e1cb8d4e44a273a | https://github.com/dineenai/pytorch_untrained_models/tree/eb301d3b8e3e87b8a79cd8cb4e1cb8d4e44a273a |
FSP | 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 FSP(nn.Module):
"""
A Gift from Knowledge Distillation: Fast Optimization, Network Minimization and Transfer Learning
http://openaccess.thecvf... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
import torch._utils
from i... | wangxianliang/FaceX-Zoo | FSP | false | 13,084 | [
"Apache-2.0"
] | 0 | b0555c88a0350fa7b59c317f3a171f551fef4e6e | https://github.com/wangxianliang/FaceX-Zoo/tree/b0555c88a0350fa7b59c317f3a171f551fef4e6e |
GAT | # 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.... | bpilseo/VLP_GAT | GAT | false | 1,623 | [
"MIT"
] | 0 | ca8a2594036ab8fe4a180e5ced87f59f8984e54f | https://github.com/bpilseo/VLP_GAT/tree/ca8a2594036ab8fe4a180e5ced87f59f8984e54f |
FeedForwardLayer | # 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.... | RosettaCommons/RFDesign | FeedForwardLayer | false | 14,342 | [
"MIT"
] | 45 | b404b8b2c57f89c047529c30259aeeb8f6012b61 | https://github.com/RosettaCommons/RFDesign/tree/b404b8b2c57f89c047529c30259aeeb8f6012b61 |
ResBlock | # 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_... | cluePrints/fsdl-text-recognizer-2021-labs | ResBlock | false | 9,961 | [
"MIT"
] | 0 | d166dcbd00513b2f0031fbc991af3a852bc2d605 | https://github.com/cluePrints/fsdl-text-recognizer-2021-labs/tree/d166dcbd00513b2f0031fbc991af3a852bc2d605 |
ELBOLoss | import torch
from torch import nn
class ELBOLoss(nn.Module):
def __init__(self):
super(ELBOLoss, self).__init__()
self.recons_loss = nn.BCELoss(reduction='sum')
def forward(self, reconstruction, x, mu, log_var):
loss = -self.recons_loss(reconstruction, x)
KL_loss = 0.5 * 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 libdevice, math as tl_math
from torch ... | mirmohammad/IFT6135-TP3 | ELBOLoss | false | 4,009 | [
"MIT"
] | 0 | 70453b4ea695313837ab88243b0206552eb50632 | https://github.com/mirmohammad/IFT6135-TP3/tree/70453b4ea695313837ab88243b0206552eb50632 |
LogisticRegression | import torch
import torch.utils
class LogisticRegression(torch.nn.Module):
def __init__(self, input_dim, output_dim):
super(LogisticRegression, self).__init__()
self.linear = torch.nn.Linear(input_dim, output_dim)
def forward(self, x):
outputs = torch.sigmoid(self.linear(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
import torch.utils
assert_size_stride = torch._C._dynamo.guards.assert_size_stri... | BlakeDai/FedML-test | LogisticRegression | false | 9,197 | [
"Apache-2.0"
] | 0 | 3cb9a7234f3f0294f3137e4be572153ba7b62f8f | https://github.com/BlakeDai/FedML-test/tree/3cb9a7234f3f0294f3137e4be572153ba7b62f8f |
Classify | import torch
import torch.nn as nn
def autopad(k, p=None):
if p is None:
p = k // 2 if isinstance(k, int) else [(x // 2) for x in k]
return p
class Flatten(nn.Module):
@staticmethod
def forward(x):
return x.view(x.size(0), -1)
class Classify(nn.Module):
def __init__(self, c1,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | hyperparameters/Towards-Realtime-MOT | Classify | false | 10,282 | [
"MIT"
] | 0 | eb956a3bd5991f4895178566cb0173769977f88d | https://github.com/hyperparameters/Towards-Realtime-MOT/tree/eb956a3bd5991f4895178566cb0173769977f88d |
ConvTemporalGraphical | import torch
import torch.nn as nn
class ConvTemporalGraphical(nn.Module):
"""The basic module for applying a graph convolution.
Args:
in_channels (int): Number of channels in the input sequence data
out_channels (int): Number of channels produced by the convolution
kernel_size (int): ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Immocat/ACTOR | ConvTemporalGraphical | false | 13,831 | [
"MIT"
] | 164 | c7237e82e333bf2c57f7d8e12f27d0831233befc | https://github.com/Immocat/ACTOR/tree/c7237e82e333bf2c57f7d8e12f27d0831233befc |
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.... | CasperLindbergAtGithub/CaptionGeneration | Attention | false | 2,101 | [
"MIT"
] | 0 | a181d4e8db41e77cb2663ed10652f40f62bed482 | https://github.com/CasperLindbergAtGithub/CaptionGeneration/tree/a181d4e8db41e77cb2663ed10652f40f62bed482 |
StatsNet | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | kerenalli/Capsule-Forensics-v2 | StatsNet | false | 15,801 | [
"BSD-3-Clause"
] | 97 | 8e60ca0035f8392a543f7fad37ab3704d43021cf | https://github.com/kerenalli/Capsule-Forensics-v2/tree/8e60ca0035f8392a543f7fad37ab3704d43021cf |
WeightedCrossEntropyLoss | import torch
import torch.nn as nn
class WeightedCrossEntropyLoss(nn.Module):
def __init__(self):
super(WeightedCrossEntropyLoss, self).__init__()
self.bce = nn.CrossEntropyLoss(reduction='none')
def forward(self, y_pred, y_true, weight):
y_true_hot = y_true.argmax(1)
loss = ... | 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
... | CarlosPena00/pytorch-unet | WeightedCrossEntropyLoss | false | 218 | [
"MIT"
] | 0 | 8365bace23e4b04b9c5b75cd6720807ea8cac5ab | https://github.com/CarlosPena00/pytorch-unet/tree/8365bace23e4b04b9c5b75cd6720807ea8cac5ab |
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.... | jiahuanluo/Global-Encoding | MultiHeadAttention | false | 3,736 | [
"MIT"
] | 0 | 2adb01def9525588b3a75e6f2a5181a3a11464ed | https://github.com/jiahuanluo/Global-Encoding/tree/2adb01def9525588b3a75e6f2a5181a3a11464ed |
GaussianLayer | import torch
import torch.nn as nn
class GaussianLayer(nn.Module):
def __init__(self, std, device):
super().__init__()
self.std = std
self.device = device
def forward(self, x):
return x + self.std * torch.randn_like(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]... | 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_... | krylea/mine-pytorch | GaussianLayer | false | 15,849 | [
"MIT"
] | 108 | a638ca3e46ff21a3b9dfebe25480eaed0e3304bc | https://github.com/krylea/mine-pytorch/tree/a638ca3e46ff21a3b9dfebe25480eaed0e3304bc |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.