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 |
|---|---|---|---|---|---|---|---|---|---|---|
ModelNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from to... | AswinRetnakumar/Machina | ModelNet | false | 13,334 | [
"MIT"
] | 302 | 6519935ca4553192ac99fc1c7c1e7cab9dd72693 | https://github.com/AswinRetnakumar/Machina/tree/6519935ca4553192ac99fc1c7c1e7cab9dd72693 |
SimpleStackModel | import torch
import torch.onnx
import torch.nn
class SimpleStackModel(torch.nn.Module):
def __init__(self):
super(SimpleStackModel, self).__init__()
def forward(self, a, b):
c = torch.stack((a, b), 0)
d = torch.stack((c, c), 1)
return torch.stack((d, d), 2)
def get_inputs()... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | mlupon/glow | SimpleStackModel | false | 4,018 | [
"Apache-2.0"
] | 0 | aedaa7b98617f1a2db651608e7f7c916a7d2c766 | https://github.com/mlupon/glow/tree/aedaa7b98617f1a2db651608e7f7c916a7d2c766 |
CrossEntropyLoss | # 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.utils.cpp... | ParthaEth/PyTorch-StudioGAN | CrossEntropyLoss | false | 1,887 | [
"MIT"
] | 0 | 16dd84415e4b7f4667cb1b1e0ef3fc04edf6b5a9 | https://github.com/ParthaEth/PyTorch-StudioGAN/tree/16dd84415e4b7f4667cb1b1e0ef3fc04edf6b5a9 |
RMSELoss | # 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... | PARMAGroup/UNet-Instance-Cell-Segmentation | RMSELoss | false | 8,626 | [
"MIT"
] | 30 | 79655a2c5781d2e20c7d5760f631fbb0be392292 | https://github.com/PARMAGroup/UNet-Instance-Cell-Segmentation/tree/79655a2c5781d2e20c7d5760f631fbb0be392292 |
ContrastiveDistanceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn.modules.loss import *
import torch.nn as nn
from torch.nn import *
from tor... | pokidyshev/catalyst | ContrastiveDistanceLoss | false | 16,263 | [
"Apache-2.0"
] | 46 | bfe2cc2af7b02bd954fb0b4a0cae8b350f56789a | https://github.com/pokidyshev/catalyst/tree/bfe2cc2af7b02bd954fb0b4a0cae8b350f56789a |
HSwish | # 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... | UniSerj/ai-research | HSwish | false | 14,527 | [
"Apache-2.0"
] | 46 | 79f0093c93408cc5dd7d3f56aafd7dc1f901421c | https://github.com/UniSerj/ai-research/tree/79f0093c93408cc5dd7d3f56aafd7dc1f901421c |
FactorTransfer | import torch
from torch import nn
import torch.nn.functional as F
class FactorTransfer(nn.Module):
"""Paraphrasing Complex Network: Network Compression via Factor Transfer, NeurIPS 2018"""
def __init__(self, p1=2, p2=1):
super(FactorTransfer, self).__init__()
self.p1 = p1
self.p2 = p2... | 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 ... | bobo0810/RepDistiller | FactorTransfer | false | 10,154 | [
"BSD-2-Clause"
] | 0 | 0a4cea2142221b9b31c8e995920273f5619b37f8 | https://github.com/bobo0810/RepDistiller/tree/0a4cea2142221b9b31c8e995920273f5619b37f8 |
Gate | import torch
import torch.nn as nn
import torch.nn.functional as F
class Gate(nn.Module):
"""Gate Unit
g = sigmoid(Wx)
x = g * x
"""
def __init__(self, input_size):
super(Gate, self).__init__()
self.linear = nn.Linear(input_size, input_size, bias=False)
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | hansd410/mnemonic | Gate | false | 3,567 | [
"BSD-3-Clause"
] | 0 | 409508d08da7f5d5940ffb56fd9715e6ef1e68a3 | https://github.com/hansd410/mnemonic/tree/409508d08da7f5d5940ffb56fd9715e6ef1e68a3 |
HadamardProduct | import torch
import torch.nn as nn
class HadamardProduct(nn.Module):
def __init__(self, shape):
super(HadamardProduct, self).__init__()
self.weights = nn.Parameter(torch.rand(shape))
def forward(self, x):
return x * self.weights
def get_inputs():
return [torch.rand([4, 4, 4, 4]... | 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... | KimUyen/LSTM-BCI-Decoder | HadamardProduct | false | 8,395 | [
"MIT"
] | 38 | c7b4bd108335a4d6c7d99c00c263346026186b0b | https://github.com/KimUyen/LSTM-BCI-Decoder/tree/c7b4bd108335a4d6c7d99c00c263346026186b0b |
MAB | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
class MAB(nn.Module):
def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False):
super(MAB, self).__init__()
self.dim_V = dim_V
self.num_heads = num_heads
self.fc_q = nn.Linear(dim_Q, dim_V)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | AntonValk/BagGraph-Graph-MIL | MAB | false | 16,951 | [
"MIT"
] | 8 | 1447b52b32995cf6c71e731dd1261104cd66ced0 | https://github.com/AntonValk/BagGraph-Graph-MIL/tree/1447b52b32995cf6c71e731dd1261104cd66ced0 |
NetEnd | # 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.... | EadCat/Road-Extraction | NetEnd | false | 17,238 | [
"MIT"
] | 4 | 9d4831b6c3a5ef07676cbe1c79b03045fda427ea | https://github.com/EadCat/Road-Extraction/tree/9d4831b6c3a5ef07676cbe1c79b03045fda427ea |
ResBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
class conv_relu(nn.Module):
"""docstring for conv_relu"""
def __init__(self, in_channels, out_channels, **kwargs):
super(conv_relu, self).__init__()
self.conv = nn.Conv2d(in_channels, out_chan... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | llpspark/PytorchToCaffe | ResBlock | false | 10,456 | [
"MIT"
] | 0 | 01f6fb2cfd42e2c06ae5d46a7a91f7fd6d40d5d1 | https://github.com/llpspark/PytorchToCaffe/tree/01f6fb2cfd42e2c06ae5d46a7a91f7fd6d40d5d1 |
LinearZeros | # 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.... | ShreyDixit/glow-pytorch | LinearZeros | false | 9,447 | [
"MIT"
] | 0 | a964ba181898183c41f6ec6122a71b925ac33efa | https://github.com/ShreyDixit/glow-pytorch/tree/a964ba181898183c41f6ec6122a71b925ac33efa |
MultiHeadAttention | import math
import torch
from torch import nn
from torch.nn import functional as F
import torch.utils.data
class MultiHeadAttention(nn.Module):
def __init__(self, channels, out_channels, n_heads, p_dropout=0.0,
window_size=None, heads_share=True, block_length=None,
proximal_bias=False, proximal_i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | dimitrijejankov/vits | MultiHeadAttention | false | 3,426 | [
"MIT"
] | 0 | d2f6385c7946c2355433804796b541ffae0a3d9f | https://github.com/dimitrijejankov/vits/tree/d2f6385c7946c2355433804796b541ffae0a3d9f |
Conv2dDynamicSamePadding | # 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._C
import torch.serialization
assert_size_str... | AlexanderDokuchaev/mmsegmentation | Conv2dDynamicSamePadding | false | 11,172 | [
"Apache-2.0"
] | 0 | 0c443ee370cce6227661b802184072174c4e3f64 | https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64 |
BasicModel4_MultiArgs | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicModel4_MultiArgs(nn.Module):
"""
Slightly modified example model from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1 - 1) - ReLU(x2) / x3)
"""
def __init__(self):
super()... | 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... | ngduduong/captum | BasicModel4_MultiArgs | false | 4,067 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 |
KeyValueAttention | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data
import torch.nn.init
class KeyValueAttention(nn.Module):
def __init__(self, query_size, key_size, value_size, hid_size, init_range):
super(KeyValueAttention, self).__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ChrisGeishauser/ConvLab-2 | KeyValueAttention | false | 2,258 | [
"Apache-2.0"
] | 0 | 8f55d033c6e2453fdc092c4f504be3973a55e7ea | https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea |
RobertaClassificationHead | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from ty... | NivekT/text | RobertaClassificationHead | false | 11,764 | [
"BSD-3-Clause"
] | 0 | 4908d3c88f92296a4c23be2f064ccde13cce50ce | https://github.com/NivekT/text/tree/4908d3c88f92296a4c23be2f064ccde13cce50ce |
SoftmaxAllocator | # 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
assert_size_stride = t... | vishalbelsare/deepdow | SoftmaxAllocator | false | 16,672 | [
"Apache-2.0"
] | 511 | cbb99347fba9a447d4fcae64fe5137c203643e44 | https://github.com/vishalbelsare/deepdow/tree/cbb99347fba9a447d4fcae64fe5137c203643e44 |
ATOCAttentionUnit | # 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 ... | Weiyuhong-1998/DI-engine | ATOCAttentionUnit | false | 14,580 | [
"Apache-2.0"
] | 464 | 88658ea358298c6e61e95a454284b8853a3e9484 | https://github.com/Weiyuhong-1998/DI-engine/tree/88658ea358298c6e61e95a454284b8853a3e9484 |
Swish | # 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... | brandstetter-johannes/ocp | Swish | false | 9,963 | [
"MIT",
"BSD-3-Clause"
] | 0 | 69cc90e6bed8aa09222cd77b926d7a34e96302ed | https://github.com/brandstetter-johannes/ocp/tree/69cc90e6bed8aa09222cd77b926d7a34e96302ed |
ValueNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
class ValueNetwork(nn.Module):
def __init__(self):
super(ValueNetwork, self).__init__()
self.fc1 = nn.Linear(4, 256)
self.fc2 = nn.Linear(256, 256)
self.fc3 = nn.Linear(256, 1)
def forward(self, x):
x ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | DensoITLab/spinningup_in_pytorch | ValueNetwork | false | 7,962 | [
"MIT"
] | 11 | 612d8c4c6593c8c5ecb5a939bf43085daac9e552 | https://github.com/DensoITLab/spinningup_in_pytorch/tree/612d8c4c6593c8c5ecb5a939bf43085daac9e552 |
_D3Shape_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
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 |
SmallDecoder5_16x | import torch
import torch.nn as nn
class SmallDecoder5_16x(nn.Module):
def __init__(self, model=None, fixed=False):
super(SmallDecoder5_16x, self).__init__()
self.fixed = fixed
self.conv51 = nn.Conv2d(128, 128, 3, 1, 0)
self.conv44 = nn.Conv2d(128, 128, 3, 1, 0)
self.conv4... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | MingSun-Tse/Collaborative-Distillation | SmallDecoder5_16x | false | 14,072 | [
"MIT"
] | 172 | 915712674af82ff91d926d922c14988cce0430f3 | https://github.com/MingSun-Tse/Collaborative-Distillation/tree/915712674af82ff91d926d922c14988cce0430f3 |
ContrastiveLoss | import torch
import torch.nn.functional as F
class ContrastiveLoss(torch.nn.Module):
def __init__(self, margin=2.0):
super(ContrastiveLoss, self).__init__()
self.margin = margin
def forward(self, output1, output2, label):
euclidean_distance = F.pairwise_distance(output1, output2)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._... | WLYLab/PepFormer | ContrastiveLoss | false | 18,056 | [
"MIT"
] | 6 | 9bac4544dc88bcd66e975a6714a264dcc9c55304 | https://github.com/WLYLab/PepFormer/tree/9bac4544dc88bcd66e975a6714a264dcc9c55304 |
KL_Triplet_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, math as tl_math
import torc... | WorksApplications/omni_torch | KL_Triplet_Loss | false | 1,232 | [
"Apache-2.0"
] | 0 | 10b689d794c8f485e38c765303ef018da17bc641 | https://github.com/WorksApplications/omni_torch/tree/10b689d794c8f485e38c765303ef018da17bc641 |
TransformerEncoderLayerWithConv1d | import torch
import torch.nn as nn
import torch.nn.functional as F
class TransformerEncoderLayerWithConv1d(nn.Module):
"""
Input and output shape: seqlen x batch_size x dim
"""
def __init__(self, dim_model, nheads, dim_feedforward, dropout,
kernel_size, stride):
super(TransformerEnc... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | jzlianglu/pykaldi2 | TransformerEncoderLayerWithConv1d | false | 15,831 | [
"MIT"
] | 179 | 4d31968f8dff7cccf6a8395b7e69005ae3b2b30a | https://github.com/jzlianglu/pykaldi2/tree/4d31968f8dff7cccf6a8395b7e69005ae3b2b30a |
MonotonicMax | # 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... | tiwalayo/monotonic-mlp | MonotonicMax | false | 10,863 | [
"MIT"
] | 0 | 2f519797a753f7f297fac1365125c6da79f7b890 | https://github.com/tiwalayo/monotonic-mlp/tree/2f519797a753f7f297fac1365125c6da79f7b890 |
Div | import torch
import torch.nn as nn
class Div(nn.Module):
def __init__(self):
super(Div, self).__init__()
def forward(self, x):
x = torch.div(x, 0.5)
return 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | yifanpu001/PytorchToCaffe | Div | false | 4,707 | [
"MIT"
] | 0 | 37c1ebfc3547e93b1c174721036d03c831c60e48 | https://github.com/yifanpu001/PytorchToCaffe/tree/37c1ebfc3547e93b1c174721036d03c831c60e48 |
PSNRLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
from t... | connorlee77/kornia | PSNRLoss | false | 6,472 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f |
QNetwork | import torch
import torch.nn.functional as F
import torch.nn as nn
class QNetwork(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc1_units=1024,
fc2_units=512):
"""Initialize parameters and build model.
Params
======
state... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | SagarRathod-TomTom/Navigation-Deep-Reinforcement-Learning-Nanodegree | QNetwork | false | 9,426 | [
"MIT"
] | 0 | a13597d5077785bd486d8ce528dc177685226b1c | https://github.com/SagarRathod-TomTom/Navigation-Deep-Reinforcement-Learning-Nanodegree/tree/a13597d5077785bd486d8ce528dc177685226b1c |
VDSR | # 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_... | MingSun-Tse/pytorch-vdsr | VDSR | false | 5,606 | [
"MIT"
] | 1 | 597bacb4ec7385c8cc6cdf91e26e64ef2e6808b7 | https://github.com/MingSun-Tse/pytorch-vdsr/tree/597bacb4ec7385c8cc6cdf91e26e64ef2e6808b7 |
MemoryEfficientSwish | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class SwishImplementation(torch.autograd.Function):
@staticmethod
def forward(ctx, i):
result = i * torch.sigmoid(i)
ctx.save_for_backward(i)
retu... | 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
import torch.utils.data.distributed
assert_size_st... | BradleyBrown19/CustomObjectDetector | MemoryEfficientSwish | false | 2,078 | [
"Apache-2.0"
] | 0 | 11c14ec6127c553ac365703c768b75dde33d9a4d | https://github.com/BradleyBrown19/CustomObjectDetector/tree/11c14ec6127c553ac365703c768b75dde33d9a4d |
VNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from to... | ven-kyoshiro/PILCO-1 | VNet | false | 10,960 | [
"MIT"
] | 0 | 61c4ef18a6bbecbeb6a10784a7925d31f46dd23b | https://github.com/ven-kyoshiro/PILCO-1/tree/61c4ef18a6bbecbeb6a10784a7925d31f46dd23b |
Sparsemax | import torch
import torch.multiprocessing
import torch.nn as nn
class Sparsemax(nn.Module):
"""Sparsemax function."""
def __init__(self, dim=None):
"""Initialize sparsemax activation
Args:
dim (int, optional): The dimension over which to apply the sparsemax function.
... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.multiprocessing
import torch.nn as nn
assert_size_s... | ai4ce/DiscoNet | Sparsemax | false | 14,763 | [
"MIT"
] | 80 | 44b57faac3c5be289d33cbbab12b300e3ac767b0 | https://github.com/ai4ce/DiscoNet/tree/44b57faac3c5be289d33cbbab12b300e3ac767b0 |
MSELoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class MSELoss(nn.Module):
"""MSE loss for coordinate regression."""
def __init__(self, use_target_weight=False, loss_weight=1.0):
super().__init__()
self.criterion = F.mse_loss
self.use_target_weight = use_target_weigh... | 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.nn.functional as F
assert_size_stride = torch._C._dyna... | ALISCIFP/mmpose | MSELoss | false | 2,049 | [
"Apache-2.0"
] | 0 | 2433e3dbcc44baa2253e2a7c748ba0216937933e | https://github.com/ALISCIFP/mmpose/tree/2433e3dbcc44baa2253e2a7c748ba0216937933e |
ConvBlock | # 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, math as tl_math
im... | RaresAmbrus/KP3D | ConvBlock | false | 14,272 | [
"MIT"
] | 227 | 7966c66679d32b81ea6e3181847ab3146e5a3ed2 | https://github.com/RaresAmbrus/KP3D/tree/7966c66679d32b81ea6e3181847ab3146e5a3ed2 |
VGG11 | # 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 ... | FujitsuLaboratories/CAC | VGG11 | false | 17,328 | [
"Apache-2.0"
] | 8 | d12df8e47f61eaf7d7b0ed355e2d1aa296453f86 | https://github.com/FujitsuLaboratories/CAC/tree/d12df8e47f61eaf7d7b0ed355e2d1aa296453f86 |
IoUnionLoss | import torch
from torch import nn
class IoUnionLoss(nn.Module):
"""
Intersection over Union loss function
Args:
alpha (default: int=10): Coefficient in exp of sigmoid function
smooth (default: int=1): To prevent zero in nominator
"""
def __init__(self, alpha=10, 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 math as tl_math
from torch import nn
a... | akanametov/pathgan | IoUnionLoss | false | 18,300 | [
"MIT"
] | 8 | d93464a9c2490532afdf7bbc0f60decdf2d0767d | https://github.com/akanametov/pathgan/tree/d93464a9c2490532afdf7bbc0f60decdf2d0767d |
UpsampleConvLayer | import torch
import torch.onnx
class UpsampleConvLayer(torch.nn.Module):
"""UpsampleConvLayer
Upsamples the input and then does a convolution. This method gives better results
compared to ConvTranspose2d.
ref: http://distill.pub/2016/deconv-checkerboard/
"""
def __init__(self, in_channels, ou... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Ali-ry/azureml-examples | UpsampleConvLayer | false | 1,957 | [
"MIT"
] | 0 | 817ae89d2766dcafd70937a22cb3a80f100a2906 | https://github.com/Ali-ry/azureml-examples/tree/817ae89d2766dcafd70937a22cb3a80f100a2906 |
BertMultiPairPooler | # 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 ... | doduo-anonymous/doduo-submission | BertMultiPairPooler | false | 10,027 | [
"Apache-2.0"
] | 0 | 34d397c14174d64e6a3026d51cc25560a4f1e29f | https://github.com/doduo-anonymous/doduo-submission/tree/34d397c14174d64e6a3026d51cc25560a4f1e29f |
LR | # 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.... | Ottovonxu/islide | LR | false | 2,707 | [
"Apache-2.0"
] | 0 | 5ee9954e378f0b5a0722292351cb3cc74b95c1b3 | https://github.com/Ottovonxu/islide/tree/5ee9954e378f0b5a0722292351cb3cc74b95c1b3 |
SC | # 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_... | Willamjie/CCWH | SC | false | 9,643 | [
"MIT"
] | 0 | 5217d76f8d112a17b2e00775b812387ab71ce798 | https://github.com/Willamjie/CCWH/tree/5217d76f8d112a17b2e00775b812387ab71ce798 |
DynamicWeights | import torch
import torch.utils.data
from torch import nn
class DynamicWeights(nn.Module):
def __init__(self, channels):
super(DynamicWeights, self).__init__()
self.cata = nn.Conv2d(channels, 9, 3, padding=1, bias=False)
self.softmax = nn.Softmax(dim=-1)
self.unfold1 = nn.Unfold(k... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | lzrobots/dgmn | DynamicWeights | false | 15,983 | [
"MIT"
] | 54 | 515476b5c6a07dcc3b7a4d2243c541377624bb33 | https://github.com/lzrobots/dgmn/tree/515476b5c6a07dcc3b7a4d2243c541377624bb33 |
WeightedBDiceLoss | import torch
import torch.nn as nn
def centercrop(image, w, h):
_nt, _ct, ht, wt = image.size()
padw, padh = (wt - w) // 2, (ht - h) // 2
if padw > 0 and padh > 0:
image = image[:, :, padh:-padh, padw:-padw]
return image
class WeightedBDiceLoss(nn.Module):
def __init__(self):
su... | 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... | CarlosPena00/pytorch-unet | WeightedBDiceLoss | false | 201 | [
"MIT"
] | 0 | 8365bace23e4b04b9c5b75cd6720807ea8cac5ab | https://github.com/CarlosPena00/pytorch-unet/tree/8365bace23e4b04b9c5b75cd6720807ea8cac5ab |
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... | VedPatwardhan/ivy | TorchModule | false | 5,935 | [
"Apache-2.0"
] | 1 | 7b2105fa8cf38879444a1029bfaa7f0b2f27717a | https://github.com/VedPatwardhan/ivy/tree/7b2105fa8cf38879444a1029bfaa7f0b2f27717a |
ExampleTorchModule | import torch
class ExampleTorchModule(torch.nn.Module):
def __init__(self):
super(ExampleTorchModule, self).__init__()
def forward(self, input):
residual = 10 - input
return residual
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... | abhigoudar/ceres_python_bindings | ExampleTorchModule | false | 14,730 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 86 | 2106d043bce37adcfef450dd23d3005480948c37 | https://github.com/abhigoudar/ceres_python_bindings/tree/2106d043bce37adcfef450dd23d3005480948c37 |
ContextAttentionLayer | import torch
from collections import OrderedDict
import torch.nn as nn
class Squeeze(nn.Module):
"""Squeeze wrapper for nn.Sequential."""
def forward(self, data):
return torch.squeeze(data)
class Temperature(nn.Module):
"""Temperature wrapper for nn.Sequential."""
def __init__(self, temper... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | PaccMann/paccmann_predictor | ContextAttentionLayer | false | 8,691 | [
"MIT"
] | 19 | 58071311310c45c1efabb34a4003b96a1c58901a | https://github.com/PaccMann/paccmann_predictor/tree/58071311310c45c1efabb34a4003b96a1c58901a |
NavigatorBranch | import torch
import torch.utils.data
import torch.nn as nn
def conv1x1(in_channels, out_channels, stride=1, groups=1, bias=False):
"""
Convolution 1x1 layer.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels.
st... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | HyperGAN/imgclsmob | NavigatorBranch | false | 17,696 | [
"MIT"
] | 9 | 88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3 | https://github.com/HyperGAN/imgclsmob/tree/88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3 |
HexaLinearScore | import math
import torch
import torch.utils.data.dataloader
import torch.nn as nn
import torch.nn
class HexaLinearScore(nn.Module):
"""
Outer product version of hexalinear function for sequence labeling.
"""
def __init__(self, wemb_size, tagset_size, temb_size=20, rank=396, std=
0.1545, norma... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.utils.data.dataloader
import torch.nn as nn
import torc... | Dadmatech/DadmaTools | HexaLinearScore | false | 8,009 | [
"Apache-2.0"
] | 25 | c1b7add5c33544f69c1ba1c5250a5ea07caf9aa2 | https://github.com/Dadmatech/DadmaTools/tree/c1b7add5c33544f69c1ba1c5250a5ea07caf9aa2 |
ECAAttention | # 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
from torch.nn import init
assert_size_stride = torch._C._dy... | LiChengChen666/DetectDee | ECAAttention | false | 9,817 | [
"Apache-2.0"
] | 0 | 1e6aaa0d15b1fc12d1342d8a922004e372b5f437 | https://github.com/LiChengChen666/DetectDee/tree/1e6aaa0d15b1fc12d1342d8a922004e372b5f437 |
Critic | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
""" outputs the limits for the values in the hidden layer for initialisation"""
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Critic(nn.Module):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import numpy as np
import tor... | SHIVOH/DeepReinforcementLearning-DDPG-for-RoboticsControl | Critic | false | 11,851 | [
"MIT"
] | 0 | f3e811a3ae3eb603173c2475bbfe1de91074ecdc | https://github.com/SHIVOH/DeepReinforcementLearning-DDPG-for-RoboticsControl/tree/f3e811a3ae3eb603173c2475bbfe1de91074ecdc |
SEBlock | import torch
import torch.nn.functional as F
import torch.nn
def to_device(device_object, tensor):
"""
Select device for non-parameters tensor w.r.t model or tensor which has been specified a device.
"""
if isinstance(device_object, torch.nn.Module):
next(device_object.parameters()).device
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn.functional as... | fancyliumeng/asv-subtools | SEBlock | false | 6,693 | [
"Apache-2.0"
] | 1 | 56a13484472e7ae6eb00d762c00d57e581e78eb4 | https://github.com/fancyliumeng/asv-subtools/tree/56a13484472e7ae6eb00d762c00d57e581e78eb4 |
GT | # 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... | NVIDIA-AI-IOT-private/torch2trt | GT | false | 10,511 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
GlobalAttention_text | import torch
import torch.nn as nn
import torch.nn.parallel
class GlobalAttention_text(nn.Module):
def __init__(self, idf, cdf):
super(GlobalAttention_text, self).__init__()
self.conv_context = nn.Conv1d(cdf, idf, kernel_size=1, stride=1,
padding=0)
self.sm = nn.Softmax()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | JoonHong-Kim/T2I_CL | GlobalAttention_text | false | 8,397 | [
"MIT"
] | 35 | c52aa73da903d6e4174eeef2663e5bc1163785b1 | https://github.com/JoonHong-Kim/T2I_CL/tree/c52aa73da903d6e4174eeef2663e5bc1163785b1 |
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
from torch._inductor.runtime.... | kgarg8/hypertune | NN | false | 12,677 | [
"MIT"
] | 0 | fbc4b87c9aefcd8449f6068232d7105975ff9dc9 | https://github.com/kgarg8/hypertune/tree/fbc4b87c9aefcd8449f6068232d7105975ff9dc9 |
Depth_Pointwise_Conv1d | import torch
from torch import nn
class Depth_Pointwise_Conv1d(nn.Module):
def __init__(self, in_ch, out_ch, k):
super().__init__()
if k == 1:
self.depth_conv = nn.Identity()
else:
self.depth_conv = nn.Conv1d(in_channels=in_ch, out_channels=
in_ch, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | Nitin-Mane/External-Attention-pytorch | Depth_Pointwise_Conv1d | false | 14,099 | [
"MIT"
] | 4,466 | 1ceda306c41063af11c956334747763444a4d83f | https://github.com/Nitin-Mane/External-Attention-pytorch/tree/1ceda306c41063af11c956334747763444a4d83f |
MaxPoolTrinary | import torch
from torch import nn
class MaxPoolTrinary(nn.Module):
def __init__(self):
super().__init__()
def new_length(self, length):
return length
def forward(self, states):
"""
:param states: [batch, length, *]
"""
assert states.size(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 import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | C-SUNSHINE/TOQ-Nets-PyTorch-Release | MaxPoolTrinary | false | 17,131 | [
"MIT"
] | 6 | 05e06bf633fb3c6b610dda9a5126ecd7af1db02f | https://github.com/C-SUNSHINE/TOQ-Nets-PyTorch-Release/tree/05e06bf633fb3c6b610dda9a5126ecd7af1db02f |
StableBCELoss | import torch
import torch.utils.data
class StableBCELoss(torch.nn.modules.Module):
def __init__(self):
super(StableBCELoss, self).__init__()
def forward(self, input, target):
neg_abs = -input.abs()
loss = input.clamp(min=0) - input * target + (1 + neg_abs.exp()).log()
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
import torch.utils.dat... | ELEKTRONN/elektronn3 | StableBCELoss | false | 13,603 | [
"MIT"
] | 124 | 19c751855dffc67b744cd43e757aa4a5bd577d9b | https://github.com/ELEKTRONN/elektronn3/tree/19c751855dffc67b744cd43e757aa4a5bd577d9b |
L1Loss | # 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 functools
impor... | Fanzhongjie/ARFE | L1Loss | false | 469 | [
"Apache-2.0"
] | 0 | 4b96b8c5bc0895d3d30acec2a490f81a860fe860 | https://github.com/Fanzhongjie/ARFE/tree/4b96b8c5bc0895d3d30acec2a490f81a860fe860 |
MultiheadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Atten4Vis/DemystifyLocalViT | MultiheadAttention | false | 13,379 | [
"MIT"
] | 64 | 2e2327caec6d56ae2c8aa861b32bb62f3cdb786e | https://github.com/Atten4Vis/DemystifyLocalViT/tree/2e2327caec6d56ae2c8aa861b32bb62f3cdb786e |
Nullifier | # 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... | haoruilee/DeepSets | Nullifier | false | 15,485 | [
"Apache-2.0"
] | 213 | b405dd6b51a34fb1ef622e25e6685b417b7b7cbb | https://github.com/haoruilee/DeepSets/tree/b405dd6b51a34fb1ef622e25e6685b417b7b7cbb |
HyperConv2d | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1 or classname.find('Conv') != -1:
nn.init.constant_(m.weight, 0)
nn.init.normal_(m.bias, 0, 0.01)
class HyperConv2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
as... | musyoku/ffjord | HyperConv2d | false | 7,305 | [
"MIT"
] | 1 | 9e431e122e59fa9a71f3f301dec8fdd3db51e0ce | https://github.com/musyoku/ffjord/tree/9e431e122e59fa9a71f3f301dec8fdd3db51e0ce |
MeanVoxelFeatureExtractor | # 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... | AndyYuan96/MVF-End-to-End-Multi-View-Fusion-for-3D-Object-Detection-in-LiDAR-Point-Clouds- | MeanVoxelFeatureExtractor | false | 13,250 | [
"Apache-2.0"
] | 55 | cf34897f25353a3f348d0a39c8db5ba15cadb2d7 | https://github.com/AndyYuan96/MVF-End-to-End-Multi-View-Fusion-for-3D-Object-Detection-in-LiDAR-Point-Clouds-/tree/cf34897f25353a3f348d0a39c8db5ba15cadb2d7 |
Gate | import torch
import torch.nn as nn
class Gate(torch.nn.Module):
def __init__(self, out_planes):
super(Gate, self).__init__()
self.gate = nn.Parameter(torch.ones(1, out_planes, 1, 1),
requires_grad=False)
def forward(self, x):
return self.gate * x
def get_inputs():
r... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | CityU-AIM-Group/GFBS | Gate | false | 298 | [
"MIT"
] | 0 | d71361243f1bcf699e1a20b312b05fe0be4dfd6d | https://github.com/CityU-AIM-Group/GFBS/tree/d71361243f1bcf699e1a20b312b05fe0be4dfd6d |
GroupNorm | # 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.nn import Module
from torch import nn
import torch.utils.data
import... | Aarsh2001/annotated_deep_learning_paper_implementations | GroupNorm | false | 4,780 | [
"MIT"
] | 1 | ff0d5c065da1a46769f5f66fddc252c178f8fa37 | https://github.com/Aarsh2001/annotated_deep_learning_paper_implementations/tree/ff0d5c065da1a46769f5f66fddc252c178f8fa37 |
SimpleConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn.functional as... | Princeton-SysML/GradAttack | SimpleConvNet | false | 8,777 | [
"MIT"
] | 43 | 40f0ab3b88d995d9c59acb7609d01380bb0749fe | https://github.com/Princeton-SysML/GradAttack/tree/40f0ab3b88d995d9c59acb7609d01380bb0749fe |
BasicBlock | import torch
import torch.nn as nn
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=dilation, groups=groups, bias=False, dilation=dilation)
class BasicBlock(nn.Module):... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | Limingxing00/Retinal-Vessel-Segmentation-ISBI2022 | BasicBlock | false | 17,580 | [
"MIT"
] | 9 | 9480de5c17dc3665a5f6d6d0117596bc5ffc108e | https://github.com/Limingxing00/Retinal-Vessel-Segmentation-ISBI2022/tree/9480de5c17dc3665a5f6d6d0117596bc5ffc108e |
SigmoidModel | import torch
import torch.nn as nn
class SigmoidModel(nn.Module):
"""
Model architecture from:
https://medium.com/coinmonks/create-a-neural-network-in
-pytorch-and-make-your-life-simpler-ec5367895199
"""
def __init__(self, num_in, num_hidden, num_out):
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
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | archydeberker/captum | SigmoidModel | false | 9,758 | [
"BSD-3-Clause"
] | 0 | 2d72a060f12f5e325c9d1c411a2ef69bf43a06fd | https://github.com/archydeberker/captum/tree/2d72a060f12f5e325c9d1c411a2ef69bf43a06fd |
Policy | import torch
import torch.nn as nn
import torch.nn.functional as F
class Policy(nn.Module):
def __init__(self, num_inputs, num_outputs):
super(Policy, self).__init__()
self.affine1 = nn.Linear(num_inputs, 64)
self.affine2 = nn.Linear(64, 64)
self.action_mean = nn.Linear(64, num_ou... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
im... | dragen1860/TRPO-Pytorch | Policy | false | 6,598 | [
"MIT"
] | 1 | c5a8e5ac890ec50e331db12fd5885dd4fb753a3b | https://github.com/dragen1860/TRPO-Pytorch/tree/c5a8e5ac890ec50e331db12fd5885dd4fb753a3b |
BasicModel5_MultiArgs | # 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... | Europium248/captum | BasicModel5_MultiArgs | false | 417 | [
"BSD-3-Clause"
] | 0 | ac02fae2651b8d68a44bcb9d03b91cbb3959f2fc | https://github.com/Europium248/captum/tree/ac02fae2651b8d68a44bcb9d03b91cbb3959f2fc |
DecoderLayer | # 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.... | NathanYanJing/TransformerReplication | DecoderLayer | false | 11,788 | [
"MIT"
] | 0 | b20f987dcc507724971f843c2d214c9c76bd8e34 | https://github.com/NathanYanJing/TransformerReplication/tree/b20f987dcc507724971f843c2d214c9c76bd8e34 |
CrossEntropy | import torch
import torch.nn as nn
class CrossEntropy(nn.Module):
def __init__(self):
super().__init__()
def forward(self, props, tgt):
tgt_props = props.gather(2, tgt.unsqueeze(2)).squeeze()
mask = (tgt > 0).float()
return -(tgt_props * mask).sum() / mask.sum()
def get_inp... | 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... | shinoyuki222/torch-light | CrossEntropy | false | 16,418 | [
"MIT"
] | 310 | 4799805d9bcae82a9f12a574dcf9fdd838c92ee9 | https://github.com/shinoyuki222/torch-light/tree/4799805d9bcae82a9f12a574dcf9fdd838c92ee9 |
ActorCritic | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
class ActorCritic(nn.Module):
def __init__(self, num_states, num_actions, hidden_size):
super(ActorCritic, self).__init__()
self.num_actions = num_actions
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | HarshCasper/nni | ActorCritic | false | 5,281 | [
"MIT"
] | 1 | 291bbbba9f296382015a77b2c88eb5db5b44bf94 | https://github.com/HarshCasper/nni/tree/291bbbba9f296382015a77b2c88eb5db5b44bf94 |
SubPixelConvolutionalBlock | import torch
from torch import nn
class SubPixelConvolutionalBlock(nn.Module):
"""
A subpixel convolutional block, comprising convolutional, pixel-shuffle, and PReLU activation layers.
"""
def __init__(self, kernel_size=3, n_channels=64, scaling_factor=3):
"""
:param kernel_size: kern... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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... | chilung/NCTU_Adv_DNN_HW4 | SubPixelConvolutionalBlock | false | 1,705 | [
"MIT"
] | 0 | 967f228c6e80cbc703a89ee611b90ef5e037da40 | https://github.com/chilung/NCTU_Adv_DNN_HW4/tree/967f228c6e80cbc703a89ee611b90ef5e037da40 |
FactorTransfer | # 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 ... | kctsiolis/RepDistiller | FactorTransfer | false | 3,930 | [
"BSD-2-Clause"
] | 0 | ce88f6e53fcf8ef81c5bac2d20ad31628dd279ac | https://github.com/kctsiolis/RepDistiller/tree/ce88f6e53fcf8ef81c5bac2d20ad31628dd279ac |
WayPoly | import torch
class WayPoly(torch.nn.Module):
"""Apply multiple modules to input and sum.
It's equation for `poly_modules` length equal to :math:`N` could be expressed by
!!!math
I + F_1(I) + F_2(I) + ... + F_N
where :math:`I` is identity and consecutive :math:`F_N` are consecutive `poly_mo... | 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... | klaudiapalasz/torchlayers | WayPoly | false | 15,835 | [
"MIT"
] | 573 | e6edd8797875325b7c0539d75a12f0d51f494127 | https://github.com/klaudiapalasz/torchlayers/tree/e6edd8797875325b7c0539d75a12f0d51f494127 |
AgreementRouting | # 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._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | bentrevett/capsules | AgreementRouting | false | 3,237 | [
"MIT"
] | 0 | 239273de25c607d7a7504e8c6900772fddd15cd3 | https://github.com/bentrevett/capsules/tree/239273de25c607d7a7504e8c6900772fddd15cd3 |
BinaryCrossEntropyLabelSmooth | # 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
assert_size... | dianjixz/AutoDL | BinaryCrossEntropyLabelSmooth | false | 15,189 | [
"Apache-2.0"
] | 1,044 | 48db4eb04d55ce69e93d4a3bdc24592bdb34a868 | https://github.com/dianjixz/AutoDL/tree/48db4eb04d55ce69e93d4a3bdc24592bdb34a868 |
IBertLMHead | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
import torch.utils.checkpoint
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class IBertLMHead(nn.Module):
"""I-BERT Head for masked language modelin... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | sajastu/transformers-sent-curr | IBertLMHead | false | 4,246 | [
"Apache-2.0"
] | 0 | 6dc41545c4ac298a010090fbca4b454c2eaf3dbb | https://github.com/sajastu/transformers-sent-curr/tree/6dc41545c4ac298a010090fbca4b454c2eaf3dbb |
AttentionSortNet | import torch
from torch.nn import functional as F
from functools import partial
from torch import nn
def bucket(buckets, t, dim=1):
shape = list(t.shape)
shape[dim:dim + 1] = [buckets, -1]
return t.reshape(*shape)
def expand_dim(t, dim, k):
expand_shape = [-1] * len(t.shape)
expand_shape[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.... | blizda/sinkhorn-transformer | AttentionSortNet | false | 9,839 | [
"MIT"
] | 0 | 4b626a40759010e4cb1752f22387fdbda438f37c | https://github.com/blizda/sinkhorn-transformer/tree/4b626a40759010e4cb1752f22387fdbda438f37c |
AdvLoss | # 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... | akanametov/SuperResolution | AdvLoss | false | 6,139 | [
"MIT"
] | 1 | 45313d1309ddb5cdef821aaf5ac7b5ad574b5287 | https://github.com/akanametov/SuperResolution/tree/45313d1309ddb5cdef821aaf5ac7b5ad574b5287 |
GCNLayer | import torch
import torch.nn as nn
class GCNLayer(nn.Module):
def __init__(self, input_dim, output_dim, prop_depth=1, act=torch.relu,
dropout=0.0, layer_i=0):
super(GCNLayer, self).__init__()
self.prop_depth = 1
self.weight = nn.Parameter(torch.empty(input_dim, output_dim, dtype
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | snap-stanford/distance-encoding | GCNLayer | false | 16,490 | [
"MIT"
] | 177 | b9ccb1b59422b11b40883d0284d7fc9ba88efdb6 | https://github.com/snap-stanford/distance-encoding/tree/b9ccb1b59422b11b40883d0284d7fc9ba88efdb6 |
Conv1d2Score | import torch
import torch.nn as nn
import torch.optim
import torch.utils.data
class Conv1d2Score(nn.Module):
"""Calculate a N*out_dim tensor from N*in_dim*seq_len using nn.Conv1d
Essentially it is a linear layer
Args:
in_dim: int
out_dim: int, usually number of classes
seq_len: int
Shape... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.utils.data
assert_size_str... | BeautyOfWeb/VIN | Conv1d2Score | false | 7,761 | [
"MIT"
] | 34 | 53343d28130f5fd6e5badb58daf8079a5933fd6a | https://github.com/BeautyOfWeb/VIN/tree/53343d28130f5fd6e5badb58daf8079a5933fd6a |
FusionLayer | import torch
from torch import nn
from torch.nn import functional as F
class FusionLayer(nn.Module):
"""
make a fusion two vectors
"""
def __init__(self, hdim):
super(FusionLayer, self).__init__()
self.linear_fusion = nn.Linear(hdim * 4, hdim)
self.linear_gate = nn.Linear(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | lixinsu/RCZoo | FusionLayer | false | 15,940 | [
"MIT"
] | 166 | 37fcb7962fbd4c751c561d4a0c84173881ea8339 | https://github.com/lixinsu/RCZoo/tree/37fcb7962fbd4c751c561d4a0c84173881ea8339 |
RSoftmax | import torch
import torch.nn as nn
import torch.nn.functional as F
class RSoftmax(nn.Module):
"""Radix Softmax module in ``SplitAttentionConv2d``.
Args:
radix (int): Radix of input.
groups (int): Groups of input.
"""
def __init__(self, radix, groups):
super().__init__()
... | 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
... | ALISCIFP/mmpose | RSoftmax | false | 2,046 | [
"Apache-2.0"
] | 0 | 2433e3dbcc44baa2253e2a7c748ba0216937933e | https://github.com/ALISCIFP/mmpose/tree/2433e3dbcc44baa2253e2a7c748ba0216937933e |
InjectNoise | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.utils.data
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_si... | shimon-c/Machine-Learning-Collection | InjectNoise | false | 16,403 | [
"MIT"
] | 3,094 | ac5dcd03a40a08a8af7e1a67ade37f28cf88db43 | https://github.com/shimon-c/Machine-Learning-Collection/tree/ac5dcd03a40a08a8af7e1a67ade37f28cf88db43 |
Highway | import torch
import torch.nn as nn
import torch.utils.data
class Highway(nn.Linear):
"""
:param input_dim: Scalar.
:param drop_rate: Scalar. dropout rate
"""
def __init__(self, input_dim, drop_rate=0.0):
self.drop_rate = drop_rate
super(Highway, self).__init__(input_dim, inpu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | CookiePPP/mellotron | Highway | false | 9,054 | [
"BSD-3-Clause"
] | 0 | 488425981c19cd0eddddea13d1348da4bfef8d26 | https://github.com/CookiePPP/mellotron/tree/488425981c19cd0eddddea13d1348da4bfef8d26 |
Generator | import torch
import torch.nn.functional as F
from torch import nn
class Generator(nn.Module):
def __init__(self, d_model, vocab_size):
super(Generator, self).__init__()
self.proj = nn.Linear(d_model, vocab_size)
def forward(self, x, temperature):
return F.log_softmax(self.proj(x) / 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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | chanhee0222/feed2resp | Generator | false | 9,911 | [
"MIT"
] | 0 | 16dc7071f17af56cbf019eeabcd12a5dbd0693e7 | https://github.com/chanhee0222/feed2resp/tree/16dc7071f17af56cbf019eeabcd12a5dbd0693e7 |
GuidedBackpropReLUasModule | # 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.autograd import Function
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.gu... | bei2/pytorch-grad-cam | GuidedBackpropReLUasModule | false | 9,765 | [
"MIT"
] | 0 | c7f4a6cc26638fc668738c81ca35908ed6b1845b | https://github.com/bei2/pytorch-grad-cam/tree/c7f4a6cc26638fc668738c81ca35908ed6b1845b |
PIENet | import torch
import numpy as np
import torch.nn as nn
import torch.nn.init
import torch.nn.parallel
class MultiHeadSelfAttention(nn.Module):
"""Self-attention module by Lin, Zhouhan, et al. ICLR 2017"""
def __init__(self, n_head, d_in, d_hidden):
super(MultiHeadSelfAttention, self).__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | CLT29/pvse | PIENet | false | 13,471 | [
"MIT"
] | 119 | bf5232148396ee5051564ef68a48538de0ddbc84 | https://github.com/CLT29/pvse/tree/bf5232148396ee5051564ef68a48538de0ddbc84 |
CosLoss | import torch
from torch.nn.modules.loss import _Loss
class CosLoss(_Loss):
def __init__(self, eps=1e-05):
super(CosLoss, self).__init__(True)
self.eps = eps
def forward(self, pred_ofsts, kp_targ_ofst, labels, normalize=True):
"""
:param pred_ofsts: [bs, n_kpts, n_pts, c]... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn.modules.loss import _Loss
assert_size_stride = torch._C._dynamo.g... | StannisZhou/FFB6D | CosLoss | false | 11,896 | [
"MIT"
] | 0 | 5e7534805cd2e397427886d9a2a8ecfbb4f6cdfe | https://github.com/StannisZhou/FFB6D/tree/5e7534805cd2e397427886d9a2a8ecfbb4f6cdfe |
upsample | # 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... | FMsunyh/CornerNet-Lite | upsample | false | 2,244 | [
"BSD-3-Clause"
] | 0 | 85770fa6682646d572a5bd2277a0075d6dd22b93 | https://github.com/FMsunyh/CornerNet-Lite/tree/85770fa6682646d572a5bd2277a0075d6dd22b93 |
SEBlock | # 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... | LDOUBLEV/DBNet.pytorch | SEBlock | false | 9,425 | [
"Apache-2.0"
] | 0 | 206f4a1e5cc3686284476f029a26fc69f610e898 | https://github.com/LDOUBLEV/DBNet.pytorch/tree/206f4a1e5cc3686284476f029a26fc69f610e898 |
Explorer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import numpy as np
... | baturaysaglam/DISCOVER | Explorer | false | 1,637 | [
"MIT"
] | 0 | 423158c84a5935ca5755ccad06ea5fe20fb57d76 | https://github.com/baturaysaglam/DISCOVER/tree/423158c84a5935ca5755ccad06ea5fe20fb57d76 |
BERTIntermediate | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
def gelu(x):
"""Implementation of the gelu activation function.
For information: OpenAI GPT's gelu is slightly different (and gives slightly different results):
0.5 * x * (1 + torch.tanh(math.sqrt(2 / math... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | DAQuestionAnswering/Bert-n-Pals | BERTIntermediate | false | 6,896 | [
"MIT"
] | 1 | d5a288b9ac62259e70c249635108ba3906e19f00 | https://github.com/DAQuestionAnswering/Bert-n-Pals/tree/d5a288b9ac62259e70c249635108ba3906e19f00 |
ConvToVector | # 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_... | MarcCote/spatial-reasoning | ConvToVector | false | 812 | [
"MIT"
] | 0 | 06c57cfafbd1c24b68d6ab634d19806964d867f3 | https://github.com/MarcCote/spatial-reasoning/tree/06c57cfafbd1c24b68d6ab634d19806964d867f3 |
CAMBlock | # 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_... | YuRui8879/CPSC2021_python | CAMBlock | false | 18,172 | [
"MIT"
] | 4 | bfa4c565ec3113528e73b064041082863cd228b4 | https://github.com/YuRui8879/CPSC2021_python/tree/bfa4c565ec3113528e73b064041082863cd228b4 |
PEG | # 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... | Steffen-Wolf/vit-pytorch | PEG | false | 9,605 | [
"MIT"
] | 0 | 4f590b9bd570091d9070a039ad33301516caa341 | https://github.com/Steffen-Wolf/vit-pytorch/tree/4f590b9bd570091d9070a039ad33301516caa341 |
Scaled_Dot_Product_Attention | import torch
import torch.nn as nn
import torch.nn.functional as F
class Scaled_Dot_Product_Attention(nn.Module):
"""Scaled Dot-Product Attention """
def __init__(self):
super(Scaled_Dot_Product_Attention, self).__init__()
def forward(self, Q, K, V, scale=None):
"""
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Ch4ndelier/Transformer_Zero_Velocity_classification | Scaled_Dot_Product_Attention | false | 17,076 | [
"MIT"
] | 6 | 857efb66189c503e983c11bd7dde16ad19c51ada | https://github.com/Ch4ndelier/Transformer_Zero_Velocity_classification/tree/857efb66189c503e983c11bd7dde16ad19c51ada |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.