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 |
|---|---|---|---|---|---|---|---|---|---|---|
Net | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | mmayers88/learn_pytorch | Net | false | 4,043 | [
"MIT"
] | 0 | 0dbc1aed24d869109feb23bfa6e970686cf485e3 | https://github.com/mmayers88/learn_pytorch/tree/0dbc1aed24d869109feb23bfa6e970686cf485e3 |
ResidualBlock | # 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.optim
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | ajiljalal/code-cs-fairness | ResidualBlock | false | 18,228 | [
"MIT"
] | 9 | 2025c1c8520444df800a1fc03d91d63d1415db54 | https://github.com/ajiljalal/code-cs-fairness/tree/2025c1c8520444df800a1fc03d91d63d1415db54 |
UpBlock | import torch
from torchvision.transforms import *
class ConvBlock(torch.nn.Module):
def __init__(self, input_size, output_size, kernel_size=3, stride=1,
padding=1, bias=True, activation='prelu', norm=None):
super(ConvBlock, self).__init__()
self.conv = torch.nn.Conv2d(input_size, output_s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torchvision.transforms import *
assert_size_stride = torch._C._dynamo.guard... | EvgeneyZ/RBPN | UpBlock | false | 9,561 | [
"MIT"
] | 0 | acfe636cc48a4fbfea78f934a251c32e53367659 | https://github.com/EvgeneyZ/RBPN/tree/acfe636cc48a4fbfea78f934a251c32e53367659 |
ActorCritic | # 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.... | savan77/nni | ActorCritic | false | 4,280 | [
"MIT"
] | 0 | 510213393d9cae58c5a8cccd21f322f7bba4e0cf | https://github.com/savan77/nni/tree/510213393d9cae58c5a8cccd21f322f7bba4e0cf |
GCN | from torch.nn import Module
import math
import torch
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
import torch.nn as nn
import torch.nn.functional as F
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __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.... | AlexHeffner/pygcn | GCN | false | 11,196 | [
"MIT"
] | 0 | 514f4329209a3bf9c75beba97af42d2c1bf8c129 | https://github.com/AlexHeffner/pygcn/tree/514f4329209a3bf9c75beba97af42d2c1bf8c129 |
ResidualBlock | # 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.... | haofeixu/gmflow | ResidualBlock | false | 15,489 | [
"Apache-2.0"
] | 58 | d304e5e516c11df378d63808d6679aea43bc564a | https://github.com/haofeixu/gmflow/tree/d304e5e516c11df378d63808d6679aea43bc564a |
mlp | import torch
import torch.nn as nn
class mlp(nn.Module):
def __init__(self, seq_len):
super(mlp, self).__init__()
self.lin1 = nn.Linear(seq_len, 2048)
self.lin2 = nn.Linear(2048, 2048)
self.lin3 = nn.Linear(2048, seq_len)
self.relu = nn.ReLU()
def forward(self, 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
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | liuziyang1106/sodeep | mlp | false | 10,460 | [
"BSD-3-Clause-Clear"
] | 0 | 47f8a5cbe5b8405624877efc81cb28f104f1e2d7 | https://github.com/liuziyang1106/sodeep/tree/47f8a5cbe5b8405624877efc81cb28f104f1e2d7 |
InterModalityUpdate | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class InterModalityUpdate(nn.Module):
"""
Inter-modality Attention Flow
"""
def __init__(self, v_size, q_size, output_size, num_head, drop=0.0):
super(InterModalityUpdate, self).__init__()
self.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | TranTony/DFAF-for-VQA.pytorch | InterModalityUpdate | false | 11,963 | [
"MIT"
] | 0 | eba1a893e8e5d3d8bf85078611b0bcf4d56eea86 | https://github.com/TranTony/DFAF-for-VQA.pytorch/tree/eba1a893e8e5d3d8bf85078611b0bcf4d56eea86 |
ActNorm | # 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 math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | ralphc1212/normalizing-flows | ActNorm | false | 12,925 | [
"MIT"
] | 0 | 40353bca33d80400201b0bf29d72ca68de2757dd | https://github.com/ralphc1212/normalizing-flows/tree/40353bca33d80400201b0bf29d72ca68de2757dd |
ZonoConv | # 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 typing import Tuple
from typing import Union
import torch.utils.data
assert... | david-shmailov/adversarial-robustness-toolbox | ZonoConv | false | 6,528 | [
"MIT"
] | 1 | ad8b94d3928abe218cd6ab2eed1c5c21f1d6e420 | https://github.com/david-shmailov/adversarial-robustness-toolbox/tree/ad8b94d3928abe218cd6ab2eed1c5c21f1d6e420 |
ContrastiveLoss | import torch
class ContrastiveLoss(torch.nn.Module):
"""
Contrastive loss function.
reference code: https://github.com/delijati/pytorch-siamese/blob/master/contrastive.py
"""
def __init__(self, margin=1.0):
super(ContrastiveLoss, self).__init__()
self.margin = margin
def chec... | 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... | Akimoto-Cris/Pytorch_AMOC | ContrastiveLoss | false | 18,404 | [
"Apache-2.0"
] | 2 | d2587ff3cfdd555c537c021dd616844da63210b9 | https://github.com/Akimoto-Cris/Pytorch_AMOC/tree/d2587ff3cfdd555c537c021dd616844da63210b9 |
BPRLoss | # 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
... | BELIEVEfxy/LightSANs | BPRLoss | false | 7,767 | [
"MIT"
] | 17 | 94ce7e59d144dbc787153b8c486cad334790ec6e | https://github.com/BELIEVEfxy/LightSANs/tree/94ce7e59d144dbc787153b8c486cad334790ec6e |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
self.conv2_drop = nn.Dropout2d()
self.fc1 = n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | lzhbrian/FashionAI-1 | Net | false | 7,166 | [
"MIT"
] | 1 | 1fede16044c8a4516ba4dd6766add44d47245f6b | https://github.com/lzhbrian/FashionAI-1/tree/1fede16044c8a4516ba4dd6766add44d47245f6b |
BboxHead | import torch
from itertools import product as product
import torch.nn as nn
class BboxHead(nn.Module):
def __init__(self, inchannels=512, num_anchors=3):
super(BboxHead, self).__init__()
self.conv1x1 = nn.Conv2d(inchannels, num_anchors * 4, kernel_size=(
1, 1), stride=1, padding=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
from itertools import product as product
import torch.nn as nn
assert_size_strid... | Danil328/Pytorch_Retinaface | BboxHead | false | 2,216 | [
"MIT"
] | 0 | 048a1d68217b2a99fbf83e2537ecc7e281ed6bd6 | https://github.com/Danil328/Pytorch_Retinaface/tree/048a1d68217b2a99fbf83e2537ecc7e281ed6bd6 |
Delta | import torch
import torch.nn as nn
from torchaudio import transforms
class Delta(nn.Module):
def __init__(self, order=2, **kwargs):
super(Delta, self).__init__()
self.order = order
self.compute_delta = transforms.ComputeDeltas(**kwargs)
def forward(self, x):
feats = [x]
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torchaudio import transforms
assert_size_stride = tor... | B06901052/s3prl | Delta | false | 154 | [
"MIT"
] | 0 | 5f63d2df043d2d7c81580cd042fa2cea34746f48 | https://github.com/B06901052/s3prl/tree/5f63d2df043d2d7c81580cd042fa2cea34746f48 |
BertOutput | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | Sy-Zhang/recurrent-transformer | BertOutput | false | 11,132 | [
"MIT"
] | 0 | f66ba49a2c9ec42759d3d00d497b49ffe39e18de | https://github.com/Sy-Zhang/recurrent-transformer/tree/f66ba49a2c9ec42759d3d00d497b49ffe39e18de |
QNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
def weights_init_(m):
if isinstance(m, nn.Linear):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.constant_(m.bias, 0)
class QNetwork(nn.Module):
def __init__(self, num_inputs, num_actions, 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
import torch.nn as nn
assert_... | SheepiesLab/plato | QNetwork | false | 12,090 | [
"Apache-2.0"
] | 0 | 9f5bbfa4b6952d1b3af24be409982d303d54a169 | https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169 |
MultiplicativeIntegration | import torch
import torch.nn as nn
from typing import List
class MultiplicativeIntegration(nn.Module):
def __init__(self, inputs_sizes: 'List[int]', output_sizes: 'List[int]',
bias: 'bool', bias_start: 'float'=0.0, alpha_start: 'float'=1.0,
beta_start: 'float'=1.0):
super().__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from typing import List
assert_size_stride = torch._C._dyn... | KnowingNothing/FlexTensor | MultiplicativeIntegration | false | 13,959 | [
"MIT"
] | 135 | 00f6cd7e038af7714b833fde7034d465fe2dc4a7 | https://github.com/KnowingNothing/FlexTensor/tree/00f6cd7e038af7714b833fde7034d465fe2dc4a7 |
VectorQuantizer | import torch
import torch.nn as nn
import torch.nn.functional as F
class VectorQuantizer(nn.Module):
def __init__(self, num_embeddings, embedding_dim, commitment_cost):
super(VectorQuantizer, self).__init__()
self._embedding_dim = embedding_dim
self._num_embeddings = num_embeddings
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | imatge-upc/pixelcoordEDL | VectorQuantizer | false | 6,904 | [
"MIT"
] | 1 | 353632feed6ac8c93758c1a2a1b7a477e7ff053c | https://github.com/imatge-upc/pixelcoordEDL/tree/353632feed6ac8c93758c1a2a1b7a477e7ff053c |
LSN | import torch
from torch import Tensor
import torch.nn as nn
import torch.utils.data
import torch.nn.parallel
import torch.nn.functional as F
class LSN(nn.Module):
""" Custom Linear layer that modifies standard ReLU layer"""
__constants__ = ['inplace']
inplace: 'bool'
def __init__(self, scale: 'int'=2... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
import torch.nn.parallel
assert_size_stride... | SindiLab/ACTIVA | LSN | false | 17,923 | [
"MIT"
] | 6 | 599f57478c5e13868d27879632c54964bf7b02ad | https://github.com/SindiLab/ACTIVA/tree/599f57478c5e13868d27879632c54964bf7b02ad |
PreNet | # 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... | Rexiome/NATSpeech | PreNet | false | 14,296 | [
"MIT"
] | 561 | 238165e8cd430531b69c484cabb032c1313ee73b | https://github.com/Rexiome/NATSpeech/tree/238165e8cd430531b69c484cabb032c1313ee73b |
kl_loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch.nn import Module
from torch.nn.modules.module import Module
as... | iMoonLab/HHDTI | kl_loss | false | 6,843 | [
"MIT"
] | 1 | b2dd0e78818888e676afc91af1425dada5b3258a | https://github.com/iMoonLab/HHDTI/tree/b2dd0e78818888e676afc91af1425dada5b3258a |
LSTMAttentionLayer | import torch
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
import torch.optim
import torch.utils.data
import torch.onnx.operators
def Linear(in_features, out_features, bias=True):
m = nn.Linear(in_features, out_features, bias)
nn.init.xavier_uniform_(m.weight)
if bias:
n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | PeterouZh/SemiNAS | LSTMAttentionLayer | false | 17,821 | [
"Apache-2.0"
] | 5 | 39731663271b994571160d43d796b2bb93386b3b | https://github.com/PeterouZh/SemiNAS/tree/39731663271b994571160d43d796b2bb93386b3b |
GateAddNorm | import torch
import torch.nn.functional as F
import torch.nn as nn
class TimeDistributedInterpolation(nn.Module):
def __init__(self, output_size: 'int', batch_first: 'bool'=False,
trainable: 'bool'=False):
super().__init__()
self.output_size = output_size
self.batch_first = batch_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.fun... | JustinNeumann/pytorch-forecasting | GateAddNorm | false | 696 | [
"MIT"
] | 0 | 4f6e449cb3788b856e66c4283398a5db201aa6ff | https://github.com/JustinNeumann/pytorch-forecasting/tree/4f6e449cb3788b856e66c4283398a5db201aa6ff |
GatedConv2d | import torch
import torch.nn as nn
class GatedConv2d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding):
super(GatedConv2d, self).__init__()
self.in_channels = in_channels
self.conv = nn.Conv2d(in_channels, out_channels * 3, kernel_size=
kernel_siz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | alisiahkoohi/survae_flows | GatedConv2d | false | 14,797 | [
"MIT"
] | 262 | e1747b05524c7ab540a211ed360ab3e67bc3e96d | https://github.com/alisiahkoohi/survae_flows/tree/e1747b05524c7ab540a211ed360ab3e67bc3e96d |
SAMblock | # 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
assert_size_stride = torch._C... | Knight825/models-pytorch | SAMblock | false | 8,414 | [
"Apache-2.0"
] | 16 | 133559eebb8795d78a32fa44d49408d0c5167ae9 | https://github.com/Knight825/models-pytorch/tree/133559eebb8795d78a32fa44d49408d0c5167ae9 |
ResidualAttention | import torch
from torch import nn
class ResidualAttention(nn.Module):
def __init__(self, channel=512, num_class=1000, la=0.2):
super().__init__()
self.la = la
self.fc = nn.Conv2d(in_channels=channel, out_channels=num_class,
kernel_size=1, stride=1, bias=False)
def forward... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | LiChengChen666/DetectDee | ResidualAttention | false | 9,836 | [
"Apache-2.0"
] | 0 | 1e6aaa0d15b1fc12d1342d8a922004e372b5f437 | https://github.com/LiChengChen666/DetectDee/tree/1e6aaa0d15b1fc12d1342d8a922004e372b5f437 |
Gate | import torch
import torch.nn as nn
import torch.nn.functional as F
class Gate(nn.Module):
def __init__(self, hidden_size):
super(Gate, self).__init__()
self.hidden_size = hidden_size
self.wrx = nn.Linear(hidden_size, hidden_size)
self.wrh = nn.Linear(hidden_size, hidden_size)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | elsehow/Writing-editing-Network | Gate | false | 15,305 | [
"MIT"
] | 79 | a8551cd224a4987a6eec3cf566bcf0793ad36dfd | https://github.com/elsehow/Writing-editing-Network/tree/a8551cd224a4987a6eec3cf566bcf0793ad36dfd |
Attention | import math
import torch
import torch.nn.functional as F
import torch.utils.data
def restricted_softmax(src, dim: 'int'=-1, margin: 'float'=0.0):
src_max = torch.clamp(src.max(dim=dim, keepdim=True)[0], min=0.0)
out = (src - src_max).exp()
out = out / (out.sum(dim=dim, keepdim=True) + (margin - src_max).e... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | THinnerichs/pytorch_geometric | Attention | false | 11,915 | [
"MIT"
] | 0 | 90c2126895b21313a23657f4e845acc782d11bf5 | https://github.com/THinnerichs/pytorch_geometric/tree/90c2126895b21313a23657f4e845acc782d11bf5 |
RgbaToRgb | import torch
import torch.nn as nn
def rgba_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert an image from RGBA to RGB.
Args:
image (torch.Tensor): RGBA Image to be converted to RGB of shape :math:`(*,4,H,W)`.
Returns:
torch.Tensor: RGB version of the image with shape :math:`(*,3... | 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... | NickleDave/kornia | RgbaToRgb | false | 2,685 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd |
FCMinibatchStd | # 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... | mkleshchenok/dlcourse_2021_p1_final_project | FCMinibatchStd | false | 12,791 | [
"MIT"
] | 0 | 1dd4f2e3dccc4604aa98982bf9377273ab4783c1 | https://github.com/mkleshchenok/dlcourse_2021_p1_final_project/tree/1dd4f2e3dccc4604aa98982bf9377273ab4783c1 |
AdaptiveMaxPool2d | # 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... | tomking/PySNN | AdaptiveMaxPool2d | false | 16,594 | [
"MIT"
] | 175 | c99ba6cd28a518dc07cab765acac9b69ac6fe36b | https://github.com/tomking/PySNN/tree/c99ba6cd28a518dc07cab765acac9b69ac6fe36b |
CrossEntropy | import torch
from torch import nn
import torch.nn.functional as F
def cross_entropy(y, target, mask=None):
if target.ndim == 1:
loss = F.cross_entropy(y, target, reduction='none')
else:
loss = -(target * F.log_softmax(y, 1)).sum(1)
if mask is not None:
loss = mask * loss
return... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
i... | uncharted-distil/d3m-primitives | CrossEntropy | false | 13,057 | [
"Apache-2.0"
] | 0 | e8d37dbe302c0f2bae4e7f7fa241a46faebc9b79 | https://github.com/uncharted-distil/d3m-primitives/tree/e8d37dbe302c0f2bae4e7f7fa241a46faebc9b79 |
ProtoNN | # 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 ... | Shenzhen-Cloudatawalk-Technology-Co-Ltd/EdgeML | ProtoNN | false | 14,415 | [
"MIT"
] | 719 | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | https://github.com/Shenzhen-Cloudatawalk-Technology-Co-Ltd/EdgeML/tree/ef9f8a77f096acbdeb941014791f8eda1c1bc35b |
TVLoss | import torch
import torch.nn as nn
class TVLoss(nn.Module):
def __init__(self, weight=1.0):
super(TVLoss, self).__init__()
self.weight = weight
self.l1 = nn.L1Loss(reduction='mean')
def forward(self, out, gt):
grad_out_x = out[:, :, :, 1:] - out[:, :, :, :-1]
grad_out... | 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... | juyongjiang/Simple-SR | TVLoss | false | 7,008 | [
"MIT"
] | 1 | 76820511abc04fbe6e4a79d23c67aee97406d563 | https://github.com/juyongjiang/Simple-SR/tree/76820511abc04fbe6e4a79d23c67aee97406d563 |
GramMatrix | import torch
import torch.nn as nn
import torch.onnx
class GramMatrix(nn.Module):
def forward(self, input):
a, b, c, d = input.size()
features = input.view(a, b, c * d)
G = torch.matmul(features, torch.transpose(features, 1, 2))
return G.div(a * b * c * d)
def get_inputs():
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.onnx
assert_size_stride = torch._C._dynamo.gu... | adi-horowitz/final-project | GramMatrix | false | 1,377 | [
"MIT"
] | 0 | 0fd864663e92a6bcaa5f068e3e45b2a76460d335 | https://github.com/adi-horowitz/final-project/tree/0fd864663e92a6bcaa5f068e3e45b2a76460d335 |
GLU | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | Weiyuhong-1998/DI-engine | GLU | false | 14,575 | [
"Apache-2.0"
] | 464 | 88658ea358298c6e61e95a454284b8853a3e9484 | https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484 |
MultiHeadAttn | import torch
from torch.nn import functional as F
from torch import nn
import torch.utils.data
import torch.optim
class MultiHeadAttn(nn.Module):
def __init__(self, n_head, d_model, d_head, dropout, dropatt=0.1,
pre_lnorm=False):
super(MultiHeadAttn, self).__init__()
self.n_head = n_head
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | PiotrDabkowski/NeMo | MultiHeadAttn | false | 11,798 | [
"Apache-2.0"
] | 0 | 7c251e9035b24136cf130f3caf760087e5ccf07c | https://github.com/PiotrDabkowski/NeMo/tree/7c251e9035b24136cf130f3caf760087e5ccf07c |
SpatialAttention | import torch
import torch.nn as nn
class SpatialAttention(nn.Module):
def __init__(self, kernel_size=3):
super(SpatialAttention, self).__init__()
assert kernel_size in (3, 7), 'kernel size must be 3 or 7'
padding = 3 if kernel_size == 7 else 1
self.conv1 = nn.Conv2d(2, 1, kernel_s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | lee-zq/VesselSeg-pytorch | SpatialAttention | false | 15,894 | [
"Apache-2.0"
] | 83 | b4f6571fc1fb1fbdaad60ff9282a54a1f1c455fa | https://github.com/lee-zq/VesselSeg-pytorch/tree/b4f6571fc1fb1fbdaad60ff9282a54a1f1c455fa |
RNN | import torch
import torch.nn as nn
import torch.nn.init
class RNN(nn.Module):
def __init__(self, data_size, hidden_size, output_size):
super(RNN, self).__init__()
self.hidden_size = hidden_size
input_size = data_size + hidden_size
self.i2h = nn.Linear(input_size, hidden_size)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.init
assert_size_stride = torch._C._dynamo... | OBA9k/Test_dev | RNN | false | 17,753 | [
"Apache-2.0"
] | 4 | bfdd337fb56ca160e1d09b6c310d1e6037d55fcd | https://github.com/OBA9k/Test_dev/tree/bfdd337fb56ca160e1d09b6c310d1e6037d55fcd |
MAE_loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
import torch.utils.data
import torch.optim
assert_s... | alopezgit/project-adapt | MAE_loss | false | 18,322 | [
"MIT"
] | 8 | e93ab350344a5504f76f4e460002e0163996f88a | https://github.com/alopezgit/project-adapt/tree/e93ab350344a5504f76f4e460002e0163996f88a |
PixelUnshuffle | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._... | Dazz993/AlphaPose | PixelUnshuffle | false | 5,044 | [
"Apache-2.0"
] | 1 | d4b9a3af5f590fa21bd033b4a19e98b5748ae683 | https://github.com/Dazz993/AlphaPose/tree/d4b9a3af5f590fa21bd033b4a19e98b5748ae683 |
EntmaxBisect | from torch.autograd import Function
import torch
import torch.nn as nn
def entmax_bisect(X, alpha=1.5, dim=-1, n_iter=50, ensure_sum_one=True):
"""alpha-entmax: normalizing sparse transform (a la softmax).
Solves the optimization problem:
max_p <x, p> - H_a(p) s.t. p >= 0, sum(p) == 1.
wh... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch.autograd import F... | antoniogois/entmax | EntmaxBisect | false | 15,108 | [
"MIT"
] | 298 | 7ff3fa6b09ee53e04514173aacae9de90c95ca75 | https://github.com/antoniogois/entmax/tree/7ff3fa6b09ee53e04514173aacae9de90c95ca75 |
SILogLoss | # 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... | appliedinnovation/fast-depth | SILogLoss | false | 1,459 | [
"MIT"
] | 0 | 4606b4d340ae416de94afed45bc767fe6f64bd67 | https://github.com/appliedinnovation/fast-depth/tree/4606b4d340ae416de94afed45bc767fe6f64bd67 |
Rot180 | import torch
import torch.nn as nn
def rot180(input: 'torch.Tensor') ->torch.Tensor:
return torch.flip(input, [-2, -1])
class Rot180(nn.Module):
"""Rotate a tensor image or a batch of tensor images
180 degrees. Input must be a tensor of shape (C, H, W)
or a batch of tensors :math:`(*, 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | JoanFM/kornia | Rot180 | false | 11,545 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 808898887cde69074ca3e3df9b24dea9682aad90 | https://github.com/JoanFM/kornia/tree/808898887cde69074ca3e3df9b24dea9682aad90 |
Accuracy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | jgoodson/TraGeC | Accuracy | false | 6,935 | [
"BSD-3-Clause"
] | 1 | 3370e29ba0639745055cbee726a40181a4dd61df | https://github.com/jgoodson/TraGeC/tree/3370e29ba0639745055cbee726a40181a4dd61df |
AsymmetricLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
... | 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... | JiYuanFeng/mmclassification | AsymmetricLoss | false | 13,883 | [
"Apache-2.0"
] | 1,190 | b337ef1f11b85148cca4b6fb0c4da3f8cc2eede6 | https://github.com/JiYuanFeng/mmclassification/tree/b337ef1f11b85148cca4b6fb0c4da3f8cc2eede6 |
Normalize3D | # 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... | dariocazzani/vo-id | Normalize3D | false | 1,787 | [
"MIT"
] | 0 | 41d0f2779e7909cfa15afcb6c8222c48a5855eb8 | https://github.com/dariocazzani/vo-id/tree/41d0f2779e7909cfa15afcb6c8222c48a5855eb8 |
AE | # 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 ... | ahanagemini/Phd_final_year_old_sr | AE | false | 3,045 | [
"BSD-2-Clause"
] | 0 | 62be9d1294acdb724a2fe424789b657a44e2cd7d | https://github.com/ahanagemini/Phd_final_year_old_sr/tree/62be9d1294acdb724a2fe424789b657a44e2cd7d |
FixedSubnetConv | import math
import torch
import torch.multiprocessing
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.functional as F
class FixedSubnetConv(nn.Conv2d):
def __init__(self, *args, **kwargs):
super().__init__(*args... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.multiprocessing
import torch.nn as nn
import torch.nn.p... | RICE-EIC/Robust_Scratch_Ticket | FixedSubnetConv | false | 8,669 | [
"MIT"
] | 13 | f77b41cdaab6db4922a6d4b5970db75a9bfc7257 | https://github.com/RICE-EIC/Robust_Scratch_Ticket/tree/f77b41cdaab6db4922a6d4b5970db75a9bfc7257 |
ComboLoss | import torch
import torch.nn as nn
class ComboLoss(nn.Module):
def __init__(self, weight=None, size_average=True, alpha=0.5, ce_ratio=0.5
):
super(ComboLoss, self).__init__()
self.alpha = alpha
self.ce_ratio = ce_ratio
def forward(self, inputs, targets, smooth=1):
e =... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | johnugeorge/medperf | ComboLoss | false | 6,974 | [
"Apache-2.0"
] | 1 | 5bc3f643064df14e9476bd4d4c1a4c0cce5337d5 | https://github.com/johnugeorge/medperf/tree/5bc3f643064df14e9476bd4d4c1a4c0cce5337d5 |
ScaledDotProductAttention | import torch
import numpy as np
import torch.nn as nn
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super(ScaledDotProductAttention, self).__init__()
self.temperature = temperature
self.dropout = nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | MarcosPampuch/TDNet_CARLA | ScaledDotProductAttention | false | 802 | [
"MIT"
] | 0 | efc1c872966f1cef49b82723170586a6abcfb524 | https://github.com/MarcosPampuch/TDNet_CARLA/tree/efc1c872966f1cef49b82723170586a6abcfb524 |
GeodesicLoss | import torch
import torch.nn as nn
class GeodesicLoss(nn.Module):
def __init__(self, eps=1e-07):
super().__init__()
self.eps = eps
def forward(self, m1, m2):
m = torch.bmm(m1, m2.transpose(1, 2))
cos = (m[:, 0, 0] + m[:, 1, 1] + m[:, 2, 2] - 1) / 2
theta = torch.acos(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | arsalan0004/6DRepNet | GeodesicLoss | false | 14,895 | [
"MIT"
] | 84 | cdfb2b151785eb89fef70907a6f2a19fa0acf4ae | https://github.com/arsalan0004/6DRepNet/tree/cdfb2b151785eb89fef70907a6f2a19fa0acf4ae |
Conv2dMtl | from torch.nn import Module
import math
import torch
from torch.nn.parameter import Parameter
from torch.nn import functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from torch.nn.modules.module import Module
from torch.nn.modules.utils import _pair
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import math
from torch.nn.parameter import Parameter... | JosephKJ/class-incremental-learning | Conv2dMtl | false | 17,518 | [
"MIT"
] | 8 | 689271b84f2e553930ca6687d036ac99bd84b311 | https://github.com/JosephKJ/class-incremental-learning/tree/689271b84f2e553930ca6687d036ac99bd84b311 |
VGGBase | import torch
import torchvision
from torch import nn
import torch.nn.functional as F
from itertools import product as product
import torch.optim
import torch.utils.data
def decimate(tensor, m):
"""
Decimate a tensor by a factor 'm', i.e. downsample by keeping every 'm'th value.
This is used when we conve... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 torchvision
from torch... | mosevg/ssd | VGGBase | false | 11,144 | [
"MIT"
] | 0 | 8fd9f6cc376c027427531bcf475188ae43c4b2d6 | https://github.com/mosevg/ssd/tree/8fd9f6cc376c027427531bcf475188ae43c4b2d6 |
L1RankLoss | # 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.onnx
asse... | usutdzxych/CenseoQoE | L1RankLoss | false | 16,658 | [
"BSD-3-Clause"
] | 75 | 3f653296b223da6190e1e1781e7b9b54ff877102 | https://github.com/usutdzxych/CenseoQoE/tree/3f653296b223da6190e1e1781e7b9b54ff877102 |
ReduceDim | # 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.... | dendisuhubdy/collaborative-experts | ReduceDim | false | 10,107 | [
"MIT"
] | 0 | e6db63837537c054723ce00b73264101acc29d39 | https://github.com/dendisuhubdy/collaborative-experts/tree/e6db63837537c054723ce00b73264101acc29d39 |
SimpleArch | import torch
import torch.nn as nn
class SimpleArch(nn.Module):
def __init__(self, input_size, dropout=0.1, hidden_layer_size=10,
output_neurons=1):
"""
A simple architecture wrapper -- build with intuitive Sklearn-like API.
"""
super(SimpleArch, self).__init__()
s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | EMBEDDIA/PropStar | SimpleArch | false | 5,098 | [
"BSD-3-Clause"
] | 1 | 987be390775130893f2c3440a5f1f94025309e4d | https://github.com/EMBEDDIA/PropStar/tree/987be390775130893f2c3440a5f1f94025309e4d |
Vgg16 | # 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 ... | AllenPu/mbdg | Vgg16 | false | 7,776 | [
"MIT"
] | 27 | 243f53a57dcf4bfb6e717c0c9f64a839cff8d548 | https://github.com/AllenPu/mbdg/tree/243f53a57dcf4bfb6e717c0c9f64a839cff8d548 |
FeatExemplarAvgBlock | import torch
import torch.nn as nn
import torch.optim
import torch.nn.parallel
class FeatExemplarAvgBlock(nn.Module):
def __init__(self, nFeat):
super(FeatExemplarAvgBlock, self).__init__()
def forward(self, features_train, labels_train):
labels_train_transposed = labels_train.transpose(1, 2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.optim
import torch.nn.parallel
assert_size_st... | nikran1/Few_shot | FeatExemplarAvgBlock | false | 16,169 | [
"MIT"
] | 497 | 5298c98e208411e44ee7767e6f4d457006d373cb | https://github.com/nikran1/Few_shot/tree/5298c98e208411e44ee7767e6f4d457006d373cb |
SelfGating | # 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
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | Fork-for-Modify/VideoFeatureExtractor | SelfGating | false | 8,110 | [
"Apache-2.0"
] | 15 | a73bb5a575a318c2d71bc8dd2432c8941c35a77f | https://github.com/Fork-for-Modify/VideoFeatureExtractor/tree/a73bb5a575a318c2d71bc8dd2432c8941c35a77f |
FCUDown | import torch
import torch.nn as nn
from functools import partial
class FCUDown(nn.Module):
""" CNN feature maps -> Transformer patch embeddings
"""
def __init__(self, inplanes, outplanes, dw_stride, act_layer=nn.GELU,
norm_layer=partial(nn.LayerNorm, eps=1e-06)):
super(FCUDown, self).__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.triton_helpers import libdevice
import torch.nn as ... | xuewengeophysics/Conformer | FCUDown | false | 13,123 | [
"Apache-2.0"
] | 0 | e769a1ac9ab110dae2a356a4de1e06ccd0e95041 | https://github.com/xuewengeophysics/Conformer/tree/e769a1ac9ab110dae2a356a4de1e06ccd0e95041 |
InfoLoss | # 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... | pudumagico/deepproblog | InfoLoss | false | 16,282 | [
"Apache-2.0"
] | 54 | 6d38e783990551f4030780a1d69c7138fada2020 | https://github.com/pudumagico/deepproblog/tree/6d38e783990551f4030780a1d69c7138fada2020 |
MatrixTree | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
import torch.cuda
import torch.distributed
assert_s... | Zer0-dev115/OpenNMT-py | MatrixTree | false | 12,131 | [
"MIT"
] | 0 | 028c76b34779223ee6b3eb224b99617552987100 | https://github.com/Zer0-dev115/OpenNMT-py/tree/028c76b34779223ee6b3eb224b99617552987100 |
LayerNorm | import torch
import torch.nn as nn
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(LayerNorm, self).__init__()
self.weight = nn.Parameter(torch.ones(hidden_size))
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | CaptainJa/demo-torch-gpt2 | LayerNorm | false | 2,129 | [
"MIT"
] | 0 | 83d6074e8b321101e08c0aa5749c8eb988a5faa8 | https://github.com/CaptainJa/demo-torch-gpt2/tree/83d6074e8b321101e08c0aa5749c8eb988a5faa8 |
ChannelMixer | # 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 ... | TheRealMarVin/mlp-mixer | ChannelMixer | false | 1,136 | [
"MIT"
] | 0 | 2124cb5c5adfc7af473cab535095471d4943adab | https://github.com/TheRealMarVin/mlp-mixer/tree/2124cb5c5adfc7af473cab535095471d4943adab |
Fusion | # 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 ... | dumpmemory/MMSA | Fusion | false | 6,613 | [
"MIT"
] | 1 | 08b3a7f4529c380356eeb1cf6bf9a89e7c9701e7 | https://github.com/dumpmemory/MMSA/tree/08b3a7f4529c380356eeb1cf6bf9a89e7c9701e7 |
ToLongTensor | import torch
from torch import Tensor
from typing import List
import torch.nn as nn
import torch.utils.data
class ToLongTensor(nn.Module):
"""Convert a list of integers to long tensor
"""
def __init__(self):
super(ToLongTensor, self).__init__()
def forward(self, tokens: 'List[List[int]]') ->... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | Hirni-Meshram3/text | ToLongTensor | false | 5,333 | [
"BSD-3-Clause"
] | 1 | 84e6c7bd99c7fb3c229ff289aa722149e3136094 | https://github.com/Hirni-Meshram3/text/tree/84e6c7bd99c7fb3c229ff289aa722149e3136094 |
Feedback | # 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... | e96031413/tfvaegan | Feedback | false | 10,096 | [
"MIT"
] | 0 | 4d0512c6ce98155b9e8ba37fbcf90d43cd5bbe90 | https://github.com/e96031413/tfvaegan/tree/4d0512c6ce98155b9e8ba37fbcf90d43cd5bbe90 |
FF | import torch
from torch import nn
class FF(nn.Module):
"""
Feed-forward in a transformer layer.
"""
def __init__(self, input_size, hidden_size):
super().__init__()
self.lin_1 = nn.Linear(input_size, hidden_size)
self.lin_2 = nn.Linear(hidden_size, input_size)
self.relu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | Altair-inc/behaviour-seq-transformer | FF | false | 16,887 | [
"MIT"
] | 10 | 74185eb5588b1e57a936de9901313dddcc10acf4 | https://github.com/Altair-inc/behaviour-seq-transformer/tree/74185eb5588b1e57a936de9901313dddcc10acf4 |
PositioningCost | import torch
import torch.nn as nn
class PositioningCost(nn.Module):
def __init__(self, target, Q=1, R=0, P=0):
super().__init__()
self.target = target
self.Q, self.R, self.P = Q, R, P
def forward(self, traj, u=None, mesh_p=None):
cost = 0.1 * torch.norm(traj[..., -1, :3] - s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | Juju-botu/diffeqml-research | PositioningCost | false | 13,918 | [
"Apache-2.0"
] | 49 | aa796c87447e5299ec4f25a07fc4d032afb1f63e | https://github.com/Juju-botu/diffeqml-research/tree/aa796c87447e5299ec4f25a07fc4d032afb1f63e |
BlendConv2d | import torch
import torch.nn as nn
import torch.utils.data
class BlendConv2d(nn.Module):
def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0,
dilation=1, groups=1, bias=True, transpose=False, **unused_kwargs):
super(BlendConv2d, self).__init__()
module = nn.ConvTranspose2d if... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | musyoku/ffjord | BlendConv2d | false | 7,298 | [
"MIT"
] | 1 | 9e431e122e59fa9a71f3f301dec8fdd3db51e0ce | https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce |
ScaleNorm | import math
import torch
import torch.nn as nn
class ScaleNorm(nn.Module):
"""ScaleNorm"""
"""All g’s in SCALE NORM are initialized to sqrt(d)"""
def __init__(self, scale, eps=1e-05):
super(ScaleNorm, self).__init__()
self.scale = nn.Parameter(torch.tensor(math.sqrt(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 import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import math
import torch.nn ... | Jh-SYSU/MolRep | ScaleNorm | false | 13,882 | [
"MIT"
] | 57 | b2c802d18d41d7db26c19c6dd644098f945e48a1 | https://github.com/Jh-SYSU/MolRep/tree/b2c802d18d41d7db26c19c6dd644098f945e48a1 |
GELU | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torch.optim
import torch._utils
import torch.nn
class GELU(nn.Module):
@staticmethod
def forward(x):
erf = F.tanh(np.sqrt(2 / np.pi) * (x + 0.044715 * torch.pow(x, 3)))
return 0.5 * x * (1 + erf)
de... | 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.optim
import torch._utils
import torch.nn
as... | ModelTC/EOD | GELU | false | 14,060 | [
"Apache-2.0"
] | 196 | 164bff80486e9ae6a095a97667b365c46ceabd86 | https://github.com/ModelTC/EOD/tree/164bff80486e9ae6a095a97667b365c46ceabd86 |
GrayScaleToRGB | # 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.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 |
Conv3x3 | # 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.... | Morbotu/drone-PWS | Conv3x3 | false | 11,719 | [
"MIT"
] | 0 | face9cbf30a55783592cce8af59c1c70da982b6a | https://github.com/Morbotu/drone-PWS/tree/face9cbf30a55783592cce8af59c1c70da982b6a |
BCE_Dice | import torch
import torch.nn as nn
def IoU(logit, truth, smooth=1):
prob = torch.sigmoid(logit)
intersection = torch.sum(prob * truth)
union = torch.sum(prob + truth)
iou = (2 * intersection + smooth) / (union + smooth)
return iou
class DiceLoss(nn.Module):
def __init__(self, smooth=1):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | evilidol/kaggle-Steel-Defect-Detection | BCE_Dice | false | 6,660 | [
"MIT"
] | 1 | 41e3e360f49d706c8c79bcd442342c529648a736 | https://github.com/evilidol/kaggle-Steel-Defect-Detection/tree/41e3e360f49d706c8c79bcd442342c529648a736 |
InvertibleChannelMixing3D | # 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
from torch import nn
from warnings import wa... | cetmann/iunets | InvertibleChannelMixing3D | false | 15,016 | [
"MIT"
] | 86 | 80ed7cce0e505a0396c42359eaf27819222d71f6 | https://github.com/cetmann/iunets/tree/80ed7cce0e505a0396c42359eaf27819222d71f6 |
VDB | # 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.triton_helpers import libd... | sgrimbly/lets-do-irl | VDB | false | 4,297 | [
"MIT"
] | 0 | 4233e238342394feef6a7bd495cc6b700d435b00 | https://github.com/sgrimbly/lets-do-irl/tree/4233e238342394feef6a7bd495cc6b700d435b00 |
DumbFeat | import torch
import torch.nn as nn
import torch.optim
class DumbFeat(nn.Module):
def __init__(self, dropout):
super().__init__()
if dropout > 0.0:
self.dropout = torch.nn.Dropout(p=dropout, inplace=False)
else:
self.dropout = None
def forward(self, x):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.optim
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dyna... | alisure-fork/BF3S | DumbFeat | false | 14,793 | [
"Apache-2.0"
] | 130 | 99cfb7ce4696f2585bb7c2502f234e60c55e8007 | https://github.com/alisure-fork/BF3S/tree/99cfb7ce4696f2585bb7c2502f234e60c55e8007 |
MaxPoolBlock | import torch
import torch.nn as nn
class Block(nn.Module):
def __init__(self):
"""Initialisation for a lower-level DeepLPF conv block
:returns: N/A
:rtype: N/A
"""
super(Block, self).__init__()
def conv3x3(self, in_channels, out_channels, stride=1):
"""Repre... | 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... | ZombaSY/DeepLPF | MaxPoolBlock | false | 1,310 | [
"BSD-3-Clause"
] | 0 | adce64ae01bc9e32f465a354cb1f6534f0d13597 | https://github.com/ZombaSY/DeepLPF/tree/adce64ae01bc9e32f465a354cb1f6534f0d13597 |
RBF_activation | import torch
import numpy as np
import torch.nn as nn
class RBF_activation(torch.nn.Module):
def __init__(self, input_features):
super(RBF_activation, self).__init__()
self.input_features = input_features
self.centers = nn.Parameter(torch.ones(input_features))
self.log_sigma2 = nn... | 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 numpy as np
import torch.nn as nn
assert_size_stride = ... | bkompa/PyTorch_CIFAR10_GAU | RBF_activation | false | 9,789 | [
"MIT"
] | 0 | 2c6da19b251a9536167df473dabcb5cc34c66133 | https://github.com/bkompa/PyTorch_CIFAR10_GAU/tree/2c6da19b251a9536167df473dabcb5cc34c66133 |
EncoderDecoder | # 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... | ClementPla/VisionTransformerForOphtalmicImages | EncoderDecoder | false | 5,013 | [
"MIT"
] | 1 | b99fd6c9ec076d94c8e2cd9302178888b8b50d17 | https://github.com/ClementPla/VisionTransformerForOphtalmicImages/tree/b99fd6c9ec076d94c8e2cd9302178888b8b50d17 |
GraphVae | from torch.nn import Module
import math
import torch
import torch.nn.functional as F
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
from scipy.sparse import *
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
i... | TTomatoZhang/GHGCN | GraphVae | false | 3,082 | [
"Apache-2.0"
] | 0 | 09a07ff9e29e5889b912ca5feff74bb9308eda55 | https://github.com/TTomatoZhang/GHGCN/tree/09a07ff9e29e5889b912ca5feff74bb9308eda55 |
GCN2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import math
import torch.nn a... | Ononoki-Yotsugi/IDGL | GCN2 | false | 9,512 | [
"Apache-2.0"
] | 0 | a99f840681a4ae26c2740ed9e9302d4e15a68c7f | https://github.com/Ononoki-Yotsugi/IDGL/tree/a99f840681a4ae26c2740ed9e9302d4e15a68c7f |
KMaxPool1d | # 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... | LindgeW/DomainAdaption4DependencyParsing | KMaxPool1d | false | 5,537 | [
"Apache-2.0"
] | 1 | 5de136a37d8fe730e4235ed95bf923763fe21ea6 | https://github.com/LindgeW/DomainAdaption4DependencyParsing/tree/5de136a37d8fe730e4235ed95bf923763fe21ea6 |
ReduceMean | import torch
import torch.onnx
import torch.nn as nn
class ReduceMean(nn.Module):
def forward(self, x):
return torch.mean(x, -1, keepdim=True)
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
import torch.onnx
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynam... | mil-tokyo/webdnn | ReduceMean | false | 16,078 | [
"MIT"
] | 1,967 | 38a60fd3e1a4e72bc01108189a3aa51e0752aecd | https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd |
Conv2d | import torch
import torch.nn as nn
class Conv2d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, NL
='relu', same_padding=False, bn=False, dilation=1):
super(Conv2d, self).__init__()
padding = int((kernel_size - 1) / 2) if same_padding else 0
self.c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Elin24/DCL-CrowdCounting | Conv2d | false | 8,043 | [
"MIT"
] | 12 | 2f8e68a2d29a8599e795b502f21b4de778e6214c | https://github.com/Elin24/DCL-CrowdCounting/tree/2f8e68a2d29a8599e795b502f21b4de778e6214c |
AlbertAttention | from _paritybench_helpers import _mock_config
import math
import torch
from typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | jxhe/unify-parameter-efficient-tuning | AlbertAttention | false | 15,784 | [
"Apache-2.0"
] | 101 | 3222ce2c0079566a28043e22380eb4ab6ad14389 | https://github.com/jxhe/unify-parameter-efficient-tuning/tree/3222ce2c0079566a28043e22380eb4ab6ad14389 |
GraphAttentionLayer | # 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.... | jiangnanboy/gcn_for_prediction_of_protein_interactions | GraphAttentionLayer | false | 6,944 | [
"Apache-2.0"
] | 1 | b2a9eb06cdfe0971d0c352299db1075ec4827dd9 | https://github.com/jiangnanboy/gcn_for_prediction_of_protein_interactions/tree/b2a9eb06cdfe0971d0c352299db1075ec4827dd9 |
SimpleReciprocalModel | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | briancoutinho/glow | SimpleReciprocalModel | false | 12,575 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
MLP | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.init import kaiming_normal
def ZeroInitializer(param):
shape = param.size()
init = np.zeros(shape).astype(np.float32)
param.data.set_(torch.from_numpy(init))
def Linear(initializer=kaiming_normal, bias_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.... | NLP-Discourse-SoochowU/rst_dp2019Bottom2Up | MLP | false | 5,630 | [
"MIT"
] | 1 | ac1624127c9c8a3301685193ac8239357e01f6ca | https://github.com/NLP-Discourse-SoochowU/rst_dp2019Bottom2Up/tree/ac1624127c9c8a3301685193ac8239357e01f6ca |
LayerNormCustom | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | renebidart/pytorch-cifar | LayerNormCustom | false | 4,245 | [
"MIT"
] | 0 | 8f623299c25f7f219bab34bc7df41fe24232b1af | https://github.com/renebidart/pytorch-cifar/tree/8f623299c25f7f219bab34bc7df41fe24232b1af |
PFLDLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import ... | Johnsonms/NNI_master | PFLDLoss | false | 11,596 | [
"MIT"
] | 0 | e5e5c7aed89cf3189cffe1056464833c15eb54ff | https://github.com/Johnsonms/NNI_master/tree/e5e5c7aed89cf3189cffe1056464833c15eb54ff |
KDTH | import torch
from torch import nn
import torch.nn.functional as F
class KDTH(nn.Module):
"""KD with a Teacher Head auxiliary loss"""
def __init__(self, T=4):
super(KDTH, self).__init__()
self.T = T
def forward(self, y_s, y_t):
y_s_th = y_s[1]
y_s = y_s[0]
p_t = F.... | 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 ... | Alibaba-MIIL/HeadSharingKD | KDTH | false | 7,683 | [
"BSD-2-Clause"
] | 15 | 8e2738bf069c7d12ec933f9b9107f267f7b6603a | https://github.com/Alibaba-MIIL/HeadSharingKD/tree/8e2738bf069c7d12ec933f9b9107f267f7b6603a |
Generator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | MolecularAI/deep-molecular-optimization | Generator | false | 14,069 | [
"Apache-2.0"
] | 52 | 815fecabd210662db1a89c4a2ab13d5e0ff9c037 | https://github.com/MolecularAI/deep-molecular-optimization/tree/815fecabd210662db1a89c4a2ab13d5e0ff9c037 |
TorchSub | # 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 | TorchSub | false | 6,119 | [
"MIT"
] | 1 | 53c663f0e0570ef7ffd6771354ae3478f63bd328 | https://github.com/ahangchen/torch2trt/tree/53c663f0e0570ef7ffd6771354ae3478f63bd328 |
StyleMod | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.nn
import torch.nn.functional as F
assert_size... | Qingyang-Xu/GANInversion_with_ConsecutiveImgs | StyleMod | false | 8,692 | [
"MIT"
] | 23 | 9078a48ec3474dacdd02693b051e3addef1c5697 | https://github.com/Qingyang-Xu/GANInversion_with_ConsecutiveImgs/tree/9078a48ec3474dacdd02693b051e3addef1c5697 |
FeedForward_NN | # 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_... | AqibJavaid899/PyTorch_Models | FeedForward_NN | false | 11,204 | [
"MIT"
] | 0 | cf81f6ef5d81aed76dca3f1a15be1a308b5d450f | https://github.com/AqibJavaid899/PyTorch_Models/tree/cf81f6ef5d81aed76dca3f1a15be1a308b5d450f |
ConvWS2d | # 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 ... | AlphaLFC/mmdetection | ConvWS2d | false | 4,845 | [
"Apache-2.0"
] | 1 | 45619c5b8aca0ca3e6ddc211210a8946c94694d8 | https://github.com/AlphaLFC/mmdetection/tree/45619c5b8aca0ca3e6ddc211210a8946c94694d8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.