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 |
|---|---|---|---|---|---|---|---|---|---|---|
TonemappedMSE | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Mephisto405/WCMC-Public | TonemappedMSE | false | 8,551 | [
"BSD-2-Clause"
] | 19 | bd54f218d5239db84f404fbe1b465f9497bcf9e4 | https://github.com/Mephisto405/WCMC-Public/tree/bd54f218d5239db84f404fbe1b465f9497bcf9e4 |
ViTStemPatchify | from torch.nn import Module
import torch
import torch.nn as nn
import torch.utils.data
def patchify2d(w_in, w_out, k, *, bias=True):
"""Helper for building a patchify layer as used by ViT models."""
return nn.Conv2d(w_in, w_out, k, stride=k, padding=0, bias=bias)
def patchify2d_cx(cx, w_in, w_out, k, *, bia... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import torch.nn as nn
import torch.utils.data
assert... | MAC-AutoML/XCompression | ViTStemPatchify | false | 5,567 | [
"MIT"
] | 1 | 9f76eb3ccfb3057110ecf12aa48dec00a4667a25 | https://github.com/MAC-AutoML/XCompression/tree/9f76eb3ccfb3057110ecf12aa48dec00a4667a25 |
hsigmoid | # 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.onnx
import torch
import torch.nn as nn
assert_size_stride = torch._C._dynam... | tomy-0000/pytorch-ssd | hsigmoid | false | 10,924 | [
"MIT"
] | 0 | 620c0020bbd418001d10263559406bb464139419 | https://github.com/tomy-0000/pytorch-ssd/tree/620c0020bbd418001d10263559406bb464139419 |
RobertaSelfOutput | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class RobertaSelfOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | BlackNoodle/TUCORE-GCN | RobertaSelfOutput | false | 8,780 | [
"MIT"
] | 27 | 16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 | https://github.com/BlackNoodle/TUCORE-GCN/tree/16fb37d81c5b1182a31fcf7da08a9c0013b20cd6 |
VocabGraphConvolution | # 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.nn.init as init
assert_size_strid... | Aksh97/VGCN-BERT | VocabGraphConvolution | false | 13,244 | [
"MIT"
] | 106 | 62b5ae5a3c53f4bff555027d87a57d3a994a32bb | https://github.com/Aksh97/VGCN-BERT/tree/62b5ae5a3c53f4bff555027d87a57d3a994a32bb |
Norm | import torch
import torch.nn as nn
import torch.onnx
class Norm(nn.Module):
def __init__(self, emb_dim, eps=1e-06):
super().__init__()
self.size = emb_dim
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.zeros(self.size))
self.eps = eps
... | 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.onnx
assert_size_stride = torch._C._dynamo.g... | chandar-lab/CriticalGradientOptimization | Norm | false | 6,411 | [
"MIT"
] | 1 | 1af4b1df40489991289bb50bb69859a00b2c97c6 | https://github.com/chandar-lab/CriticalGradientOptimization/tree/1af4b1df40489991289bb50bb69859a00b2c97c6 |
BertOutput | # 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.nn impor... | axiserr/Hetu | BertOutput | false | 14,938 | [
"Apache-2.0"
] | 82 | 0052f727488db0570d6b37f63549b43b0920bc29 | https://github.com/axiserr/Hetu/tree/0052f727488db0570d6b37f63549b43b0920bc29 |
HeatmapLoss | import torch
import torch.utils.data
class HeatmapLoss(torch.nn.Module):
"""
loss for detection heatmap
"""
def __init__(self):
super(HeatmapLoss, self).__init__()
def forward(self, pred, gt):
l = (pred - gt) ** 2
l = l.mean(dim=3).mean(dim=2).mean(dim=1)
return l... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_... | rm-rf-me/Study-stacked-hourglass | HeatmapLoss | false | 7,572 | [
"BSD-3-Clause"
] | 1 | 48441f0dd5ae3397470c70db0f50ab5576b9d2f2 | https://github.com/rm-rf-me/Study-stacked-hourglass/tree/48441f0dd5ae3397470c70db0f50ab5576b9d2f2 |
L2Norm | import torch
import torch.nn as nn
class L2Norm(nn.Module):
def __init__(self, n_channels, scale=1.0):
super(L2Norm, self).__init__()
self.n_channels = n_channels
self.scale = scale
self.eps = 1e-10
self.weight = nn.Parameter(torch.Tensor(self.n_channels))
self.wei... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | Rocketbase-AI/rockets-s3fd | L2Norm | false | 987 | [
"MIT"
] | 0 | 40d978270a6b3ba2d397217ede0c735712814250 | https://github.com/Rocketbase-AI/rockets-s3fd/tree/40d978270a6b3ba2d397217ede0c735712814250 |
MaxPoolStride1 | import torch
import torch.nn as nn
import torch.nn.functional as F
class MaxPoolStride1(nn.Module):
def __init__(self):
super(MaxPoolStride1, self).__init__()
def forward(self, x):
x = F.max_pool2d(F.pad(x, (0, 1, 0, 1), mode='replicate'), 2, stride=1)
return x
def get_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 import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | AmitNativ1984/masqr | MaxPoolStride1 | false | 8,865 | [
"MIT"
] | 0 | a57a60d1011aa70317f5893fc05bfb0f029cafb5 | https://github.com/AmitNativ1984/masqr/tree/a57a60d1011aa70317f5893fc05bfb0f029cafb5 |
nin | # 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 ... | Warvito/lmconv | nin | false | 14,570 | [
"MIT"
] | 69 | 01adba51e3fff1e7da99324dc64a9fc9cd38621e | https://github.com/Warvito/lmconv/tree/01adba51e3fff1e7da99324dc64a9fc9cd38621e |
SConv2d | import math
import torch
import torch.nn as nn
def quick_scale(module, name='weight'):
ScaleW.apply(module, name)
return module
class ScaleW:
"""
Constructor: name - name of attribute to be scaled
"""
def __init__(self, name):
self.name = name
def scale(self, module):
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
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | sergkuzn148/stg | SConv2d | false | 16,383 | [
"MIT"
] | 96 | 84d9f53ae3665c423836a4d0176dc3b22de62b19 | https://github.com/sergkuzn148/stg/tree/84d9f53ae3665c423836a4d0176dc3b22de62b19 |
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 torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | HalimSD/A-eye | LayerNorm | false | 2,332 | [
"MIT"
] | 0 | 502dcdf47d54d93e8745be7c49897064550db8c7 | https://github.com/HalimSD/A-eye/tree/502dcdf47d54d93e8745be7c49897064550db8c7 |
Bilinear | import torch
from torch import Tensor
from torch import nn as nn
import torch.nn.functional as F
class MonteCarloDropout(nn.Dropout):
"""
Defines Monte Carlo dropout Module as defined
in the paper https://arxiv.org/pdf/1506.02142.pdf.
In summary, This technique uses the regular dropout
which can 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 import Tensor
from torch import nn as nn
import torch.nn.functional a... | gdevos010/darts | Bilinear | false | 3,667 | [
"Apache-2.0"
] | 0 | 96c97c1e241500ae7b91d32bbfa21d811e4a7d71 | https://github.com/gdevos010/darts/tree/96c97c1e241500ae7b91d32bbfa21d811e4a7d71 |
AttentionNet | # 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.functional
im... | CarlosPena00/pytorchvision | AttentionNet | false | 245 | [
"MIT"
] | 0 | 824b3a5a8940f3ee6b4da5de7a391a88e5aa36a2 | https://github.com/CarlosPena00/pytorchvision/tree/824b3a5a8940f3ee6b4da5de7a391a88e5aa36a2 |
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.... | Chenny0808/tatk | MultiHeadAttention | false | 13,477 | [
"Apache-2.0"
] | 81 | 1c1a3cb557ba84bbfdbd1f6d8b8ea43ed8b9d7c5 | https://github.com/Chenny0808/tatk/tree/1c1a3cb557ba84bbfdbd1f6d8b8ea43ed8b9d7c5 |
LuongAttentionDot | import torch
import torch.nn as nn
import torch.nn.functional as F
class LuongAttentionDot(nn.Module):
def __init__(self):
super().__init__()
def forward(self, query, values):
query = torch.squeeze(query, 0)
query = torch.unsqueeze(query, 1)
query_transposed = query.transpose... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | beroguedou/nmt-pytorch | LuongAttentionDot | false | 6,336 | [
"MIT"
] | 1 | 8758ba33e2d5f4eca7f1ac2d04582678332bbcd5 | https://github.com/beroguedou/nmt-pytorch/tree/8758ba33e2d5f4eca7f1ac2d04582678332bbcd5 |
ChannelPool | import torch
from torch import nn
class ChannelPool(nn.Module):
def forward(self, x):
return torch.mean(x, 1).unsqueeze(1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | VictorSuciu/ICCV2019_MirrorNet | ChannelPool | false | 14,557 | [
"BSD-3-Clause"
] | 48 | e7ce3c269feaf33a0b156091beebbaebdabf6155 | https://github.com/VictorSuciu/ICCV2019_MirrorNet/tree/e7ce3c269feaf33a0b156091beebbaebdabf6155 |
Neumann | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import math
import torch.nn a... | alexprz/NeuMiss | Neumann | false | 18,272 | [
"BSD-3-Clause"
] | 9 | bf4f68ba4dd29b51ec3de9d6eef85deecebfa68d | https://github.com/alexprz/NeuMiss/tree/bf4f68ba4dd29b51ec3de9d6eef85deecebfa68d |
VarianceLayer | # 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
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 |
ClusterDistance | # 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 import nn
from typing import Optional
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch.... | marx-alex/Morphelia | ClusterDistance | false | 3,977 | [
"MIT"
] | 0 | 809278b07f1a535789455d54df3cbddc850d609c | https://github.com/marx-alex/Morphelia/tree/809278b07f1a535789455d54df3cbddc850d609c |
_CMT_loss | import torch
import torch.nn as nn
class _CMT_loss(nn.Module):
def __init__(self):
super(_CMT_loss, self).__init__()
self.d = nn.PairwiseDistance()
def forward(self, feat, sematics):
"""
:param feat: features of images or images. bs * d. d is the length of word vector.
... | 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_... | Jiangtong-Li/ZHSIR | _CMT_loss | false | 17,497 | [
"Apache-2.0"
] | 8 | fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 | https://github.com/Jiangtong-Li/ZHSIR/tree/fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 |
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.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dy... | xyc1207/benchmarking-gnns | LayerNorm | false | 16,755 | [
"MIT"
] | 1,809 | 9ba25a2825e8c155a93730d6e8f8752090292942 | https://github.com/xyc1207/benchmarking-gnns/tree/9ba25a2825e8c155a93730d6e8f8752090292942 |
MyLinear | # 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.nn
assert_size_stride = torch._C._dynamo.guard... | Qingyang-Xu/GANInversion_with_ConsecutiveImgs | MyLinear | false | 8,683 | [
"MIT"
] | 23 | 9078a48ec3474dacdd02693b051e3addef1c5697 | https://github.com/Qingyang-Xu/GANInversion_with_ConsecutiveImgs/tree/9078a48ec3474dacdd02693b051e3addef1c5697 |
ClippedValueFunctionLoss | # 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.nn import Module
import torch.utils.data
import torch.nn.functional
import tor... | mcx/annotated_deep_learning_paper_implementations | ClippedValueFunctionLoss | false | 7,196 | [
"MIT"
] | 1 | f169f3a71dd2d36eb28ad31062d3475efa367b88 | https://github.com/mcx/annotated_deep_learning_paper_implementations/tree/f169f3a71dd2d36eb28ad31062d3475efa367b88 |
ChannelSELayer1d | # 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_... | ioanvl/1d_squeeze_excitation | ChannelSELayer1d | false | 10,248 | [
"MIT"
] | 0 | f422dc4b8e7de6239a6fb7d1688048db5053e733 | https://github.com/ioanvl/1d_squeeze_excitation/tree/f422dc4b8e7de6239a6fb7d1688048db5053e733 |
SimpleMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | AlexandreGuilbault/CS294-Hws | SimpleMLP | false | 34 | [
"MIT"
] | 0 | 2810323c1560949707b71843039ff7c88ae7e596 | https://github.com/AlexandreGuilbault/CS294-Hws/tree/2810323c1560949707b71843039ff7c88ae7e596 |
SoftCrossEntropyLoss2d | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils
class SoftCrossEntropyLoss2d(nn.Module):
def __init__(self):
super(SoftCrossEntropyLoss2d, self).__init__()
def forward(self, inputs, targets):
loss = 0
inputs = -F.log_softmax(inputs, dim=1)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | jameslong95/FasterSeg | SoftCrossEntropyLoss2d | false | 6,928 | [
"MIT"
] | 1 | 872e04964ea46494a6018d9915cee5476e361c27 | https://github.com/jameslong95/FasterSeg/tree/872e04964ea46494a6018d9915cee5476e361c27 |
LinearFeedforward | import torch
import torch.nn as nn
import torch.utils.data
class Linear(nn.Linear):
def forward(self, x):
size = x.size()
return super().forward(x.contiguous().view(-1, size[-1])).view(*
size[:-1], -1)
class Feedforward(nn.Module):
def __init__(self, d_in, d_out, activation=Non... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | harmdevries89/genienlp | LinearFeedforward | false | 3,576 | [
"BSD-3-Clause"
] | 0 | adf163c63a43adaddecb4b3645635f6ba92772f2 | https://github.com/harmdevries89/genienlp/tree/adf163c63a43adaddecb4b3645635f6ba92772f2 |
RobertaClassificationHead | # 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 ... | burakisikli/Contra-OOD | RobertaClassificationHead | false | 11,139 | [
"MIT"
] | 0 | 0affc280a8db54940c66d822efb2a8722cafdf52 | https://github.com/burakisikli/Contra-OOD/tree/0affc280a8db54940c66d822efb2a8722cafdf52 |
relu | # 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
@... | yifanpu001/PytorchToCaffe | relu | false | 4,722 | [
"MIT"
] | 0 | 37c1ebfc3547e93b1c174721036d03c831c60e48 | https://github.com/yifanpu001/PytorchToCaffe/tree/37c1ebfc3547e93b1c174721036d03c831c60e48 |
ScaleExp | import torch
import torch.nn as nn
class ScaleExp(nn.Module):
def __init__(self, init_value=1.0):
super(ScaleExp, self).__init__()
self.scale = nn.Parameter(torch.FloatTensor([init_value]))
def forward(self, input):
return torch.exp(input * self.scale)
def get_inputs():
return ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | TencentYoutuResearch/ActionDetection-AFSD | ScaleExp | false | 14,464 | [
"BSD-3-Clause"
] | 112 | ed86a0df91e58baa7d78c796ed29cff82b1f3fa6 | https://github.com/TencentYoutuResearch/ActionDetection-AFSD/tree/ed86a0df91e58baa7d78c796ed29cff82b1f3fa6 |
L1Loss | import functools
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 ten... | 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... | AtticusJohnson/mmdetection | L1Loss | false | 11,222 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 |
ChunkSeparationAffine | # 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.functional as F
import torch.nn
assert_size_stride = torch._C._d... | qlindazm/asv-subtools | ChunkSeparationAffine | false | 4,237 | [
"Apache-2.0"
] | 0 | fe1d31db9f3268622016babe944201f6ff81ed56 | https://github.com/qlindazm/asv-subtools/tree/fe1d31db9f3268622016babe944201f6ff81ed56 |
LocalSnrLoss | import torch
from torch import Tensor
from torch import nn
from torch.nn import functional as F
class LocalSnrLoss(nn.Module):
def __init__(self, factor: 'float'=1):
super().__init__()
self.factor = factor
def forward(self, input: 'Tensor', target_lsnr: 'Tensor'):
input = input.squee... | 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... | Rikorose/DeepFilterNet | LocalSnrLoss | false | 14,305 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 54 | afe6bfb53efae70207e18df7ed372c2cfe337fee | https://github.com/Rikorose/DeepFilterNet/tree/afe6bfb53efae70207e18df7ed372c2cfe337fee |
RgbaToRgb | import torch
import torch.nn as nn
def rgba_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert an image from RGBA to RGB.
Args:
image: RGBA Image to be converted to RGB of shape :math:`(*,4,H,W)`.
Returns:
RGB version of the image with shape :math:`(*,3,H,W)`.
Example:
... | 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... | JoanFM/kornia | RgbaToRgb | false | 11,549 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 808898887cde69074ca3e3df9b24dea9682aad90 | https://github.com/JoanFM/kornia/tree/808898887cde69074ca3e3df9b24dea9682aad90 |
DiceLoss | import torch
import torch.nn as nn
class DiceLoss(nn.Module):
def __init__(self, weight=None, size_average=True):
super(DiceLoss, self).__init__()
def forward(self, inputs, targets, smooth=1):
inputs = torch.sigmoid(inputs)
inputs = inputs.view(-1)
targets = targets.view(-1)
... | 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... | chakerouari/UNET_segmetation | DiceLoss | false | 6,413 | [
"MIT"
] | 1 | a7d9e9ccd31595d482f620cbf9a625a486f5f0df | https://github.com/chakerouari/UNET_segmetation/tree/a7d9e9ccd31595d482f620cbf9a625a486f5f0df |
LayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | thetobysiu/transfer-pytorch-dc-tts | LayerNorm | false | 4,423 | [
"MIT"
] | 0 | 20d0c381970a01f0e343c65aeac2f325be436a7e | https://github.com/thetobysiu/transfer-pytorch-dc-tts/tree/20d0c381970a01f0e343c65aeac2f325be436a7e |
WeightedSumLoss | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class WeightedSumLoss(nn.Module):
"""Aggregate multiple loss functions in one weighted sum."""
def __init__(self... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import tor... | JinYAnGHe/openvino_training_extensions | WeightedSumLoss | false | 2,718 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee |
FromRGB | import torch
import torch.nn as nn
class FromRGB(nn.Module):
"""Some Information about FromRGB"""
def __init__(self, channels):
super(FromRGB, self).__init__()
self.conv = nn.Conv2d(3, channels, kernel_size=1, stride=1, padding
=0, bias=True)
def forward(self, x):
ret... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | uthree/gan-image-generator | FromRGB | false | 11,001 | [
"MIT"
] | 0 | 85585e389b5a494393da0789d82824f8c811e263 | https://github.com/uthree/gan-image-generator/tree/85585e389b5a494393da0789d82824f8c811e263 |
CharbonnierLoss | # 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 as nn
assert... | CM-BF/FeatureFlow | CharbonnierLoss | false | 13,436 | [
"MIT"
] | 161 | 06642697922f17211e5faa353e24b1a0946885b1 | https://github.com/CM-BF/FeatureFlow/tree/06642697922f17211e5faa353e24b1a0946885b1 |
SelfAttention | import torch
import torch.nn.functional as F
import torch.nn as nn
class SelfAttention(nn.Module):
def __init__(self, input_size, heads, embed_size):
super().__init__()
self.input_size = input_size
self.heads = heads
self.emb_size = embed_size
self.tokeys = nn.Linear(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.... | benellis3/pymarl2 | SelfAttention | false | 14,950 | [
"Apache-2.0"
] | 401 | 0875995a0e0b9692ea64484478b369c7f6c0cf44 | https://github.com/benellis3/pymarl2/tree/0875995a0e0b9692ea64484478b369c7f6c0cf44 |
EdgeClassifLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | MauTrib/gnn-en-folie | EdgeClassifLoss | false | 818 | [
"Apache-2.0"
] | 0 | 3ca639919a2b285a41641717f4131107c015b510 | https://github.com/MauTrib/gnn-en-folie/tree/3ca639919a2b285a41641717f4131107c015b510 |
BertLayerNorm | import torch
from torch import nn
import torch.onnx
class BertLayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(BertLayerNorm, self).__init__()
self.weight = nn.Paramete... | 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.onnx
assert_size_stride = torch._C._dynamo.gu... | Alwaysproblem/examples-1 | BertLayerNorm | false | 42 | [
"MIT"
] | 0 | 9754fa63ed1931489a21ac1f5b299f945e369a5c | https://github.com/Alwaysproblem/examples-1/tree/9754fa63ed1931489a21ac1f5b299f945e369a5c |
RegressionModel | import torch
import torch.nn as nn
class RegressionModel(nn.Module):
def __init__(self, num_features_in, num_anchors=9, feature_size=256):
super(RegressionModel, self).__init__()
self.conv1 = nn.Conv2d(num_features_in, feature_size, kernel_size=3,
padding=1)
self.act1 = nn.ReL... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | Hyojin021/auto_labeling | RegressionModel | false | 11,644 | [
"Apache-2.0"
] | 0 | 1ccf0cd1c5adf34692751553a988aa0fcf4efefb | https://github.com/Hyojin021/auto_labeling/tree/1ccf0cd1c5adf34692751553a988aa0fcf4efefb |
UPChannelBAN | # 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.functional as F
import torch.nn as nn
assert_size_stride = torch... | QiangliangHuang/siamban | UPChannelBAN | false | 14,334 | [
"Apache-2.0"
] | 216 | 940208cb26f8146f87f7534d1674791dcb62468a | https://github.com/QiangliangHuang/siamban/tree/940208cb26f8146f87f7534d1674791dcb62468a |
ScaledDotProductAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention --baseline version"""
def __init__(self, dropout=0.3):
super().__init__()
self.dropout = nn.Dropout(dropout)
def forward(self, q, k, v, mask=Non... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ayyyq/T-LSTM | ScaledDotProductAttention | false | 6,309 | [
"MIT"
] | 1 | 36dbc88ac710d3925851cd87c2368ecfc7061b70 | https://github.com/ayyyq/T-LSTM/tree/36dbc88ac710d3925851cd87c2368ecfc7061b70 |
GumbelMNACLayer | import collections
import torch
import torch.utils.data
def mnac(x, W, mode='prod'):
out_size, in_size = W.size()
x = x.view(x.size()[0], in_size, 1)
W = W.t().view(1, in_size, out_size)
if mode == 'prod':
return torch.prod(x * W + 1 - W, -2)
elif mode == 'exp-log':
return torch.ex... | 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
from torch._inductor.runtime.triton_helpers import math as tl_math
import collections
import torch.utils.data
asser... | hoedt/stable-nalu | GumbelMNACLayer | false | 3,608 | [
"MIT"
] | 0 | 64b3d240db8bff4da857d955f213ef3c7e38e035 | https://github.com/hoedt/stable-nalu/tree/64b3d240db8bff4da857d955f213ef3c7e38e035 |
PrimaryCapsule | # 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 ... | Arno3165229/Corner_Traffic_Light | PrimaryCapsule | false | 8,881 | [
"BSD-3-Clause"
] | 0 | 91eead49318a3b1e3a9c2295cbe5661cb1074b69 | https://github.com/Arno3165229/Corner_Traffic_Light/tree/91eead49318a3b1e3a9c2295cbe5661cb1074b69 |
Splitter | import torch
import numpy as np
class Splitter(torch.nn.Module):
"""
An implementation of "Splitter: Learning Node Representations that Capture Multiple Social Contexts" (WWW 2019).
Paper: http://epasto.org/papers/www2019splitter.pdf
"""
def __init__(self, dimensions, lambd, base_node_count, node... | 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... | balla2081/SpliiterPytorch | Splitter | false | 3,174 | [
"MIT"
] | 0 | 366742166470dc730fe761bae081779d737e1315 | https://github.com/balla2081/SpliiterPytorch/tree/366742166470dc730fe761bae081779d737e1315 |
Net | import torch
from torch.nn import functional as F
from torch import nn
from torchvision import models as models
import torch.onnx
import torch.nn
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 10, kernel_size=3)
self.conv2 = nn.Conv2d(10, 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.... | krodyush/training_extensions | Net | false | 10,992 | [
"Apache-2.0"
] | 0 | 542f4004dfbc6fc62a622065367ba4f85a703dd3 | https://github.com/krodyush/training_extensions/tree/542f4004dfbc6fc62a622065367ba4f85a703dd3 |
SimpleGFLLoss | import torch
import torch.nn.functional as F
def simple_gfl(pred, target, beta):
"""Simply add a pow of abs difference in front of BCE"""
assert pred.size() == target.size(
), 'simple GFL assume pred and target to have the same shape'
loss = (pred.sigmoid() - target).abs().pow(beta)
loss = F.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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | huimlight/OpenMMLab-IoUNet | SimpleGFLLoss | false | 6,829 | [
"Apache-2.0"
] | 1 | 00536bac99f4d3d7ad2682dad44f299f714565b6 | https://github.com/huimlight/OpenMMLab-IoUNet/tree/00536bac99f4d3d7ad2682dad44f299f714565b6 |
Downsample | import torch
import torch.nn as nn
import torch.nn.parallel
class Downsample(nn.Module):
"""
Image to Patch Embedding, downsampling between stage1 and stage2
"""
def __init__(self, in_embed_dim, out_embed_dim, patch_size):
super().__init__()
self.proj = nn.Conv2d(in_embed_dim, out_emb... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
assert_size_stride = torch._C._dy... | javierrodenas/clearml_javi | Downsample | false | 10,358 | [
"Apache-2.0"
] | 0 | b6326104fe6a6f522223c2ac3d87468990a9e6f2 | https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2 |
PositionwiseFeedForward | import torch
import torch.nn.functional as F
import torch.nn as nn
class PositionwiseFeedForward(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_in, d_hid, dropout=0.1):
super().__init__()
self.w_1 = nn.Linear(d_in, d_hid)
self.w_2 = nn.Linear(d_hid, d_in)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | RogerTsai917/attention-is-all-you-need-pytorch | PositionwiseFeedForward | false | 2,775 | [
"MIT"
] | 0 | 64197e55d275e5c819bc786a9ff19849cdf2f6b9 | https://github.com/RogerTsai917/attention-is-all-you-need-pytorch/tree/64197e55d275e5c819bc786a9ff19849cdf2f6b9 |
Quantizing | import torch
import torch.nn as nn
from typing import Tuple
class Quantizing(nn.Module):
"""
This is quantizing layer.
"""
__initialized: 'bool' = True
def __init__(self, num_quantizing: 'int', quantizing_dim: 'int',
_weight: 'torch.Tensor'=None, initialize_by_dataset: 'bool'=True,
... | 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... | Geson-anko/VQ_AutoEncoder | Quantizing | false | 2,289 | [
"MIT"
] | 0 | 62e1694de38ea6f152891e19abc190ad4048e587 | https://github.com/Geson-anko/VQ_AutoEncoder/tree/62e1694de38ea6f152891e19abc190ad4048e587 |
SeperableConv | import torch
import torch.nn as nn
import torch.nn.functional as F
def _get_padding(kernel_size, stride, dilation):
padding = (stride - 1 + dilation * (kernel_size - 1)) // 2
return padding
class SeperableConv(nn.Module):
def __init__(self, inp, outp, k=3, stride=1, dilation=1):
super(Seperable... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | henningpohl/body-based-ar | SeperableConv | false | 6,797 | [
"MIT"
] | 1 | dc7d5d6eaf8dd4427de0f2b1cfdcc415cbfffdfb | https://github.com/henningpohl/body-based-ar/tree/dc7d5d6eaf8dd4427de0f2b1cfdcc415cbfffdfb |
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.... | alexarnimueller/smiles-transformer | Attention | false | 9,673 | [
"MIT"
] | 0 | 4584a0bd043d6659a941589677951b2c6823cd2a | https://github.com/alexarnimueller/smiles-transformer/tree/4584a0bd043d6659a941589677951b2c6823cd2a |
ResizeConv2d | import torch
from torch import nn
import torch.utils.data
class ResizeConv2d(nn.Module):
def __init__(self, input_channels, output_channels, kernel_size, stride,
padding, dilation=1, scale_factor=2, activation=None):
super(ResizeConv2d, self).__init__()
self.activation = activation
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.utils.data
assert_size_stride = torch._C._dyna... | RobertYCXu/vae_vampprior | ResizeConv2d | false | 9,571 | [
"MIT"
] | 0 | edcec4f5f7af673172c5b5b9aa2a22f993564fab | https://github.com/RobertYCXu/vae_vampprior/tree/edcec4f5f7af673172c5b5b9aa2a22f993564fab |
DiscShiftLoss | import torch
import torch.nn as nn
class DiscShiftLoss(nn.Module):
"""Disc shift loss.
Args:
loss_weight (float, optional): Loss weight. Defaults to 1.0.
"""
def __init__(self, loss_weight=0.1):
super().__init__()
self.loss_weight = loss_weight
def forward(self, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | Jason-Khan/mmediting | DiscShiftLoss | false | 614 | [
"Apache-2.0"
] | 0 | d187f95a675dff3eb975a575bd9278d643b5b645 | https://github.com/Jason-Khan/mmediting/tree/d187f95a675dff3eb975a575bd9278d643b5b645 |
BertSelfAttention | # 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.... | Abhimanyu08/minbert-assignment | BertSelfAttention | false | 11,806 | [
"Apache-2.0"
] | 0 | 1610364213b1aab2d5446175dffabd7e1742833b | https://github.com/Abhimanyu08/minbert-assignment/tree/1610364213b1aab2d5446175dffabd7e1742833b |
Conv2d | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.nn.functional as F
class Conv2d(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, bias=True):
super(Conv2d, self).__init__(in_channels, out_channels, kernel_siz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | T1anZhenYu/pytorch-classification | Conv2d | false | 1,110 | [
"MIT"
] | 0 | ad68e09f20a98541bcb437a7df8e7d14e8c21636 | https://github.com/T1anZhenYu/pytorch-classification/tree/ad68e09f20a98541bcb437a7df8e7d14e8c21636 |
GCN | from torch.nn import Module
import math
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __ini... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | hongfz16/Garment4D | GCN | false | 15,539 | [
"MIT"
] | 89 | 9317dc262f3d35eb9e6cd6a7bfbb29f04560ca35 | https://github.com/hongfz16/Garment4D/tree/9317dc262f3d35eb9e6cd6a7bfbb29f04560ca35 |
Reg_layer | # 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... | Peiiii/detro | Reg_layer | false | 946 | [
"MIT"
] | 0 | 26d74468d7554dc20b2a2daf7ec5009302c820f2 | https://github.com/Peiiii/detro/tree/26d74468d7554dc20b2a2daf7ec5009302c820f2 |
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.... | PINE4PPLE/transformer-lm | ScaledDotProductAttention | false | 9,397 | [
"MIT"
] | 0 | da76a4afd29d1fd023ba866ccc21a49901ad46f2 | https://github.com/PINE4PPLE/transformer-lm/tree/da76a4afd29d1fd023ba866ccc21a49901ad46f2 |
PositionwiseFeedForward | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Doomski99/MarcCoru2019CropType | PositionwiseFeedForward | false | 11,386 | [
"MIT"
] | 0 | 17db294ef51bdd39fd884e0052141d8092b98b86 | https://github.com/Doomski99/MarcCoru2019CropType/tree/17db294ef51bdd39fd884e0052141d8092b98b86 |
ConvReLU | import math
import torch
import torch.nn.functional as F
from torch.nn import Conv2d
from torch.nn import LeakyReLU
class PadSameConv2d(torch.nn.Module):
def __init__(self, kernel_size, stride=1):
"""
Imitates padding_mode="same" from tensorflow.
:param kernel_size: Kernelsize of the conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.functional as F
from torch.nn import Conv2d
from tor... | fish258/MonoRec | ConvReLU | false | 15,369 | [
"MIT"
] | 388 | c0612d2710802004cdd83205e63d0582de543c41 | https://github.com/fish258/MonoRec/tree/c0612d2710802004cdd83205e63d0582de543c41 |
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.... | Doomski99/MarcCoru2019CropType | ScaledDotProductAttention | false | 11,377 | [
"MIT"
] | 0 | 17db294ef51bdd39fd884e0052141d8092b98b86 | https://github.com/Doomski99/MarcCoru2019CropType/tree/17db294ef51bdd39fd884e0052141d8092b98b86 |
CondConv2D | # 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 functools
from torch import nn
import torch.nn.functional as F
from torch... | yifanpu001/CondConv-pytorch | CondConv2D | false | 13,152 | [
"MIT"
] | 0 | d5198f1c53de97304f8a23f4ca287cf5b4d33561 | https://github.com/yifanpu001/CondConv-pytorch/tree/d5198f1c53de97304f8a23f4ca287cf5b4d33561 |
EncoderLayer | import torch
import torch.nn.functional as F
import torch.nn as nn
def padding_mask(inputs, padding_idx=0):
mask = (inputs == padding_idx).bool()
return mask
class Linear(nn.Module):
def __init__(self, in_dim, out_dim, bias=True, w_init='linear'):
super(Linear, self).__init__()
self.lin... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | poria-cat/Transformer-TTS-Pytorch | EncoderLayer | false | 10,760 | [
"MIT"
] | 0 | 1e9e2dccc16c17372bf86ca73001f76645f53338 | https://github.com/poria-cat/Transformer-TTS-Pytorch/tree/1e9e2dccc16c17372bf86ca73001f76645f53338 |
AdaptiveReLU | # 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.nn.parameter import Parameter
assert_size_stride = torch._C._dynamo.guards.ass... | ndem0/PINA | AdaptiveReLU | false | 10,726 | [
"MIT"
] | 0 | 1812ddb8d96a9c8aeb80ce35002dbd115e7d7931 | https://github.com/ndem0/PINA/tree/1812ddb8d96a9c8aeb80ce35002dbd115e7d7931 |
SmooothLabelCELoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | hekq/3DFingerPose | SmooothLabelCELoss | false | 6,816 | [
"MIT"
] | 1 | 385c672408e2fd29ed0373a842727c9fcfd0fc59 | https://github.com/hekq/3DFingerPose/tree/385c672408e2fd29ed0373a842727c9fcfd0fc59 |
ConvertFloatToUint8 | # 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 torchvision
import torch.utils.data
import torchvision.transforms
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert... | kevinmtian/pytorchvideo | ConvertFloatToUint8 | false | 15,846 | [
"Apache-2.0"
] | 2,391 | 168e16859a6029ef8ebeb476f9163bebb6c6b87d | https://github.com/kevinmtian/pytorchvideo/tree/168e16859a6029ef8ebeb476f9163bebb6c6b87d |
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.... | hyunwoongko/transformer | MultiHeadAttention | false | 15,566 | [
"Apache-2.0"
] | 233 | 8f7aaa19d37b088c156db0512868127ba9bf1a0f | https://github.com/hyunwoongko/transformer/tree/8f7aaa19d37b088c156db0512868127ba9bf1a0f |
Spatial_Attention_layer | # 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.... | wxh453751461/Gformer | Spatial_Attention_layer | false | 4,566 | [
"Apache-2.0"
] | 0 | a033eb6fce59ceacc61a76430010805023ac230f | https://github.com/wxh453751461/Gformer/tree/a033eb6fce59ceacc61a76430010805023ac230f |
LittleAdversarialNetwork | import torch
import torch.utils.data
import torch
import torch.nn as nn
class LittleAdversarialNetwork(nn.Module):
def __init__(self, in_feature):
super(LittleAdversarialNetwork, self).__init__()
self.ad_layer1 = nn.Linear(in_feature, 1)
self.ad_layer1.weight.data.normal_(0, 0.01)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch
import torch.nn as nn
assert_size_stride = ... | FigaroK/pytorch-CycleGAN-and-pix2pix | LittleAdversarialNetwork | false | 9,070 | [
"BSD-3-Clause"
] | 0 | 74407363baf4626782398040e34a342e20915d41 | https://github.com/FigaroK/pytorch-CycleGAN-and-pix2pix/tree/74407363baf4626782398040e34a342e20915d41 |
MNIST_CNN | # 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.... | VinAIResearch/mDSDI | MNIST_CNN | false | 18,068 | [
"Apache-2.0"
] | 9 | 8ec49085d8389ab490ec633c3ae4bf66be085366 | https://github.com/VinAIResearch/mDSDI/tree/8ec49085d8389ab490ec633c3ae4bf66be085366 |
ListMLELoss | # 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 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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_ma... | Pepijnnn/MasterThesis | ListMLELoss | false | 962 | [
"MIT"
] | 0 | 7ec831f5e55f5f181e0196fa78284e2846ce2e26 | https://github.com/Pepijnnn/MasterThesis/tree/7ec831f5e55f5f181e0196fa78284e2846ce2e26 |
MultiHeadAttention | import torch
from torch import nn
class ScaledDotProductAttention(nn.Module):
def __init__(self, temperature, dropout=0.1):
super(ScaledDotProductAttention, self).__init__()
self.temperature = temperature
self.dropout = nn.Dropout(p=dropout)
def forward(self, q, k, v, mask=None):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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/vedastr | MultiHeadAttention | false | 1,274 | [
"Apache-2.0"
] | 0 | 2353780489b58d2398b9af49d238ef0df3f45f2a | https://github.com/YacobBY/vedastr/tree/2353780489b58d2398b9af49d238ef0df3f45f2a |
Classify | # 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... | Lalihoo/yolov5-detect | Classify | false | 9,628 | [
"MIT"
] | 0 | 265c3137ea3586d913541501a1562488fbe59e9e | https://github.com/Lalihoo/yolov5-detect/tree/265c3137ea3586d913541501a1562488fbe59e9e |
MPNetAttention | from _paritybench_helpers import _mock_config
import math
import torch
from typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Clemens123/transformers | MPNetAttention | false | 12,331 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
BCEFocalLoss | import torch
import torch.nn as nn
class BCEFocalLoss(nn.Module):
def __init__(self, gamma=2, alpha=None, reduction='elementwise_mean'):
super().__init__()
self.gamma = gamma
self.alpha = alpha
self.reduction = reduction
def forward(self, _input, target):
pt = torch.s... | 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
... | Chizuchizu/riadd | BCEFocalLoss | false | 4,987 | [
"MIT"
] | 1 | c3f55aebc0f582d9fa55dc517b1489963cf0506f | https://github.com/Chizuchizu/riadd/tree/c3f55aebc0f582d9fa55dc517b1489963cf0506f |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | LDOUBLEV/DBNet.pytorch | DiceLoss | false | 9,413 | [
"Apache-2.0"
] | 0 | 206f4a1e5cc3686284476f029a26fc69f610e898 | https://github.com/LDOUBLEV/DBNet.pytorch/tree/206f4a1e5cc3686284476f029a26fc69f610e898 |
GELU | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | yyht/Funnel_Transformer | GELU | false | 16,779 | [
"MIT"
] | 193 | 4b35a794d5e122a8054471863a52d4eac1c39dcd | https://github.com/yyht/Funnel_Transformer/tree/4b35a794d5e122a8054471863a52d4eac1c39dcd |
BinaryAdd | import abc
import inspect
import torch
import warnings
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
from typing import Any
from typing import *
def get_module_name(cls_or_func):
module_name = cls_or_func.__module__
if module_name == '__main__':
for frm in i... | 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 abc
import inspect
import warnings
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
from typ... | Johnsonms/NNI_master | BinaryAdd | false | 11,589 | [
"MIT"
] | 0 | e5e5c7aed89cf3189cffe1056464833c15eb54ff | https://github.com/Johnsonms/NNI_master/tree/e5e5c7aed89cf3189cffe1056464833c15eb54ff |
ConvTanh | import torch
import numpy as np
class ConvLayer(torch.nn.Module):
"""Reflection padded convolution layer."""
def __init__(self, in_channels, out_channels, kernel_size, stride, bias
=True):
super(ConvLayer, self).__init__()
reflection_padding = int(np.floor(kernel_size / 2))
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.triton_helpers import libdevice, math as tl_math
im... | irsisyphus/reconet | ConvTanh | false | 15,605 | [
"MIT"
] | 56 | 863acf8dde4d45c8521634af27878fe04f3b2e56 | https://github.com/irsisyphus/reconet/tree/863acf8dde4d45c8521634af27878fe04f3b2e56 |
CrossNet | import torch
import torch.nn as nn
from sklearn.metrics import *
import torch.onnx
import torch as torch
class CrossNet(nn.Module):
"""The Cross Network part of Deep&Cross Network model,
which leans both low and high degree cross feature.
Input shape
- 2D tensor with shape: ``(batch_size, units)... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
import torch.onnx
import tor... | dulvqingyunLT/DeepCTR-Torch | CrossNet | false | 10,412 | [
"Apache-2.0"
] | 0 | f40cf08f3469aa471f9ca69e44c5de51180341cc | https://github.com/dulvqingyunLT/DeepCTR-Torch/tree/f40cf08f3469aa471f9ca69e44c5de51180341cc |
MultiheadAttention | import torch
import torch.nn as nn
class MultiheadAttention(nn.Module):
"""A warpper for torch.nn.MultiheadAttention.
This module implements MultiheadAttention with residual connection,
and positional encoding used in DETR is also passed as input.
Args:
embed_dims (int): The embedding dimens... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | Huuush/deepfashion2-det | MultiheadAttention | false | 11,494 | [
"Apache-2.0"
] | 0 | 46af0ada8d6f534de2de6a9c069580cd1bf609ec | https://github.com/Huuush/deepfashion2-det/tree/46af0ada8d6f534de2de6a9c069580cd1bf609ec |
LearnedPositionalEncoding | # 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 torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | longnsl1998/vietocr | LearnedPositionalEncoding | false | 10,411 | [
"Apache-2.0"
] | 0 | 686dd6c9d897e0401c20e7dcadb07a07c1dbc284 | https://github.com/longnsl1998/vietocr/tree/686dd6c9d897e0401c20e7dcadb07a07c1dbc284 |
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... | huangruizhe/icefall | Joiner | false | 15,541 | [
"Apache-2.0"
] | 173 | ea8af0ee9af5169d93f8f389ffebbc27a1d9e82a | https://github.com/huangruizhe/icefall/tree/ea8af0ee9af5169d93f8f389ffebbc27a1d9e82a |
hsigmoid | # 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... | Qidian213/NAIC2019 | hsigmoid | false | 949 | [
"MIT"
] | 0 | 23e05a8a096168ccfa4d1743467fdf78ffcaabba | https://github.com/Qidian213/NAIC2019/tree/23e05a8a096168ccfa4d1743467fdf78ffcaabba |
MultiLinear | import torch
import numpy as np
import torch.nn as nn
def tensor(x, dtype=torch.float32):
if torch.is_tensor(x):
return x.type(dtype)
x = torch.tensor(x, device=Config.DEVICE, dtype=dtype)
return x
def batch_linear(input, weight, bias=None):
""" input: (N, D), weight: (N, D, H), bias: (N, H)... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | lchenat/TSA | MultiLinear | false | 3,885 | [
"Apache-2.0"
] | 0 | 661266ba16e06f63962b306a7c30d25f37920c2d | https://github.com/lchenat/TSA/tree/661266ba16e06f63962b306a7c30d25f37920c2d |
PolicyModuleAlt | import torch
import torch.nn as nn
import torch.nn.functional as F
class PolicyModuleAlt(nn.Module):
def __init__(self, input_dim, hid_dim, n_actions):
super().__init__()
self.fc_1 = nn.Linear(input_dim, hid_dim)
self.fc_2 = nn.Linear(hid_dim, hid_dim)
self.fc_a = nn.Linear(hid_di... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | bentrevett/task-oriented-language-grounding | PolicyModuleAlt | false | 6,319 | [
"MIT"
] | 1 | 812a7bc21ee622030eb0594c576c7d60dc630148 | https://github.com/bentrevett/task-oriented-language-grounding/tree/812a7bc21ee622030eb0594c576c7d60dc630148 |
SoftWingLoss | # 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... | chenxinfeng4/mmpose | SoftWingLoss | false | 12,246 | [
"Apache-2.0"
] | 0 | b0aac4178c1f3d679d2a007e1d9c6c567fc2607d | https://github.com/chenxinfeng4/mmpose/tree/b0aac4178c1f3d679d2a007e1d9c6c567fc2607d |
Generator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | goldenbili/SRGAN_Test | Generator | false | 10,198 | [
"MIT"
] | 0 | 06705c92abd5b7084ae878a4746060760bcff5c3 | https://github.com/goldenbili/SRGAN_Test/tree/06705c92abd5b7084ae878a4746060760bcff5c3 |
AttentionLayer | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch
import torch.nn.functional as F
class AttentionLayer(nn.Module):
"""
Attention layer according to https://arxiv.org/abs/1409.0473.
Params:
num_units: Number of units used in the attention layer
"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | B0BBB/seq2seq.pytorch | AttentionLayer | false | 147 | [
"MIT"
] | 0 | 54bb0e9f3e5c7db7f257841ed652e8ff447b8ee4 | https://github.com/B0BBB/seq2seq.pytorch/tree/54bb0e9f3e5c7db7f257841ed652e8ff447b8ee4 |
HardNegativeContrastiveLoss | # 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
import torch.nn as nn
assert_... | debayan/dsve-loc | HardNegativeContrastiveLoss | false | 3,407 | [
"BSD-3-Clause-Clear"
] | 0 | 21b1e1837668b6daa0881514d0756e9bec039fcb | https://github.com/debayan/dsve-loc/tree/21b1e1837668b6daa0881514d0756e9bec039fcb |
SVIGlobalMeanPool2D | import torch
import torch.nn as nn
class SVIGlobalMeanPool2D(nn.Module):
"""
Expects
:param x: [examples, samples, channels, H, W]
:return: [examples, samples, channels]
"""
def __init__(self):
super(SVIGlobalMeanPool2D, self).__init__()
def forward(self, x):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | SebFar/radial_bnn | SVIGlobalMeanPool2D | false | 8,738 | [
"MIT"
] | 29 | 2497e5e009409ac910d609850eae27f7cc74cec2 | https://github.com/SebFar/radial_bnn/tree/2497e5e009409ac910d609850eae27f7cc74cec2 |
Divide | # 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
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
assert_size_stride =... | arjunsuresh/aimet | Divide | false | 12,354 | [
"BSD-3-Clause"
] | 0 | f6e09cb07a91eed3a5e6b8e19e6b065303af5a39 | https://github.com/arjunsuresh/aimet/tree/f6e09cb07a91eed3a5e6b8e19e6b065303af5a39 |
WeightedFeatureFusion | # 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... | cititude/Media-and-Cognition-Homework | WeightedFeatureFusion | false | 3,292 | [
"MIT"
] | 0 | dabaaef6d8ec115171e7115731c5f76b518d9bde | https://github.com/cititude/Media-and-Cognition-Homework/tree/dabaaef6d8ec115171e7115731c5f76b518d9bde |
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.... | Kormap/Side-Projects | MultiHeadAttention | false | 750 | [
"MIT"
] | 0 | 9e61d5b062cc6823cfebc18370f7caae622ea571 | https://github.com/Kormap/Side-Projects/tree/9e61d5b062cc6823cfebc18370f7caae622ea571 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.