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 |
|---|---|---|---|---|---|---|---|---|---|---|
Contract | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | Aditya239233/MDP | Contract | false | 16,907 | [
"MIT"
] | 4 | 87491e1d67e547c11f4bdd5d784d120473429eae | https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae |
Softmax | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | awlange/pysurvival | Softmax | false | 14,934 | [
"Apache-2.0"
] | 242 | 841b9bc6ce700ba8898d2a1488aa9cd25ee7a8e6 | https://github.com/awlange/pysurvival/tree/841b9bc6ce700ba8898d2a1488aa9cd25ee7a8e6 |
L2Normalization | # 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
from torch.nn import Module
... | coreylowman/avalanche | L2Normalization | false | 6,483 | [
"MIT"
] | 1 | 9c1e7765f1577c400ec0c57260221bcffd9566a2 | https://github.com/coreylowman/avalanche/tree/9c1e7765f1577c400ec0c57260221bcffd9566a2 |
RDivFloat | import torch
class RDivFloat(torch.nn.Module):
def __init__(self):
super(RDivFloat, self).__init__()
def forward(self, x):
return 100.0 / x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Akababa/torch2trt | RDivFloat | false | 18,396 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
ConvNet | # 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 ... | FedericoZocco/VarMemLBFGS-PyTorch | ConvNet | false | 5,165 | [
"MIT"
] | 1 | 5a0ed7b95fc71c9a421a07071f8d5199cf6a6216 | https://github.com/FedericoZocco/VarMemLBFGS-PyTorch/tree/5a0ed7b95fc71c9a421a07071f8d5199cf6a6216 |
ContrastiveLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._... | WLYLab/PepFormer | ContrastiveLoss | false | 18,056 | [
"MIT"
] | 6 | 9bac4544dc88bcd66e975a6714a264dcc9c55304 | https://github.com/WLYLab/PepFormer/tree/9bac4544dc88bcd66e975a6714a264dcc9c55304 |
PositionwiseFeedForward | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.functional import F
from torch.nn import functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.distributions
class PositionwiseFeedForward(nn.Module):
"""Imp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | greenstar1151/pytorch-benchmark | PositionwiseFeedForward | false | 10,453 | [
"BSD-3-Clause"
] | 0 | 8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b | https://github.com/greenstar1151/pytorch-benchmark/tree/8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b |
SE | # 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_... | BXuan694/basemodel-pytorch | SE | false | 4,892 | [
"MIT"
] | 1 | a36c96904580be902e323db17eebbe2ea1f54176 | https://github.com/BXuan694/basemodel-pytorch/tree/a36c96904580be902e323db17eebbe2ea1f54176 |
ScaledDotProductAttention | # 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 import triton_helpers
from torch._inductor.runtime.... | PaParaZz1/DI-engine | ScaledDotProductAttention | false | 11,840 | [
"Apache-2.0"
] | 0 | b38144117c1ebc6eb860d8637ec8866dfbcdf2de | https://github.com/PaParaZz1/DI-engine/tree/b38144117c1ebc6eb860d8637ec8866dfbcdf2de |
MLPLayer | # 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_... | luogan1234/prerequisite-prediction-co-training | MLPLayer | false | 7,132 | [
"MIT"
] | 1 | 28e3f241ada5afe75a73525375087be230735c2a | https://github.com/luogan1234/prerequisite-prediction-co-training/tree/28e3f241ada5afe75a73525375087be230735c2a |
DepthwiseSeparableConv | import torch
from torch import nn
class DepthwiseSeparableConv(nn.Module):
def __init__(self, in_channels, output_channels, kernel_size, padding=0,
kernels_per_layer=1):
super(DepthwiseSeparableConv, self).__init__()
self.depthwise = nn.Conv2d(in_channels, in_channels *
kernel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | Dauriel/weather4cast2021 | DepthwiseSeparableConv | false | 354 | [
"Apache-2.0"
] | 0 | 29e818c4bcd488ec84b51558bf5392e4a887db70 | https://github.com/Dauriel/weather4cast2021/tree/29e818c4bcd488ec84b51558bf5392e4a887db70 |
Mac_Pooling | # 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... | SIJIEJI/2020-ai-meets-beauty_ntubeauty | Mac_Pooling | false | 5,813 | [
"MIT"
] | 1 | fede564fb3e3029f3fadfe107484c5c7e39c29c5 | https://github.com/SIJIEJI/2020-ai-meets-beauty_ntubeauty/tree/fede564fb3e3029f3fadfe107484c5c7e39c29c5 |
FocalLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class FocalLoss(nn.Module):
def __init__(self, alpha=1, gamma=0):
super(FocalLoss, self).__init__()
self.gamma = gamma
self.alpha = alpha
def get_attention(self, input, target):
prob = F.soft... | 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
... | umairjavaid/staff-employee-classification | FocalLoss | false | 13,061 | [
"MIT"
] | 0 | fc5fe32acfbde2b188094df90d888eeb0f4f4acd | https://github.com/umairjavaid/staff-employee-classification/tree/fc5fe32acfbde2b188094df90d888eeb0f4f4acd |
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
from typing import Callable
from typing import Tuple
import torch.utils.data
fr... | RobertCsordas/modules | LayerNorm | false | 8,706 | [
"BSD-3-Clause"
] | 22 | efdb8790b074862581e035c9ab5bf889440a8023 | https://github.com/RobertCsordas/modules/tree/efdb8790b074862581e035c9ab5bf889440a8023 |
Gather | # 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 import nn
import torch.onnx
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo... | jiuntian/onnx2pytorch | Gather | false | 10,293 | [
"Apache-2.0"
] | 0 | fadca10a6045f4373293c9c0854607fb51a47c12 | https://github.com/jiuntian/onnx2pytorch/tree/fadca10a6045f4373293c9c0854607fb51a47c12 |
WeldonPooling | import torch
import torch.nn as nn
class WeldonPooling(nn.Module):
def __init__(self, nMax=1, nMin=None):
super(WeldonPooling, self).__init__()
self.nMax = nMax
if nMin is None:
self.nMin = nMax
else:
self.nMin = nMin
self.input = 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._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | debayan/dsve-loc | WeldonPooling | false | 3,406 | [
"BSD-3-Clause-Clear"
] | 0 | 21b1e1837668b6daa0881514d0756e9bec039fcb | https://github.com/debayan/dsve-loc/tree/21b1e1837668b6daa0881514d0756e9bec039fcb |
ParallelPolarizedSelfAttention | # 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.... | Nitin-Mane/External-Attention-pytorch | ParallelPolarizedSelfAttention | false | 14,150 | [
"MIT"
] | 4,466 | 1ceda306c41063af11c956334747763444a4d83f | https://github.com/Nitin-Mane/External-Attention-pytorch/tree/1ceda306c41063af11c956334747763444a4d83f |
VarianceLayer | import torch
import numpy as np
import torch.nn.functional as F
from torch import nn
class VarianceLayer(nn.Module):
def __init__(self, patch_size=5, channels=1):
self.patch_size = patch_size
super(VarianceLayer, self).__init__()
mean_mask = np.ones((channels, channels, patch_size, patch_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
from torch import nn
assert_size_stride = torch._C._dynamo.gu... | GuYuanjie/Deep-Retinex-fusion | VarianceLayer | false | 17,352 | [
"MIT"
] | 5 | ffa2a1689fd512c8820fd87cbf665c09bcb142b4 | https://github.com/GuYuanjie/Deep-Retinex-fusion/tree/ffa2a1689fd512c8820fd87cbf665c09bcb142b4 |
Prototypes | # 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.... | Baymine/Dassl | Prototypes | false | 11,244 | [
"MIT"
] | 0 | 0836fb1f08393e2204326618e783d796741f657e | https://github.com/Baymine/Dassl/tree/0836fb1f08393e2204326618e783d796741f657e |
ComprehensionLayer_step3 | import math
import torch
import torch.nn as nn
class ScaledDotProductAttention(nn.Module):
def __init__(self, dropout=0.0):
super(ScaledDotProductAttention, self).__init__()
self.dropout = nn.Dropout(dropout)
def forward(self, query, key, value):
assert query.size()[-1] == key.size()... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | luyu-fan/LRCM | ComprehensionLayer_step3 | false | 7,145 | [
"MIT"
] | 1 | 6b0e4d7998bc4969afa764eb753077e3f858f1ba | https://github.com/luyu-fan/LRCM/tree/6b0e4d7998bc4969afa764eb753077e3f858f1ba |
Hflip | import torch
import torch.nn as nn
def hflip(input: 'torch.Tensor') ->torch.Tensor:
"""Horizontally flip a tensor image or a batch of tensor images.
.. image:: _static/img/hflip.png
Input must be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`.
Args:
input: input tens... | 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... | EStorm21/kornia | Hflip | false | 386 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | b2bba7950d748ba0b8ce0cc68035a248799a1044 | https://github.com/EStorm21/kornia/tree/b2bba7950d748ba0b8ce0cc68035a248799a1044 |
SoftmaxLoss | import torch
import torch.nn as nn
class SoftmaxLoss(nn.Module):
def __init__(self, hidden_dim, speaker_num, **kwargs):
"""
Softmax Loss
"""
super(SoftmaxLoss, self).__init__()
self.fc = nn.Linear(hidden_dim, speaker_num)
self.loss = nn.CrossEntropyLoss()
def ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | AyushExel/s3prl | SoftmaxLoss | false | 1,987 | [
"MIT"
] | 0 | 6531904e9621a778978b9cfef3ba9f582e56639a | https://github.com/AyushExel/s3prl/tree/6531904e9621a778978b9cfef3ba9f582e56639a |
FromRGB | import math
import torch
import torch.nn as nn
import torch.utils.cpp_extension
@torch.no_grad()
def scaling_init(tensor, scale=1, dist='u'):
fan_in, fan_out = nn.init._calculate_fan_in_and_fan_out(tensor)
scale /= (fan_in + fan_out) / 2
if dist == 'n':
std = math.sqrt(scale)
return tensor... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.cpp_extension
assert_size_s... | STomoya/animeface | FromRGB | false | 14,384 | [
"MIT"
] | 61 | 37b3cd26097d7874559d4c152e41e5712b7a1a42 | https://github.com/STomoya/animeface/tree/37b3cd26097d7874559d4c152e41e5712b7a1a42 |
BertPredictionHeadTransform | from _paritybench_helpers import _mock_config
import math
import torch
import torch.utils.data
import torch.nn as nn
import torch
import torch.nn.parallel
def gelu(x):
"""Implementation of the gelu activation function.
For information: OpenAI GPT"s gelu is slightly different (and gives slightly different ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | IsmaelElsharkawi/new_pororo_repo | BertPredictionHeadTransform | false | 8,817 | [
"MIT"
] | 19 | 4617083b420615b8a3eb0f44d02e4e91a8f407f7 | https://github.com/IsmaelElsharkawi/new_pororo_repo/tree/4617083b420615b8a3eb0f44d02e4e91a8f407f7 |
hswish | import torch
import torch.onnx
import torch
import torch.nn as nn
import torch.nn.functional as F
class hswish(nn.Module):
def forward(self, x):
out = x * F.relu6(x + 3, inplace=True) / 6
return out
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[],... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.onnx
import torch
import torch.nn as nn
assert_size_stride = torch._C._dynam... | LukasKratochvila/pytorch-ssd | hswish | false | 2,595 | [
"MIT"
] | 0 | de6ed2be6ce0b03634d4cbf41622cfe5c87d077c | https://github.com/LukasKratochvila/pytorch-ssd/tree/de6ed2be6ce0b03634d4cbf41622cfe5c87d077c |
QNet | import torch
import torch.nn as nn
import torch.nn.functional as F
class QNet(nn.Module):
def __init__(self, input_dim, output_dim):
super(QNet, self).__init__()
self.input_dim = input_dim
self.output_dim = output_dim
self.fc1 = nn.Linear(input_dim, 64)
self.fc2 = nn.Linea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | SunlightWarrior/q_learning | QNet | false | 9,513 | [
"MIT"
] | 0 | 3c5f0c700fbe84ca4859165513123f404c44937f | https://github.com/SunlightWarrior/q_learning/tree/3c5f0c700fbe84ca4859165513123f404c44937f |
AttentionConv | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
class AttentionConv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=False):
super(AttentionConv, self).__init__()
self.out_channels = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Sam-limyr/End-to-end-ASR-Pytorch | AttentionConv | false | 1,011 | [
"MIT"
] | 0 | 623a50792f48218228549ea17b8ea5e8bb1b342f | https://github.com/Sam-limyr/End-to-end-ASR-Pytorch/tree/623a50792f48218228549ea17b8ea5e8bb1b342f |
SimSiamLoss | import torch
from torch import nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class SimSiamLoss(nn.Module):
def __init__(self, version='simplified'):
super().__init__()
self.ver = version
def asymmetric_loss(self, p, z):
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 nn
import ... | Yif-Yang/DSSL | SimSiamLoss | false | 18,167 | [
"MIT"
] | 8 | 79a000450cfe66836089ecd5e2467863cc702e1c | https://github.com/Yif-Yang/DSSL/tree/79a000450cfe66836089ecd5e2467863cc702e1c |
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_... | tom99763/implement-DQN-on-maze-game | Net | false | 10,849 | [
"BSD-2-Clause"
] | 0 | 24135a06e348b6f8b88a22c58b4a2c930bf7d7b6 | https://github.com/tom99763/implement-DQN-on-maze-game/tree/24135a06e348b6f8b88a22c58b4a2c930bf7d7b6 |
EqualizedConv2d | # 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 torch.nn as nn
import torch.utils.cpp_extension
assert_size_s... | STomoya/animeface | EqualizedConv2d | false | 14,381 | [
"MIT"
] | 61 | 37b3cd26097d7874559d4c152e41e5712b7a1a42 | https://github.com/STomoya/animeface/tree/37b3cd26097d7874559d4c152e41e5712b7a1a42 |
FullAttention | # 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 import triton_helpers
from torch._inductor.runtime.... | lee-vius/LoFTR | FullAttention | false | 10,468 | [
"Apache-2.0"
] | 0 | dd9add373a20696fb6f020f4fda38bca7a91cdd9 | https://github.com/lee-vius/LoFTR/tree/dd9add373a20696fb6f020f4fda38bca7a91cdd9 |
ModMBStddevLayer | # 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
import torch.distributed as dist
import torch.autograd as... | HXWAndCL/mmgeneration | ModMBStddevLayer | false | 5,256 | [
"Apache-2.0"
] | 1 | 9afb1d740bf56a4ecde5064d5bb2a4e2d777638b | https://github.com/HXWAndCL/mmgeneration/tree/9afb1d740bf56a4ecde5064d5bb2a4e2d777638b |
ActorNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | bwosh/DRL_ContinuousControl | ActorNet | false | 9,837 | [
"MIT"
] | 0 | 34314cd600f0da428bc6dddf1b89b64bc04d43df | https://github.com/bwosh/DRL_ContinuousControl/tree/34314cd600f0da428bc6dddf1b89b64bc04d43df |
G_u | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class G_u(nn.Module):
def __init__(self, args):
super(G_u, self).__init__()
self._relu = nn.ReLU()
self._ws1 = nn.Linear(args.video_feature_dim, args.
Vu_middle_feature_dim, bias=False)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | HCShi/IONet | G_u | false | 18,362 | [
"MIT"
] | 4 | 42e3c0455a1ecb610f458e814d7310d685b2be7b | https://github.com/HCShi/IONet/tree/42e3c0455a1ecb610f458e814d7310d685b2be7b |
JointsMSELossNoReduction | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class JointsMSELossNoReduction(nn.Module):
def __init__(self, use_target_weight, logger):
super(JointsMSELossNoReduction, self).__init__()
self.criterion = la... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
assert_size_st... | NiteshBharadwaj/ignoringhumanpose | JointsMSELossNoReduction | false | 920 | [
"MIT"
] | 0 | 1fb7a063fded9cff18f7de4e1d71845983077256 | https://github.com/NiteshBharadwaj/ignoringhumanpose/tree/1fb7a063fded9cff18f7de4e1d71845983077256 |
Critic | # 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 ... | raznem/rlex | Critic | false | 4,231 | [
"MIT"
] | 0 | d24b964d80067becc81d86f6ce87e5be413b7049 | https://github.com/raznem/rlex/tree/d24b964d80067becc81d86f6ce87e5be413b7049 |
SimpleFusionGenerator | # 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.... | pltrdy/encoder-agnostic-adaptation | SimpleFusionGenerator | false | 12,890 | [
"MIT"
] | 0 | e45d157f84804696e109e5952957570fd781e9b7 | https://github.com/pltrdy/encoder-agnostic-adaptation/tree/e45d157f84804696e109e5952957570fd781e9b7 |
PixelNorm | # 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
from torch import nn
assert_size_stride = torch._C._dyn... | Archjbald/PoseStylizer | PixelNorm | false | 1,974 | [
"BSD-3-Clause"
] | 0 | 95aae02d1f4ac83536d91b8db5f78d12e7830f97 | https://github.com/Archjbald/PoseStylizer/tree/95aae02d1f4ac83536d91b8db5f78d12e7830f97 |
PANNsLoss | import torch
import torch.nn as nn
from torch.nn import functional as F
class PANNsLoss(nn.Module):
def __init__(self):
super().__init__()
@staticmethod
def stabilize_input(cwo):
cwo = torch.where(torch.isnan(cwo), torch.zeros_like(cwo), cwo)
cwo = torch.where(torch.isinf(cwo), t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | botkop/lark | PANNsLoss | false | 1,574 | [
"Apache-2.0"
] | 0 | edb2defdb514213fc121418578b0d9006a55f3a0 | https://github.com/botkop/lark/tree/edb2defdb514213fc121418578b0d9006a55f3a0 |
AngularPWConv | # 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.... | AlexanderDokuchaev/mmsegmentation | AngularPWConv | false | 11,187 | [
"Apache-2.0"
] | 0 | 0c443ee370cce6227661b802184072174c4e3f64 | https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64 |
FeatureNorm | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
class FeatureNorm(nn.Module):
def __init__(self, eps=1e-06):
super(FeatureNorm, self).__init__()
self.eps = eps
def forward(self, feature):
norm_feat = torch.sum(torch.pow(feature, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.... | Karenou/mmfashion | FeatureNorm | false | 9,460 | [
"Apache-2.0"
] | 0 | dfc334232d1700cde18d144f983dd5b0a7f9852a | https://github.com/Karenou/mmfashion/tree/dfc334232d1700cde18d144f983dd5b0a7f9852a |
AttCeMeanLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class AttCeMeanLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, attention_S, attention_T, mask=None):
"""
Calculate the cross entropy between attention_S and attention_T, the dim of num_heads... | 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
... | lonePatient/TorchBlocks | AttCeMeanLoss | false | 15,967 | [
"MIT"
] | 82 | 4a65d746cc8a396cb7df73ed4644d97ddf843e29 | https://github.com/lonePatient/TorchBlocks/tree/4a65d746cc8a396cb7df73ed4644d97ddf843e29 |
Attention | import torch
import torch.nn as nn
import torch.utils.data
class Attention(nn.Module):
def __init__(self):
super(Attention, self).__init__()
def forward(self, input_hidden_traces, target_hidden_traces):
Attn = torch.bmm(target_hidden_traces, input_hidden_traces.
transpose(1, 2))
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | hk19960522/2018-DL-Final | Attention | false | 3,588 | [
"MIT"
] | 0 | cbc70260aa22d7df366a1d28bee472f1fc5b82c7 | https://github.com/hk19960522/2018-DL-Final/tree/cbc70260aa22d7df366a1d28bee472f1fc5b82c7 |
GlobalAvgPool2d | # 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... | synxlin/mini-torchpack | GlobalAvgPool2d | false | 4,400 | [
"MIT"
] | 0 | 3ea5bca75992941e4346102d99e789a88417d7c1 | https://github.com/synxlin/mini-torchpack/tree/3ea5bca75992941e4346102d99e789a88417d7c1 |
Critic | # 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 numpy as np
... | SriramPingali/P3_collaborate_complete | Critic | false | 11,897 | [
"MIT"
] | 0 | 66df22c9eb7577b15adcaa7bbc1796dbd333af2e | https://github.com/SriramPingali/P3_collaborate_complete/tree/66df22c9eb7577b15adcaa7bbc1796dbd333af2e |
XSigmoid | import torch
def _assert_no_grad(tensor):
assert not tensor.requires_grad
class XSigmoid(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, output, target):
_assert_no_grad(target)
error = target - output
return torch.mean(2 * error / (1 + 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
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_stride = t... | dattientran/attorch | XSigmoid | false | 12,393 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
ShallowNet | # 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... | SkBlaz/KBNR | ShallowNet | false | 5,830 | [
"MIT"
] | 1 | 4c37fe3fdfa7719572affd617e2dab43a54ba1d5 | https://github.com/SkBlaz/KBNR/tree/4c37fe3fdfa7719572affd617e2dab43a54ba1d5 |
SeqAttnMatch | import torch
import torch.nn as nn
from torch.nn import 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.... | hamishivi/claf | SeqAttnMatch | false | 3,561 | [
"MIT"
] | 0 | 8e35f30e3fc4a45a45cc0766eb6ab55a6ba3f0c2 | https://github.com/hamishivi/claf/tree/8e35f30e3fc4a45a45cc0766eb6ab55a6ba3f0c2 |
LabelSmoothCrossEntropyLoss | # 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
... | gosiqueira/dog-breed-recognition | LabelSmoothCrossEntropyLoss | false | 10,162 | [
"MIT"
] | 0 | 27d3499f4922e6e36219f47af08c34e30c929e12 | https://github.com/gosiqueira/dog-breed-recognition/tree/27d3499f4922e6e36219f47af08c34e30c929e12 |
BCEWithLogitsLoss2d | import torch
import numpy as np
import torch.nn as nn
class BCEWithLogitsLoss2d(nn.Module):
"""Computationally stable version of 2D BCE loss
"""
def __init__(self, weight=None, reduction='elementwise_mean'):
super(BCEWithLogitsLoss2d, self).__init__()
if isinstance(weight, np.ndarray):
... | 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... | MIPT-Oulu/3D-Histo-Grading | BCEWithLogitsLoss2d | false | 5,566 | [
"MIT"
] | 1 | b779a154d0e5b104fc152c8952124768fb7b1dc6 | https://github.com/MIPT-Oulu/3D-Histo-Grading/tree/b779a154d0e5b104fc152c8952124768fb7b1dc6 |
Q_Index | # 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... | dawnofthedebayan/MedAI_Project | Q_Index | false | 1,807 | [
"Apache-2.0"
] | 0 | a7f2597c96569662f1ca9d21ffd0eb41c77211c1 | https://github.com/dawnofthedebayan/MedAI_Project/tree/a7f2597c96569662f1ca9d21ffd0eb41c77211c1 |
FCLateActionSAQFunction | import torch
import numpy as np
from torch import nn
from abc import ABCMeta
from abc import abstractmethod
import torch.nn.functional as F
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
from torch... | tarokiritani/pfrl | FCLateActionSAQFunction | false | 11,031 | [
"MIT"
] | 0 | 284ed1f43b32654a2ec1569b16a0f6b9acbd5e79 | https://github.com/tarokiritani/pfrl/tree/284ed1f43b32654a2ec1569b16a0f6b9acbd5e79 |
BiaffineAttention | import torch
import torch.nn as nn
class BiaffineAttention(nn.Module):
def __init__(self, in1_features, in2_features, num_label, bias=True):
super(BiaffineAttention, self).__init__()
self.bilinear = nn.Bilinear(in1_features, in2_features, num_label,
bias=bias)
self.linear = nn... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | LindgeW/DomainAdaption4DependencyParsing | BiaffineAttention | false | 5,542 | [
"Apache-2.0"
] | 1 | 5de136a37d8fe730e4235ed95bf923763fe21ea6 | https://github.com/LindgeW/DomainAdaption4DependencyParsing/tree/5de136a37d8fe730e4235ed95bf923763fe21ea6 |
TransformerDecoderLayer | import torch
import torch.nn as nn
from torch.nn import functional as F
import torch._utils
def _get_activation_fn(activation):
"""Return an activation function given a string"""
if activation == 'relu':
return F.relu
if activation == 'gelu':
return F.gelu
if activation == 'glu':
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | dingmyu/mmclassification | TransformerDecoderLayer | false | 12,297 | [
"Apache-2.0"
] | 0 | c600b22907fb9423899f7c308c659168c2d01cd8 | https://github.com/dingmyu/mmclassification/tree/c600b22907fb9423899f7c308c659168c2d01cd8 |
_Residual_Block | import torch
import torch.nn as nn
class _Residual_Block(nn.Module):
def __init__(self, inc=64, outc=64, groups=1):
super(_Residual_Block, self).__init__()
if inc is not outc:
self.conv_expand = nn.Conv2d(in_channels=inc, out_channels=outc,
kernel_size=1, stride=1, pad... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | BradyFU/DVG | _Residual_Block | false | 13,438 | [
"MIT"
] | 102 | 53fd50cdc51d783b33394726b8f8a2b2216f157b | https://github.com/BradyFU/DVG/tree/53fd50cdc51d783b33394726b8f8a2b2216f157b |
PosEnc | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
import torch.utils
from matplotlib import cm as cm
from torch.nn.parallel import *
from torchv... | evdcush/ppuda | PosEnc | false | 15,344 | [
"MIT"
] | 262 | 22783ac92207da6730ee618c953af230c5c39f28 | https://github.com/evdcush/ppuda/tree/22783ac92207da6730ee618c953af230c5c39f28 |
PytorchMultiClass | # 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.... | HninPwint/beer_type_prediction | PytorchMultiClass | false | 5,314 | [
"MIT"
] | 1 | 6845920821bedc059dbe92af5c4a7689cb616023 | https://github.com/HninPwint/beer_type_prediction/tree/6845920821bedc059dbe92af5c4a7689cb616023 |
PPReLU | # 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 torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | hilman-dayo/ObjectDetection-OneStageDet | PPReLU | false | 15,524 | [
"MIT"
] | 331 | 44054ad335e24e99a98fdad0d18b9bf3a80c941c | https://github.com/hilman-dayo/ObjectDetection-OneStageDet/tree/44054ad335e24e99a98fdad0d18b9bf3a80c941c |
NoisyLinear | import math
import torch
import torch.nn as nn
import torch.nn
import torch.optim
class NoisyLinear(nn.Linear):
def __init__(self, in_dimension, out_dimension, std_dev_init=0.4) ->None:
"""
Noisy Networks for Exploration: https://arxiv.org/abs/1706.10295
Standard linear layer: y = wx + b
... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libd... | ailzy/Horizon | NoisyLinear | false | 6,127 | [
"BSD-3-Clause"
] | 1 | 377786d6c0306c3ecec1b18b6029f72949a4fdea | https://github.com/ailzy/Horizon/tree/377786d6c0306c3ecec1b18b6029f72949a4fdea |
RobertaClassificationHead | import torch
import torch.nn as nn
from typing import Optional
class RobertaClassificationHead(nn.Module):
def __init__(self, num_classes, input_dim, inner_dim: 'Optional[int]'=
None, dropout: 'float'=0.1, activation=nn.ReLU):
super().__init__()
if not inner_dim:
inner_dim = i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from ty... | LaudateCorpus1/text-1 | RobertaClassificationHead | false | 9,267 | [
"BSD-3-Clause"
] | 0 | 8808e7eee5a2df79b9566a4a348889dc2722fcfb | https://github.com/LaudateCorpus1/text-1/tree/8808e7eee5a2df79b9566a4a348889dc2722fcfb |
LeastSquaresGenerativeAdversarialLoss | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
import torch.utils.data.distributed
class LeastSquaresGenerativeAdversarialLoss(nn.Module):
"""
Loss for `Least Squares Generative Adversarial Network (LSGAN) <https://arxiv.org/abs/1611.04076>`_
Args:
reduction (... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
import torch.utils... | Liuhong99/CST | LeastSquaresGenerativeAdversarialLoss | false | 8,494 | [
"MIT"
] | 20 | f6653a4ee7968fa3ba875a182670636f648be783 | https://github.com/Liuhong99/CST/tree/f6653a4ee7968fa3ba875a182670636f648be783 |
GeneratorBlock | import torch
import torch.nn as nn
def leaky_relu(p=0.2):
return nn.LeakyReLU(p)
class GeneratorBlock(nn.Module):
def __init__(self, input_channels, latent_channels, output_channels,
upsample=True):
super(GeneratorBlock, self).__init__()
if upsample:
self.upsample = nn.U... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | uthree/pg-gan | GeneratorBlock | false | 13,070 | [
"MIT"
] | 0 | 7a72a9f3487a66ddc6c8c51a774e3d8128369b2a | https://github.com/uthree/pg-gan/tree/7a72a9f3487a66ddc6c8c51a774e3d8128369b2a |
WingLoss | # 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 math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | atoaiari/mmpose | WingLoss | false | 6,288 | [
"Apache-2.0"
] | 1 | 256a9117767008e8c33b4038a346aca12233e300 | https://github.com/atoaiari/mmpose/tree/256a9117767008e8c33b4038a346aca12233e300 |
DownSample | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Smooth(nn.Module):
"""
<a id="smooth"></a>
### Smoothing Layer
This layer blurs each channel
"""
def __init__(self):
super().__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | techthiyanes/annotated_deep_learning_paper_implementations | DownSample | false | 16,566 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 |
SimpleCosModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleCosModule(torch.nn.Module):
def __init__(self):
super(SimpleCosModule, self).__init__()
def forward(self, a):
return torch.cos(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = t... | opti-mix/glow | SimpleCosModule | false | 7,395 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
L1CompositionLoss | import functools
import torch
import torch.nn as nn
from torch.nn import 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".
Returns:
Tensor: Reduced lo... | 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... | Sardhendu/mmediting | L1CompositionLoss | false | 9,883 | [
"Apache-2.0"
] | 0 | 623b59ac758d856abc9fab7e845beeab61074d8f | https://github.com/Sardhendu/mmediting/tree/623b59ac758d856abc9fab7e845beeab61074d8f |
ExternalAttention | # 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.... | Nitin-Mane/External-Attention-pytorch | ExternalAttention | false | 14,105 | [
"MIT"
] | 4,466 | 1ceda306c41063af11c956334747763444a4d83f | https://github.com/Nitin-Mane/External-Attention-pytorch/tree/1ceda306c41063af11c956334747763444a4d83f |
L0Loss | import torch
from torch import nn
class L0Loss(nn.Module):
"""L0loss from
"Noise2Noise: Learning Image Restoration without Clean Data"
<https://arxiv.org/pdf/1803.04189>`_ paper.
"""
def __init__(self, gamma=2, eps=1e-08):
super(L0Loss, self).__init__()
self.gamma = gamma
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | sailfish009/torch-toolbox | L0Loss | false | 7,588 | [
"BSD-3-Clause"
] | 1 | 80dfc22c697b9f323e097de72af04f0e5435d7b4 | https://github.com/sailfish009/torch-toolbox/tree/80dfc22c697b9f323e097de72af04f0e5435d7b4 |
BahdanauAttention | # 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.... | SerailHydra/examples | BahdanauAttention | false | 1,051 | [
"BSD-3-Clause"
] | 0 | 547226ff28032d4dab1dbf26e0b5f8b8276d79ae | https://github.com/SerailHydra/examples/tree/547226ff28032d4dab1dbf26e0b5f8b8276d79ae |
Swish | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils
class Swish(nn.Module):
def __init__(self):
super(Swish, self).__init__()
self.beta = nn.Parameter(torch.ones(1))
def forward(self, x):
return x * F.sigmoid(self.beta * x)
def get_inputs():
re... | 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dyna... | lorylei/DARTS-et | Swish | false | 7,128 | [
"Apache-2.0"
] | 1 | f22cfd53c14afd6ba602b8ecfbff9cdf77fc2ff8 | https://github.com/lorylei/DARTS-et/tree/f22cfd53c14afd6ba602b8ecfbff9cdf77fc2ff8 |
ConvRelu | import torch
from torch import nn
def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=True)
class ConvRelu(nn.Module):
def __init__(self, in_: 'int', out: 'int'):
super().__init__()
self.conv = conv3x3(i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | BloodAxe/segmentation-networks-benchmark | ConvRelu | false | 7,856 | [
"MIT"
] | 34 | 2e3feb560102230be9369ab442b4a59cc86dff61 | https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61 |
PSAModule | # 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.... | murufeng/EPSANet | PSAModule | false | 16,167 | [
"MIT"
] | 120 | 9955041a1db4591fae080d2e6edb25e2a2914d47 | https://github.com/murufeng/EPSANet/tree/9955041a1db4591fae080d2e6edb25e2a2914d47 |
ResidualFeedFowardBlock | import torch
class ResidualFeedFowardBlock(torch.nn.Module):
"""Block of two feed-forward layer with a reisdual connection:
f(W1^T x + b1) f(W2^T h1 + b2 ) h2 + x
x ------------------> h1 --------------------> h2 ----------> y
| ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | BUTSpeechFIT/beer | ResidualFeedFowardBlock | false | 16,972 | [
"MIT"
] | 6 | 43fb9027a859db28d2f2f8709260ca2ce9501e25 | https://github.com/BUTSpeechFIT/beer/tree/43fb9027a859db28d2f2f8709260ca2ce9501e25 |
SimpleFmodModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleFmodModule(torch.nn.Module):
def __init__(self):
super(SimpleFmodModule, self).__init__()
def forward(self, a, b):
if b.size() == torch.Size([]):
c = a.fmod(b.item())
else:
c = a.fmod(... | 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._... | mciprian13/glow | SimpleFmodModule | false | 3,998 | [
"Apache-2.0"
] | 0 | 90f88205d9bf8baff8df5bbda51c9d138e3e668b | https://github.com/mciprian13/glow/tree/90f88205d9bf8baff8df5bbda51c9d138e3e668b |
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.... | ahgit2021/deep-reinforcement-learning | Actor | false | 3,041 | [
"MIT"
] | 0 | 081464ba45f803663e841e1635d829aa00cce870 | https://github.com/ahgit2021/deep-reinforcement-learning/tree/081464ba45f803663e841e1635d829aa00cce870 |
Fcn8s | import torch
import numpy as np
import torch.nn as nn
def _upsampling_weights(in_channels, out_channels, kernel_size):
factor = (kernel_size + 1) // 2
if kernel_size % 2 == 1:
center = factor - 1
else:
center = factor - 0.5
og = np.ogrid[:kernel_size, :kernel_size]
filt = (1 - abs(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | lxxue/cil-road-segmentation-2019 | Fcn8s | false | 11,090 | [
"MIT"
] | 0 | c6477556dc3d6d9c8ed2f2a3f185b4d986a03bb4 | https://github.com/lxxue/cil-road-segmentation-2019/tree/c6477556dc3d6d9c8ed2f2a3f185b4d986a03bb4 |
InfoLoss | import math
import torch
import torch.nn as nn
class InfoLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, eps=1e-08):
x = torch.mean(x, 0)
logN = math.log(float(x.shape[0]))
x = x * (x + eps).log() / logN
neg_entropy = x.sum()
retur... | 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... | pudumagico/deepproblog | InfoLoss | false | 16,282 | [
"Apache-2.0"
] | 54 | 6d38e783990551f4030780a1d69c7138fada2020 | https://github.com/pudumagico/deepproblog/tree/6d38e783990551f4030780a1d69c7138fada2020 |
SquashingCosine_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.triton_helpers import libdevice
import math
import ... | JKozerawski/BLT | SquashingCosine_Classifier | false | 17,453 | [
"MIT"
] | 5 | 6f3a6f4dc3c832b62c4ac3f3baf34b6a0bd6e181 | https://github.com/JKozerawski/BLT/tree/6f3a6f4dc3c832b62c4ac3f3baf34b6a0bd6e181 |
UpBlock | # 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 torchvision.transforms import *
assert_size_stride = torch._C._dynamo.guard... | Haabibi/RBPN-PyTorch | UpBlock | false | 5,265 | [
"MIT"
] | 1 | 0b04420b384fcc8f78a7b9afeca179fa6c0332c2 | https://github.com/Haabibi/RBPN-PyTorch/tree/0b04420b384fcc8f78a7b9afeca179fa6c0332c2 |
CNN64x3 | import torch
import torch.nn as nn
class CNN64x3(nn.Module):
def __init__(self, input_channels, output_channels):
super(CNN64x3, self).__init__()
self.conv = nn.Conv2d(in_channels=input_channels, kernel_size=3,
out_channels=output_channels)
self.relu = nn.ReLU()
self.p... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | InExp123/pytorch-self_driving_car | CNN64x3 | false | 2,376 | [
"MIT"
] | 0 | b4e8c8a76079085bf0471dad1820ee9995cffc74 | https://github.com/InExp123/pytorch-self_driving_car/tree/b4e8c8a76079085bf0471dad1820ee9995cffc74 |
wide_basic | # 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... | tianyi21/JEM | wide_basic | false | 4,437 | [
"Apache-2.0"
] | 0 | 59b4bb87be1b1643731540133df557edd7780a88 | https://github.com/tianyi21/JEM/tree/59b4bb87be1b1643731540133df557edd7780a88 |
WingLoss | # 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 math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | ALISCIFP/mmpose | WingLoss | false | 2,062 | [
"Apache-2.0"
] | 0 | 2433e3dbcc44baa2253e2a7c748ba0216937933e | https://github.com/ALISCIFP/mmpose/tree/2433e3dbcc44baa2253e2a7c748ba0216937933e |
BackwardCrossAttentionLayer | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class ResidualConnectionLayer(nn.Module):
def __init__(self, dim_model, prob_dropout=0.1, add_sublayer=True):
super(ResidualConnectionLayer, self).__init__()
self.add_sublayer = add_sublayer
self.norm = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | KirkGuo/HCN | BackwardCrossAttentionLayer | false | 5,481 | [
"MIT"
] | 1 | 7d8020c8d76413b6ca3a359fb2e9b34652949e17 | https://github.com/KirkGuo/HCN/tree/7d8020c8d76413b6ca3a359fb2e9b34652949e17 |
NormMLP | import torch
import torch.nn as nn
import torch.nn.functional as F
class NormMLP(nn.Module):
def __init__(self, input_size, output_size):
super(NormMLP, self).__init__()
self.linear = nn.Linear(input_size, output_size)
self.layer_norm = nn.LayerNorm(output_size)
def forward(self, act... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | lizhaoliu-Lec/apl | NormMLP | false | 3,927 | [
"MIT"
] | 0 | 3c8837f93b21353f9dd3ed7e0dd02982d0caab4c | https://github.com/lizhaoliu-Lec/apl/tree/3c8837f93b21353f9dd3ed7e0dd02982d0caab4c |
kAttentionPooling | import torch
import torch.nn as nn
class kAttentionPooling(nn.Module):
def __init__(self, seq_len, hidden_size, k_heads=5):
super().__init__()
self.k_heads = k_heads
self.theta_k = nn.Parameter(torch.randn([hidden_size, k_heads]))
def forward(self, input_tensor):
attention_ma... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | BELIEVEfxy/LightSANs | kAttentionPooling | false | 7,782 | [
"MIT"
] | 17 | 94ce7e59d144dbc787153b8c486cad334790ec6e | https://github.com/BELIEVEfxy/LightSANs/tree/94ce7e59d144dbc787153b8c486cad334790ec6e |
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
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ChienHsuan/MMT | TripletLoss | false | 13,482 | [
"MIT"
] | 425 | fe4a559b8af3ec93242b24acb4c8e962a00a1248 | https://github.com/ChienHsuan/MMT/tree/fe4a559b8af3ec93242b24acb4c8e962a00a1248 |
DenseAtt | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.optim
import torch.nn.modules.loss
assert_siz... | RingBDStack/ACE-HGNN | DenseAtt | false | 17,846 | [
"MIT"
] | 5 | afc610dd838951dcd6c3910795b472566f0c23ca | https://github.com/RingBDStack/ACE-HGNN/tree/afc610dd838951dcd6c3910795b472566f0c23ca |
RKDLoss | # 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 import triton_helpers
from torch._inductor.runtime.... | UBCDingXin/RepDistiller | RKDLoss | false | 14,529 | [
"BSD-2-Clause"
] | 1,347 | dcc043277f2820efafd679ffb82b8e8195b7e222 | https://github.com/UBCDingXin/RepDistiller/tree/dcc043277f2820efafd679ffb82b8e8195b7e222 |
LR | import torch
import torch.nn as nn
import torch.nn.functional as F
class LR(nn.Module):
""" Logistinc regression
"""
def __init__(self, input_nc, input_width, input_height, no_classes=10,
**kwargs):
super(LR, self).__init__()
self.fc = nn.Linear(input_nc * input_width * input_heig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | yulinfeng000/AdaptiveNeuralTrees | LR | false | 13,155 | [
"MIT"
] | 0 | bbcb381b9cb0c91ae1af33ce43b43f352055041c | https://github.com/yulinfeng000/AdaptiveNeuralTrees/tree/bbcb381b9cb0c91ae1af33ce43b43f352055041c |
SEModule | # 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.nn import Module
f... | ArashVahabpour/encoder4editing-contrastive | SEModule | false | 13,287 | [
"MIT"
] | 1,051 | 1b91afe1693e01a41118e1ce2451b7d14bec51f4 | https://github.com/ArashVahabpour/encoder4editing-contrastive/tree/1b91afe1693e01a41118e1ce2451b7d14bec51f4 |
GELU | import math
import torch
from torch import nn
from torch.optim.lr_scheduler import *
from torch.optim import *
class GELU(nn.Module):
"""
Paper Section 3.4, last paragraph notice that BERT used the GELU instead of RELU
"""
def forward(self, x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / 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
from torch import nn
from torch.optim.lr_scheduler import *
from torch.optim im... | Challyfilio/NAIC2021 | GELU | false | 231 | [
"MIT"
] | 0 | 11b38a920dcc902f9b798dc43ae360062862e6e4 | https://github.com/Challyfilio/NAIC2021/tree/11b38a920dcc902f9b798dc43ae360062862e6e4 |
AttentiveStatsPool | # 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.... | ishine/asv-subtools | AttentiveStatsPool | false | 15,637 | [
"Apache-2.0"
] | 370 | 597dcb29a772b8113dbe7ab64f0d4cc1da298707 | https://github.com/ishine/asv-subtools/tree/597dcb29a772b8113dbe7ab64f0d4cc1da298707 |
cnn_4layer | # 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_... | mnmueller/auto_LiRPA | cnn_4layer | false | 7,263 | [
"BSD-3-Clause"
] | 1 | 55cb270b0b99f07b74541d55706c69fbb9daff66 | https://github.com/mnmueller/auto_LiRPA/tree/55cb270b0b99f07b74541d55706c69fbb9daff66 |
PixelNormLayer | import torch
import torch.nn as nn
class PixelNormLayer(nn.Module):
def __init__(self):
super(PixelNormLayer, self).__init__()
def forward(self, x):
return x / torch.sqrt(torch.mean(x ** 2, dim=1, keepdim=True) + 1e-08)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | NunoEdgarGFlowHub/gandissect | PixelNormLayer | false | 5,663 | [
"MIT"
] | 1 | 1a162a6bd3d4842139feb9f191aa1fad565dee4e | https://github.com/NunoEdgarGFlowHub/gandissect/tree/1a162a6bd3d4842139feb9f191aa1fad565dee4e |
Polynomial3 | # 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.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.op... | Nayef211/tutorials | Polynomial3 | false | 9,526 | [
"BSD-3-Clause"
] | 0 | faf2c476fc3be855051fbea3cce77eaf7b2a2175 | https://github.com/Nayef211/tutorials/tree/faf2c476fc3be855051fbea3cce77eaf7b2a2175 |
TwoMLPHead | import torch
from torch import nn
import torch.nn.functional as F
class TwoMLPHead(nn.Module):
"""
Standard heads for FPN-based models
Arguments:
in_channels (int): number of input channels
representation_size (int): size of the intermediate representation
"""
def __init__(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 import nn
assert_s... | GerardWalsh/DeepLabv3FineTuning | TwoMLPHead | false | 11,530 | [
"MIT"
] | 0 | 149d4b33a7dc94c56361f559ca67cb0fcf9ae9d5 | https://github.com/GerardWalsh/DeepLabv3FineTuning/tree/149d4b33a7dc94c56361f559ca67cb0fcf9ae9d5 |
CNN_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.... | Jiangtong-Li/ZHSIR | CNN_attention | false | 17,500 | [
"Apache-2.0"
] | 8 | fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 | https://github.com/Jiangtong-Li/ZHSIR/tree/fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 |
SigmoidAbsoluteRelativeErrorLoss | # 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
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_... | ElectronicElephant/openpilot-reimplementation | SigmoidAbsoluteRelativeErrorLoss | false | 2,200 | [
"MIT"
] | 0 | 063a9f5c6bbbf02c03dadc59e236e8f7c253a350 | https://github.com/ElectronicElephant/openpilot-reimplementation/tree/063a9f5c6bbbf02c03dadc59e236e8f7c253a350 |
GEGLU | import torch
import torch.nn.functional as F
from torch import nn
class GEGLU(nn.Module):
def forward(self, x):
x, gates = x.chunk(2, dim=-1)
return x * F.gelu(gates)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | TabbenBenchmark/tabben | GEGLU | false | 17,963 | [
"MIT"
] | 5 | d74114afc4b6f67be488ab6bf8ad6fd316fdb888 | https://github.com/TabbenBenchmark/tabben/tree/d74114afc4b6f67be488ab6bf8ad6fd316fdb888 |
OnnxGatherElements | # 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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | ENOT-AutoDL/onnx2torch | OnnxGatherElements | false | 13,622 | [
"Apache-2.0"
] | 144 | 2391987b3349bed1670ac3c1bc9062a37323abe3 | https://github.com/ENOT-AutoDL/onnx2torch/tree/2391987b3349bed1670ac3c1bc9062a37323abe3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.