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 |
|---|---|---|---|---|---|---|---|---|---|---|
TestTimeIN | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import... | MosyMosy/Pytorch_ImaneNet_With_wandb | TestTimeIN | false | 8,582 | [
"MIT"
] | 30 | b7b6e245e29ec342212025b8164e5053d4197fa1 | https://github.com/MosyMosy/Pytorch_ImaneNet_With_wandb/tree/b7b6e245e29ec342212025b8164e5053d4197fa1 |
ShiftedSoftplus | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torch.utils.data
assert_size_stride = torch._C._dynamo.... | THinnerichs/pytorch_geometric | ShiftedSoftplus | false | 11,910 | [
"MIT"
] | 0 | 90c2126895b21313a23657f4e845acc782d11bf5 | https://github.com/THinnerichs/pytorch_geometric/tree/90c2126895b21313a23657f4e845acc782d11bf5 |
ResnetBlock | # 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
assert_size_stride = torch... | DrLSimon/precision-recall-distributions-icml19 | ResnetBlock | false | 2,170 | [
"Apache-2.0"
] | 0 | 364188eaa26ac1bf39ebf038136c79aeee97da3a | https://github.com/DrLSimon/precision-recall-distributions-icml19/tree/364188eaa26ac1bf39ebf038136c79aeee97da3a |
F_conv | import torch
import warnings
import torch.nn as nn
import torch.nn.functional as F
class F_conv(nn.Module):
"""ResNet transformation, not itself reversible, just used below"""
def __init__(self, in_channels, channels, channels_hidden=None, stride=
None, kernel_size=3, leaky_slope=0.1, batch_norm=Fals... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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 warnings
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guar... | Xenovortex/INN_Embedding_Classification | F_conv | false | 1,245 | [
"MIT"
] | 0 | df31ec3dcf70780cae5140a69ffafdd64f218e5f | https://github.com/Xenovortex/INN_Embedding_Classification/tree/df31ec3dcf70780cae5140a69ffafdd64f218e5f |
SoftmaxLoss | import torch
class SoftmaxLoss(torch.nn.Module):
def __init__(self, tau=1.0):
super().__init__()
self.tau = tau
self.ce_loss = torch.nn.CrossEntropyLoss()
def forward(self, pred, true):
logits = pred / self.tau
l = self.ce_loss(logits, true)
return l
def get... | 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
assert_size_stride = t... | MargauxMasson/semanticGAN_code | SoftmaxLoss | false | 2,629 | [
"BSD-2-Clause",
"MIT"
] | 0 | a5b7fbbc505f8ae08c8aab8e199aa6406fffdb07 | https://github.com/MargauxMasson/semanticGAN_code/tree/a5b7fbbc505f8ae08c8aab8e199aa6406fffdb07 |
Linear_dynamics | import torch
import torch.utils.data
from torch import nn
class Linear_dynamics(nn.Module):
def __init__(self, device='cpu'):
super(Linear_dynamics, self).__init__()
self.time = nn.Parameter(torch.ones(1) * 0.7)
self.device = device
self
def forward(self, x, v):
retur... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._... | SuperXiang/GMN | Linear_dynamics | false | 5,871 | [
"MIT"
] | 1 | b74364e5b9f424b63a5ce63a207a6e4a067d7d3b | https://github.com/SuperXiang/GMN/tree/b74364e5b9f424b63a5ce63a207a6e4a067d7d3b |
Fusion | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Fusion(nn.Module):
""" Crazy multi-modal fusion: negative squared difference minus relu'd sum
"""
def __init__(self):
super().__init__()
def forward(self, x, y):
return -(x - y) ** 2 + 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
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guard... | KaihuaTang/VCTree-Visual-Question-Answering | Fusion | false | 8,399 | [
"MIT"
] | 31 | b6b0a8bdb01d45d36de3bded91db42544ad6a593 | https://github.com/KaihuaTang/VCTree-Visual-Question-Answering/tree/b6b0a8bdb01d45d36de3bded91db42544ad6a593 |
SSE | # 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... | earlbabson/torchflare | SSE | false | 6,636 | [
"Apache-2.0"
] | 1 | 15db06d313a53a3ec4640869335ba87730562b28 | https://github.com/earlbabson/torchflare/tree/15db06d313a53a3ec4640869335ba87730562b28 |
SqueezeEmbedding | import torch
import torch.nn as nn
class SqueezeEmbedding(nn.Module):
"""
Squeeze sequence embedding length to the longest one in the batch
"""
def __init__(self, batch_first=True):
super(SqueezeEmbedding, self).__init__()
self.batch_first = batch_first
def forward(self, x, x_len... | 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... | WeiLi9811/PyABSA | SqueezeEmbedding | false | 11,955 | [
"MIT"
] | 0 | e1595784b8c978c1e91c0d8139a0a4dc36ac5965 | https://github.com/WeiLi9811/PyABSA/tree/e1595784b8c978c1e91c0d8139a0a4dc36ac5965 |
LossD | # 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... | andy6804tw/talking-hands-API | LossD | false | 1,432 | [
"MIT"
] | 0 | 4895c980565082b0fdcabbc704ee871855e6d5f5 | https://github.com/andy6804tw/talking-hands-API/tree/4895c980565082b0fdcabbc704ee871855e6d5f5 |
perceptron | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | GuilhermeSenna/Testes-TCC | perceptron | false | 506 | [
"MIT"
] | 0 | ed38baf864d8993685427affa1f009e6cf7c5dcb | https://github.com/GuilhermeSenna/Testes-TCC/tree/ed38baf864d8993685427affa1f009e6cf7c5dcb |
Attention_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.... | xieenze/Trans2Seg | Attention_Decoder | false | 16,740 | [
"Apache-2.0"
] | 149 | 3972916bba7f985ca1aabc047fea56bdec9e9e5d | https://github.com/xieenze/Trans2Seg/tree/3972916bba7f985ca1aabc047fea56bdec9e9e5d |
LipNormLinear | import torch
import torch.nn as nn
import torch.nn.functional as F
def _max_except_dim(input, dim):
maxed = input
for axis in range(input.ndimension() - 1, dim, -1):
maxed, _ = maxed.max(axis, keepdim=True)
for axis in range(dim - 1, -1, -1):
maxed, _ = maxed.max(axis, keepdim=True)
re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | zxydi1992/residual-flows | LipNormLinear | false | 13,201 | [
"MIT"
] | 0 | 4ec289681dc91cff5312b22f7ebed93838b440fb | https://github.com/zxydi1992/residual-flows/tree/4ec289681dc91cff5312b22f7ebed93838b440fb |
Cartesian | import torch
from torch import nn
import torch.utils.data
import torch.utils.data.distributed
import torch.optim
class Cartesian(nn.Module):
def forward(self, x):
r, phi = x[..., 0], x[..., 1]
return torch.stack((r * torch.cos(phi), r * torch.sin(phi)), dim=-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.triton_helpers import math as tl_math
from torch import nn
import torch.utils.data
import torch.utils.data.dist... | gbosdet/fastMRI | Cartesian | false | 6,722 | [
"MIT"
] | 1 | 7f94f8006f8919d98fb87788b6dadec9a58d1a3a | https://github.com/gbosdet/fastMRI/tree/7f94f8006f8919d98fb87788b6dadec9a58d1a3a |
AdaptiveSoftplus | import torch
from torch.nn.parameter import Parameter
class AdaptiveSoftplus(torch.nn.Module):
"""
Implementation of soft exponential activation.
Shape:
- Input: (N, *) where * means, any number of additional
dimensions
- Output: (N, *), same shape as the input
Parameters:
... | 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
from torch.nn.parameter import Parameter
assert_size_stride = ... | ndem0/PINA | AdaptiveSoftplus | false | 10,730 | [
"MIT"
] | 0 | 1812ddb8d96a9c8aeb80ce35002dbd115e7d7931 | https://github.com/ndem0/PINA/tree/1812ddb8d96a9c8aeb80ce35002dbd115e7d7931 |
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
from torch import nn
f... | gavrin-s/catalyst | BPRLoss | false | 12,407 | [
"Apache-2.0"
] | 0 | 81087d8348b359e501d899f7a8350e0bedfc2b7d | https://github.com/gavrin-s/catalyst/tree/81087d8348b359e501d899f7a8350e0bedfc2b7d |
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.... | Anshul044/Project-NN | Attention | false | 71 | [
"MIT"
] | 0 | ef080846715a95b735f0381e4f60742e40791630 | https://github.com/Anshul044/Project-NN/tree/ef080846715a95b735f0381e4f60742e40791630 |
UpsampleConv2d | import torch
import torch.nn.functional as F
import torch.nn as nn
class UpsampleConv2d(nn.Module):
"""
Avoid checkerboard patterns by upsampling the image and convolving.
https://distill.pub/2016/deconv-checkerboard/
"""
def __init__(self, in_channels, out_channels, kernel_size, stride,
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | TrueMatthewKirkham/face-preserving-style-transfer | UpsampleConv2d | false | 5,917 | [
"MIT"
] | 1 | ae8a9509570227ea52776fba85658022124c886c | https://github.com/TrueMatthewKirkham/face-preserving-style-transfer/tree/ae8a9509570227ea52776fba85658022124c886c |
ReLUHyperSolver | import torch
import torch.nn as nn
class ReLUHyperSolver(nn.Module):
def __init__(self, in_dim, out_dim, hidden_dim=32):
super().__init__()
self.fc1 = nn.Linear(in_dim, hidden_dim)
self.fc2 = nn.Linear(hidden_dim, hidden_dim)
self.fc3 = nn.Linear(hidden_dim, out_dim)
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
import torch.nn as nn
assert_... | Juju-botu/diffeqml-research | ReLUHyperSolver | false | 13,912 | [
"Apache-2.0"
] | 49 | aa796c87447e5299ec4f25a07fc4d032afb1f63e | https://github.com/Juju-botu/diffeqml-research/tree/aa796c87447e5299ec4f25a07fc4d032afb1f63e |
MaskedSmoothL1 | import torch
import torch.nn as nn
class MaskedSmoothL1(nn.Module):
def __init__(self):
super(MaskedSmoothL1, self).__init__()
self.criterion = nn.SmoothL1Loss(size_average=True)
def forward(self, input, target, mask):
self.loss = self.criterion(input, target * mask)
return s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | ngerstle/soccerontable | MaskedSmoothL1 | false | 16,176 | [
"BSD-2-Clause"
] | 465 | 25426ff0f8fe0ce008b99c5c0fdbb35091d8d92c | https://github.com/ngerstle/soccerontable/tree/25426ff0f8fe0ce008b99c5c0fdbb35091d8d92c |
FeedForwardLayer | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint
class FeedForwardLayer(nn.Module):
def __init__(self, d_model, r_ff, p_drop=0.1):
super(FeedForwardLayer, self).__init__()
self.norm = nn.LayerNorm(d_model)
self.linear1 = nn.Linear(d_model, d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | RosettaCommons/RFDesign | FeedForwardLayer | false | 14,342 | [
"MIT"
] | 45 | b404b8b2c57f89c047529c30259aeeb8f6012b61 | https://github.com/RosettaCommons/RFDesign/tree/b404b8b2c57f89c047529c30259aeeb8f6012b61 |
Dense | # 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 ... | COEN-390/YOLOv5-Lite | Dense | false | 11,289 | [
"MIT"
] | 0 | 06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | https://github.com/COEN-390/YOLOv5-Lite/tree/06a53f5d001c5d37729f55f47cbd46cc8eb63f84 |
Model | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_size, hidden_size, num_classes):
super().__init__()
self.h1 = nn.Linear(input_size, hidden_size)
self.h2 = nn.Linear(hidden_size, num_classes)
def forward(self, x):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Natenumber12/LUDO_QLearning | Model | false | 9,323 | [
"MIT"
] | 0 | 0878b9bce01d0afc5798bdbf96db253302654f33 | https://github.com/Natenumber12/LUDO_QLearning/tree/0878b9bce01d0afc5798bdbf96db253302654f33 |
SpatialSoftmax | # 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.optim
ass... | ai-in-motion/moai | SpatialSoftmax | false | 18,343 | [
"Apache-2.0"
] | 10 | e38cac046c059d2e2331ef4883bbabc5a500a5cf | https://github.com/ai-in-motion/moai/tree/e38cac046c059d2e2331ef4883bbabc5a500a5cf |
TorchModule | # 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
ass... | JudeDavis1/ivy | TorchModule | false | 2,435 | [
"Apache-2.0"
] | 0 | 0f3dc38f978a6ce65fc1ed11110338d635e5c9f3 | https://github.com/JudeDavis1/ivy/tree/0f3dc38f978a6ce65fc1ed11110338d635e5c9f3 |
MaxMinGroup | # 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... | lingzenan/invertible-resnet | MaxMinGroup | false | 7,094 | [
"MIT"
] | 1 | 57b1c0de51a885aed074b77628f3b0c85c548e70 | https://github.com/lingzenan/invertible-resnet/tree/57b1c0de51a885aed074b77628f3b0c85c548e70 |
GlobalAvgPool2dResNext | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class GlobalAvgPool2dResNext(nn.Module):
def __init__(self):
"""Global average pooling over the input's spatial dimensions"""
super(Globa... | 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 torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distr... | Alibaba-MIIL/ZS_SDL | GlobalAvgPool2dResNext | false | 7,988 | [
"MIT"
] | 20 | 769fe4f57d2d458a7c4b5468a6395c9b296b1dad | https://github.com/Alibaba-MIIL/ZS_SDL/tree/769fe4f57d2d458a7c4b5468a6395c9b296b1dad |
C3D | # 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 logging
import torch.n... | Lill98/mmaction_custom_data | C3D | false | 14,325 | [
"Apache-2.0"
] | 1,929 | a174e995b78a936a7c80a1feb884cbfa801af740 | https://github.com/Lill98/mmaction_custom_data/tree/a174e995b78a936a7c80a1feb884cbfa801af740 |
tofp16 | import torch
import torch.nn as nn
import torch.utils.data
class tofp16(nn.Module):
"""
Model wrapper that implements::
def forward(self, input):
return input.half()
"""
def __init__(self):
super(tofp16, self).__init__()
def forward(self, input):
return input.... | 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.... | AlongRide/Py3torch_HigherHRNet | tofp16 | false | 4,830 | [
"MIT"
] | 1 | 62c455b62c0ac6d1de482fd3740dc947033e9e9a | https://github.com/AlongRide/Py3torch_HigherHRNet/tree/62c455b62c0ac6d1de482fd3740dc947033e9e9a |
Mnist_CNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | voyageth/PyTorch-tutorials-kr | Mnist_CNN | false | 4,514 | [
"BSD-3-Clause"
] | 0 | 05d2dd5931abfca6ce1e0b297f4ceb7f4eae6239 | https://github.com/voyageth/PyTorch-tutorials-kr/tree/05d2dd5931abfca6ce1e0b297f4ceb7f4eae6239 |
MumfordShah_Loss | import torch
import torch.nn as nn
class MumfordShah_Loss(nn.Module):
def levelsetLoss(self, output, target, penalty='l1'):
outshape = output.shape
tarshape = target.shape
self.penalty = penalty
loss = 0.0
for ich in range(tarshape[1]):
target_ = torch.unsqueez... | 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
... | HiLab-git/WSL4MIS | MumfordShah_Loss | false | 8,283 | [
"MIT"
] | 29 | 9683e7c7409b95c0ac2169fe7964f6ca04c80d9a | https://github.com/HiLab-git/WSL4MIS/tree/9683e7c7409b95c0ac2169fe7964f6ca04c80d9a |
Classifier | # 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.... | KathleenQ/context-aware-doc-analysis | Classifier | false | 11,610 | [
"MIT"
] | 0 | 93af994b2dee09f5fe6bfcc2e76e47e74708d3fe | https://github.com/KathleenQ/context-aware-doc-analysis/tree/93af994b2dee09f5fe6bfcc2e76e47e74708d3fe |
ToeplitzBlock | import torch
import torch.nn as nn
def expand_toeplitz(diag, lower_diags, upper_diags):
pattern = torch.cat([upper_diags, diag, lower_diags], 0)
d = lower_diags.size(0)
columns = []
for i in range(d + 1):
columns.append(pattern[d - i:d - i + d + 1])
return torch.stack(columns, 0)
class T... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | daemon/toepl.it.z | ToeplitzBlock | false | 9,967 | [
"MIT"
] | 0 | b16754b11f03f33bbfa05cf8544ef0dca3574ed4 | https://github.com/daemon/toepl.it.z/tree/b16754b11f03f33bbfa05cf8544ef0dca3574ed4 |
SVIGlobalMaxPool2D | # 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... | RomanShen/radial-bnn | SVIGlobalMaxPool2D | false | 992 | [
"Apache-2.0"
] | 0 | 7c8bc85397c1461a6fd5ea9adf0631f9ade27f6c | https://github.com/RomanShen/radial-bnn/tree/7c8bc85397c1461a6fd5ea9adf0631f9ade27f6c |
Transformer | import torch
import torch.nn as nn
class Transformer(nn.Module):
def __init__(self, in_dims):
super(Transformer, self).__init__()
self.temperature = in_dims ** 0.5
self.query_fc = nn.Linear(in_dims, in_dims)
self.key_fc = nn.Linear(in_dims, in_dims)
self.value_fc = nn.Line... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | leaderj1001/Synthesizer-Rethinking-Self-Attention-Transformer-Models | Transformer | false | 15,885 | [
"MIT"
] | 58 | 3ee5829438a8f9c063ae485e77c9ce7649d24139 | https://github.com/leaderj1001/Synthesizer-Rethinking-Self-Attention-Transformer-Models/tree/3ee5829438a8f9c063ae485e77c9ce7649d24139 |
CriterionKD | # 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... | yubin1219/Semantic-Seg | CriterionKD | false | 4,677 | [
"BSD-2-Clause"
] | 0 | c40bd43d3d7e44bc995b8d041736580dec084251 | https://github.com/yubin1219/Semantic-Seg/tree/c40bd43d3d7e44bc995b8d041736580dec084251 |
Critic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import numpy as np
import tor... | Odiurd/deep-reinforcement-learning-continuous-control | Critic | false | 2,750 | [
"MIT"
] | 0 | b1fb17ceab8cf23200dbdada21ba2ab0e33aa1a2 | https://github.com/Odiurd/deep-reinforcement-learning-continuous-control/tree/b1fb17ceab8cf23200dbdada21ba2ab0e33aa1a2 |
LocalizationNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | YIFEI-MA/MultiDigitRecognition | LocalizationNet | false | 12,049 | [
"MIT"
] | 0 | f1f9567c31102ccdc7464a35b8a7c533b5d46734 | https://github.com/YIFEI-MA/MultiDigitRecognition/tree/f1f9567c31102ccdc7464a35b8a7c533b5d46734 |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | WHU-YH-jx/bionetwork_segmentation | DiceLoss | false | 5,947 | [
"MIT"
] | 1 | 556c5b61a1a3784875b31eacb8c6bb418d70ee9a | https://github.com/WHU-YH-jx/bionetwork_segmentation/tree/556c5b61a1a3784875b31eacb8c6bb418d70ee9a |
BasicBlock | import math
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
class GraphConv(nn.Module):
def __init__(self, in_features, out_features, bias=False):
super(GraphConv, self).__init__()
self.in_features = in_features
self.out_features = out_features
self.wei... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | ardihikaru/learn-to-cluster | BasicBlock | false | 6,230 | [
"MIT"
] | 1 | d7a5ea0946f7b402f8878bfd608bf3e0dc9a26ca | https://github.com/ardihikaru/learn-to-cluster/tree/d7a5ea0946f7b402f8878bfd608bf3e0dc9a26ca |
Actor | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, state_dim: 'int', action_dim: 'int'):
"""
Initialize the network
param: state_dim : Size of the state space
param: action_dim: Size of the action space
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | JiangengDong/ECE276C | Actor | false | 5,395 | [
"MIT"
] | 1 | 2338b5226d6fed8858402e8d67db7f2eead98221 | https://github.com/JiangengDong/ECE276C/tree/2338b5226d6fed8858402e8d67db7f2eead98221 |
QueryModule | # 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_... | ArjitJ/tbd-nets | QueryModule | false | 8,880 | [
"MIT"
] | 0 | 8e93ecad54489706ec3249c9ca5d345d6866e1ba | https://github.com/ArjitJ/tbd-nets/tree/8e93ecad54489706ec3249c9ca5d345d6866e1ba |
Downsampling | # 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.... | RRemixx/DMRDenoise | Downsampling | false | 14,280 | [
"MIT"
] | 79 | 026d25f9eaf98fdfd85a67caeb9b49cab71148e9 | https://github.com/RRemixx/DMRDenoise/tree/026d25f9eaf98fdfd85a67caeb9b49cab71148e9 |
UpsampleBlock | import torch
import torch.nn as nn
class PixelShuffle1d(nn.Module):
def __init__(self, upscale_factor):
super().__init__()
self.upscale_factor = upscale_factor
def forward(self, x):
batch_size = x.shape[0]
short_channel_len = x.shape[1]
short_width = x.shape[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
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Yotsuyubi/drumgan | UpsampleBlock | false | 2,982 | [
"MIT"
] | 0 | eb6a9aa8b5c0d64bad65e4dbd14d444b7a859a29 | https://github.com/Yotsuyubi/drumgan/tree/eb6a9aa8b5c0d64bad65e4dbd14d444b7a859a29 |
TVLoss | import torch
from typing import Tuple
from torch.nn.modules.loss import _Loss
from typing import List
from typing import Optional
def _reduce(x: 'torch.Tensor', reduction: 'str'='mean') ->torch.Tensor:
"""Reduce input in batch dimension if needed.
Args:
x: Tensor with shape (N, *).
reduction:... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from typing import Tuple
from torch.nn.modules.loss import _Loss
from typing im... | hecoding/piq | TVLoss | false | 10,188 | [
"Apache-2.0"
] | 0 | c72143ce9deb30fefaca434a39e4dfc557673e97 | https://github.com/hecoding/piq/tree/c72143ce9deb30fefaca434a39e4dfc557673e97 |
nin | import torch
import torch.nn as nn
from torch.nn.utils import weight_norm as wn
class nin(nn.Module):
def __init__(self, dim_in, dim_out, weight_norm=True):
super(nin, self).__init__()
if weight_norm:
self.lin_a = wn(nn.Linear(dim_in, dim_out))
else:
self.lin_a = 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.triton_helpers import libdevice
import torch.nn as ... | Warvito/lmconv | nin | false | 14,570 | [
"MIT"
] | 69 | 01adba51e3fff1e7da99324dc64a9fc9cd38621e | https://github.com/Warvito/lmconv/tree/01adba51e3fff1e7da99324dc64a9fc9cd38621e |
FeedForwardNN | # 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_... | chenjun-110/WZCQ | FeedForwardNN | false | 1,671 | [
"Apache-2.0"
] | 0 | e2de7743ad671e8632cfa084638555d7f1deb42f | https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f |
AbsModule | # 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_str... | MichaelZhero/nncase | AbsModule | false | 11,929 | [
"Apache-2.0"
] | 0 | 0fae6ce90d7adff386e1a286cd2b42422f4b850a | https://github.com/MichaelZhero/nncase/tree/0fae6ce90d7adff386e1a286cd2b42422f4b850a |
FloorModule | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | MichaelZhero/nncase | FloorModule | false | 11,934 | [
"Apache-2.0"
] | 0 | 0fae6ce90d7adff386e1a286cd2b42422f4b850a | https://github.com/MichaelZhero/nncase/tree/0fae6ce90d7adff386e1a286cd2b42422f4b850a |
EmbeddingModule | # 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... | ActiveVisionLab/LaLaLoc | EmbeddingModule | false | 16,872 | [
"MIT"
] | 5 | 21a0da94fbe7ef6cce3d34c6a5f47cc09d072f45 | https://github.com/ActiveVisionLab/LaLaLoc/tree/21a0da94fbe7ef6cce3d34c6a5f47cc09d072f45 |
BCEWithLogitsLoss | import torch
import torch as th
import torch.nn as nn
class BCEWithLogitsLoss(nn.Module):
def __init__(self, weight=None):
super().__init__()
self.loss = th.nn.BCEWithLogitsLoss(weight=weight)
def forward(self, x, target):
return self.loss(x, target)
def get_inputs():
return [t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | albanie/collaborative-experts | BCEWithLogitsLoss | false | 14,780 | [
"Apache-2.0"
] | 237 | b41defc4fb8de451809014c970ccbe518621909f | https://github.com/albanie/collaborative-experts/tree/b41defc4fb8de451809014c970ccbe518621909f |
Cell | import torch
import torch.nn as nn
class Conv(nn.Module):
def __init__(self, conv, in_channels, out_channels):
super().__init__()
self.conv_type = conv
self.relu = nn.ReLU(inplace=True)
if self.conv_type == 'conv2d':
self.conv2d = nn.Conv3d(in_channels, out_channels, 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
from torch._inductor.runtime.... | BCV-Uniandes/SAMA | Cell | false | 131 | [
"BSD-3-Clause"
] | 0 | 4c732c71486af17efed17480e363298cb65c851f | https://github.com/BCV-Uniandes/SAMA/tree/4c732c71486af17efed17480e363298cb65c851f |
minibatch_std_concat_layer | import copy
import torch
import torch.nn as nn
def mean(tensor, dim=None, keepdim=False):
if dim is None:
return torch.mean(tensor)
else:
if isinstance(dim, int):
dim = [dim]
dim = sorted(dim)
for d in dim:
tensor = tensor.mean(dim=d, keepdim=True)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | grofit/traiNNer | minibatch_std_concat_layer | false | 15,483 | [
"Apache-2.0"
] | 78 | 12d006fd44ed304e4178839c53b1f3d95ca25dcb | https://github.com/grofit/traiNNer/tree/12d006fd44ed304e4178839c53b1f3d95ca25dcb |
SpatialTransformerPooled2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from torch.nn import Parameter
assert_size_stride = torch._C._dynamo... | dattientran/attorch | SpatialTransformerPooled2d | false | 12,402 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
decoder3 | import torch
import torch.nn as nn
class decoder3(nn.Module):
def __init__(self):
super(decoder3, self).__init__()
self.reflecPad7 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv7 = nn.Conv2d(256, 128, 3, 1, 0)
self.relu7 = nn.ReLU(inplace=True)
self.unpool = nn.UpsamplingNea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | guswl8033/ARtists | decoder3 | false | 3,565 | [
"Apache-2.0"
] | 0 | d353195872c1ef1a1aa68659a32fb47779a416fc | https://github.com/guswl8033/ARtists/tree/d353195872c1ef1a1aa68659a32fb47779a416fc |
ImageLevelFeaturePooling2D | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | Dauriel/weather4cast2021 | ImageLevelFeaturePooling2D | false | 349 | [
"Apache-2.0"
] | 0 | 29e818c4bcd488ec84b51558bf5392e4a887db70 | https://github.com/Dauriel/weather4cast2021/tree/29e818c4bcd488ec84b51558bf5392e4a887db70 |
MINCNet | import torch
import torch.utils.data
import torch.nn as nn
class MINCNet(nn.Module):
def __init__(self):
super(MINCNet, self).__init__()
self.ReLU = nn.ReLU(True)
self.conv11 = nn.Conv2d(3, 64, 3, 1, 1)
self.conv12 = nn.Conv2d(64, 64, 3, 1, 1)
self.maxpool1 = nn.MaxPool2d(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | KwanWaiPang/BasicSR | MINCNet | false | 17,607 | [
"Apache-2.0"
] | 5 | b48db3f962beca806f70388be759889620257112 | https://github.com/KwanWaiPang/BasicSR/tree/b48db3f962beca806f70388be759889620257112 |
Eltwise | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
class Eltwise(nn.Module):
def __init__(self, operation='+'):
super(Eltwise, self).__init__()
self.operation = operation
def forward(self, x1, x2):
if self.operation == '+' or self.o... | 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... | Alin1102/Yolov3_Dartnet2Caffe | Eltwise | false | 7,640 | [
"MIT"
] | 21 | b4284b080f53c1ac73c1930b1b1c4e07dcd97559 | https://github.com/Alin1102/Yolov3_Dartnet2Caffe/tree/b4284b080f53c1ac73c1930b1b1c4e07dcd97559 |
LossLoglikelihoodNb | import torch
class LossLoglikelihoodNb(torch.nn.Module):
def __init__(self, average=True):
super(LossLoglikelihoodNb, self).__init__()
self.average = average
def forward(self, preds, target):
"""Implements the negative log likelihood loss as VAE reconstruction loss"""
x = tar... | 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
assert_size... | johnmous/sfaira | LossLoglikelihoodNb | false | 3,760 | [
"BSD-3-Clause"
] | 0 | c50240a74530e614ab7681bf9c63b04cb815b361 | https://github.com/johnmous/sfaira/tree/c50240a74530e614ab7681bf9c63b04cb815b361 |
TransformerEncoderLayer | import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional
from torch.nn import TransformerEncoderLayer
from torch.nn.modules.activation import MultiheadAttention
from torch.nn.init import xavier_uniform_
from torch.nn.modules.dropout import Dropout
from torc... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | Chertushkin/efficient-dl-systems | TransformerEncoderLayer | false | 9,035 | [
"MIT"
] | 0 | 9541dbbbc92f8cf58d0f14c646562e068089aad0 | https://github.com/Chertushkin/efficient-dl-systems/tree/9541dbbbc92f8cf58d0f14c646562e068089aad0 |
AttentiveStatsPooling | # 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.... | Wadaboa/titanet | AttentiveStatsPooling | false | 18,096 | [
"MIT"
] | 4 | b07e3074e79ea8c1129fb0adb8315e06bb4943ea | https://github.com/Wadaboa/titanet/tree/b07e3074e79ea8c1129fb0adb8315e06bb4943ea |
Actor | import torch
import torch.nn.functional as F
import torch.nn as nn
class Actor(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc1_units=200,
fc2_units=150):
"""Initialize parameters and build model.
Params
======
state_siz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | rafapi/PMTG | Actor | false | 10,649 | [
"Apache-2.0"
] | 0 | 8a89a3dd9620e2fdf747d20781b46daebd41569c | https://github.com/rafapi/PMTG/tree/8a89a3dd9620e2fdf747d20781b46daebd41569c |
Myloss | import torch
import torch.nn as nn
class Myloss(nn.Module):
def __init__(self, epsilon=1e-08):
super(Myloss, self).__init__()
self.epsilon = epsilon
return
def forward(self, input_, label, weight):
entropy = -label * torch.log(input_ + self.epsilon) - (1 - label
)... | 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
... | cuishuhao/HDA | Myloss | false | 15,085 | [
"Apache-2.0"
] | 58 | 1733ca74eee7839b455e9ffd7a169bc54b272745 | https://github.com/cuishuhao/HDA/tree/1733ca74eee7839b455e9ffd7a169bc54b272745 |
LayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn as nn
import torch.utils.data
assert_size_stride = torch._... | HamzaHz2/rlkit | LayerNorm | false | 5,262 | [
"MIT"
] | 1 | 55f30c2f1830693624bc5d4085ab9a1ac80b30c4 | https://github.com/HamzaHz2/rlkit/tree/55f30c2f1830693624bc5d4085ab9a1ac80b30c4 |
pixelwise_norm_layer | import torch
import torch.nn as nn
import torch.utils.data
class pixelwise_norm_layer(nn.Module):
def __init__(self):
super(pixelwise_norm_layer, self).__init__()
self.eps = 1e-08
def forward(self, x):
return x / (torch.mean(x ** 2, dim=1, keepdim=True) + self.eps) ** 0.5
def get_i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dy... | mingo-x/pggan-pytorch | pixelwise_norm_layer | false | 7,231 | [
"MIT"
] | 1 | a1dde73cd4df52476fe7c948d81fa9caea8070a5 | https://github.com/mingo-x/pggan-pytorch/tree/a1dde73cd4df52476fe7c948d81fa9caea8070a5 |
MyNet2 | import torch
from torch import nn
from torch.nn import functional as F
class MyNet2(nn.Module):
"""Very simple network made with two fully connected layers"""
def __init__(self):
super(MyNet2, self).__init__()
self.fc1 = nn.Linear(28 * 50, 128)
self.fc2 = nn.Linear(128, 1)
def fo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | LucaZampieri/DL | MyNet2 | false | 792 | [
"MIT"
] | 0 | e53ade2638ccc3ca368e15c8454845856776e719 | https://github.com/LucaZampieri/DL/tree/e53ade2638ccc3ca368e15c8454845856776e719 |
PreProcess | # 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... | UnibsMatt/NN | PreProcess | false | 2,912 | [
"MIT"
] | 0 | 25eaddc079cd08227a52fdebd95453473fcd3b29 | https://github.com/UnibsMatt/NN/tree/25eaddc079cd08227a52fdebd95453473fcd3b29 |
HingeMarginLoss | # 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... | Cuiqingyao/multilabel | HingeMarginLoss | false | 8,906 | [
"Apache-2.0"
] | 0 | f36dc6f1168a3edf8f43565477c096dc0bf31de8 | https://github.com/Cuiqingyao/multilabel/tree/f36dc6f1168a3edf8f43565477c096dc0bf31de8 |
_D3Shape_loss | import torch
import torch.nn as nn
class _D3Shape_loss(nn.Module):
def __init__(self, cp=0.2, cn=10):
super(_D3Shape_loss, self).__init__()
self.alpha = 1 / cp
self.beta = cn
self.gamma = -2.77 / cn
def _d(self, feat1, feat2):
return torch.sum(torch.abs(feat1 - feat2)... | 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... | Jiangtong-Li/ZHSIR | _D3Shape_loss | false | 17,498 | [
"Apache-2.0"
] | 8 | fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 | https://github.com/Jiangtong-Li/ZHSIR/tree/fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 |
Reverse | import torch
class Reverse(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, audio):
return torch.flip(audio, dims=[1])
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | h0ngwen/torchaudio-augmentations | Reverse | false | 6,773 | [
"MIT"
] | 1 | d044f9d020e12032ab9280acf5f34a337e72d212 | https://github.com/h0ngwen/torchaudio-augmentations/tree/d044f9d020e12032ab9280acf5f34a337e72d212 |
ActorNetwork | # 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_... | PuzeLiu/mushroom-rl | ActorNetwork | false | 14,248 | [
"MIT"
] | 344 | 99942b425e66b4ddcc26009d7105dde23841e95d | https://github.com/PuzeLiu/mushroom-rl/tree/99942b425e66b4ddcc26009d7105dde23841e95d |
ResizeModule | # 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... | mirecta/nncase | ResizeModule | false | 4,181 | [
"Apache-2.0"
] | 0 | d2efa59677a26f4259b3b6a5b6ec05ea16d4e40c | https://github.com/mirecta/nncase/tree/d2efa59677a26f4259b3b6a5b6ec05ea16d4e40c |
MIoU | import torch
import torch.nn as nn
class MIoU(nn.Module):
"""
This class implements the mean IoU for validation. Not gradients supported.
"""
def __init__(self, threshold: 'float'=0.5) ->None:
"""
Constructor method
:param threshold: (float) Threshold to be applied
"""... | 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... | ChristophReich1996/Cell-DETR | MIoU | false | 13,497 | [
"MIT"
] | 55 | 4d0c3a2d3ffd19184c8443e5b3a6dccc053c77ea | https://github.com/ChristophReich1996/Cell-DETR/tree/4d0c3a2d3ffd19184c8443e5b3a6dccc053c77ea |
GramMatrix | import torch
import torch.nn as nn
class GramMatrix(nn.Module):
def forward(self, y):
b, ch, h, w = y.size()
features = y.view(b, ch, w * h)
features_t = features.transpose(1, 2)
gram = features.bmm(features_t) / (ch * h * w)
return gram
def get_inputs():
return [tor... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | IvoryCandy/neural-style | GramMatrix | false | 5,360 | [
"Apache-2.0"
] | 1 | d9d73676479e36c1cbd6c9af36d857f80099504b | https://github.com/IvoryCandy/neural-style/tree/d9d73676479e36c1cbd6c9af36d857f80099504b |
Swish | # 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
import torch.distributed
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | anidnerocram/PointFlow | Swish | false | 14,858 | [
"MIT"
] | 539 | b9f82a5534fad830c99ba0a30f4f3320626f64f4 | https://github.com/anidnerocram/PointFlow/tree/b9f82a5534fad830c99ba0a30f4f3320626f64f4 |
HearthstoneNet | import torch
from torch import nn
import torch.nn.functional as F
class HearthstoneNet(nn.Module):
def __init__(self):
super(HearthstoneNet, self).__init__()
self.conv1 = nn.Conv2d(1, 64, kernel_size=(3, 3), padding=1)
self.conv2 = nn.Conv2d(64, 64, kernel_size=(3, 3), padding=1)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | dianarvp/stone_ground_hearth_battles | HearthstoneNet | false | 1,844 | [
"Apache-2.0"
] | 0 | 450e70eaef21b543be579a6d696676fb148a99b0 | https://github.com/dianarvp/stone_ground_hearth_battles/tree/450e70eaef21b543be579a6d696676fb148a99b0 |
L2N | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
import torch.autograd
assert_size_stride = torch._C._dynam... | bestfitting/instance_level_recognition | L2N | false | 14,942 | [
"Apache-2.0"
] | 103 | 683f021b4e65876835f028797ec28b0d1071bb45 | https://github.com/bestfitting/instance_level_recognition/tree/683f021b4e65876835f028797ec28b0d1071bb45 |
iCaRL_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 import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert... | mao-example/End-to-End-Incremental-Learning | iCaRL_loss | false | 16,003 | [
"MIT"
] | 53 | 39d6f4e594e805a713aa7a1deedbcb03d1f2c9cc | https://github.com/mao-example/End-to-End-Incremental-Learning/tree/39d6f4e594e805a713aa7a1deedbcb03d1f2c9cc |
SuperpointDecoder | import torch
import torch.nn as nn
class SuperpointDecoder(nn.Module):
""" Junction decoder based on the SuperPoint architecture. """
def __init__(self, input_feat_dim=128, backbone_name='lcnn'):
super(SuperpointDecoder, self).__init__()
self.relu = torch.nn.ReLU(inplace=True)
if back... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | wx-b/SOLD2 | SuperpointDecoder | false | 16,746 | [
"MIT"
] | 347 | 71c3243f9d3a695788d0a6bfd134b9849425900a | https://github.com/wx-b/SOLD2/tree/71c3243f9d3a695788d0a6bfd134b9849425900a |
QNet | # 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 ... | SunlightWarrior/q_learning | QNet | false | 9,513 | [
"MIT"
] | 0 | 3c5f0c700fbe84ca4859165513123f404c44937f | https://github.com/SunlightWarrior/q_learning/tree/3c5f0c700fbe84ca4859165513123f404c44937f |
BCEWithLogitsWithClassWeightLoss | # 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 ... | DeepPSP/torch_ecg | BCEWithLogitsWithClassWeightLoss | false | 17,203 | [
"MIT"
] | 9 | 6db5ffb063d0e8fb4ce97029a0d184a658f43a37 | https://github.com/DeepPSP/torch_ecg/tree/6db5ffb063d0e8fb4ce97029a0d184a658f43a37 |
ResnetDecoder | import torch
import torch.nn as nn
class ResnetDecoder(nn.Module):
"""
This class represents the tail of ResNet. It performs a global pooling and maps the output to the
correct class by using a fully connected layer.
"""
def __init__(self, in_features, n_classes):
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
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | SeffyVon/ECG_MICResNet | ResnetDecoder | false | 17,904 | [
"BSD-3-Clause"
] | 5 | 8c6a319b5822ddfb130738eb1d9cdc3c21b24209 | https://github.com/SeffyVon/ECG_MICResNet/tree/8c6a319b5822ddfb130738eb1d9cdc3c21b24209 |
CustomBatchNormManualModule | import torch
import torch.nn as nn
class CustomBatchNormManualFunction(torch.autograd.Function):
"""
This torch.autograd.Function implements a functional custom version of the batch norm operation for MLPs.
Using torch.autograd.Function allows you to write a custom backward function.
The function will... | 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_... | davide-belli/deep-learning-labs | CustomBatchNormManualModule | false | 1,799 | [
"MIT"
] | 0 | 1acd37a527711dccdc00c1935724cc5de7c10955 | https://github.com/davide-belli/deep-learning-labs/tree/1acd37a527711dccdc00c1935724cc5de7c10955 |
PositionwiseFeedForward | import math
import torch
from torch import nn
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class PositionwiseFeedForward(nn.Module):
""" A two-layer Feed-Forward-Network with residual layer norm.
Args:
d_model (int): the 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 math
from to... | clairett/fast-bert | PositionwiseFeedForward | false | 15,041 | [
"Apache-2.0"
] | 1,542 | 506771b930aa70e7ca2852e5e8ebb14656d97bfa | https://github.com/clairett/fast-bert/tree/506771b930aa70e7ca2852e5e8ebb14656d97bfa |
BCEWithLogitsLoss | import torch
from torch import nn as nn
from torch.utils import data as data
from torch import autograd as autograd
import torch.onnx
class BCEWithLogitsLoss(nn.Module):
def __init__(self, loss_weight=1.0, **kwargs):
super(BCEWithLogitsLoss, self).__init__()
self.bce_wlogits_loss = nn.BCEWithLogi... | 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 ... | theleokul/Real-ESRGAN | BCEWithLogitsLoss | false | 4,419 | [
"BSD-3-Clause"
] | 0 | 0afbc090d012d729e6cb3ff47a80018d53bce3f6 | https://github.com/theleokul/Real-ESRGAN/tree/0afbc090d012d729e6cb3ff47a80018d53bce3f6 |
ReduceMeanModule | import torch
class ReduceMeanModule(torch.nn.Module):
def __init__(self):
super(ReduceMeanModule, self).__init__()
def forward(self, x):
return torch.mean(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | mirecta/nncase | ReduceMeanModule | false | 4,178 | [
"Apache-2.0"
] | 0 | d2efa59677a26f4259b3b6a5b6ec05ea16d4e40c | https://github.com/mirecta/nncase/tree/d2efa59677a26f4259b3b6a5b6ec05ea16d4e40c |
IOUloss | # 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... | JJLimmm/YOLOx | IOUloss | false | 9,316 | [
"Apache-2.0"
] | 0 | 85fdb819be84dfec3a8306cb74872a1c0ef28e3e | https://github.com/JJLimmm/YOLOx/tree/85fdb819be84dfec3a8306cb74872a1c0ef28e3e |
LayerNorm | import torch
from torch import nn
from typing import *
class LayerNorm(nn.Module):
"""Normalize by channels, height and width for images."""
__constants__ = ['eps']
def __init__(self, eps):
super().__init__()
self.eps = eps
self.gamma = nn.Parameter(torch.ones(1))
self.bet... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
from typing import *
assert_size_stride = torch._C._dynamo... | ImadDabbura/fastai-courses | LayerNorm | false | 17,433 | [
"Apache-2.0"
] | 3 | 053637a2dd3b4ad6c35f97a13f3fba87af1d3940 | https://github.com/ImadDabbura/fastai-courses/tree/053637a2dd3b4ad6c35f97a13f3fba87af1d3940 |
PIENet | # 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.... | CLT29/pvse | PIENet | false | 13,471 | [
"MIT"
] | 119 | bf5232148396ee5051564ef68a48538de0ddbc84 | https://github.com/CLT29/pvse/tree/bf5232148396ee5051564ef68a48538de0ddbc84 |
CNN | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNN(nn.Module):
"""
Convolutional Neural Network.
"""
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 20, kernel_size=5, stride=1)
self.fc1 = nn.Linear(8 * 8 * 20, 64)
self.fc2 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | EricZLou/Ax | CNN | false | 9,023 | [
"MIT"
] | 0 | 3f8fc6f4a055e93cb69fda3799be41ee9572ef02 | https://github.com/EricZLou/Ax/tree/3f8fc6f4a055e93cb69fda3799be41ee9572ef02 |
ProposalNet | import torch
from torch import nn
import torch.utils.data
class ProposalNet(nn.Module):
def __init__(self):
super(ProposalNet, self).__init__()
self.down1 = nn.Conv2d(2048, 128, 3, 1, 1)
self.down2 = nn.Conv2d(128, 128, 3, 2, 1)
self.down3 = nn.Conv2d(128, 128, 3, 2, 1)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | mobulan/NTS-Net | ProposalNet | false | 10,704 | [
"MIT"
] | 0 | 9246c33b9e9aed2514f53fd0aef48c8ed3eb91d3 | https://github.com/mobulan/NTS-Net/tree/9246c33b9e9aed2514f53fd0aef48c8ed3eb91d3 |
NormScaleFeature | import torch
from torch import nn
class NormScaleFeature(nn.Module):
def __init__(self, init_value=1):
super().__init__()
self.scale = nn.Parameter(torch.FloatTensor([init_value]))
def forward(self, input):
magnitudes = 1e-06 + torch.sqrt(torch.sum(input ** 2, axis=1,
kee... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | uncbiag/FeatureMapICON | NormScaleFeature | false | 10,874 | [
"Apache-2.0"
] | 0 | 04160d0ce4e8f7615e1c59a1be5c6b8340b5b6e5 | https://github.com/uncbiag/FeatureMapICON/tree/04160d0ce4e8f7615e1c59a1be5c6b8340b5b6e5 |
Asym_ReLU_Block | import torch
from torch import nn
class Asym_ReLU_Block(nn.Module):
def __init__(self):
super(Asym_ReLU_Block, self).__init__()
self.conv1 = nn.Conv2d(in_channels=64, out_channels=64, kernel_size
=(3, 1), stride=1, padding=(1, 0), bias=False)
self.conv2 = nn.Conv2d(in_channels... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | HwangToeMat/Asym_VDSR | Asym_ReLU_Block | false | 17,412 | [
"MIT"
] | 4 | 598200f745434fc6e1bb46b6da7d6cf7b0fdaa50 | https://github.com/HwangToeMat/Asym_VDSR/tree/598200f745434fc6e1bb46b6da7d6cf7b0fdaa50 |
TokenMixer | # 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.fun... | Misuzu-Kurenai/mlp-singer | TokenMixer | false | 856 | [
"MIT"
] | 0 | 416451045bb9b3965aaf496e84a8b45332a6ba59 | https://github.com/Misuzu-Kurenai/mlp-singer/tree/416451045bb9b3965aaf496e84a8b45332a6ba59 |
LabelSmoothingLoss | # 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
... | jordiae/DeepLearning-MAI | LabelSmoothingLoss | false | 6,982 | [
"MIT"
] | 1 | e12b6975d8de6cbe89f812bf691a7f7e95213552 | https://github.com/jordiae/DeepLearning-MAI/tree/e12b6975d8de6cbe89f812bf691a7f7e95213552 |
BinaryActivation | # 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.utils
import torch.utils.data.distributed
assert_size_stride = torch._C._dynamo.guards.assert_size_stride... | CQUlearningsystemgroup/LearningToBinarize | BinaryActivation | false | 4,937 | [
"MIT"
] | 1 | 1ecad897145af65ff52323bf2ec64a2154dc87d6 | https://github.com/CQUlearningsystemgroup/LearningToBinarize/tree/1ecad897145af65ff52323bf2ec64a2154dc87d6 |
AvgPoolPad | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | BigFishMaster/tnt | AvgPoolPad | false | 17,158 | [
"BSD-3-Clause"
] | 3 | 8b80bb3b194eb87ac18924428ef0924c2fb263c5 | https://github.com/BigFishMaster/tnt/tree/8b80bb3b194eb87ac18924428ef0924c2fb263c5 |
PolicyNet | # 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.... | ChangQingAAS/Deep-Reinforcement-Learning | PolicyNet | false | 624 | [
"MIT"
] | 0 | 3bc1381c632b1730a48e63e972aea62086c4287c | https://github.com/ChangQingAAS/Deep-Reinforcement-Learning/tree/3bc1381c632b1730a48e63e972aea62086c4287c |
NN | import torch
import torch.nn as nn
class NN(nn.Module):
def __init__(self, input, hidden, output):
super(NN, self).__init__()
self.lin1 = nn.Linear(input, hidden)
self.lin2 = nn.Linear(hidden, output)
def forward(self, X):
out = torch.sigmoid(self.lin1(X))
out = torch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | AqibJavaid899/PyTorch_Models | NN | false | 11,208 | [
"MIT"
] | 0 | cf81f6ef5d81aed76dca3f1a15be1a308b5d450f | https://github.com/AqibJavaid899/PyTorch_Models/tree/cf81f6ef5d81aed76dca3f1a15be1a308b5d450f |
BackboneModel1 | # 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.parallel
import torch.optim
import torch.u... | Johnsonms/NNI_master | BackboneModel1 | false | 11,590 | [
"MIT"
] | 0 | e5e5c7aed89cf3189cffe1056464833c15eb54ff | https://github.com/Johnsonms/NNI_master/tree/e5e5c7aed89cf3189cffe1056464833c15eb54ff |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.