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 |
|---|---|---|---|---|---|---|---|---|---|---|
Model | import torch
from torchvision.transforms import functional as F
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
"""
定义了一个简单的三层全连接神经网络,每一层都是线性的
"""
def __init__(self, in_dim, n_hidden1, out_dim):
super().__init__()
self.layer1 = nn.Linear(in_dim, n_hidden1)... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | Event0511/curling-reid | Model | false | 17,561 | [
"Apache-2.0"
] | 3 | 1494d0faeed951e495573c694362f001df5bf6fd | https://github.com/Event0511/curling-reid/tree/1494d0faeed951e495573c694362f001df5bf6fd |
Model | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import torch.nn.functional
from torch.nn import Parameter
from torch.nn.parameter import Parameter
from torch.nn... | DominickZhang/Distillation-Swin-Transformer | Model | false | 13,236 | [
"MIT"
] | 0 | 6fc7b25bd558edb14e6f15715f53612c37e5166f | https://github.com/DominickZhang/Distillation-Swin-Transformer/tree/6fc7b25bd558edb14e6f15715f53612c37e5166f |
CIFAR10ConvNet | # 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.... | xinranzhu/GPTune-1 | CIFAR10ConvNet | false | 13,115 | [
"BSD-3-Clause-LBNL"
] | 0 | 1e502295e790ab68990f657492243fd4fb3dfc0a | https://github.com/xinranzhu/GPTune-1/tree/1e502295e790ab68990f657492243fd4fb3dfc0a |
Block | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim as optim
class LayerNorm(nn.Module):
""" LayerNorm that supports two data formats: channels_last (default) or channels_first.
The ordering of the dimensions in the inputs. channels_last corresponds to inputs with
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | pgruening/ConvNeXt | Block | false | 12,892 | [
"MIT"
] | 0 | e9a1beaf312f3a724f0c21d098efbe7db872b049 | https://github.com/pgruening/ConvNeXt/tree/e9a1beaf312f3a724f0c21d098efbe7db872b049 |
ClusterAssignment | # 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
from torch.nn import Parameter
from typing import Optional
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | zhyhan/pt-dec | ClusterAssignment | false | 13,179 | [
"MIT"
] | 0 | 52aef59e508c8e7ffdde0fd7bea84570a7571b2a | https://github.com/zhyhan/pt-dec/tree/52aef59e508c8e7ffdde0fd7bea84570a7571b2a |
MlpBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | Nitin-Mane/External-Attention-pytorch | MlpBlock | false | 14,113 | [
"MIT"
] | 4,466 | 1ceda306c41063af11c956334747763444a4d83f | https://github.com/Nitin-Mane/External-Attention-pytorch/tree/1ceda306c41063af11c956334747763444a4d83f |
MaxPool2dDynamicSamePadding | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import torch.utils
assert_size_stride = torch._C._dynamo.guards.asse... | BlakeDai/FedML-test | MaxPool2dDynamicSamePadding | false | 9,198 | [
"Apache-2.0"
] | 0 | 3cb9a7234f3f0294f3137e4be572153ba7b62f8f | https://github.com/BlakeDai/FedML-test/tree/3cb9a7234f3f0294f3137e4be572153ba7b62f8f |
PolynomialEnvelope | import torch
class PolynomialEnvelope(torch.nn.Module):
"""
Polynomial envelope function that ensures a smooth cutoff.
Parameters
----------
exponent: int
Exponent of the envelope function.
"""
def __init__(self, exponent):
super().__init__()
assert expone... | 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... | chris-price19/ocp | PolynomialEnvelope | false | 1,697 | [
"MIT",
"BSD-3-Clause"
] | 0 | 0175c5a11dd3aaccd4f4780c8cb559401f1ca15e | https://github.com/chris-price19/ocp/tree/0175c5a11dd3aaccd4f4780c8cb559401f1ca15e |
Block | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
from torch.nn import functional as F
class RWKV_TimeMix(nn.Module):
def __init__(self, config, layer_id):
super().__init__()
assert config.n_attn % config.n_head == 0
self.layer_id = layer_id
self.ctx... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | ofooo/AI-Writer | Block | false | 12,869 | [
"BSD-3-Clause"
] | 0 | 1ba84894c15c9e5605d3c6cd7521d5c6dab6eb6d | https://github.com/ofooo/AI-Writer/tree/1ba84894c15c9e5605d3c6cd7521d5c6dab6eb6d |
Unet_2levels | # 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_... | MuhammadIbrahim0/dvae-refiner | Unet_2levels | false | 9,373 | [
"MIT"
] | 0 | 034241ce6a5aeb19e9f8952ee996b56412a1f95a | https://github.com/MuhammadIbrahim0/dvae-refiner/tree/034241ce6a5aeb19e9f8952ee996b56412a1f95a |
AvgPoolPad | # 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... | RndmVariableQ/deep-person-reid | AvgPoolPad | false | 11,866 | [
"MIT"
] | 0 | 9ab8343b2fc2ac130aeca5bc2bd1ae808e9ce1b9 | https://github.com/RndmVariableQ/deep-person-reid/tree/9ab8343b2fc2ac130aeca5bc2bd1ae808e9ce1b9 |
ModelWithDuplicates | import torch
from collections import OrderedDict
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
from torch.optim.lr_scheduler import *
import torch.optim.lr_scheduler
import torch.quantization
import torch.onnx
import torch.testing
class ModelWithDuplicates(nn.Module):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Donfa1con/distiller | ModelWithDuplicates | false | 11,525 | [
"Apache-2.0"
] | 0 | 645ee41bfebc463523b228ff087e41619607d8b2 | https://github.com/Donfa1con/distiller/tree/645ee41bfebc463523b228ff087e41619607d8b2 |
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 functools
import torc... | WoojunePark/BasicSR | CharbonnierLoss | false | 18,089 | [
"Apache-2.0"
] | 9 | e0910b022b924bb913045fc412a5470dc2242cf0 | https://github.com/WoojunePark/BasicSR/tree/e0910b022b924bb913045fc412a5470dc2242cf0 |
ResNetBlock | from torch.nn import Module
import torch
from torch.nn import Conv2d
from torch.nn import InstanceNorm2d
from torch.nn.init import kaiming_normal_
from torch.nn.init import xavier_normal_
from torch import relu
def create_init_function(method: 'str'='none'):
def init(module: 'Module'):
if method == '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.... | fireresistance/talking_heads | ResNetBlock | false | 10,071 | [
"MIT"
] | 0 | 949af9ee8192d737bdfd9f2d83b70f56b3cdfbe7 | https://github.com/fireresistance/talking_heads/tree/949af9ee8192d737bdfd9f2d83b70f56b3cdfbe7 |
mfm | import torch
import torch.nn as nn
class mfm(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1, type=1):
super(mfm, self).__init__()
self.out_channels = out_channels
if type == 1:
self.filter = nn.Conv2d(in_channels, 2 * out_c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | BradyFU/DVG-Face | mfm | false | 7,831 | [
"MIT"
] | 33 | 16d51fe7da6e4a52d144e938afb3072eb8e4e8de | https://github.com/BradyFU/DVG-Face/tree/16d51fe7da6e4a52d144e938afb3072eb8e4e8de |
L1 | import torch
import torch.utils.data
import torch.nn as nn
class L1(nn.Module):
def __init__(self, eps=1e-06):
super(L1, self).__init__()
self.eps = eps
def forward(self, x, target):
diff = x - target
return torch.mean(torch.sum(torch.sqrt(diff * diff + self.eps), (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.triton_helpers import libdevice
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dy... | qwopqwop200/Fast-Invertible-Rescaling-Net | L1 | false | 7,518 | [
"MIT"
] | 1 | 871733f2eee7929d6b37c4d1d6a27347b39b67a9 | https://github.com/qwopqwop200/Fast-Invertible-Rescaling-Net/tree/871733f2eee7929d6b37c4d1d6a27347b39b67a9 |
TransformerDecoderLayer | import torch
from typing import Optional
from torch import nn
def _get_activation_fn(activation: 'str'):
if activation == 'relu':
return nn.functional.relu
elif activation == 'gelu':
return nn.functional.gelu
raise RuntimeError('activation should be relu/gelu, not {}'.format(
activ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | marcinwitkowski/icefall | TransformerDecoderLayer | false | 10,501 | [
"Apache-2.0"
] | 0 | 73e917f689fa2ebfcfe5d484a34a262e74b77581 | https://github.com/marcinwitkowski/icefall/tree/73e917f689fa2ebfcfe5d484a34a262e74b77581 |
DQN | import torch
import torch.nn as nn
import torch.nn.functional as F
class DQN(nn.Module):
def __init__(self, input_size, hidden_1_size, hidden_2_size, output_size):
super().__init__()
self.fc1 = nn.Linear(input_size, hidden_1_size)
self.fc2 = nn.Linear(hidden_1_size, hidden_2_size)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | TejaswiniMedi/DRL | DQN | false | 5,879 | [
"MIT"
] | 1 | d4a694c5e505822e6e8627be52afd0ccc60f80ef | https://github.com/TejaswiniMedi/DRL/tree/d4a694c5e505822e6e8627be52afd0ccc60f80ef |
PositionalEncoder | import math
import torch
class PositionalEncoder(torch.nn.Module):
def __init__(self, max_freq, feat_size, dimensionality, base=2):
super().__init__()
self.max_freq = max_freq
self.dimensionality = dimensionality
self.num_bands = math.floor(feat_size / dimensionality / 2)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda... | PRBonn/contrastive_association | PositionalEncoder | false | 8,622 | [
"MIT"
] | 19 | 649693494197c8d3948252daee6767b66a89c868 | https://github.com/PRBonn/contrastive_association/tree/649693494197c8d3948252daee6767b66a89c868 |
ModelClassifier | # 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.... | carlosmertens/Flowers-Classifier | ModelClassifier | false | 3,274 | [
"MIT"
] | 0 | d454348e3f6eba4e0c176f5e8e05c8a4f6fe9ba2 | https://github.com/carlosmertens/Flowers-Classifier/tree/d454348e3f6eba4e0c176f5e8e05c8a4f6fe9ba2 |
Attention | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
def __init__(self, embed_dim, hidden_dim=None, n_head=1, score_function
='scaled_dot_product'):
super(Attention, self).__init__()
if hidden_dim is None:
hidden_dim = embe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | AlbertoPaz/ABSA-PyTorch | Attention | false | 7,650 | [
"MIT"
] | 20 | 070a4b6f20cde0e2021c72b84c534659d749f36e | https://github.com/AlbertoPaz/ABSA-PyTorch/tree/070a4b6f20cde0e2021c72b84c534659d749f36e |
ConvLayer | import torch
from torch import nn
class ConvLayer(nn.Module):
"""1-D Convolution layer to extract high-level features of each time-series input
:param n_features: Number of input features/nodes
:param window_size: length of the input sequence
:param kernel_size: size of kernel to use in the convolutio... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | kj21choi/LATAD | ConvLayer | false | 7,037 | [
"MIT"
] | 1 | 80d91e0f251ad0225342ee30e2461a39fa9cca97 | https://github.com/kj21choi/LATAD/tree/80d91e0f251ad0225342ee30e2461a39fa9cca97 |
ExternalAttention | import torch
from torch import nn
from torch.nn import init
class ExternalAttention(nn.Module):
def __init__(self, d_model, S=64):
super().__init__()
self.mk = nn.Linear(d_model, S, bias=False)
self.mv = nn.Linear(S, d_model, bias=False)
self.softmax = nn.Softmax(dim=1)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | LeftAttention/Attention-Codebase | ExternalAttention | false | 17,589 | [
"Apache-2.0"
] | 6 | 348ec66233a7c0f95a3cb5f0f11641e2a7a9b9c3 | https://github.com/LeftAttention/Attention-Codebase/tree/348ec66233a7c0f95a3cb5f0f11641e2a7a9b9c3 |
LocalizationNet | import torch
import torch.nn.functional as F
from torch import nn
class LocalizationNet(nn.Module):
def __init__(self, num_bbox=2, num_digits=2):
super(LocalizationNet, self).__init__()
self.conv1 = nn.Conv2d(1, 64, 3, padding=1)
self.conv2 = nn.Conv2d(64, 64, 3, padding=1)
self.c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | YIFEI-MA/MultiDigitRecognition | LocalizationNet | false | 12,049 | [
"MIT"
] | 0 | f1f9567c31102ccdc7464a35b8a7c533b5d46734 | https://github.com/YIFEI-MA/MultiDigitRecognition/tree/f1f9567c31102ccdc7464a35b8a7c533b5d46734 |
L2Norm | import torch
import torch.nn as nn
class L2Norm(nn.Module):
"""l2-normalization as layer. """
def __init__(self, *, eps: float=1e-10) ->None:
super().__init__()
self.eps = eps
def forward(self, x: 'torch.Tensor') ->torch.Tensor:
norm = torch.sqrt(torch.sum(x * x, dim=-1) + self.e... | 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_... | manyids2/mkd_pytorch | L2Norm | false | 7,157 | [
"MIT"
] | 1 | fb97c4285f93f38371b2aac904a133f970be247e | https://github.com/manyids2/mkd_pytorch/tree/fb97c4285f93f38371b2aac904a133f970be247e |
ModMBStddevLayer | import torch
import torch.nn as nn
class ModMBStddevLayer(nn.Module):
"""Modified MiniBatch Stddev Layer.
This layer is modified from ``MiniBatchStddevLayer`` used in PGGAN. In
StyleGAN2, the authors add a new feature, `channel_groups`, into this
layer.
"""
def __init__(self, group_size=4, c... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | akimotty877/mmediting | ModMBStddevLayer | false | 3,091 | [
"Apache-2.0"
] | 0 | cae872d6f3e867ba144c7c0dbc29a0ee1a29e5a6 | https://github.com/akimotty877/mmediting/tree/cae872d6f3e867ba144c7c0dbc29a0ee1a29e5a6 |
SumNormalizer | import torch
def sum_normalizer(x, detach=False, scale_by_batch_size=False):
y = torch.sum(x)
if detach:
y = y.detach()
if scale_by_batch_size:
x = x * x.shape[0]
return x / y
class SumNormalizer(torch.nn.Module):
def __init__(self, detach=False, scale_by_batch_size=False):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | KevinMusgrave/pytorch-adapt | SumNormalizer | false | 13,948 | [
"MIT"
] | 131 | ff1491e1bfcc586afb8ee619712c8816ddf10358 | https://github.com/KevinMusgrave/pytorch-adapt/tree/ff1491e1bfcc586afb8ee619712c8816ddf10358 |
LastBlock | # 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 numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | Twizwei/idinvert_pytorch | LastBlock | false | 1,156 | [
"MIT"
] | 0 | 11f1126aab517fbe32b488d92f6fdea339463d04 | https://github.com/Twizwei/idinvert_pytorch/tree/11f1126aab517fbe32b488d92f6fdea339463d04 |
make_dense | import torch
import torch.nn as nn
import torch.nn.functional as F
class make_dense(nn.Module):
def __init__(self, nChannels, growthRate, kernel_size=3):
super(make_dense, self).__init__()
self.conv = nn.Conv2d(nChannels, growthRate, kernel_size=
kernel_size, padding=kernel_size - 1, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | HusterRC/FHDR | make_dense | false | 5,335 | [
"BSD-3-Clause"
] | 1 | f61fea7eba3de8430fc2891afdabc77dd8e5f13f | https://github.com/HusterRC/FHDR/tree/f61fea7eba3de8430fc2891afdabc77dd8e5f13f |
LandmarksLoss | import torch
import numpy as np
import torch.nn as nn
import torch.utils.data
class WingLoss(nn.Module):
def __init__(self, w=10, e=2):
super(WingLoss, self).__init__()
self.w = w
self.e = e
self.C = self.w - self.w * np.log(1 + self.w / self.e)
def forward(self, x, t, sigma=... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strid... | homomorfism/wise-programming | LandmarksLoss | false | 6,812 | [
"MIT"
] | 1 | e0589e8900237ddc9c3abf54c85be532cacf2d33 | https://github.com/homomorfism/wise-programming/tree/e0589e8900237ddc9c3abf54c85be532cacf2d33 |
ConvElement | # 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... | tensormedical/PARIETAL | ConvElement | false | 13,030 | [
"Apache-2.0"
] | 0 | 25bf1cf7828b24d60ccff42efbd0537989aaf160 | https://github.com/tensormedical/PARIETAL/tree/25bf1cf7828b24d60ccff42efbd0537989aaf160 |
DimReduce | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional as F
import torch.cuda
import t... | InitialBug/BiSET | DimReduce | false | 13,838 | [
"MIT"
] | 47 | a697a3c61014281bbd83cd37ede29b1263c8832f | https://github.com/InitialBug/BiSET/tree/a697a3c61014281bbd83cd37ede29b1263c8832f |
BahdanauAttention | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
from torchvision.transforms import functional as F
from torch.nn import functional as F
import torch.jit
from torch.nn import Parameter
from torch.nn.parameter import Parameter
import torch.optim
import torch.utils.co... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | cometta/training | BahdanauAttention | false | 10,066 | [
"Apache-2.0"
] | 0 | 2f33c36d5aa2e1c2770fb3bab35afc8c665e01ce | https://github.com/cometta/training/tree/2f33c36d5aa2e1c2770fb3bab35afc8c665e01ce |
LxmertSelfAttentionLayer | # 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.... | rsgit95/med_kg_txt_multimodal | LxmertSelfAttentionLayer | false | 4,223 | [
"Apache-2.0"
] | 0 | 80355b0cf58e0571531ad6f9728c533110ca996d | https://github.com/rsgit95/med_kg_txt_multimodal/tree/80355b0cf58e0571531ad6f9728c533110ca996d |
CrossEncoderLayer | # 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.... | wukevin/RoseTTAFold | CrossEncoderLayer | false | 4,606 | [
"MIT"
] | 0 | e3c15dbf4bc1e4f8726e26c63aca1625188da803 | https://github.com/wukevin/RoseTTAFold/tree/e3c15dbf4bc1e4f8726e26c63aca1625188da803 |
GenNoise | import torch
import torch.optim
import torch.nn as nn
import torch.nn.init
class GenNoise(nn.Module):
def __init__(self, dim2):
super(GenNoise, self).__init__()
self.dim2 = dim2
def forward(self, input):
a = list(input.size())
a[1] = self.dim2
b = torch.zeros(a).type_... | 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.optim
import torch.nn as nn
import torch.nn.init
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_... | ChongYou/robust-image-recovery | GenNoise | false | 7,875 | [
"MIT"
] | 13 | 5bb23142509f307d31fd435de12787a70ec3a5bc | https://github.com/ChongYou/robust-image-recovery/tree/5bb23142509f307d31fd435de12787a70ec3a5bc |
LowRankPositionwiseFeedForward | import torch
import torch.nn as nn
import torch.utils.checkpoint
import torch.nn.functional as F
from torch.cuda.amp import autocast
class LowRankPositionwiseFeedForward(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_in, d_hid, dropout=0.1):
super().__init__()
self.w... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | bahducoup/factorized_training | LowRankPositionwiseFeedForward | false | 12,155 | [
"MIT"
] | 0 | 0af38f16338a9bcfcc11091b1a6b75befd67f234 | https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234 |
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
import torch.nn as nn
import ... | JanKalo/OpenNRE | CNN | false | 11,538 | [
"MIT"
] | 0 | 2842903e5b66c88311820adac50a16ee3dc8ff77 | https://github.com/JanKalo/OpenNRE/tree/2842903e5b66c88311820adac50a16ee3dc8ff77 |
BothContextGate | # 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 ... | BradLin0819/kg2text | BothContextGate | false | 13,419 | [
"Apache-2.0"
] | 86 | e586eb2027c0d85db9826cbe1d9e14f2d26fc93f | https://github.com/BradLin0819/kg2text/tree/e586eb2027c0d85db9826cbe1d9e14f2d26fc93f |
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_... | dollarkillerx/PyTorchStudy | Net | false | 10,022 | [
"MIT"
] | 0 | c17b2973c89e3a2f088513f29bd5eb6f47957585 | https://github.com/dollarkillerx/PyTorchStudy/tree/c17b2973c89e3a2f088513f29bd5eb6f47957585 |
ActFirstResBlock | import torch
import torch.nn.functional as F
from torch import nn
class AdaptiveInstanceNorm2d(nn.Module):
def __init__(self, num_features, eps=1e-05, momentum=0.1):
super(AdaptiveInstanceNorm2d, self).__init__()
self.num_features = num_features
self.eps = eps
self.momentum = mome... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | Alikfp/research-GANwriting | ActFirstResBlock | false | 7,656 | [
"MIT"
] | 41 | 2190954218a733deac52c929f51bb85bca5d7216 | https://github.com/Alikfp/research-GANwriting/tree/2190954218a733deac52c929f51bb85bca5d7216 |
Pad_Pool2d | import torch
from torch import nn
class Pad_Pool2d(nn.Module):
"""
Implements a padding layer in front of pool1d layers used in our architectures to achieve padding=same output shape
Pads 0 to the left and 1 to the right side of x
"""
def __init__(self, left=0, right=1, top=0, bottom=1, value=0... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | Hullimulli/EEGEyeNet | Pad_Pool2d | false | 549 | [
"MIT"
] | 0 | 677a791b39800f44dc254553b16ee2f92e62c423 | https://github.com/Hullimulli/EEGEyeNet/tree/677a791b39800f44dc254553b16ee2f92e62c423 |
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
from torch._inductor.runtime.... | Fanxingye/AutoDL | ConvNet | false | 5,155 | [
"Apache-2.0"
] | 1 | 6f409aefc8b81e5fe47df57b82332c8df427875d | https://github.com/Fanxingye/AutoDL/tree/6f409aefc8b81e5fe47df57b82332c8df427875d |
Mish | import torch
import torch.nn as nn
import torch.nn.functional as F
class Mish(nn.Module):
@staticmethod
def forward(x):
return x * F.softplus(x).tanh()
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, math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.gu... | Aditya239233/MDP | Mish | false | 16,889 | [
"MIT"
] | 4 | 87491e1d67e547c11f4bdd5d784d120473429eae | https://github.com/Aditya239233/MDP/tree/87491e1d67e547c11f4bdd5d784d120473429eae |
SimpleSumModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleSumModule(torch.nn.Module):
def __init__(self, dtype=None):
super(SimpleSumModule, self).__init__()
self.dtype = dtype
def forward(self, a):
b = a + a
return torch.sum(b, dtype=self.dtype)
def get_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
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | opti-mix/glow | SimpleSumModule | false | 7,415 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
JS_Divergence | # 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... | WorksApplications/omni_torch | JS_Divergence | false | 1,226 | [
"Apache-2.0"
] | 0 | 10b689d794c8f485e38c765303ef018da17bc641 | https://github.com/WorksApplications/omni_torch/tree/10b689d794c8f485e38c765303ef018da17bc641 |
UpsampleBLock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | tomron27/srganus | UpsampleBLock | false | 11,015 | [
"Apache-2.0"
] | 0 | 5dab73540535138375203bf31e31246cd203f3c0 | https://github.com/tomron27/srganus/tree/5dab73540535138375203bf31e31246cd203f3c0 |
KernelConv | import torch
import torch.nn as nn
import torch.nn.functional as F
class KernelConv(nn.Module):
"""
the class of computing prediction
"""
def __init__(self, kernel_size=[5], sep_conv=False, core_bias=False):
super(KernelConv, self).__init__()
self.kernel_size = sorted(kernel_size)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | xenbaloch/efficientderain | KernelConv | false | 16,788 | [
"MIT"
] | 109 | d5646815fd14a5a03c859102ecd2f298db7e53be | https://github.com/xenbaloch/efficientderain/tree/d5646815fd14a5a03c859102ecd2f298db7e53be |
ShapeConv2d | from torch.nn import Module
import math
import torch
import numpy as np
from torch.nn.modules.utils import _pair
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.nn import init
from torch._jit_internal import Optional
from torch.nn.modules.module import Module
class ShapeConv2d(Modu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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 math
import numpy as np
from torch.nn.modules... | COATZ/ShapeConv | ShapeConv2d | false | 13,467 | [
"Apache-2.0"
] | 57 | f34f4e95ee2b69ac645fd5ba608e3c11cfadfded | https://github.com/COATZ/ShapeConv/tree/f34f4e95ee2b69ac645fd5ba608e3c11cfadfded |
LayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | carankt/FastSpeech2-1 | LayerNorm | false | 6,381 | [
"Apache-2.0"
] | 1 | 42c06e4fbdf741a0719154d1cb4617b7d3f15a5c | https://github.com/carankt/FastSpeech2-1/tree/42c06e4fbdf741a0719154d1cb4617b7d3f15a5c |
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.... | Sud0x67/mrmix | SelfAttention | false | 18,003 | [
"Apache-2.0"
] | 4 | 4f4784e421c768509bd007e21b4455b56edc7cd2 | https://github.com/Sud0x67/mrmix/tree/4f4784e421c768509bd007e21b4455b56edc7cd2 |
SimpleReshapeModel | # 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.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleReshapeModel | false | 7,414 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SpatialAttention | import torch
import torch.nn as nn
class AttentionModule(nn.Module):
def __init__(self, dim):
super().__init__()
self.conv0 = nn.Conv2d(dim, dim, 5, padding=2, groups=dim)
self.conv_spatial = nn.Conv2d(dim, dim, 7, stride=1, padding=9,
groups=dim, dilation=3)
self.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
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | LSH9832/MyPythonModules | SpatialAttention | false | 761 | [
"MIT"
] | 0 | 442566a0fbd6ebe2bc20b6914686a1e2663d10c0 | https://github.com/LSH9832/MyPythonModules/tree/442566a0fbd6ebe2bc20b6914686a1e2663d10c0 |
AdaIN | # 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 ... | ORANZINO/bouquet_server | AdaIN | false | 17,755 | [
"MIT"
] | 7 | 2ce1bb59df15297878c555dd97e0f27b5202ed02 | https://github.com/ORANZINO/bouquet_server/tree/2ce1bb59df15297878c555dd97e0f27b5202ed02 |
PartialConv | import math
import torch
import torch.nn as nn
def weights_init(init_type='gaussian'):
def init_fun(m):
classname = m.__class__.__name__
if (classname.find('Conv') == 0 or classname.find('Linear') == 0
) and hasattr(m, 'weight'):
if init_type == 'gaussian':
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | maayan-myheritage/3d-photo-inpainting | PartialConv | false | 10,597 | [
"MIT"
] | 0 | 6293eecfeb55ceba019655723f6efe31e8ecb177 | https://github.com/maayan-myheritage/3d-photo-inpainting/tree/6293eecfeb55ceba019655723f6efe31e8ecb177 |
ATLoss | # 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
from t... | PiaCuk/KD_Lib | ATLoss | false | 14,184 | [
"MIT"
] | 360 | 153299d484e4c6b33793749709dbb0f33419f190 | https://github.com/PiaCuk/KD_Lib/tree/153299d484e4c6b33793749709dbb0f33419f190 |
MultiheadAttentionWrapper | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils import weight_norm
from torch.optim.lr_scheduler import *
import torch.utils.data
import torch.onnx.operators
import torch.optim
import torch.optim.lr_scheduler
def linear(x):
return x
def activation(func_a):
"""Activatio... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils import weight_norm
from torch.optim.lr_scheduler import *
import t... | brightgems/BartWithRL | MultiheadAttentionWrapper | false | 6,368 | [
"MIT"
] | 1 | 17614c4009ec976cdc73dacaf94573a6d8f6d529 | https://github.com/brightgems/BartWithRL/tree/17614c4009ec976cdc73dacaf94573a6d8f6d529 |
TorchPow | import torch
class TorchPow(torch.nn.Module):
def __init__(self):
super(TorchPow, self).__init__()
def forward(self, x, y):
return torch.pow(x, y)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | NVIDIA-AI-IOT-private/torch2trt | TorchPow | false | 10,548 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
NonnegativeLinear | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class NonnegativeLinear(nn.Linear):
def reset_parameters(self):
nn.init.xavier_uniform_(self.weight)
self.weight.data.abs_()
if self.bias is not None:
fan_in, _ = nn.init._calculate_fan_in_an... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | GlenHGHUANG/STRODE | NonnegativeLinear | false | 8,155 | [
"MIT"
] | 11 | 91565275dffd4f08738c8a0e5b6c9ad89344623e | https://github.com/GlenHGHUANG/STRODE/tree/91565275dffd4f08738c8a0e5b6c9ad89344623e |
Critic | import torch
import torch.nn as nn
class Critic(nn.Module):
def __init__(self, state_dim, action_dim):
super(Critic, self).__init__()
n_layer = 30
self.layer_1 = nn.Linear(state_dim, n_layer)
nn.init.normal_(self.layer_1.weight, 0.0, 0.1)
nn.init.constant_(self.layer_1.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._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Code-Notebook/RL_with_pytorch_gym | Critic | false | 5,015 | [
"MIT"
] | 1 | 5417e450ba8b6eb991c6970ffd42f26911de3d6a | https://github.com/Code-Notebook/RL_with_pytorch_gym/tree/5417e450ba8b6eb991c6970ffd42f26911de3d6a |
DPSLTMAdapter | import math
import torch
from torch import Tensor
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.parallel
from typing import Optional
from typing import Union
from typing import List
from typing import Tuple
from torch.nn.uti... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
from to... | ffuuugor/opacus | DPSLTMAdapter | false | 6,726 | [
"Apache-2.0"
] | 1 | 2048a6e92902685c2a735e9fb7c0d48b4846b494 | https://github.com/ffuuugor/opacus/tree/2048a6e92902685c2a735e9fb7c0d48b4846b494 |
AsymmetricLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
r... | 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... | CAMP-eXplain-AI/imba-explain | AsymmetricLoss | false | 2,060 | [
"MIT"
] | 0 | e41b4ca5de63955cb0e925aad9599f38c5a3e973 | https://github.com/CAMP-eXplain-AI/imba-explain/tree/e41b4ca5de63955cb0e925aad9599f38c5a3e973 |
Net | import torch
import torch.nn as nn
class Net(nn.Module):
def __init__(self, n_inputs, n_units=[50, 50, 50]):
super(Net, self).__init__()
self.fc1 = nn.Linear(n_inputs, n_units[0])
self.fc2 = nn.Linear(n_units[0], n_units[1])
self.fc3 = nn.Linear(n_units[1], n_units[2])
sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | hssandriss/pybnn | Net | false | 15,551 | [
"BSD-3-Clause"
] | 110 | e878553a24ce9ebdde9088f285c7f292e4ee8885 | https://github.com/hssandriss/pybnn/tree/e878553a24ce9ebdde9088f285c7f292e4ee8885 |
get_confidence | # 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.utils.data
import torch
import torch.nn as nn
import torch.sparse
a... | PrendiProgramming/UprightNet | get_confidence | false | 2,734 | [
"MIT"
] | 0 | 73a0677079e27a806b48bf9ede70b8377002b2f3 | https://github.com/PrendiProgramming/UprightNet/tree/73a0677079e27a806b48bf9ede70b8377002b2f3 |
Sentence_Maxpool | import torch
import torch.nn as nn
import torch.nn.functional as F
class Sentence_Maxpool(nn.Module):
""" Utilitary for the answer module """
def __init__(self, word_dimension, output_dim, relu=True):
super(Sentence_Maxpool, self).__init__()
self.fc = nn.Linear(word_dimension, output_dim)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | Tiamat-Tech/just-ask | Sentence_Maxpool | false | 14,501 | [
"Apache-2.0"
] | 59 | 80725161e12ad0682b4c2091f61a5889a335ba21 | https://github.com/Tiamat-Tech/just-ask/tree/80725161e12ad0682b4c2091f61a5889a335ba21 |
AsymmetricLossOptimized | import torch
import torch.nn as nn
class AsymmetricLossOptimized(nn.Module):
""" Notice - optimized version, minimizes memory allocation and gpu uploading,
favors inplace operations
https://github.com/Alibaba-MIIL/ASL/blob/main/src/loss_functions/losses.py
"""
def __init__(self, gamma_neg=4, gamm... | 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... | LanXiangExcavator/challenge2021_submission_4 | AsymmetricLossOptimized | false | 762 | [
"BSD-2-Clause"
] | 0 | ca0d4d4dd219119f7dc46464c92062ecdb7f9c49 | https://github.com/LanXiangExcavator/challenge2021_submission_4/tree/ca0d4d4dd219119f7dc46464c92062ecdb7f9c49 |
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 import triton_helpers
import torch.nn as nn
import ... | doudoulaile/RL-GAN-Net | Critic | false | 15,219 | [
"MIT"
] | 112 | 9c221223d1878bc24f0f39ad34928c1bb2974ae3 | https://github.com/doudoulaile/RL-GAN-Net/tree/9c221223d1878bc24f0f39ad34928c1bb2974ae3 |
SharedDropoutMLP | # 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... | Spico197/REx | SharedDropoutMLP | false | 17,944 | [
"MIT"
] | 4 | bb3cdb845765a63e9bd18070068af52a1b2db3f3 | https://github.com/Spico197/REx/tree/bb3cdb845765a63e9bd18070068af52a1b2db3f3 |
PLU | import torch
import torch.nn as nn
class PLU(nn.Module):
"""
y = max(alpha*(x+c)−c, min(alpha*(x−c)+c, x))
from PLU: The Piecewise Linear Unit Activation Function
"""
def __init__(self, alpha=0.1, c=1):
super().__init__()
self.alpha = alpha
self.c = c
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... | IrisDinge/YoloV3_DOTA | PLU | false | 5,350 | [
"MIT"
] | 1 | cdfe6375a2323e9ee162e50a46478d8a66529e6c | https://github.com/IrisDinge/YoloV3_DOTA/tree/cdfe6375a2323e9ee162e50a46478d8a66529e6c |
Coboundary | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional
assert_size_stride = torch._C._... | AtreusCorp/simplicial_neural_networks | Coboundary | false | 8,862 | [
"MIT"
] | 0 | 7a903dd02494811ace0d86e36476059e156fc15c | https://github.com/AtreusCorp/simplicial_neural_networks/tree/7a903dd02494811ace0d86e36476059e156fc15c |
ThreeNet | # 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 ... | SkBlaz/KBNR | ThreeNet | false | 5,840 | [
"MIT"
] | 1 | 4c37fe3fdfa7719572affd617e2dab43a54ba1d5 | https://github.com/SkBlaz/KBNR/tree/4c37fe3fdfa7719572affd617e2dab43a54ba1d5 |
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.... | Blickwinkel1107/NJUNMT-pytorch | ScaledDotProductAttention | false | 17,015 | [
"MIT"
] | 9 | 82f684fe768b137ca0649b7b79a1820077917385 | https://github.com/Blickwinkel1107/NJUNMT-pytorch/tree/82f684fe768b137ca0649b7b79a1820077917385 |
Actor | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class Actor(nn.Module):
def __init__(self, num_inputs, num_outputs, args):
super(Actor, self).__init__()
self.fc1 = nn.Linear(num_inputs, args.hidden_size)
self.fc2 = nn.Linear(args.hidden_size, args.hidden_s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | sgrimbly/lets-do-irl | Actor | false | 4,305 | [
"MIT"
] | 0 | 4233e238342394feef6a7bd495cc6b700d435b00 | https://github.com/sgrimbly/lets-do-irl/tree/4233e238342394feef6a7bd495cc6b700d435b00 |
Critic | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
def __init__(self, state_dim, action_dim):
super(Critic, self).__init__()
self.l1 = nn.Linear(state_dim + action_dim, 256)
self.l2 = nn.Linear(256, 256)
self.l3 = nn.Linear(256, 1)
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
import torch.nn as nn
import ... | linsats/GRAC2.0 | Critic | false | 3,919 | [
"MIT"
] | 0 | 2fde25103b2316a3435ef0ebdbf471ec4e204fbe | https://github.com/linsats/GRAC2.0/tree/2fde25103b2316a3435ef0ebdbf471ec4e204fbe |
iRMSE | import torch
import torch.nn as nn
class iRMSE(nn.Module):
def __init__(self):
super(iRMSE, self).__init__()
def forward(self, outputs, target, *args):
outputs = outputs / 1000.0
target = target / 1000.0
outputs[outputs == 0] = -1
target[target == 0] = -1
outp... | 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_... | anglixjtu/MSG_CHN_WACV20 | iRMSE | false | 14,859 | [
"Apache-2.0"
] | 61 | 6910894cf3caed2ffde27586f96b132b0c1d1a98 | https://github.com/anglixjtu/MSG_CHN_WACV20/tree/6910894cf3caed2ffde27586f96b132b0c1d1a98 |
PSNRLoss | import torch
import torch.nn as nn
from torch.nn.functional import mse_loss
def psnr_loss(input: 'torch.Tensor', target: 'torch.Tensor', max_val: 'float'
) ->torch.Tensor:
"""Function that computes PSNR
See :class:`~kornia.losses.PSNRLoss` for details.
"""
if not torch.is_tensor(input) or not tor... | 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
from t... | gf0507033/kornia | PSNRLoss | false | 12,421 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 2624f40a62d3639e6d946f3ca41fd1ce4b9de82d | https://github.com/gf0507033/kornia/tree/2624f40a62d3639e6d946f3ca41fd1ce4b9de82d |
GumbelMNACLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
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 |
SpatialGather_Module | import torch
from torchvision.transforms import functional as F
import torch.nn as nn
import torch.nn.functional as F
class SpatialGather_Module(nn.Module):
"""
Aggregate the context features according to the initial predicted probability distribution.
Employ the soft-weighted method to aggregate ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | openseg-group/panoptic-deeplab | SpatialGather_Module | false | 7,372 | [
"Apache-2.0"
] | 1 | 818887597e75af77ba32185eb67d8aeac47b54fe | https://github.com/openseg-group/panoptic-deeplab/tree/818887597e75af77ba32185eb67d8aeac47b54fe |
GeneralizedFocalLoss | import torch
import torch.utils.data
from torch import nn
class GeneralizedFocalLoss(nn.Module):
def __init__(self, beta=2):
super(GeneralizedFocalLoss, self).__init__()
self.beta = beta
def forward(self, prediction, target, cls_weights):
cls_weights = cls_weights.unsqueeze(-1).unsqu... | 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.utils.dat... | ZhuokunYao/smoke | GeneralizedFocalLoss | false | 1,323 | [
"MIT"
] | 0 | d524fbe43b1aba6078c25d9aca7924b71a635e1d | https://github.com/ZhuokunYao/smoke/tree/d524fbe43b1aba6078c25d9aca7924b71a635e1d |
ModifiedSmoothL1Loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch.... | AIpakchoi/visualDet3D | ModifiedSmoothL1Loss | false | 4,777 | [
"Apache-2.0"
] | 1 | 920f6f8ea44eac4c1896b7d157c015e039ac39f9 | https://github.com/AIpakchoi/visualDet3D/tree/920f6f8ea44eac4c1896b7d157c015e039ac39f9 |
Warp | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import Tensor
import torch.nn as nn
assert_size_stride = torch._C._d... | hologerry/mmflow | Warp | false | 15,543 | [
"Apache-2.0"
] | 481 | 40caf064851bd95317424e31cc137c0007a2bece | https://github.com/hologerry/mmflow/tree/40caf064851bd95317424e31cc137c0007a2bece |
GaussianFilter | import torch
import torch.nn as nn
import torch.utils.data
class GaussianFilter(nn.Module):
def __init__(self, kernel_size=13, stride=1, padding=6):
super(GaussianFilter, self).__init__()
mean = (kernel_size - 1) / 2.0
variance = ((kernel_size - 1) / 6.0) ** 2.0
x_coord = torch.ar... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | alsgkals2/SRResCGAN | GaussianFilter | false | 14,830 | [
"MIT"
] | 81 | a71201a93e1819045f9c7711743812546d3a1f31 | https://github.com/alsgkals2/SRResCGAN/tree/a71201a93e1819045f9c7711743812546d3a1f31 |
QNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | AmineKheldouni/Graphs-in-Machine-Learning | QNetwork | false | 4,858 | [
"MIT"
] | 1 | 003217495c624eaa33d44d679a0bc2164ca1f3d2 | https://github.com/AmineKheldouni/Graphs-in-Machine-Learning/tree/003217495c624eaa33d44d679a0bc2164ca1f3d2 |
VanillaGenerativeAdversarialLoss | import torch
import torch.nn as nn
import torch.utils.data
class VanillaGenerativeAdversarialLoss(nn.Module):
"""
Loss for `Vanilla Generative Adversarial Network <https://arxiv.org/abs/1406.2661>`_
Args:
reduction (str, optional): Specifies the reduction to apply to the output:
``'none... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | Neronjust2017/TransferBed | VanillaGenerativeAdversarialLoss | false | 5,645 | [
"MIT"
] | 1 | eaa703a4bc10eaf6216fe1394cd272f6e75489e2 | https://github.com/Neronjust2017/TransferBed/tree/eaa703a4bc10eaf6216fe1394cd272f6e75489e2 |
SpatialAttention | import torch
import torch.nn as nn
class SpatialAttention(nn.Module):
def __init__(self, kernel=3):
super(SpatialAttention, self).__init__()
self.conv1 = nn.Conv2d(2, 1, kernel_size=kernel, padding=kernel //
2, bias=False)
self.sigmoid = nn.Sigmoid()
def forward(self, x)... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Clayrisee/BanchelorsProject-FAS | SpatialAttention | false | 290 | [
"MIT"
] | 0 | 3da199fb2e7be04eed7f28374ef753383511dbee | https://github.com/Clayrisee/BanchelorsProject-FAS/tree/3da199fb2e7be04eed7f28374ef753383511dbee |
GraphAttentionLayer | import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
import torch.nn.functional as F
class GraphAttentionLayer(nn.Module):
def __init__(self, input_dim, output_dim, dropout, alpha):
super(GraphAttentionLayer, self).__init__()
self.input_dim = input_dim
self.output_d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | jiangnanboy/gcn_for_prediction_of_protein_interactions | GraphAttentionLayer | false | 6,944 | [
"Apache-2.0"
] | 1 | b2a9eb06cdfe0971d0c352299db1075ec4827dd9 | https://github.com/jiangnanboy/gcn_for_prediction_of_protein_interactions/tree/b2a9eb06cdfe0971d0c352299db1075ec4827dd9 |
SimpleCumSumModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleCumSumModule(torch.nn.Module):
def __init__(self, dim):
super(SimpleCumSumModule, self).__init__()
self.dim = dim
def forward(self, tensor):
return torch.cumsum(tensor, self.dim)
def get_inputs():
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
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | briancoutinho/glow | SimpleCumSumModule | false | 12,570 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
DotProductAttention | import torch
import torch.nn.functional as F
import torch.nn as nn
class DotProductAttention(nn.Module):
def __init__(self, k_dim):
super(DotProductAttention, self).__init__()
self.scale = 1.0 / k_dim ** 0.5
def forward(self, hn, enc_out, mask=None):
"""
:param hn: query - rn... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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/BiaffineNER | DotProductAttention | false | 8,463 | [
"Apache-2.0"
] | 13 | 0ae179e9ff731362f6c8ba6d0b24485ad45e8bbf | https://github.com/LindgeW/BiaffineNER/tree/0ae179e9ff731362f6c8ba6d0b24485ad45e8bbf |
LayerNorm | import torch
import torch.nn.init
import torch.optim.lr_scheduler
import torch.nn
import torch.autograd
class LayerNorm(torch.nn.Module):
"""
An implementation of `Layer Normalization
<https://www.semanticscholar.org/paper/Layer-Normalization-Ba-Kiros/97fb4e3d45bb098e27e0071448b6152217bd35a5>`_ .
Lay... | 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.init
import torch.optim.lr_scheduler
import torch.nn
import tor... | codedecde/BiMPM | LayerNorm | false | 9,958 | [
"Apache-2.0"
] | 0 | 818602fcf7a018632707b8fbfe33200036795731 | https://github.com/codedecde/BiMPM/tree/818602fcf7a018632707b8fbfe33200036795731 |
FocalTiLoss | import torch
import torch.nn as nn
class FocalTiLoss(nn.Module):
def __init__(self, alpha=0.7, beta=0.4, gamma=0.75):
super().__init__()
self.alpha = alpha
self.beta = beta
self.gamma = gamma
self.eps = 1e-06
def forward(self, output, target):
output = output.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert... | xuyangcao/AttD2UNet | FocalTiLoss | false | 11,047 | [
"MIT"
] | 0 | b76ed8104a4183140b3cbd7f9671ca99d36e3b3e | https://github.com/xuyangcao/AttD2UNet/tree/b76ed8104a4183140b3cbd7f9671ca99d36e3b3e |
UnbalancedWeight | import torch
class UnbalancedWeight(torch.nn.Module):
def __init__(self, ε, ρ):
super(UnbalancedWeight, self).__init__()
self.ε, self.ρ = ε, ρ
def forward(self, x):
return (self.ρ + self.ε / 2) * x
def backward(self, g):
return (self.ρ + self.ε) * g
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | AdrienCorenflos/PFlow | UnbalancedWeight | false | 4,764 | [
"MIT"
] | 1 | ec5f43a5e20d1280260e482ee0f9139fb9d1ca2b | https://github.com/AdrienCorenflos/PFlow/tree/ec5f43a5e20d1280260e482ee0f9139fb9d1ca2b |
MDN | # 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.... | AnesBenmerzoug/Handwriting-Model | MDN | false | 16,894 | [
"MIT"
] | 7 | 925a8d43174cccd58e01d41fdc513343df09d000 | https://github.com/AnesBenmerzoug/Handwriting-Model/tree/925a8d43174cccd58e01d41fdc513343df09d000 |
Linear | import math
import torch
from torch import Tensor
from torch.nn import Linear
from torch.nn import Parameter
import torch.utils.data
def uniform(size, tensor):
bound = 1.0 / math.sqrt(size)
if tensor is not None:
tensor.data.uniform_(-bound, bound)
def kaiming_uniform(tensor, fan, a):
if 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
from torch import Tensor
from torch.nn import Parameter
import torch... | GrumpyZhou/pytorch_geometric | Linear | false | 5,236 | [
"MIT"
] | 1 | 88c54e72d3e26ad48e9ccd99e5696c7f19269d94 | https://github.com/GrumpyZhou/pytorch_geometric/tree/88c54e72d3e26ad48e9ccd99e5696c7f19269d94 |
ReluSquared | import torch
from torch import nn
import torch.nn.functional as F
class ReluSquared(nn.Module):
def forward(self, input):
return F.relu(input) ** 2
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | imflash217/bumblebee | ReluSquared | false | 12,531 | [
"MIT"
] | 0 | 09343d42634aa954cac867f7e426eee260b4df57 | https://github.com/imflash217/bumblebee/tree/09343d42634aa954cac867f7e426eee260b4df57 |
Upconv | # 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.functional as F
from torch.nn import Conv2d
from tor... | shlomi-amitai/monorec | Upconv | false | 10,905 | [
"MIT"
] | 0 | 74571c6cd8d06ae4fb15cbee5a41147c54c78556 | https://github.com/shlomi-amitai/monorec/tree/74571c6cd8d06ae4fb15cbee5a41147c54c78556 |
SplAtConv1d | # 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.... | Neronjust2017/challenge2020_test4 | SplAtConv1d | false | 9,481 | [
"BSD-2-Clause"
] | 0 | 6494107a459b563aa51f8ea75c580c17557b13af | https://github.com/Neronjust2017/challenge2020_test4/tree/6494107a459b563aa51f8ea75c580c17557b13af |
hswish | 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.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | Ecalose/dddd_trainer | hswish | false | 13,623 | [
"Apache-2.0"
] | 80 | ef0c6b271cc2898403375f53f813481ffbf6b02c | https://github.com/Ecalose/dddd_trainer/tree/ef0c6b271cc2898403375f53f813481ffbf6b02c |
A2CNetwork | # 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 ... | jacarvalho/mushroom-rl-benchmark | A2CNetwork | false | 12,543 | [
"MIT"
] | 0 | 5bc2e9b1a12be33827d6edcd5c5ad49571e11275 | https://github.com/jacarvalho/mushroom-rl-benchmark/tree/5bc2e9b1a12be33827d6edcd5c5ad49571e11275 |
BPR_max | # 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
... | hungthanhpham94/GRU4REC-pytorch | BPR_max | false | 15,547 | [
"Apache-2.0"
] | 184 | 666b84264c4afae757fe55c6997dcf0a4da1d44e | https://github.com/hungthanhpham94/GRU4REC-pytorch/tree/666b84264c4afae757fe55c6997dcf0a4da1d44e |
Encoder | import torch
import torch.nn as nn
import torch.nn.parallel
from torch.autograd import Variable
class Encoder(nn.Module):
def __init__(self, x_dim, h_dim, z_dim):
super(Encoder, self).__init__()
self.x_dim = x_dim
self.h_dim = h_dim
self.z_dim = z_dim
self.relu = nn.LeakyR... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
from torch.autograd import Variab... | Shimaa1/group_activity_gcn | Encoder | false | 5,837 | [
"MIT"
] | 1 | 53f86e93eb7a78d537532d48c836ce30cbf7e8d1 | https://github.com/Shimaa1/group_activity_gcn/tree/53f86e93eb7a78d537532d48c836ce30cbf7e8d1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.