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 |
|---|---|---|---|---|---|---|---|---|---|---|
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, out_dim=None, n_head=1,
score_function='dot_product', dropout=0):
""" Attention Mechanism
:param embed_dim:
:param hidden_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
from torch._inductor.runtime.... | rmarcacini/LC-ABSA | Attention | false | 7,567 | [
"MIT"
] | 1 | 90ae7f41b3766761005caf015292926127fe3949 | https://github.com/rmarcacini/LC-ABSA/tree/90ae7f41b3766761005caf015292926127fe3949 |
UNetModule | import torch
from torch import nn
import torch.backends.cudnn
def conv3x3(num_in, num_out):
"""Creates a 3x3 convolution building block module.
Args:
num_in: number of input feature maps
num_out: number of output feature maps
Returns:
The 3x3 convolution module.
"""
return nn.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
import t... | cxz/tgs-salt-identification-challenge | UNetModule | false | 6,518 | [
"MIT"
] | 1 | 859f3d7f2d3184532c42c34444500eec3b03b1c8 | https://github.com/cxz/tgs-salt-identification-challenge/tree/859f3d7f2d3184532c42c34444500eec3b03b1c8 |
FFGKL | import torch
import torch.nn as nn
import torch.utils.data
import torch.utils
from matplotlib import cm as cm
from torch.nn.parallel import *
from torchvision.models import *
from torchvision.datasets import *
class FFGKL(nn.Module):
"""KL divergence between standart normal prior and fully-factorize gaussian post... | 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
... | CrispyHarder/ppuda | FFGKL | false | 799 | [
"MIT"
] | 0 | 15950ba297188163eaadd8ab69268ee7f6ffcf2a | https://github.com/CrispyHarder/ppuda/tree/15950ba297188163eaadd8ab69268ee7f6ffcf2a |
MLP | import torch
import torch.nn.functional as F
import torch.nn as nn
class MLP(nn.Module):
def __init__(self, n_in, n_units, n_out):
super(MLP, self).__init__()
self.l1 = nn.Linear(n_in, n_units)
self.l2 = nn.Linear(n_units, n_units)
self.l3 = nn.Linear(n_units, n_out)
def forw... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | Hiroshiba/pytorch-trainer | MLP | false | 13,775 | [
"MIT"
] | 45 | b4b3d648868e4cec33c69e18fc3877c103a8d438 | https://github.com/Hiroshiba/pytorch-trainer/tree/b4b3d648868e4cec33c69e18fc3877c103a8d438 |
Contracting_Block | # 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_... | parth2035/U-Net-Implementation | Contracting_Block | false | 7,461 | [
"MIT"
] | 1 | 36ed8d140ef8a0031f63f2d1f577dcef92c4dab6 | https://github.com/parth2035/U-Net-Implementation/tree/36ed8d140ef8a0031f63f2d1f577dcef92c4dab6 |
SelfAttention | # 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.... | tech-srl/bottleneck | SelfAttention | false | 16,563 | [
"MIT"
] | 56 | b8c629ad25e02f53ba3389dd33a90bbeb83ea447 | https://github.com/tech-srl/bottleneck/tree/b8c629ad25e02f53ba3389dd33a90bbeb83ea447 |
MaskedLoss | import torch
class MaskedLoss(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, y, Y, mask):
diff = (y - Y) / 5.0
return torch.mean(torch.square(diff[mask]))
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.ones(
... | 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... | acycliq/cellpose | MaskedLoss | false | 12,037 | [
"BSD-3-Clause"
] | 0 | 6d7a3f692206bf791e3ea7bd9524ee6df628ed8a | https://github.com/acycliq/cellpose/tree/6d7a3f692206bf791e3ea7bd9524ee6df628ed8a |
MMTMTri | # 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_... | ditannan/Multi-modal-Multi-instance-Learning | MMTMTri | false | 6,577 | [
"Apache-2.0"
] | 1 | 06aada1ff85784d5ed50aa528c506947c892d584 | https://github.com/ditannan/Multi-modal-Multi-instance-Learning/tree/06aada1ff85784d5ed50aa528c506947c892d584 |
ImgPatches | import torch
import torch.nn as nn
class ImgPatches(nn.Module):
def __init__(self, input_channel=3, dim=768, patch_size=4):
super().__init__()
self.patch_embed = nn.Conv2d(input_channel, dim, kernel_size=
patch_size, stride=patch_size)
def forward(self, img):
patches = 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | ch0n9waiu/TransCycleGAN | ImgPatches | false | 6,417 | [
"MIT"
] | 1 | a3e846e21101400282a9f1393c1f8d150a3d92c9 | https://github.com/ch0n9waiu/TransCycleGAN/tree/a3e846e21101400282a9f1393c1f8d150a3d92c9 |
SEModule | from torch.nn import Module
import torch
from torch.nn import Conv2d
from torch.nn import ReLU
from torch.nn import Sigmoid
from torch.nn import AdaptiveAvgPool2d
import torch.utils.model_zoo
class SEModule(Module):
def __init__(self, channels, reduction):
super(SEModule, self).__init__()
self.av... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
f... | Aitical/ADspeech2face | SEModule | false | 4,812 | [
"MIT"
] | 1 | 2e811ff8cc7333729f4b77d1b1067296253e8e38 | https://github.com/Aitical/ADspeech2face/tree/2e811ff8cc7333729f4b77d1b1067296253e8e38 |
ContinuousLoss_L2 | import torch
import torch.nn as nn
class ContinuousLoss_L2(nn.Module):
""" Class to measure loss between continuous emotion dimension predictions and labels. Using l2 loss as base. """
def __init__(self, margin=1):
super(ContinuousLoss_L2, self).__init__()
self.margin = margin
def forwar... | 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
... | shrookehab/Body-Language-and-Emotion-Recognition | ContinuousLoss_L2 | false | 4,317 | [
"MIT"
] | 0 | a13068be1f8599fa2df6db925a98ac64fd2adf42 | https://github.com/shrookehab/Body-Language-and-Emotion-Recognition/tree/a13068be1f8599fa2df6db925a98ac64fd2adf42 |
GLU | import torch
import torch.nn as nn
import torch.utils.data
class GLU(nn.Module):
"""
Overview:
Gating Linear Unit.
This class does a thing like this:
.. code:: python
# Inputs: input, context, output_size
# The gate value is a learnt function of the input.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Weiyuhong-1998/DI-engine | GLU | false | 14,575 | [
"Apache-2.0"
] | 464 | 88658ea358298c6e61e95a454284b8853a3e9484 | https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484 |
LSTM | import torch
import torch.utils.data
import torch.nn
import torch.optim
import torch.nn as nn
from torch.autograd import Variable
class LSTM(nn.Module):
def __init__(self, input_size, hidden_size, output_size=1, cell_size=2):
super(LSTM, self).__init__()
self.hidden_size = hidden_size
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.utils.... | lwaekfjlk/Light-the-Torch | LSTM | false | 7,140 | [
"MIT"
] | 1 | eed1df3d28016aee86385959b5e94e2108ee0571 | https://github.com/lwaekfjlk/Light-the-Torch/tree/eed1df3d28016aee86385959b5e94e2108ee0571 |
AdaIN | import torch
from torch import nn
import torch.utils.data
class WSLinear(nn.Module):
def __init__(self, in_features, out_features, gain=2):
super(WSLinear, self).__init__()
self.linear = nn.Linear(in_features, out_features)
self.scale = (gain / in_features) ** 0.5
self.bias = 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.triton_helpers import libdevice
from torch import n... | jiazhi412/Machine-Learning-Collection | AdaIN | false | 3,742 | [
"MIT"
] | 0 | 1c30faf1e27a79eeca966c017e956df8f7f6ef17 | https://github.com/jiazhi412/Machine-Learning-Collection/tree/1c30faf1e27a79eeca966c017e956df8f7f6ef17 |
ResidualBlockNoBN | # 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
from to... | ljzycmd/SimDeblur | ResidualBlockNoBN | false | 15,979 | [
"MIT"
] | 190 | dd2f60c41176b75c4eaf80d740f547c206aa8227 | https://github.com/ljzycmd/SimDeblur/tree/dd2f60c41176b75c4eaf80d740f547c206aa8227 |
Residual_module | # 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... | csm9493/FC-AIDE-Pytorch | Residual_module | false | 9,940 | [
"MIT"
] | 0 | 8ac7e4ee675824af002419650428948e60930712 | https://github.com/csm9493/FC-AIDE-Pytorch/tree/8ac7e4ee675824af002419650428948e60930712 |
NegativeBinomial | import torch
from torch import nn
class NegativeBinomial(nn.Module):
def __init__(self, input_size, output_size):
"""
Negative Binomial Supports Positive Count Data
Args:
input_size (int): hidden h_{i,t} column size
output_size (int): embedding size
"""
sup... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch im... | ashfarhangi/COVID-19_Impact | NegativeBinomial | false | 9,744 | [
"Apache-2.0"
] | 0 | 7ce46616278cac95e31b3e853bb28ea7b8e58b7e | https://github.com/ashfarhangi/COVID-19_Impact/tree/7ce46616278cac95e31b3e853bb28ea7b8e58b7e |
WeightedMCEDiceLoss | # 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.functi... | HelenGuohx/cv-ferattn-code | WeightedMCEDiceLoss | false | 5,294 | [
"MIT"
] | 1 | faa9b7850fe2a0f8c08193bb129b5fec4639d616 | https://github.com/HelenGuohx/cv-ferattn-code/tree/faa9b7850fe2a0f8c08193bb129b5fec4639d616 |
TSAFusion | import torch
from torch import nn as nn
from torch.nn import init as init
from torchvision.models import vgg as vgg
import torch.utils.data
from torch.utils import data as data
from torch import autograd as autograd
class TSAFusion(nn.Module):
"""Temporal Spatial Attention (TSA) fusion module.
Temporal: Calc... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 as nn
fr... | Lotayou/BasicSR | TSAFusion | false | 2,624 | [
"Apache-2.0",
"MIT"
] | 0 | 6cf9a706dd680d54f7dc26e87318ff79f76c0dbf | https://github.com/Lotayou/BasicSR/tree/6cf9a706dd680d54f7dc26e87318ff79f76c0dbf |
TSAFusion | import torch
import torch.nn as nn
class TSAFusion(nn.Module):
"""Temporal Spatial Attention (TSA) fusion module.
Temporal: Calculate the correlation between center frame and
neighboring frames;
Spatial: It has 3 pyramid levels, the attention is similar to SFT.
(SFT: Recovering realistic ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | grofit/traiNNer | TSAFusion | false | 15,513 | [
"Apache-2.0"
] | 78 | 12d006fd44ed304e4178839c53b1f3d95ca25dcb | https://github.com/grofit/traiNNer/tree/12d006fd44ed304e4178839c53b1f3d95ca25dcb |
TransitionUp | import torch
import torch.nn as nn
def center_crop(layer, max_height, max_width):
_, _, h, w = layer.size()
xy1 = (w - max_width) // 2
xy2 = (h - max_height) // 2
return layer[:, :, xy2:xy2 + max_height, xy1:xy1 + max_width]
class TransitionUp(nn.Module):
def __init__(self, in_channels, out_cha... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Sreehari-S/Tiramisu_DigestPath | TransitionUp | false | 1,083 | [
"Apache-2.0"
] | 0 | a884ee911bc60ce997996e0ec2e6036600ffcffa | https://github.com/Sreehari-S/Tiramisu_DigestPath/tree/a884ee911bc60ce997996e0ec2e6036600ffcffa |
GlobalAvgPool2d | import torch
import torch.utils.data
from torch import nn
class GlobalAvgPool2d(nn.Module):
def __init__(self):
"""Global average pooling over the input's spatial dimensions"""
super(GlobalAvgPool2d, self).__init__()
def forward(self, inputs):
in_size = inputs.size()
return 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.utils.data
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._... | GOPIKA-0204/Clothing-Detection-and-Recolouring | GlobalAvgPool2d | false | 9,052 | [
"MIT"
] | 0 | b5d436a981b854228314729b41874f31948a33ba | https://github.com/GOPIKA-0204/Clothing-Detection-and-Recolouring/tree/b5d436a981b854228314729b41874f31948a33ba |
Conv2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | tarepan/vqvaevc | Conv2 | false | 13,025 | [
"MIT"
] | 0 | dabbb9bae5ccb9d5dcb110caf3f0a59f68006a97 | https://github.com/tarepan/vqvaevc/tree/dabbb9bae5ccb9d5dcb110caf3f0a59f68006a97 |
XOR | # 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.utils.... | IST-DASLab/horovod | XOR | false | 11,506 | [
"Apache-2.0"
] | 0 | d2611353c33b299f04e47fae0de741702de3130e | https://github.com/IST-DASLab/horovod/tree/d2611353c33b299f04e47fae0de741702de3130e |
Duel_QNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
class Duel_QNetwork(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed):
"""Initialize parameters and build model.
Params
======
state_size (int): Dimension of each sta... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | jsztompka/DuelDQN | Duel_QNetwork | false | 3,783 | [
"MIT"
] | 0 | 3b1234425b66034ef233ac988305dc13ffbf7ace | https://github.com/jsztompka/DuelDQN/tree/3b1234425b66034ef233ac988305dc13ffbf7ace |
MultiHeadAttention | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class MultiHeadAttention(nn.Module):
def __init__(self, d_model, n_heads, p_drop=0.1):
super(MultiHeadAttention, self).__init__()
assert d_model % n_heads == 0
self.d_model = d_model
self.n_heads... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | RegiusQuant/nlp-practice | MultiHeadAttention | false | 995 | [
"MIT"
] | 0 | ffa99aa585134941aa148da11775c2b16d42eef7 | https://github.com/RegiusQuant/nlp-practice/tree/ffa99aa585134941aa148da11775c2b16d42eef7 |
BasicModel6_MultiTensor | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicModel6_MultiTensor(nn.Module):
def __init__(self) ->None:
super().__init__()
def forward(self, input1, input2):
input = input1 + input2
return 1 - F.relu(1 - input)[:, 1]
def get_inputs():
return [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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | aravipati12/captum | BasicModel6_MultiTensor | false | 10,097 | [
"BSD-3-Clause"
] | 0 | ef3e81d89c8c4404a49c384cf0727f2e7d393f5f | https://github.com/aravipati12/captum/tree/ef3e81d89c8c4404a49c384cf0727f2e7d393f5f |
DisaggregatedPinballLoss | # 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... | venkatkorapaty/esrnn | DisaggregatedPinballLoss | false | 11,008 | [
"MIT"
] | 0 | 411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c | https://github.com/venkatkorapaty/esrnn/tree/411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c |
FactorizationMachine | # 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.nn import Module
from torch import FloatTensor
from torch.nn import P... | DanielMorales9/FactorizationPyTorch | FactorizationMachine | false | 17,198 | [
"MIT"
] | 4 | 50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1 | https://github.com/DanielMorales9/FactorizationPyTorch/tree/50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1 |
StandardNLL | import torch
class StandardNLL(torch.nn.modules.loss._Loss):
"""
Shape:
log_prob: batch x time x class
y_true: batch x time
mask: batch x time
output: batch
"""
def forward(self, log_prob, y_true, mask):
mask = mask.float()
log_P = torch... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | NoteXYX/ACL2017 | StandardNLL | false | 14,131 | [
"Apache-2.0"
] | 119 | 436f59f2aa0044a9d57c95a2a58b2158cb99738d | https://github.com/NoteXYX/ACL2017/tree/436f59f2aa0044a9d57c95a2a58b2158cb99738d |
BinaryCrossEntropyLoss2d | # 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... | Luoxd1996/Rank2nuclearSegmentation | BinaryCrossEntropyLoss2d | false | 17,621 | [
"MIT"
] | 5 | bd85ac13eec7ce18c286efd521a27486483da904 | https://github.com/Luoxd1996/Rank2nuclearSegmentation/tree/bd85ac13eec7ce18c286efd521a27486483da904 |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | michiyasunaga/DrRepair | Attention | false | 16,066 | [
"MIT"
] | 139 | fb447594149ac4f80fef8ba091373184120019c7 | https://github.com/michiyasunaga/DrRepair/tree/fb447594149ac4f80fef8ba091373184120019c7 |
DeiTEmbeddings | # 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 collections
from torch import nn
import torch.utils.checkpoint
import col... | Clemens123/transformers | DeiTEmbeddings | false | 11,793 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
Downsample | import torch
import torch.nn as nn
import torch.nn.parallel
class Downsample(nn.Module):
"""
Image to Patch Embedding, downsampling between stage1 and stage2
"""
def __init__(self, in_embed_dim, out_embed_dim, patch_size):
super().__init__()
self.proj = nn.Conv2d(in_embed_dim, out_emb... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
assert_size_stride = torch._C._dy... | Inch-Z/volo | Downsample | false | 11,510 | [
"Apache-2.0"
] | 0 | 8bbb40838f5cc889ccae26b97438ea73cb1b4e07 | https://github.com/Inch-Z/volo/tree/8bbb40838f5cc889ccae26b97438ea73cb1b4e07 |
Skew | # 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.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import to... | Nayef211/tutorials | Skew | false | 9,527 | [
"BSD-3-Clause"
] | 0 | faf2c476fc3be855051fbea3cce77eaf7b2a2175 | https://github.com/Nayef211/tutorials/tree/faf2c476fc3be855051fbea3cce77eaf7b2a2175 |
SH2Signal | import torch
import numpy as np
import torch.nn as nn
from scipy import special as sci
def cart2sph(x, y, z):
"""
cart2sph(x, y, z) -> theta, phi, r
Computes the corresponding spherical coordinate of the given input parameters :attr:`x`, :attr:`y` and :attr:`x`.
Args:
x (Number): x position
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
from scipy import special as sci
assert... | SimonKoppers/DELIMIT | SH2Signal | false | 17,942 | [
"MIT"
] | 7 | d778a567bbec1beef2395ead60aa1e30086bb07c | https://github.com/SimonKoppers/DELIMIT/tree/d778a567bbec1beef2395ead60aa1e30086bb07c |
NetVLAD | # 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.... | GeWu-Lab/OGM-GE_CVPR2022 | NetVLAD | false | 17,615 | [
"MIT"
] | 4 | 08b3f2498dd3e89f57fe9a12b5bf0c162eba1fbf | https://github.com/GeWu-Lab/OGM-GE_CVPR2022/tree/08b3f2498dd3e89f57fe9a12b5bf0c162eba1fbf |
Centered_Grad | # 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... | AmazingAng/pytorch-tvnet | Centered_Grad | false | 7,653 | [
"MIT"
] | 12 | e880d3ce15f55e5d9a11b423cfd1e0461de4fedb | https://github.com/AmazingAng/pytorch-tvnet/tree/e880d3ce15f55e5d9a11b423cfd1e0461de4fedb |
IoULoss | import torch
import torch.distributed
import torch
import torch.nn as nn
import torch.nn.functional
import torch.utils.data
import torch.optim
import torch.optim.lr_scheduler
def fp16_clamp(x, min=None, max=None):
if not x.is_cuda and x.dtype == torch.float16:
return x.float().clamp(min, max).half()
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 math as tl_math
import torch.distribut... | zhangzhengde0225/SwinTrack | IoULoss | false | 16,797 | [
"MIT"
] | 143 | 526be17f8ef266cb924c6939bd8dda23e9b73249 | https://github.com/zhangzhengde0225/SwinTrack/tree/526be17f8ef266cb924c6939bd8dda23e9b73249 |
FLeakyReLU | # 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 random
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.gu... | dawnclaude/onnx2keras | FLeakyReLU | false | 15,139 | [
"MIT"
] | 115 | 3d2a47c0a228b91fd434232274e216e491da36e3 | https://github.com/dawnclaude/onnx2keras/tree/3d2a47c0a228b91fd434232274e216e491da36e3 |
Gain | import random
import torch
from torchaudio.transforms import Vol
class Gain(torch.nn.Module):
def __init__(self, min_gain: 'float'=-20.0, max_gain: 'float'=-1):
super().__init__()
self.min_gain = min_gain
self.max_gain = max_gain
def forward(self, audio: 'torch.Tensor') ->torch.Tenso... | 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... | wesbz/torchaudio-augmentations | Gain | false | 16,721 | [
"MIT"
] | 112 | e7b379be60376bb4a44f72a6840358871b3ff06d | https://github.com/wesbz/torchaudio-augmentations/tree/e7b379be60376bb4a44f72a6840358871b3ff06d |
ZeroLayer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.asser... | HarshCasper/nni | ZeroLayer | false | 5,279 | [
"MIT"
] | 1 | 291bbbba9f296382015a77b2c88eb5db5b44bf94 | https://github.com/HarshCasper/nni/tree/291bbbba9f296382015a77b2c88eb5db5b44bf94 |
CNNCifar | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
class CNNCifar(nn.Module):
def __init__(self, args):
super(CNNCifar, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Con... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | C3atUofU/Hierarchical-SGD | CNNCifar | false | 9,996 | [
"MIT"
] | 0 | ecc0f25065f78e70ed8deff7dfc9809331e19f21 | https://github.com/C3atUofU/Hierarchical-SGD/tree/ecc0f25065f78e70ed8deff7dfc9809331e19f21 |
Decoder | # 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.... | ShiZhuming/StyleTransfer | Decoder | false | 17,941 | [
"MIT"
] | 10 | cba2a3ceb733a2d129d52d4a3cac07c7651bd928 | https://github.com/ShiZhuming/StyleTransfer/tree/cba2a3ceb733a2d129d52d4a3cac07c7651bd928 |
SpatialDepthWiseSharedConvolution | # 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.nn import Module
from torch import nn
import torch.utils.data
import ... | mcx/annotated_deep_learning_paper_implementations | SpatialDepthWiseSharedConvolution | false | 7,213 | [
"MIT"
] | 1 | f169f3a71dd2d36eb28ad31062d3475efa367b88 | https://github.com/mcx/annotated_deep_learning_paper_implementations/tree/f169f3a71dd2d36eb28ad31062d3475efa367b88 |
ELBOLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | mirmohammad/IFT6135-TP3 | ELBOLoss | false | 4,009 | [
"MIT"
] | 0 | 70453b4ea695313837ab88243b0206552eb50632 | https://github.com/mirmohammad/IFT6135-TP3/tree/70453b4ea695313837ab88243b0206552eb50632 |
MultiHead | # 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.... | abhinavrangarajan/genienlp | MultiHead | false | 1,358 | [
"BSD-3-Clause"
] | 0 | ba121274b3365739ce9e5a8facc9a2904149b9c7 | https://github.com/abhinavrangarajan/genienlp/tree/ba121274b3365739ce9e5a8facc9a2904149b9c7 |
Attention | import torch
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
"""
Applies an attention mechanism on the query features from the decoder.
.. math::
\\begin{array}{ll}
x = context*query \\\\
attn_scores = exp(x_i) / sum_j exp(x_j) \\\\
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | nguyenxuanhoi2903/SRSF_summarization | Attention | false | 7,329 | [
"MIT"
] | 1 | 3d19e6b7669e0b22bab533fc637a434f379ed392 | https://github.com/nguyenxuanhoi2903/SRSF_summarization/tree/3d19e6b7669e0b22bab533fc637a434f379ed392 |
InfoNCELoss | import torch
from torch import Tensor
from torch.nn.modules.loss import _Loss
def cos_sim_matrix(a: 'Tensor', b: 'Tensor', eps: 'float'=1e-08) ->Tensor:
a_n, b_n = a.norm(dim=1), b.norm(dim=1)
a_norm = a / torch.clamp(a_n.unsqueeze(1), min=eps)
b_norm = b / torch.clamp(b_n.unsqueeze(1), min=eps)
sim_m... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | pfnet-research/deep-table | InfoNCELoss | false | 16,242 | [
"MIT"
] | 48 | a19c0c3048484017d5f24806604c3b3470bcf550 | https://github.com/pfnet-research/deep-table/tree/a19c0c3048484017d5f24806604c3b3470bcf550 |
UpSample | import torch
import torch.nn as nn
import torch.nn.functional as F
class UpSample(nn.Sequential):
def __init__(self, skip_input, output_features):
super(UpSample, self).__init__()
self.convA = nn.Conv2d(skip_input, output_features, kernel_size=3,
stride=1, padding=1)
self.leak... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | JanRocketMan/regression-prior-networks | UpSample | false | 8,343 | [
"MIT"
] | 24 | 3c8ffa758ee6eaa15b8afe31ac1c03f87bbf6a14 | https://github.com/JanRocketMan/regression-prior-networks/tree/3c8ffa758ee6eaa15b8afe31ac1c03f87bbf6a14 |
ActorCritic | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.distributions import Categorical
class ActorCritic(nn.Module):
def __init__(self):
super().__init__()
self.affine1 = nn.Linear(4, 128)
self.action_head = nn.Linear(128, 2)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | NeilWangziyu/torch_light | ActorCritic | false | 5,640 | [
"MIT"
] | 1 | daf8fd62f57885cf182f1b3edc3152156d229ef3 | https://github.com/NeilWangziyu/torch_light/tree/daf8fd62f57885cf182f1b3edc3152156d229ef3 |
ConvFunc | # 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_... | anway/augmented-neural-odes | ConvFunc | false | 14,889 | [
"MIT"
] | 449 | 561cfa540ef292d117ba9cf083758281774f3f22 | https://github.com/anway/augmented-neural-odes/tree/561cfa540ef292d117ba9cf083758281774f3f22 |
MPNetAttention | # 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.... | Clemens123/transformers | MPNetAttention | false | 12,331 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
Homography | # 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | EStorm21/kornia | Homography | false | 398 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | b2bba7950d748ba0b8ce0cc68035a248799a1044 | https://github.com/EStorm21/kornia/tree/b2bba7950d748ba0b8ce0cc68035a248799a1044 |
TVLoss | import torch
import torch.utils.data
import torch.nn as nn
class TVLoss(nn.Module):
def __init__(self):
super(TVLoss, self).__init__()
def forward(self, x):
x.size()[0]
h_x = x.size()[2]
w_x = x.size()[3]
self._tensor_size(x[:, :, 1:, :])
self._tensor_size(x[:... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | GuoShi28/GCP-Net | TVLoss | false | 8,160 | [
"Apache-2.0"
] | 24 | cef7513fa242343055af64e612429e4384d3c1d7 | https://github.com/GuoShi28/GCP-Net/tree/cef7513fa242343055af64e612429e4384d3c1d7 |
HingeLoss | import torch
import torch.nn as nn
import torch.utils.data
class HingeLoss(nn.Module):
def __init__(self):
super(HingeLoss, self).__init__()
self.margin = 1.0
def hinge_loss(self, input, target):
output = self.margin - input.mul(target)
output[output.le(0)] = 0
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
assert_size_stride = torch._C._dynamo.guard... | Enderdead/BinaryConnect_PyTorch | HingeLoss | false | 13,635 | [
"MIT"
] | 75 | 990e970b1fbd299ff88200db21a9cc3fe44706d3 | https://github.com/Enderdead/BinaryConnect_PyTorch/tree/990e970b1fbd299ff88200db21a9cc3fe44706d3 |
MultiHead | # 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.... | GrumpyZhou/pytorch_geometric | MultiHead | false | 5,263 | [
"MIT"
] | 1 | 88c54e72d3e26ad48e9ccd99e5696c7f19269d94 | https://github.com/GrumpyZhou/pytorch_geometric/tree/88c54e72d3e26ad48e9ccd99e5696c7f19269d94 |
BReLU | import torch
import torch.nn as nn
class BReLU(nn.Module):
"""
Biased ReLU
BReLU(x) = ReLU(x) + b
Shape:
-Input: (N, *)
-Output: (N, *), same shape as the input
Parameters:
-in_features: number of input features
-b: fixed parameter (bias like for relu... | 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... | RosarioAndolina/psychXRF | BReLU | false | 997 | [
"MIT"
] | 0 | e2adadbd17664d7f74c10304f84b3751c571226e | https://github.com/RosarioAndolina/psychXRF/tree/e2adadbd17664d7f74c10304f84b3751c571226e |
CCAMDec | # 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.... | coolgrasshopper/amodal_road_segmentation | CCAMDec | false | 6,494 | [
"MIT"
] | 1 | 462209242973815055f085ada99772af32082f5c | https://github.com/coolgrasshopper/amodal_road_segmentation/tree/462209242973815055f085ada99772af32082f5c |
TargetContextGate | # 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 ... | ESCM-summarization/ESCM-summary-evaluation | TargetContextGate | false | 9,119 | [
"MIT"
] | 0 | 3780b51f0ed44cbbea3f163a871d875f1e5e9393 | https://github.com/ESCM-summarization/ESCM-summary-evaluation/tree/3780b51f0ed44cbbea3f163a871d875f1e5e9393 |
EqualLinear | # 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.autograd import Function
import math
from torch import nn
assert_size... | BillyXYB/TransEditor | EqualLinear | false | 17,068 | [
"MIT"
] | 4 | 0194cd6f0e96c801d55c0cb9683e1f552bcf6d48 | https://github.com/BillyXYB/TransEditor/tree/0194cd6f0e96c801d55c0cb9683e1f552bcf6d48 |
Benefit3 | # 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | DingLyu/Investigating-and-Modeling-the-Dynamics-of-Long-Ties | Benefit3 | false | 11,348 | [
"MIT"
] | 0 | aa37c3d5c85a8d1696db3dda7dcb22782b737d17 | https://github.com/DingLyu/Investigating-and-Modeling-the-Dynamics-of-Long-Ties/tree/aa37c3d5c85a8d1696db3dda7dcb22782b737d17 |
RGBDiff | # 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 | RGBDiff | false | 6,034 | [
"Apache-2.0"
] | 1 | a0bb39424151a98e1ca80c4aa5c865636d401785 | https://github.com/aalborov/openvino_training_extensions/tree/a0bb39424151a98e1ca80c4aa5c865636d401785 |
PaddedMaxPool2d | # 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... | FenryrMKIII/objectDetection-lightnet | PaddedMaxPool2d | false | 2,241 | [
"MIT"
] | 0 | 3a1fa7b77227210060714a9e22d7d241888b36b4 | https://github.com/FenryrMKIII/objectDetection-lightnet/tree/3a1fa7b77227210060714a9e22d7d241888b36b4 |
EstimationLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | Gorilla-Lab-SCUT/AffordanceNet | EstimationLoss | false | 8,171 | [
"MIT"
] | 37 | 47c0c55a12f7e1429fd3e4a4bb781c4eec12803d | https://github.com/Gorilla-Lab-SCUT/AffordanceNet/tree/47c0c55a12f7e1429fd3e4a4bb781c4eec12803d |
Lookahead | import torch
import torch.nn as nn
import torch.nn.functional as F
class Lookahead(nn.Module):
def __init__(self, n_features, context):
super(Lookahead, self).__init__()
assert context > 0
self.context = context
self.n_features = n_features
self.pad = 0, self.context - 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Anwarvic/RasaChatbot-with-ASR-and-TTS | Lookahead | false | 16,903 | [
"MIT"
] | 7 | 57009f55d1ac8e4b347e81d9b8e33a08b4fd5618 | https://github.com/Anwarvic/RasaChatbot-with-ASR-and-TTS/tree/57009f55d1ac8e4b347e81d9b8e33a08b4fd5618 |
GradScale | import torch
import torch as t
import torch.utils.data
class GradScale(t.nn.Module):
def forward(self, x, scale):
y = x
y_grad = x * scale
return (y - y_grad).detach() + y_grad
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch as t
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dyn... | HumberMe/lsq-net | GradScale | false | 565 | [
"MIT"
] | 0 | 7dcd75bff4aa7ff2d9c8a7902198fe411a38eb4c | https://github.com/HumberMe/lsq-net/tree/7dcd75bff4aa7ff2d9c8a7902198fe411a38eb4c |
LevelVariabilityLoss | import torch
import torch.nn as nn
class LevelVariabilityLoss(nn.Module):
""" Level Variability Loss
Computes the variability penalty for the level.
Parameters
----------
levels: tensor with shape (batch, n_time)
levels obtained from exponential smoothing component of ESRNN
level_variability_penalt... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | venkatkorapaty/esrnn | LevelVariabilityLoss | false | 11,011 | [
"MIT"
] | 0 | 411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c | https://github.com/venkatkorapaty/esrnn/tree/411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c |
Q_Index | import torch
import torch.nn as nn
class Q_Index(nn.Module):
"""
Quality measurement between perturbated (image with applied noise) and denoised target image.
This module works only for images with a single color channel (grayscale)
"""
def __init__(self):
super().__init__()
def forw... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | dawnofthedebayan/MedAI_Project | Q_Index | false | 1,807 | [
"Apache-2.0"
] | 0 | a7f2597c96569662f1ca9d21ffd0eb41c77211c1 | https://github.com/dawnofthedebayan/MedAI_Project/tree/a7f2597c96569662f1ca9d21ffd0eb41c77211c1 |
SimpleBmmModule | # 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.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C... | opti-mix/glow | SimpleBmmModule | false | 7,387 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
CPUForgetMult | import torch
from typing import *
class CPUForgetMult(torch.nn.Module):
def __init__(self):
super(CPUForgetMult, self).__init__()
def forward(self, f, x, hidden_init=None):
result = []
forgets = f.split(1, dim=0)
prev_h = hidden_init
for i, h in enumerate((f * x).spli... | 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 typing import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | DineshChauhan/fastai_docs | CPUForgetMult | false | 11,342 | [
"Apache-2.0"
] | 0 | cf4d88073fb6f3ef7331b5360618b8dd95eb9345 | https://github.com/DineshChauhan/fastai_docs/tree/cf4d88073fb6f3ef7331b5360618b8dd95eb9345 |
HyperConv2d | # 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.utils.data
as... | musyoku/ffjord | HyperConv2d | false | 7,305 | [
"MIT"
] | 1 | 9e431e122e59fa9a71f3f301dec8fdd3db51e0ce | https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce |
MultiHeadSelfAttention | # 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.... | okcd00/glyce | MultiHeadSelfAttention | false | 10,682 | [
"Apache-2.0"
] | 0 | 010d88ac5cff4969308d2f8d105831ddcb352a02 | https://github.com/okcd00/glyce/tree/010d88ac5cff4969308d2f8d105831ddcb352a02 |
KeypointRCNNPredictor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | BoChenYS/ROPE | KeypointRCNNPredictor | false | 17,021 | [
"BSD-3-Clause"
] | 6 | 3e50f134259b555cf547e4a3ef8b14cf5cda4e00 | https://github.com/BoChenYS/ROPE/tree/3e50f134259b555cf547e4a3ef8b14cf5cda4e00 |
FFN | # 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_... | BruceRayWilson/sambanova_starter | FFN | false | 8,887 | [
"MIT"
] | 0 | be1b01369b040d00f174a0ee1fdb22e89ef40062 | https://github.com/BruceRayWilson/sambanova_starter/tree/be1b01369b040d00f174a0ee1fdb22e89ef40062 |
LinearEmbedding | # 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.nn as nn
assert_size_stride = torch._C._dyn... | Akhil-Raj/Trajectory-Transformer | LinearEmbedding | false | 1 | [
"MIT"
] | 0 | dd09fda99443f6afb59d962026573162219ea6a9 | https://github.com/Akhil-Raj/Trajectory-Transformer/tree/dd09fda99443f6afb59d962026573162219ea6a9 |
MSECompositionLoss | import functools
import torch
from torch.nn import functional as F
import torch.nn as nn
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Returns:
Tensor: Reduced lo... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import functools
from torch.nn import functional as F
import torch.nn as nn
assert_size_s... | Jason-Khan/mmediting | MSECompositionLoss | false | 631 | [
"Apache-2.0"
] | 0 | d187f95a675dff3eb975a575bd9278d643b5b645 | https://github.com/Jason-Khan/mmediting/tree/d187f95a675dff3eb975a575bd9278d643b5b645 |
MultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | simonepreite/QABERT | MultiHeadAttention | false | 4,349 | [
"MIT"
] | 0 | ed3e49f6619f3ff660068291231909693cb8f5d5 | https://github.com/simonepreite/QABERT/tree/ed3e49f6619f3ff660068291231909693cb8f5d5 |
SoftInvDiceLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class SoftInvDiceLoss(nn.Module):
def __init__(self, weight=None, size_average=True):
super(SoftInvDiceLoss, self).__init__()
def forward(self, logits, targets):
smooth = 1.0
logits = F.sigmoid(logits)
iflat =... | 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... | kryptonite0/Global_Convolutional_Network | SoftInvDiceLoss | false | 15,854 | [
"MIT"
] | 88 | 33de71bbe468f485eb38345f4982923945d1a0be | https://github.com/kryptonite0/Global_Convolutional_Network/tree/33de71bbe468f485eb38345f4982923945d1a0be |
CFRB | import torch
from torch import nn
from collections import OrderedDict
import torch.nn.functional as F
def sequential(*args):
"""Advanced nn.Sequential.
Args:
nn.Sequential, nn.Module
Returns:
nn.Sequential
"""
if len(args) == 1:
if isinstance(args[0], OrderedDict):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from col... | samuro95/Prox-PnP | CFRB | false | 10,993 | [
"MIT"
] | 0 | c05a48a586f0ef27c8ddc14e0a4c2c3d6814f8c9 | https://github.com/samuro95/Prox-PnP/tree/c05a48a586f0ef27c8ddc14e0a4c2c3d6814f8c9 |
RMulFloat | # 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | ahangchen/torch2trt | RMulFloat | false | 6,094 | [
"MIT"
] | 1 | 53c663f0e0570ef7ffd6771354ae3478f63bd328 | https://github.com/ahangchen/torch2trt/tree/53c663f0e0570ef7ffd6771354ae3478f63bd328 |
Interpolate | # 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... | yifanpu001/PytorchToCaffe | Interpolate | false | 4,714 | [
"MIT"
] | 0 | 37c1ebfc3547e93b1c174721036d03c831c60e48 | https://github.com/yifanpu001/PytorchToCaffe/tree/37c1ebfc3547e93b1c174721036d03c831c60e48 |
KnowledgeDistillationLoss | import torch
import torch.nn as nn
class KnowledgeDistillationLoss(nn.Module):
def __init__(self, reduction='mean', alpha=1.0):
super().__init__()
self.reduction = reduction
self.alpha = alpha
def forward(self, inputs, targets, mask=None):
inputs = inputs.narrow(1, 0, targets... | 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
... | fcdl94/ModelingTheBackground | KnowledgeDistillationLoss | false | 15,342 | [
"MIT"
] | 105 | 1c589833ce5c1a7446469d4602ceab2cdeac1b0e | https://github.com/fcdl94/ModelingTheBackground/tree/1c589833ce5c1a7446469d4602ceab2cdeac1b0e |
AttentionPool2d | # 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.... | lukaszbinden/Diffusion-based-Segmentation | AttentionPool2d | false | 12,747 | [
"Apache-2.0"
] | 0 | 43a475e53320adac82838f87ff7fd71f78d8d004 | https://github.com/lukaszbinden/Diffusion-based-Segmentation/tree/43a475e53320adac82838f87ff7fd71f78d8d004 |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
def set_init(layers):
for layer in layers:
nn.init.normal(layer.weight, mean=0.0, std=0.1)
nn.init.constant(layer.bias, 0.1)
class Net(nn.Module):
def __init__(self, s_dim, a_dim):
super(Net, self).__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | Dookas/Robust-Multitask-RL | Net | false | 13,613 | [
"MIT"
] | 106 | 7970e20cbdf91703c88edcb84568d7354e2525bc | https://github.com/Dookas/Robust-Multitask-RL/tree/7970e20cbdf91703c88edcb84568d7354e2525bc |
DQN_xy5 | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.utils.data
class DQN_xy5(nn.Module):
"""
A MLP for DQN learning.
Note: Uses a one hot board representation
Params
------
m, n: int
Board size
num_actions: int
Number of action-value... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | CoAxLab/azad | DQN_xy5 | false | 17,189 | [
"MIT"
] | 6 | d1498069dd8856e93ae077b34dd7c9f1c7ce80e6 | https://github.com/CoAxLab/azad/tree/d1498069dd8856e93ae077b34dd7c9f1c7ce80e6 |
Attention | import torch
import torch.nn as nn
from random import *
class Attention(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.hidden_size = hidden_size
self.w1 = nn.Linear(hidden_size, hidden_size)
self.w2 = nn.Linear(hidden_size, hidden_size)
self.v = 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 import triton_helpers
from torch._inductor.runtime.... | evinaybit/100-Days-of-NLP | Attention | false | 15,322 | [
"MIT"
] | 239 | 81e08884dd31b7b99bef27f43a179cda09ab5732 | https://github.com/evinaybit/100-Days-of-NLP/tree/81e08884dd31b7b99bef27f43a179cda09ab5732 |
Block | # 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.... | fiveflowers/ViLT | Block | false | 15,370 | [
"Apache-2.0"
] | 587 | 762fd3975c180db6fc88f577cf39549983fa373a | https://github.com/fiveflowers/ViLT/tree/762fd3975c180db6fc88f577cf39549983fa373a |
ImageTransformNet | # 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.... | TrueMatthewKirkham/face-preserving-style-transfer | ImageTransformNet | false | 6,032 | [
"MIT"
] | 1 | ae8a9509570227ea52776fba85658022124c886c | https://github.com/TrueMatthewKirkham/face-preserving-style-transfer/tree/ae8a9509570227ea52776fba85658022124c886c |
CRF | import torch
import torch.nn as nn
class CRF(nn.Module):
"""
Implements Conditional Random Fields that can be trained via
backpropagation.
"""
def __init__(self, num_tags):
super(CRF, self).__init__()
self.num_tags = num_tags
self.transitions = nn.Parameter(torch.Tensor(n... | 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... | ay94/CrossNER | CRF | false | 14,945 | [
"MIT"
] | 77 | 2e7ba2a7798c961e3f29fbc51252c5a8d40224bf | https://github.com/ay94/CrossNER/tree/2e7ba2a7798c961e3f29fbc51252c5a8d40224bf |
LinearScale | import torch
from torch import nn
class LinearScale(nn.Module):
def __init__(self, scale, bias):
super(LinearScale, self).__init__()
self.scale_v = scale
self.bias_v = bias
pass
def forward(self, x):
out = x * self.scale_v + self.bias_v
return out
def __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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | PeterouZh/CIPS-3D | LinearScale | false | 14,161 | [
"MIT"
] | 308 | 9b8bfa0fb23f642af042e150ccd70408f9d137c6 | https://github.com/PeterouZh/CIPS-3D/tree/9b8bfa0fb23f642af042e150ccd70408f9d137c6 |
DistillKL | import torch
from torch import nn
import torch.nn.functional as F
class DistillKL(nn.Module):
"""KL divergence for distillation"""
def __init__(self, T):
super(DistillKL, self).__init__()
self.T = T
def forward(self, y_s, y_t):
p_s = F.log_softmax(y_s / self.T, dim=1)
p_t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | Electronicshelf/Few-shot-regularization | DistillKL | false | 404 | [
"MIT"
] | 0 | 3fd0fef52684af77a5e574b5d61cfd8dd557b14b | https://github.com/Electronicshelf/Few-shot-regularization/tree/3fd0fef52684af77a5e574b5d61cfd8dd557b14b |
DeeperAutoencoder | import torch
import torch.nn as nn
import torch.nn.functional as F
class DeeperAutoencoder(nn.Module):
def __init__(self, input_length, output_length=None, neuron_multiplier=
1, sigmoid=False, drop=False, drop_pct=0.3):
"""
Dense deeper autoencoder.
Args:
inp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | mariajmolina/ML-for-S2S | DeeperAutoencoder | false | 10,568 | [
"MIT"
] | 0 | 3de32e72042ba7e8b37a433579fa9c5630246d8c | https://github.com/mariajmolina/ML-for-S2S/tree/3de32e72042ba7e8b37a433579fa9c5630246d8c |
ResBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.distributed
assert_size_stride = torch._C._dyn... | Improbable-AI/curiosity_baselines | ResBlock | false | 17,442 | [
"MIT"
] | 5 | 42dca92b2fb66c0790a72206bf48595d3b5b487f | https://github.com/Improbable-AI/curiosity_baselines/tree/42dca92b2fb66c0790a72206bf48595d3b5b487f |
FCLayer | # 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 ... | StevenChaoo/R-BERT-DDI | FCLayer | false | 1,091 | [
"MIT"
] | 0 | 6d9666e0bc61397ca942ffad53653690c1e8a899 | https://github.com/StevenChaoo/R-BERT-DDI/tree/6d9666e0bc61397ca942ffad53653690c1e8a899 |
HuberLoss | import torch
from torch import nn
class HuberLoss(nn.Module):
def __init__(self, delta=1):
super().__init__()
self.huber_loss_delta1 = nn.SmoothL1Loss()
self.delta = delta
def forward(self, x, x_hat):
loss = self.huber_loss_delta1(x / self.delta, x_hat / self.delta)
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 math as tl_math
from torch import nn
a... | UT-Austin-RPL/maple | HuberLoss | false | 18,072 | [
"MIT"
] | 9 | aef9fe9869945df5bbd1b02fd40813aac135cf5a | https://github.com/UT-Austin-RPL/maple/tree/aef9fe9869945df5bbd1b02fd40813aac135cf5a |
CondInjection | import torch
import torch.nn as nn
import torch.utils.cpp_extension
class CondInjection(nn.Module):
def __init__(self):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1))
def forward(self, image, labels, noise=None):
if noise is None:
batch, _, height, width = ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.cpp_extension
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = ... | crobbins327/semanticGAN_WSI | CondInjection | false | 1,752 | [
"BSD-2-Clause",
"MIT"
] | 0 | 4046ddc822f463e03952402247f79d540bf7be95 | https://github.com/crobbins327/semanticGAN_WSI/tree/4046ddc822f463e03952402247f79d540bf7be95 |
CharbonnierLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.data
impo... | GuoShi28/GCP-Net | CharbonnierLoss | false | 8,162 | [
"Apache-2.0"
] | 24 | cef7513fa242343055af64e612429e4384d3c1d7 | https://github.com/GuoShi28/GCP-Net/tree/cef7513fa242343055af64e612429e4384d3c1d7 |
CrossEntropyLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | AtticusJohnson/mmdetection | CrossEntropyLoss | false | 11,211 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 |
mlp_model | import torch
import torch.nn as nn
class mlp_model(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim):
super(mlp_model, self).__init__()
self.fc1 = nn.Linear(input_dim, hidden_dim)
self.relu1 = nn.ReLU()
self.fc2 = nn.Linear(hidden_dim, 128)
self.relu2 = nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | st186/complementary_label_learning | mlp_model | false | 4,380 | [
"MIT"
] | 0 | 5d22ea638e9e6c087cc5bba7797c1c201679ba12 | https://github.com/st186/complementary_label_learning/tree/5d22ea638e9e6c087cc5bba7797c1c201679ba12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.