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 |
|---|---|---|---|---|---|---|---|---|---|---|
L1_Gradient_loss | import torch
import torch.nn as nn
import torch.utils.data
class L1_Charbonnier_loss(nn.Module):
"""L1 Charbonnierloss."""
def __init__(self):
super(L1_Charbonnier_loss, self).__init__()
self.eps = 1e-06
def forward(self, X, Y):
diff = torch.add(X, -Y)
error = torch.sqrt(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dy... | AnonymityCode/FastLFnet | L1_Gradient_loss | false | 16,938 | [
"MIT"
] | 8 | cc4c1d9620fef5e75798f40084729d8d7fdd5a9a | https://github.com/AnonymityCode/FastLFnet/tree/cc4c1d9620fef5e75798f40084729d8d7fdd5a9a |
SameModule | # 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.... | SpyrosMouselinos/DeltaFormers | SameModule | false | 5,876 | [
"Apache-2.0"
] | 1 | 38508fa9b85f2c50aa0031b67e7e8feff1a75b27 | https://github.com/SpyrosMouselinos/DeltaFormers/tree/38508fa9b85f2c50aa0031b67e7e8feff1a75b27 |
Beta | # 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, math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.gu... | samarth-robo/apex | Beta | false | 4,254 | [
"MIT"
] | 0 | db24044acacd0fcd006886eb1677eaa2f2beedad | https://github.com/samarth-robo/apex/tree/db24044acacd0fcd006886eb1677eaa2f2beedad |
MNISTBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
class MNISTBlock(nn.Module):
def __init__(self, width, scaling=1.0, use_bias=True):
super(MNISTBlock, self).__init__()
self.scaling = scaling
self.linear = nn.Linear(width, width, bias=use_bias)
nn.init.xavier_norm... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | EulerInstitute/mgopt_icml21 | MNISTBlock | false | 9,010 | [
"Apache-2.0"
] | 0 | 3790ac863e22c49e067d2872f7e3ea6e306c65af | https://github.com/EulerInstitute/mgopt_icml21/tree/3790ac863e22c49e067d2872f7e3ea6e306c65af |
ConvBlockINEDense | # 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.... | BaekduChoi/Halftoning_v2 | ConvBlockINEDense | false | 2,067 | [
"BSD-3-Clause"
] | 0 | fdb7040e1a4044f23ef9c92757bbb90c23685afe | https://github.com/BaekduChoi/Halftoning_v2/tree/fdb7040e1a4044f23ef9c92757bbb90c23685afe |
LipNormLinear | import torch
import torch.nn as nn
import torch.nn.functional as F
def _max_except_dim(input, dim):
maxed = input
for axis in range(input.ndimension() - 1, dim, -1):
maxed, _ = maxed.max(axis, keepdim=True)
for axis in range(dim - 1, -1, -1):
maxed, _ = maxed.max(axis, keepdim=True)
re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | hologerry/residual-flows | LipNormLinear | false | 10,304 | [
"MIT"
] | 0 | 33a3639150490279c2e13238dd6244b80c52adf7 | https://github.com/hologerry/residual-flows/tree/33a3639150490279c2e13238dd6244b80c52adf7 |
HighwayMaxoutNetwork | # 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.... | mayankiitg/cs224n | HighwayMaxoutNetwork | false | 4,005 | [
"MIT"
] | 0 | c67b7904101c8f19a5a231e4fe521e764470d41b | https://github.com/mayankiitg/cs224n/tree/c67b7904101c8f19a5a231e4fe521e764470d41b |
EncoderLayer | # 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.... | bsgiovanini/transformer | EncoderLayer | false | 1,618 | [
"Apache-2.0"
] | 0 | e128fa862f1b3d17d7b92df169a2bbee3f08366f | https://github.com/bsgiovanini/transformer/tree/e128fa862f1b3d17d7b92df169a2bbee3f08366f |
FirstBlock | import torch
import numpy as np
import torch.nn as nn
class BatchNormLayer(nn.Module):
"""Implements batch normalization layer."""
def __init__(self, channels, gamma=False, beta=True, decay=0.9, epsilon
=1e-05):
"""Initializes with basic settings.
Args:
channels: Number of channels... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | lelechen63/idinvert_pytorch | FirstBlock | false | 10,449 | [
"MIT"
] | 0 | 0469e1e5460ee4dd626c05bd35a83d52f9dc2cac | https://github.com/lelechen63/idinvert_pytorch/tree/0469e1e5460ee4dd626c05bd35a83d52f9dc2cac |
Generator | import torch
import torch.nn as nn
class Generator(nn.Module):
"""Define standard linear + softmax generation step."""
def __init__(self, d_model, vocab):
super(Generator, self).__init__()
self.d_model = d_model
self.proj1 = nn.Linear(self.d_model, self.d_model)
self.proj = nn... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | context-aware-Failure-Identification/CLog | Generator | false | 9,926 | [
"MIT"
] | 0 | ef2c87605fa3cdb6db6666c754311ab9c3fed371 | https://github.com/context-aware-Failure-Identification/CLog/tree/ef2c87605fa3cdb6db6666c754311ab9c3fed371 |
VAE | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Decoder(nn.Module):
""" VAE decoder """
def __init__(self, img_channels, latent_size):
super(Decoder, self).__init__()
self.latent_size = latent_size
self.img_channels = img_channels
... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from... | benedictquartey/softgym_wm | VAE | false | 12,200 | [
"BSD-3-Clause"
] | 0 | 0aef75fed207b11029f6052c656a679c105b4677 | https://github.com/benedictquartey/softgym_wm/tree/0aef75fed207b11029f6052c656a679c105b4677 |
SpatialCrossMapLRN | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.utils.data.dataloader
import torch.utils.dat... | DeepBrainsMe/PyDoctor_Final | SpatialCrossMapLRN | false | 5,055 | [
"MIT"
] | 1 | 49ecfc64b2a2866e7f37cc79c1f32a817975f064 | https://github.com/DeepBrainsMe/PyDoctor_Final/tree/49ecfc64b2a2866e7f37cc79c1f32a817975f064 |
FiLMLayer_PreSin | # 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 math as tl_math
import numpy ... | justinjohn0306/CIPS-3D | FiLMLayer_PreSin | false | 6,999 | [
"MIT"
] | 1 | 69a910a7841846419a6b5e03182c8cf061a82584 | https://github.com/justinjohn0306/CIPS-3D/tree/69a910a7841846419a6b5e03182c8cf061a82584 |
Reorg | import torch
import torch.nn as nn
class Reorg(nn.Module):
""" This layer reorganizes a tensor according to a stride.
The dimensions 2,3 will be sliced by the stride and then stacked in dimension 1. (input must have 4 dimensions)
Args:
stride (int): stride to divide the input tensor
"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | IrisDinge/YoloV3_DOTA | Reorg | false | 5,352 | [
"MIT"
] | 1 | cdfe6375a2323e9ee162e50a46478d8a66529e6c | https://github.com/IrisDinge/YoloV3_DOTA/tree/cdfe6375a2323e9ee162e50a46478d8a66529e6c |
PowerLaw_Compressed_Loss | import torch
import torch.nn as nn
import torch.utils.data
class PowerLaw_Compressed_Loss(nn.Module):
def __init__(self, power=0.3, complex_loss_ratio=0.113):
super(PowerLaw_Compressed_Loss, self).__init__()
self.power = power
self.complex_loss_ratio = complex_loss_ratio
self.crit... | 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... | taylorjdlee/VoiceSplit | PowerLaw_Compressed_Loss | false | 13,023 | [
"Apache-2.0"
] | 0 | bd914c42ae065bdda95d81a0ce0c173c29bb040f | https://github.com/taylorjdlee/VoiceSplit/tree/bd914c42ae065bdda95d81a0ce0c173c29bb040f |
PositionwiseFeedForward | import math
import torch
from torch import nn
def gelu(x):
"""Implementation of the gelu activation function.
For information: OpenAI GPT's gelu is slightly different (and gives slightly different results):
0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))))
"... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
from to... | ArrowLuo/GRACE | PositionwiseFeedForward | false | 7,748 | [
"Apache-2.0"
] | 17 | f27b500ba905685c03eee6d91d87adc9ef78b4d1 | https://github.com/ArrowLuo/GRACE/tree/f27b500ba905685c03eee6d91d87adc9ef78b4d1 |
SimpleNN | # 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_... | sboomi/cp1 | SimpleNN | false | 10,850 | [
"MIT"
] | 0 | 7f7aa96e8ba9cfe00802028a61bfba5e90c999f6 | https://github.com/sboomi/cp1/tree/7f7aa96e8ba9cfe00802028a61bfba5e90c999f6 |
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
from torch._inductor.select_algorithm import extern_kernels
import 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... | terry97-guel/POENet-ActiveLearning | Model | false | 4,436 | [
"MIT"
] | 0 | 78e959c8c5eacc5b2dc4e3334ed609d182ce7b6c | https://github.com/terry97-guel/POENet-ActiveLearning/tree/78e959c8c5eacc5b2dc4e3334ed609d182ce7b6c |
L2Norm | # 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 itertools import product as product
from math import sqrt as sqrt
import t... | avisekiit/adversarial_object_detection | L2Norm | false | 14,915 | [
"MIT"
] | 795 | 263f264b3f2bdb0f116ebbb30ec4a805f357b3a6 | https://github.com/avisekiit/adversarial_object_detection/tree/263f264b3f2bdb0f116ebbb30ec4a805f357b3a6 |
OutlookAttention | # 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.... | javierrodenas/clearml_javi | OutlookAttention | false | 10,370 | [
"Apache-2.0"
] | 0 | b6326104fe6a6f522223c2ac3d87468990a9e6f2 | https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2 |
Scale_B | import torch
import torch.nn as nn
class Scale_B(nn.Module):
"""
Learned per-channel scale factor, used to scale the noise
"""
def __init__(self, n_channel):
super().__init__()
self.weight = nn.Parameter(torch.zeros((1, n_channel, 1, 1)))
def forward(self, noise):
result ... | 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... | sergkuzn148/stg | Scale_B | false | 16,382 | [
"MIT"
] | 96 | 84d9f53ae3665c423836a4d0176dc3b22de62b19 | https://github.com/sergkuzn148/stg/tree/84d9f53ae3665c423836a4d0176dc3b22de62b19 |
Encoder | # 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 ... | CBIIT/NCI-DOE-Colab-Pilot1-Combo | Encoder | false | 11,269 | [
"MIT"
] | 0 | 8d60900c29618083e0944b5b8ef43a2e98881b32 | https://github.com/CBIIT/NCI-DOE-Colab-Pilot1-Combo/tree/8d60900c29618083e0944b5b8ef43a2e98881b32 |
ModulatedConv2d | import math
import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
def make_kernel(k):
k = torch.tensor(k, dtype=torch.float32)
if len(k.shape) == 1:
k = k[None, :] * k[:, None]
k /= k.sum()
return k
def upfirdn2d_native(input, kernel, up_x, up... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | guyii54/Contrastive-I2I | ModulatedConv2d | false | 6,777 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 |
_Sum | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.jit
assert_size_stride = torch._C._dynamo.guards.asser... | One-sixth/ms_ssim_pytorch | _Sum | false | 8,634 | [
"MIT"
] | 42 | 6269c62e0dd29c91fa38e4ba73d906d0c84ca966 | https://github.com/One-sixth/ms_ssim_pytorch/tree/6269c62e0dd29c91fa38e4ba73d906d0c84ca966 |
Conv2d | # 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 ... | T1anZhenYu/pytorch-classification | Conv2d | false | 1,110 | [
"MIT"
] | 0 | ad68e09f20a98541bcb437a7df8e7d14e8c21636 | https://github.com/T1anZhenYu/pytorch-classification/tree/ad68e09f20a98541bcb437a7df8e7d14e8c21636 |
CustomGruCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import numpy as np
... | li4112/PySyft | CustomGruCell | false | 7,083 | [
"Apache-2.0"
] | 1 | e593cad25d6831623e6a2b6d34bcb04adcbe00f9 | https://github.com/li4112/PySyft/tree/e593cad25d6831623e6a2b6d34bcb04adcbe00f9 |
GlobalAttention | # 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.... | andy-yangz/birnn-decoder-NMT | GlobalAttention | false | 1,457 | [
"MIT"
] | 0 | 112293f463d93ef0e08cdcb363b908ed9ad5198e | https://github.com/andy-yangz/birnn-decoder-NMT/tree/112293f463d93ef0e08cdcb363b908ed9ad5198e |
TemporallyBatchedAdditiveAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
class AdditiveAttention(nn.Module):
def __init__(self, encoder_hidden_state_dim, decoder_hidden_state_dim,
internal_dim=None):
super(AdditiveAttention, self).__init__()
if internal_dim is None:
internal_dim = i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | fireofearth/Trajectron-plus-plus | TemporallyBatchedAdditiveAttention | false | 3,510 | [
"MIT"
] | 0 | b39df025b62a8ce466266936198baee9bfa14e89 | https://github.com/fireofearth/Trajectron-plus-plus/tree/b39df025b62a8ce466266936198baee9bfa14e89 |
Perceptron | # 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.cuda
assert_size_stride = torch._C._dynamo.gu... | arhouati/NLP_with_Pytorch | Perceptron | false | 1,466 | [
"MIT"
] | 0 | 8063cdb4b1245c59db2cd57f23b2cbde577c2c0f | https://github.com/arhouati/NLP_with_Pytorch/tree/8063cdb4b1245c59db2cd57f23b2cbde577c2c0f |
MeanMap | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.autograd
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._d... | LLNL/fastcam | MeanMap | false | 8,422 | [
"BSD-3-Clause"
] | 25 | 99cefe37528014247319468cf05f54fef259d3bf | https://github.com/LLNL/fastcam/tree/99cefe37528014247319468cf05f54fef259d3bf |
MyNet | # 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... | DeepDuke/Face_Keypoints_Dectection | MyNet | false | 485 | [
"MIT"
] | 0 | 9f09e1ad113734a9ba5d006d3f817a497db572aa | https://github.com/DeepDuke/Face_Keypoints_Dectection/tree/9f09e1ad113734a9ba5d006d3f817a497db572aa |
DeResNetBlockGroupNorm | # 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.... | andrecianflone/wolf | DeResNetBlockGroupNorm | false | 14,834 | [
"Apache-2.0"
] | 75 | 826bbedc58d4d29871110349356868066a3108e6 | https://github.com/andrecianflone/wolf/tree/826bbedc58d4d29871110349356868066a3108e6 |
CustomInverse | import torch
class CustomTorchOp(torch.autograd.Function):
@staticmethod
def symbolic(g, input):
return g.op('torchcustom::Add10', input)
@staticmethod
def forward(ctx, x):
return x + 10
class CustomInverse(torch.nn.Module):
def forward(self, x, y):
ress = CustomTorchO... | 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... | Sanster/onnxruntime-extensions | CustomInverse | false | 2,821 | [
"MIT"
] | 0 | 6eb41afcb2394d94ee90c7ae409fa96122e4cace | https://github.com/Sanster/onnxruntime-extensions/tree/6eb41afcb2394d94ee90c7ae409fa96122e4cace |
StyleBlock | # 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 ... | NejcHirci/material-addon | StyleBlock | false | 17,786 | [
"MIT"
] | 4 | c08e2081413c3319b712c2f7193ac8013f601382 | https://github.com/NejcHirci/material-addon/tree/c08e2081413c3319b712c2f7193ac8013f601382 |
MSE | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torch.optim import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._... | kakaxi314/GuideNet | MSE | false | 15,776 | [
"MIT"
] | 142 | 9f53b4086d707e94d48a47bbac7dd87aaba9fdea | https://github.com/kakaxi314/GuideNet/tree/9f53b4086d707e94d48a47bbac7dd87aaba9fdea |
ExpPool | import torch
from torch import nn
class ExpPool(nn.Module):
def __init__(self):
super(ExpPool, self).__init__()
def forward(self, feat_map):
"""
Numerically stable implementation of the operation
Arguments:
feat_map(Tensor): tensor with shape (N, C, H, W)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | Tarandro/Chexpert | ExpPool | false | 11,931 | [
"Apache-2.0"
] | 0 | 6bc51f899a479f8dbad8a64c92f35ed4632377b3 | https://github.com/Tarandro/Chexpert/tree/6bc51f899a479f8dbad8a64c92f35ed4632377b3 |
ReCodeAlphabet | import torch
import torch.nn as nn
class ReCodeAlphabet(nn.Module):
def __init__(self):
super(ReCodeAlphabet, self).__init__()
def forward(self, input):
input_reordered = [input[:, i, ...] for i in [0, 2, 1, 3]]
input = torch.stack(input_reordered, dim=1)
return input
def g... | 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... | banwang27/models | ReCodeAlphabet | false | 12,145 | [
"MIT"
] | 0 | 59db29e46f76b630b78c864fb607388dd927b93c | https://github.com/banwang27/models/tree/59db29e46f76b630b78c864fb607388dd927b93c |
TCL | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
from torch.nn.init import *
class TCL(nn.Module):
def __init__(self, conv_size, dim):
super(TCL, self).__init__()
self.conv2d = nn.Conv2d(dim, dim, kernel_size=(conv_size, 1),
padding=(conv_size // 2, 0))
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.optim
from torch.nn.... | Luoyadan/MM2020_ABG | TCL | false | 17,629 | [
"MIT"
] | 8 | d74cf915deea7bb425518f5bd40e64a9a7341981 | https://github.com/Luoyadan/MM2020_ABG/tree/d74cf915deea7bb425518f5bd40e64a9a7341981 |
StateInitZero | # 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
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import tor... | aalborov/openvino_training_extensions | StateInitZero | false | 6,041 | [
"Apache-2.0"
] | 1 | a0bb39424151a98e1ca80c4aa5c865636d401785 | https://github.com/aalborov/openvino_training_extensions/tree/a0bb39424151a98e1ca80c4aa5c865636d401785 |
Context2AnswerAttention | # 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.... | IBM/graph4nlp | Context2AnswerAttention | false | 8,333 | [
"Apache-2.0"
] | 18 | a9bf20b23fa1ec368d9bd40cc8c557f86a9f8297 | https://github.com/IBM/graph4nlp/tree/a9bf20b23fa1ec368d9bd40cc8c557f86a9f8297 |
DPSLTMAdapter | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
from to... | EXAPPAI/opacus | DPSLTMAdapter | false | 2,213 | [
"Apache-2.0"
] | 0 | 11e188a2f03a8a08be51fdf2367cc1387879312a | https://github.com/EXAPPAI/opacus/tree/11e188a2f03a8a08be51fdf2367cc1387879312a |
MultiHeadAttention | import torch
import numpy as np
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
from typing import Optional
def generate_local_map_mask(chunk_size: 'int', attention_size: 'int',
mask_future=False, device: 'torch.device'='cpu') ->torch.BoolTensor:
"""Compu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | YanLu-nyu/transferlearning | MultiHeadAttention | false | 14,645 | [
"MIT"
] | 9,657 | 037806c6eb8b0c12aefbfbf3e35cbf893093cff9 | https://github.com/YanLu-nyu/transferlearning/tree/037806c6eb8b0c12aefbfbf3e35cbf893093cff9 |
DotAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
class DotAttention(nn.Module):
def __init__(self, dropout=0.0):
super(DotAttention, self).__init__()
self.dropout = dropout
def forward(self, Q, K, V, mask_out=None, head_mask=None):
"""
一般输入信息 X 时,假设 K = V = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | fmc123653/DeepKE | DotAttention | false | 15,403 | [
"MIT"
] | 676 | 4d30e51368681c7cb73e2ecacf9b922b441cbe99 | https://github.com/fmc123653/DeepKE/tree/4d30e51368681c7cb73e2ecacf9b922b441cbe99 |
Addition_Module | import torch
import torch.nn as nn
class Addition_Module(nn.Module):
"""Custom addition module that uses multiple inputs to assure correct relevance
propagation. Any addition in a forward function needs to be replaced with the
module before using LRP."""
def __init__(self) ->None:
super().__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 torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | LMdeLiangMi/captum | Addition_Module | false | 5,467 | [
"BSD-3-Clause"
] | 1 | 8bd9686013fe0ba8996e9b1cbeb0ea8e91512787 | https://github.com/LMdeLiangMi/captum/tree/8bd9686013fe0ba8996e9b1cbeb0ea8e91512787 |
MolDQN | import torch
import torch.nn as nn
class MolDQN(nn.Module):
def __init__(self, input_length, output_length):
super(MolDQN, self).__init__()
self.linear_1 = nn.Linear(input_length, 1024)
self.linear_2 = nn.Linear(1024, 512)
self.linear_3 = nn.Linear(512, 128)
self.linear_4 ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | iamchosenlee/MolDQN-pytorch | MolDQN | false | 3,655 | [
"MIT"
] | 0 | 66bd1e067e439e49abc77d21089d3baf065317d4 | https://github.com/iamchosenlee/MolDQN-pytorch/tree/66bd1e067e439e49abc77d21089d3baf065317d4 |
LowRankMultiHeadAttention | import torch
import torch.nn as nn
import torch.utils.checkpoint
import torch.nn.functional as F
from torch.cuda.amp import autocast
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 | LowRankMultiHeadAttention | false | 12,160 | [
"MIT"
] | 0 | 0af38f16338a9bcfcc11091b1a6b75befd67f234 | https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234 |
MarginDisparityDiscrepancy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from typing import Opt... | mstoelzle/Transfer-Learning-Library | MarginDisparityDiscrepancy | false | 12,885 | [
"MIT"
] | 0 | 7d5022668cbe6d1bedbc7c386d44b9d89c272d6b | https://github.com/mstoelzle/Transfer-Learning-Library/tree/7d5022668cbe6d1bedbc7c386d44b9d89c272d6b |
gconv_RNN | # 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 torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dyn... | kevin-xuan/Traffic-Benchmark | gconv_RNN | false | 15,815 | [
"MIT"
] | 120 | b9f8e40b4df9b58f5ad88432dc070cbbbcdc0228 | https://github.com/kevin-xuan/Traffic-Benchmark/tree/b9f8e40b4df9b58f5ad88432dc070cbbbcdc0228 |
BertAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class BertSelfAttention(nn.Module):
def __init__(self, config):
super(BertSelfAttention, self).__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise ValueError(
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | minjoong507/Image-Captioning-Transformer | BertAttention | false | 7,252 | [
"MIT"
] | 1 | 813060f0bb656e336154173f11e99a80362c8c2a | https://github.com/minjoong507/Image-Captioning-Transformer/tree/813060f0bb656e336154173f11e99a80362c8c2a |
rSoftMax | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | Exdenta/torchsat | rSoftMax | false | 13,654 | [
"MIT"
] | 316 | 70ea3db758757104fb3ba618ddf7997f0f3a75b4 | https://github.com/Exdenta/torchsat/tree/70ea3db758757104fb3ba618ddf7997f0f3a75b4 |
ChannelAttentionBlock | import torch
import torch.nn as nn
class ChannelAttentionBlock(nn.Module):
def __init__(self, in_channels):
super(ChannelAttentionBlock, self).__init__()
self.gamma = nn.Parameter(torch.zeros(1))
self.softmax = nn.Softmax(dim=-1)
def forward(self, x):
"""
:param x: 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.... | cnuzh/CSNet | ChannelAttentionBlock | false | 6,466 | [
"MIT"
] | 1 | a6c3163624f55dc294ec2e5a6de020d77bd4ff91 | https://github.com/cnuzh/CSNet/tree/a6c3163624f55dc294ec2e5a6de020d77bd4ff91 |
DiracConv | # 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.utils.data
impor... | HyperGAN/imgclsmob | DiracConv | false | 17,675 | [
"MIT"
] | 9 | 88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3 | https://github.com/HyperGAN/imgclsmob/tree/88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3 |
NoiseLayer | # 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | AleksiKnuutila/ganspace | NoiseLayer | false | 1,917 | [
"Apache-2.0"
] | 0 | 23471a07c8b0d693fa7f1f2dfbb8b34ce22d9d38 | https://github.com/AleksiKnuutila/ganspace/tree/23471a07c8b0d693fa7f1f2dfbb8b34ce22d9d38 |
NormLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._... | phernst/TopologyLayer | NormLoss | false | 12,879 | [
"MIT"
] | 0 | aad72704114235156a244ddaa14dc805530e3fc7 | https://github.com/phernst/TopologyLayer/tree/aad72704114235156a244ddaa14dc805530e3fc7 |
VDSR | import torch
import torch.nn as nn
def load_param(model1_path, model2):
dict_param1 = torch.load(model1_path)
dict_param2 = dict(model2.named_parameters())
for name2 in dict_param2:
if name2 in dict_param1:
dict_param2[name2].data.copy_(dict_param1[name2].data)
model2.load_state_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_... | MingSun-Tse/pytorch-vdsr | VDSR | false | 5,606 | [
"MIT"
] | 1 | 597bacb4ec7385c8cc6cdf91e26e64ef2e6808b7 | https://github.com/MingSun-Tse/pytorch-vdsr/tree/597bacb4ec7385c8cc6cdf91e26e64ef2e6808b7 |
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... | krylea/ocp | PolynomialEnvelope | false | 10,491 | [
"MIT"
] | 0 | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | https://github.com/krylea/ocp/tree/00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 |
GCN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
i... | GeekV5/PaperReProduction20200425 | GCN | false | 5,212 | [
"Apache-2.0"
] | 1 | 5c44da3c2fac89dd316a5e4930a78d023a12176d | https://github.com/GeekV5/PaperReProduction20200425/tree/5c44da3c2fac89dd316a5e4930a78d023a12176d |
InnerProductDecoder | # 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 torch.nn as nn
import torch.nn.modules.loss
assert_size_stride = torch._C... | PatriciaXiao/gae-pytorch | InnerProductDecoder | false | 11,767 | [
"MIT"
] | 0 | eb0e9bdf9a2f23d38941ac731bd481bd6da737b9 | https://github.com/PatriciaXiao/gae-pytorch/tree/eb0e9bdf9a2f23d38941ac731bd481bd6da737b9 |
NormalizationLayer | import torch
import torch.nn.init
class NormalizationLayer(torch.nn.Module):
"""Class for normalization layer."""
def __init__(self, normalize_scale=1.0, learn_scale=True):
super(NormalizationLayer, self).__init__()
self.norm_s = float(normalize_scale)
if learn_scale:
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.triton_helpers import libdevice
import torch.nn.init
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | akurniawan/jina-hub | NormalizationLayer | false | 1,395 | [
"Apache-2.0"
] | 0 | d89bc5e8f527f1212c3228a15775e222983c0087 | https://github.com/akurniawan/jina-hub/tree/d89bc5e8f527f1212c3228a15775e222983c0087 |
CrossAttention | import torch
import torch.nn as nn
class CrossAttention(nn.Module):
def __init__(self, in_channel=256, ratio=8):
super(CrossAttention, self).__init__()
self.conv_query = nn.Conv2d(in_channel, in_channel // ratio,
kernel_size=1)
self.conv_key = nn.Conv2d(in_channel, in_channel ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | JosephChenHub/DPANet | CrossAttention | false | 8,415 | [
"MIT"
] | 19 | 68cf40a405d8c8c6506884079cd0a206d6d58e63 | https://github.com/JosephChenHub/DPANet/tree/68cf40a405d8c8c6506884079cd0a206d6d58e63 |
KLLoss | # 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
... | ncduy0303/wmt21-qe-task | KLLoss | false | 12,819 | [
"Apache-2.0"
] | 0 | 93082afd0c56fb8d60101457082116c79adeac50 | https://github.com/ncduy0303/wmt21-qe-task/tree/93082afd0c56fb8d60101457082116c79adeac50 |
ResidualBlock_thefirstone | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
class avgpool(nn.Module):
"""
Mean pooling class - downsampling
"""
def __init__(self, up_size=0):
super(avgpool, self).__init__()
def forward(self, x):
out_man = (x[:, :, ::2, ::2] + x[:, :, 1::2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | nathalia-kim/nu_gan | ResidualBlock_thefirstone | false | 10,725 | [
"MIT"
] | 0 | c1d0891945bd7ac3d95869db91f490f57f203110 | https://github.com/nathalia-kim/nu_gan/tree/c1d0891945bd7ac3d95869db91f490f57f203110 |
PositionwiseFeedForward | import torch
import torch.nn as nn
import torch.nn.functional as F
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.... | Romero027/OmniNet | PositionwiseFeedForward | false | 2,786 | [
"Apache-2.0"
] | 0 | c1cda1738c80925e5468b3ffc7aae2153bcd9e62 | https://github.com/Romero027/OmniNet/tree/c1cda1738c80925e5468b3ffc7aae2153bcd9e62 |
Attention | import torch
import torch.optim
import torch.utils.data
from torch import nn
import torch
class Attention(nn.Module):
"""
Attention Network.
"""
def __init__(self, encoder_dim, decoder_dim, attention_dim):
"""
:param encoder_dim: feature size of encoded images
:param decoder_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.... | ChoiIseungil/vilbert-multi-task | Attention | false | 5,001 | [
"MIT"
] | 1 | 37d14b9aed9c48117a820e05157c7ccd3dd20d5b | https://github.com/ChoiIseungil/vilbert-multi-task/tree/37d14b9aed9c48117a820e05157c7ccd3dd20d5b |
MlpAttention | # 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 math as tl_math
import torch.... | Malta-Lab/IUPE | MlpAttention | false | 8,557 | [
"MIT"
] | 10 | 44ddf119917538f02bb69509fec7a8314eed419f | https://github.com/Malta-Lab/IUPE/tree/44ddf119917538f02bb69509fec7a8314eed419f |
DQNetwork | # 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 as... | QasimWani/EARL | DQNetwork | false | 948 | [
"MIT"
] | 0 | 05c303335e67903380771c4954a5317bd46fc0e7 | https://github.com/QasimWani/EARL/tree/05c303335e67903380771c4954a5317bd46fc0e7 |
SimpleAbsModule | # 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.jit
import torch.onnx
import torch.nn
assert_size_stride = t... | YaronBenAtar/glow | SimpleAbsModule | false | 14,648 | [
"Apache-2.0"
] | 2,838 | a13706a4239fa7eaf059c670dc573e3eb0768f86 | https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86 |
AE_3D_50cone | import torch
import torch.nn as nn
import torch.utils.data
class AE_3D_50cone(nn.Module):
def __init__(self, n_features=4):
super(AE_3D_50cone, self).__init__()
self.en1 = nn.Linear(n_features, 50)
self.en2 = nn.Linear(50, 30)
self.en3 = nn.Linear(30, 20)
self.en4 = nn.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.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_3D_50cone | false | 12,434 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
NRelu | import torch
import torch.utils.data
import torch.nn as nn
import torch.optim
import torch.backends.cudnn
import torch.nn.functional as F
class NRelu(nn.Module):
"""
-max(-x,0)
Parameters
----------
Input shape: (N, C, W, H)
Output shape: (N, C * W * H)
"""
def __init__(self, inplace)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
import torch.nn as nn
import torch.optim
import torch.backends.cu... | minhtannguyen/pytorch_shake_shake | NRelu | false | 12,785 | [
"MIT"
] | 0 | d7f245d8d8b9e81a6020aadb438ffeae6d5593c2 | https://github.com/minhtannguyen/pytorch_shake_shake/tree/d7f245d8d8b9e81a6020aadb438ffeae6d5593c2 |
EncoderImagePrecomp | import torch
import numpy as np
from collections import OrderedDict
import torch.nn as nn
import torch.nn.init
def l2norm(X):
"""L2-normalize columns of X
"""
norm = torch.pow(X, 2).sum(dim=1).sqrt().view(X.size(0), -1)
X = torch.div(X, norm.expand_as(X))
return X
class EncoderImagePrecomp(nn.Mo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import numpy as np
... | ExplorerFreda/VSE-C | EncoderImagePrecomp | false | 13,679 | [
"MIT"
] | 61 | 52d7742adfe017eacd74f36a5953ea2ace9f5fce | https://github.com/ExplorerFreda/VSE-C/tree/52d7742adfe017eacd74f36a5953ea2ace9f5fce |
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 ... | ChenRocks/Distill-BERT-Textgen-ONMT | BothContextGate | false | 17,096 | [
"MIT"
] | 7 | d83dd1a95af7513cbfae4a2768f6effc2f3a589f | https://github.com/ChenRocks/Distill-BERT-Textgen-ONMT/tree/d83dd1a95af7513cbfae4a2768f6effc2f3a589f |
DenseCrossEntropy_smooth | import torch
import torch.nn as nn
import torch.nn.functional as F
class DenseCrossEntropy(nn.Module):
def __init__(self):
super(DenseCrossEntropy, self).__init__()
def forward(self, logits, labels):
logits = logits.float()
labels = labels.float()
logprobs = F.log_softmax(log... | 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
... | LichenYang-Jeffrey/DCL-with-Efficient-B7 | DenseCrossEntropy_smooth | false | 17,571 | [
"MIT"
] | 4 | 84940c96a8c7926c630a7a6d5bfd5c6e52a57c2e | https://github.com/LichenYang-Jeffrey/DCL-with-Efficient-B7/tree/84940c96a8c7926c630a7a6d5bfd5c6e52a57c2e |
Conv | import torch
import torch.nn as nn
class crop(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
N, C, H, W = x.shape
x = x[0:N, 0:C, 0:H - 1, 0:W]
return x
class Conv(nn.Module):
def __init__(self, in_channels, out_channels, bias=False, blind=Tru... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | amonod/udvd | Conv | false | 1,434 | [
"MIT"
] | 0 | a1ccb777d205255ac68c40efb93dd3996f562c45 | https://github.com/amonod/udvd/tree/a1ccb777d205255ac68c40efb93dd3996f562c45 |
GaussianKernel | # 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
... | XianyuanLiu/Transfer-Learning-Library | GaussianKernel | false | 10,137 | [
"MIT"
] | 0 | 25f83f32437032df88ca6101ecd1f63ec7a0aa2c | https://github.com/XianyuanLiu/Transfer-Learning-Library/tree/25f83f32437032df88ca6101ecd1f63ec7a0aa2c |
PositionwiseFeedForward | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions | PositionwiseFeedForward | false | 14,712 | [
"MIT"
] | 62 | 6e5ef241c64b5b30a6ff54ddad31e610013b8388 | https://github.com/YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions/tree/6e5ef241c64b5b30a6ff54ddad31e610013b8388 |
RotatELoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class RotatELoss(nn.Module):
def __init__(self):
super(RotatELoss, self).__init__()
def forward(self, p_score, n_score, penalty=None):
return torch.mean(-F.logsigmoid(p_score) - F.logsigmoid(-n_score))
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
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | CogNLP/CogKGE | RotatELoss | false | 5,019 | [
"MIT"
] | 1 | 70d851d6489600c1e90eb25b0388a3ceba2f078c | https://github.com/CogNLP/CogKGE/tree/70d851d6489600c1e90eb25b0388a3ceba2f078c |
MP | # 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
from torch.nn import MaxPool2d
assert... | ioangatop/yolo | MP | false | 6,892 | [
"MIT"
] | 1 | c65a72337369572bc07090f39123e2bf6ff5f4a3 | https://github.com/ioangatop/yolo/tree/c65a72337369572bc07090f39123e2bf6ff5f4a3 |
GrayScaleToRGB | import torch
import torch.utils.data
class GrayScaleToRGB(torch.nn.Module):
"""
Applies the transformation on an image to convert grayscale to rgb
"""
def __init__(self):
super().__init__()
def forward(self, sample):
return sample.repeat(3, 1, 1)
def get_inputs():
return [t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_... | saifullah3396/doc_robustness | GrayScaleToRGB | false | 4,395 | [
"Apache-2.0"
] | 0 | 80207fb44709d4b97de826331c074784be9c75ca | https://github.com/saifullah3396/doc_robustness/tree/80207fb44709d4b97de826331c074784be9c75ca |
SeqAttnMatch | import torch
import torch.nn as nn
import torch.nn.functional as F
class SeqAttnMatch(nn.Module):
"""
Given sequences X and Y, match sequence Y to each element in X.
* o_i = sum(alpha_j * y_j) for i in X
* alpha_j = softmax(y_j * x_i)
"""
def __init__(self, embed_dim, identity=False):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | DongjunLee/claf | SeqAttnMatch | false | 13,600 | [
"MIT"
] | 225 | ef548dda27c9aac8ce4db09774c8a1459d25bde1 | https://github.com/DongjunLee/claf/tree/ef548dda27c9aac8ce4db09774c8a1459d25bde1 |
VAE | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from... | jinyeom/ga-plastic-models | VAE | false | 3,784 | [
"MIT"
] | 0 | e38b245ae51c35a5f32679cc9f215463a3d58f1a | https://github.com/jinyeom/ga-plastic-models/tree/e38b245ae51c35a5f32679cc9f215463a3d58f1a |
VarianceLayer | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class VarianceLayer(nn.Module):
def __init__(self, patch_size=5, channels=1):
self.patch_size = patch_size
super(VarianceLayer, self).__init__()
mean_mask = np.ones((channels, channels, patch_size, patch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | GuYuanjie/DeepFusionPrior | VarianceLayer | false | 5,227 | [
"MIT"
] | 1 | a7126e073ed8c49b6a9a662492b64aaeee56cc01 | https://github.com/GuYuanjie/DeepFusionPrior/tree/a7126e073ed8c49b6a9a662492b64aaeee56cc01 |
my_Hingeloss | # 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... | carsault/chord_sequence_prediction | my_Hingeloss | false | 1,635 | [
"MIT"
] | 0 | 6eb539a963ca6350bcf0c88b8d8756775ad7c488 | https://github.com/carsault/chord_sequence_prediction/tree/6eb539a963ca6350bcf0c88b8d8756775ad7c488 |
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.... | DenDen047/data2text-macro-plan-py | PositionwiseFeedForward | false | 7,957 | [
"MIT"
] | 20 | bb01ec6e23dab28c1e969f23bd55776b597fb995 | https://github.com/DenDen047/data2text-macro-plan-py/tree/bb01ec6e23dab28c1e969f23bd55776b597fb995 |
LOGMSELoss | # 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
... | julschoen/Latent-Space-Exploration-CT | LOGMSELoss | false | 6,990 | [
"MIT"
] | 1 | 39440c83362181efc48cad69777e5671a7bf3de9 | https://github.com/julschoen/Latent-Space-Exploration-CT/tree/39440c83362181efc48cad69777e5671a7bf3de9 |
DiceLoss | import torch
from torch import nn
class DiceLoss(nn.Module):
"""DiceLoss implemented from 'Dice Loss for Data-imbalanced NLP Tasks'
Useful in dealing with unbalanced data
Add softmax automatically
"""
def __init__(self):
super(DiceLoss, self).__init__()
self.m = nn.Sigmoid()
... | 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... | ZhaoZhibin/Physionet2020model | DiceLoss | false | 18,195 | [
"BSD-2-Clause",
"MIT"
] | 6 | ea7379bd1e4c145c84fd254faa0d5d1330cd2f6e | https://github.com/ZhaoZhibin/Physionet2020model/tree/ea7379bd1e4c145c84fd254faa0d5d1330cd2f6e |
TargetQueryDecoderLayer | # 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.... | zhangzhengde0225/SwinTrack | TargetQueryDecoderLayer | false | 16,843 | [
"MIT"
] | 143 | 526be17f8ef266cb924c6939bd8dda23e9b73249 | https://github.com/zhangzhengde0225/SwinTrack/tree/526be17f8ef266cb924c6939bd8dda23e9b73249 |
Network | import torch
import torch.nn as nn
class Network(nn.Module):
def __init__(self, input_shape, output_shape, n_features, **kwargs):
super(Network, self).__init__()
n_input = input_shape[-1]
n_output = output_shape[0]
self._h1 = nn.Linear(n_input, n_features)
self._h2 = nn.Li... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | AmmarFahmy/mushroom-rl | Network | false | 4,852 | [
"MIT"
] | 1 | 2625ee7f64d5613b3b9fba00f0b7a39fece88ca5 | https://github.com/AmmarFahmy/mushroom-rl/tree/2625ee7f64d5613b3b9fba00f0b7a39fece88ca5 |
RgbaToRgb | # 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... | IEM-Computer-Vision/kornia | RgbaToRgb | false | 9,268 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | f98bd9a2158a6e59cda076d55d476acf13f4e0af | https://github.com/IEM-Computer-Vision/kornia/tree/f98bd9a2158a6e59cda076d55d476acf13f4e0af |
BilinearUpsample | import torch
from typing import List
from typing import Union
import torch.nn.functional as F
import torch.nn as nn
import torch.utils.data
class BilinearUpsample(nn.Module):
"""
Overview:
Upsamples the input to the given member varible scale_factor using mode biliner
Interface:
forward
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from typing import List
from typing import Union
import torch.nn as nn
import torch.utils... | L-Net-1992/DI-engine | BilinearUpsample | false | 5,485 | [
"Apache-2.0"
] | 1 | 06803b4e18fa64bbed0fd1d44952242c0c063b0f | https://github.com/L-Net-1992/DI-engine/tree/06803b4e18fa64bbed0fd1d44952242c0c063b0f |
MDiceLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class DiceLoss(nn.Module):
def __init__(self, dims=(1, 2, 3)) ->None:
super(DiceLoss, self).__init__()
self.eps: 'float' = 1e-06
self.dims = dims
def forward(self, input: 'torch.Tensor', target: 'torch.Tensor',
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | CarlosPena00/pytorch-unet | MDiceLoss | false | 236 | [
"MIT"
] | 0 | 8365bace23e4b04b9c5b75cd6720807ea8cac5ab | https://github.com/CarlosPena00/pytorch-unet/tree/8365bace23e4b04b9c5b75cd6720807ea8cac5ab |
LNN | import math
import torch
import torch.utils.data
import torch.nn.functional as F
class LNN(torch.nn.Module):
"""
A pytorch implementation of LNN layer
Input shape
- A 3D tensor with shape: ``(batch_size,field_size,embedding_size)``.
Output shape
- 2D tensor with shape:``(batch_size,LNN... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | lipmedusea/pytorch | LNN | false | 12,716 | [
"MIT"
] | 0 | 5d94694b9e1193a93dd7f75ea2042b5a1cf178bc | https://github.com/lipmedusea/pytorch/tree/5d94694b9e1193a93dd7f75ea2042b5a1cf178bc |
CpuSpeedModel | # 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... | VVKot/mlinsecond-general-cpu | CpuSpeedModel | false | 5,931 | [
"MIT"
] | 1 | d3e08027dc3152b5c88c2e5bf4b365eedbdcb0d1 | https://github.com/VVKot/mlinsecond-general-cpu/tree/d3e08027dc3152b5c88c2e5bf4b365eedbdcb0d1 |
ConcatenateLinear | import torch
import torch.utils.tensorboard
import torch.utils.data
import torch.distributed
class ConcatenateLinear(torch.nn.Module):
"""A torch module which concatenates several inputs and mixes them using a linear layer. """
def __init__(self, left_size, right_size, output_size):
"""Creates a new ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.tensorboard
import torch.utils.data
import torch.distributed
... | JoeLambourne/SketchGraphs | ConcatenateLinear | false | 1,259 | [
"MIT"
] | 0 | 183c65f82d71d82c62b253092e9b7fa65846a3e6 | https://github.com/JoeLambourne/SketchGraphs/tree/183c65f82d71d82c62b253092e9b7fa65846a3e6 |
TinyCnn | import torch
import torch.nn as nn
class TinyCnn(nn.Module):
def __init__(self, feature_extraction=False) ->None:
super().__init__()
self.feature_extraction = feature_extraction
self.conv1 = nn.Conv2d(3, 3, 5)
self.relu1 = nn.ReLU()
self.pool1 = nn.MaxPool2d(2, 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
import torch.nn as nn
assert_... | LMdeLiangMi/captum | TinyCnn | false | 5,484 | [
"BSD-3-Clause"
] | 1 | 8bd9686013fe0ba8996e9b1cbeb0ea8e91512787 | https://github.com/LMdeLiangMi/captum/tree/8bd9686013fe0ba8996e9b1cbeb0ea8e91512787 |
MultiChannelCombinedScorer | import torch
import torch.nn as nn
import torch.utils.data
import torch.nn.functional as F
class FociDetector(nn.Module):
def __init__(self, input_channels=3, input_size=17, ksize=5,
hidden_channels=10):
super(FociDetector, self).__init__()
self.conv1 = nn.Conv2d(input_channels, hidden_ch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | bharath272/centrosome-analysis | MultiChannelCombinedScorer | false | 6,362 | [
"MIT"
] | 1 | 6ae3744be464812b3767909420d7b78cea9da670 | https://github.com/bharath272/centrosome-analysis/tree/6ae3744be464812b3767909420d7b78cea9da670 |
BCEDiceLoss | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.backends.cudnn
import torch.utils.data
def dice_loss(preds, trues, weight=None, is_average=True):
num = preds.size(0)
preds = preds.view(num, -1)
trues = trues.view(num, -1)
if weight is not None:
w = torch.autogra... | 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... | jayden-chua/image-mask | BCEDiceLoss | false | 3,700 | [
"MIT"
] | 0 | ce2c6a32bf13df582e7b57e506d58518258be292 | https://github.com/jayden-chua/image-mask/tree/ce2c6a32bf13df582e7b57e506d58518258be292 |
NLL | import torch
import torch.nn as nn
import torch.utils.data
import torch.nn.parallel
class NLL(nn.Module):
def __init__(self):
super(NLL, self).__init__()
def forward(self, x):
return torch.mean(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
import torch.nn.parallel
assert_size_stride... | Manojbhat09/Sane-annotation-shape-complete | NLL | false | 17,695 | [
"Apache-2.0"
] | 9 | 03b298b2c0a187be979ff31ad2a39238b72a6d78 | https://github.com/Manojbhat09/Sane-annotation-shape-complete/tree/03b298b2c0a187be979ff31ad2a39238b72a6d78 |
DropConnect | import torch
class DropConnect(torch.nn.Module):
def __init__(self, p):
super(DropConnect, self).__init__()
self.p = p
def forward(self, inputs):
batch_size = inputs.shape[0]
inputs.shape[2]
inputs.shape[3]
channel_size = inputs.shape[1]
keep_prob = 1 ... | 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 libdevice
assert_size_stride = torch._C._dynamo.guards.assert_si... | jack-willturner/nas-without-training | DropConnect | false | 12,544 | [
"MIT"
] | 0 | d5e915b5f391f51d902f33b1d4beedfe3b09d2e0 | https://github.com/jack-willturner/nas-without-training/tree/d5e915b5f391f51d902f33b1d4beedfe3b09d2e0 |
SRCNN | import torch
from torch import nn
class SRCNN(nn.Module):
def __init__(self, num_channels=1):
super(SRCNN, self).__init__()
self.conv1 = nn.Conv2d(num_channels, 64, kernel_size=9, padding=9 // 2)
self.conv2 = nn.Conv2d(64, 32, kernel_size=5, padding=5 // 2)
self.conv3 = nn.Conv2d(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | DanielLiang1/a-PyTorch-Tutorial-to-Super-Resolution | SRCNN | false | 350 | [
"MIT"
] | 0 | cf7b519029687fe9726bb194fe3765934afa18b3 | https://github.com/DanielLiang1/a-PyTorch-Tutorial-to-Super-Resolution/tree/cf7b519029687fe9726bb194fe3765934afa18b3 |
SysModel | import torch
import torch.nn as nn
import torch.nn.functional as F
class SysModel(nn.Module):
def __init__(self, state_size, action_size, fc1_units=400, fc2_units=300):
super(SysModel, self).__init__()
self.l1 = nn.Linear(state_size + action_size, fc1_units)
self.l2 = nn.Linear(fc1_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
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | LuckierDodge/ROS_Dockerfiles | SysModel | false | 2,604 | [
"MIT"
] | 0 | 42fd0e7ecfef86d792fcc29197fcd79dcb789122 | https://github.com/LuckierDodge/ROS_Dockerfiles/tree/42fd0e7ecfef86d792fcc29197fcd79dcb789122 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.