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 |
|---|---|---|---|---|---|---|---|---|---|---|
AttentionConditioningLayer | import torch
import torch.utils.data
from torch import nn
class ConvNorm(torch.nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,
padding=None, dilation=1, bias=True, w_init_gain='linear'):
super(ConvNorm, self).__init__()
if padding is None:
as... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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
from ... | zachwe/flowtron | AttentionConditioningLayer | false | 13,171 | [
"Apache-2.0"
] | 0 | 28da7fbdb8c2851c835a355ae5cce45cc30bbc84 | https://github.com/zachwe/flowtron/tree/28da7fbdb8c2851c835a355ae5cce45cc30bbc84 |
FastSigmoid | import torch
import torch.utils.data
import torch
import torch.nn as nn
class FastSigmoid(nn.Module):
def __init__(self):
super(FastSigmoid, self).__init__()
def forward(self, x):
abs = torch.abs(x) + 1
return torch.div(x, abs)
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
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.utils.data
import torch
import torch.nn as nn
assert_size_st... | zhuxyme/zxySRFBN_CVPR2019 | FastSigmoid | false | 13,172 | [
"MIT"
] | 0 | c1afe776e7759bc05f2235b6db708e337cf2ae0e | https://github.com/zhuxyme/zxySRFBN_CVPR2019/tree/c1afe776e7759bc05f2235b6db708e337cf2ae0e |
LanguageModelCriterion | import torch
import torch.nn as nn
from torch.autograd import *
def to_contiguous(tensor):
if tensor.is_contiguous():
return tensor
else:
return tensor.contiguous()
class LanguageModelCriterion(nn.Module):
def __init__(self):
super(LanguageModelCriterion, self).__init__()
d... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torch.autograd import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | zhlnhn/ImageNewsMatching | LanguageModelCriterion | false | 13,173 | [
"MIT"
] | 0 | a9ebfc5f7669621cfc37510d6d9476a7b7a86eaa | https://github.com/zhlnhn/ImageNewsMatching/tree/a9ebfc5f7669621cfc37510d6d9476a7b7a86eaa |
L2Norm | import torch
from math import sqrt as sqrt
from itertools import product as product
import torch.nn as nn
import torch.nn.init as init
class L2Norm(nn.Module):
def __init__(self, n_channels, scale):
super(L2Norm, self).__init__()
self.n_channels = n_channels
self.gamma = scale or None
... | 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 math import sqrt as sqrt
from itertools import product as product
import t... | zhujiagang/realtime-neg | L2Norm | false | 13,174 | [
"MIT"
] | 0 | 7e228edc5f2d93d0eee7f3880f0b8473d8c71d27 | https://github.com/zhujiagang/realtime-neg/tree/7e228edc5f2d93d0eee7f3880f0b8473d8c71d27 |
SimpleNN | import torch
from torch import nn
class SimpleNN(nn.Module):
def __init__(self, input_dim):
super(SimpleNN, self).__init__()
self.linear1 = nn.Linear(input_dim, 50)
self.relu = nn.ReLU(inplace=True)
self.linear2 = nn.Linear(50, 100)
self.out = nn.Linear(100, 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... | zhaofeng-shu33/Learning_From_Data_2019_Fall | SimpleNN | false | 13,175 | [
"MIT"
] | 0 | 3e5e1f834c8057817d2e9c3e3fc8d7880fa3a1bd | https://github.com/zhaofeng-shu33/Learning_From_Data_2019_Fall/tree/3e5e1f834c8057817d2e9c3e3fc8d7880fa3a1bd |
SimpleMLP | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class SimpleMLP(nn.Module):
def __init__(self, num_in_features, num_out_features, neurons_per_layer):
super(SimpleMLP, self).__init__()
self.act = nn.ELU()
self.l_in = nn.Linear(in_features=num_in_features, out_feature... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.optim
... | zhaofeng-shu33/deep_euler_tests | SimpleMLP | false | 13,176 | [
"MIT"
] | 0 | a3d0961af679d490b0c58873ee0726234122bc7a | https://github.com/zhaofeng-shu33/deep_euler_tests/tree/a3d0961af679d490b0c58873ee0726234122bc7a |
PSNR | import torch
import torch as th
class PSNR(th.nn.Module):
def __init__(self):
super(PSNR, self).__init__()
self.mse = th.nn.MSELoss()
def forward(self, out, ref):
mse = self.mse(out, ref)
return -10 * th.log10(mse + 1e-12)
def get_inputs():
return [torch.rand([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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch as th
assert_si... | zsinsense/demosaicnet | PSNR | false | 13,177 | [
"MIT"
] | 0 | bbe8151cab86dbe46b76806cf9ec353994b389ff | https://github.com/zsinsense/demosaicnet/tree/bbe8151cab86dbe46b76806cf9ec353994b389ff |
APLoss_dist | import torch
import numpy as np
import torch.nn as nn
def sim_to_dist(scores):
return 1 - torch.sqrt(2.001 - 2 * scores)
class APLoss(nn.Module):
""" Differentiable AP loss, through quantization. From the paper:
Learning with Average Precision: Training Image Retrieval with a Listwise Loss
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | zhangxue123/deep-image-retrieval | APLoss_dist | false | 13,178 | [
"BSD-3-Clause"
] | 0 | ac188856fa5a034aed3f7ed3fb617d580da44462 | https://github.com/zhangxue123/deep-image-retrieval/tree/ac188856fa5a034aed3f7ed3fb617d580da44462 |
ClusterAssignment | import torch
import torch.nn as nn
from torch.nn import Parameter
from typing import Optional
class ClusterAssignment(nn.Module):
def __init__(self, cluster_number: 'int', embedding_dimension: 'int',
alpha: 'float'=1.0, cluster_centers: 'Optional[torch.Tensor]'=None
) ->None:
"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torch.nn import Parameter
from typing import Optional
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | zhyhan/pt-dec | ClusterAssignment | false | 13,179 | [
"MIT"
] | 0 | 52aef59e508c8e7ffdde0fd7bea84570a7571b2a | https://github.com/zhyhan/pt-dec/tree/52aef59e508c8e7ffdde0fd7bea84570a7571b2a |
Similarity | import torch
import torch.nn as nn
import torch.nn.functional as F
class Similarity(nn.Module):
def __init__(self, cuda, mem_dim, hidden_dim, num_classes):
super(Similarity, self).__init__()
self.cudaFlag = cuda
self.mem_dim = mem_dim
self.hidden_dim = hidden_dim
self.num_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | zhu-y11/multilingual_treelstm | Similarity | false | 13,180 | [
"MIT"
] | 0 | 39c211f3c03db733f776aa8fe73cd615aaa47465 | https://github.com/zhu-y11/multilingual_treelstm/tree/39c211f3c03db733f776aa8fe73cd615aaa47465 |
NonLocalBlock2D | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo
class NonLocalBlock2D(nn.Module):
def __init__(self, in_channels, inter_channels):
super(NonLocalBlock2D, self).__init__()
self.in_channels = in_channels
self.inter_channels = inter_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._inductor.runtime.... | zhouhuanxiang/EDSR-PyTorch | NonLocalBlock2D | false | 13,181 | [
"MIT"
] | 0 | ca2f0eea49476a0acde59dd76aa4ae257389d98c | https://github.com/zhouhuanxiang/EDSR-PyTorch/tree/ca2f0eea49476a0acde59dd76aa4ae257389d98c |
Value | import torch
import torch.nn as nn
class Value(nn.Module):
def __init__(self, num_inputs):
super(Value, self).__init__()
self.affine1 = nn.Linear(num_inputs, 64)
self.affine2 = nn.Linear(64, 64)
self.value_head = nn.Linear(64, 1)
self.value_head.weight.data.mul_(0.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.triton_helpers import libdevice
import torch.nn as ... | zwc662/Safe_GAIL | Value | false | 13,182 | [
"MIT"
] | 0 | 536dd73c91d277b418ef04efdd42aa6c87fdad33 | https://github.com/zwc662/Safe_GAIL/tree/536dd73c91d277b418ef04efdd42aa6c87fdad33 |
AutoEncoder | import torch
import torch.nn as nn
import torch.utils.data
class AutoEncoder(nn.Module):
def __init__(self, num_question, k=100):
""" Initialize a class AutoEncoder.
:param num_question: int
:param k: int
"""
super(AutoEncoder, self).__init__()
self.g = 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
import torch.nn as ... | zuoyuwang/ML-Correctness-prediction | AutoEncoder | false | 13,183 | [
"MIT"
] | 0 | 15180b73567e61cc7a5dd61b0202a42eca808734 | https://github.com/zuoyuwang/ML-Correctness-prediction/tree/15180b73567e61cc7a5dd61b0202a42eca808734 |
ImgPatches | import torch
import torch.nn as nn
import torch.utils.data
class ImgPatches(nn.Module):
def __init__(self, input_channel=3, dim=768, patch_size=4):
super().__init__()
self.patch_embed = nn.Conv2d(input_channel, dim, kernel_size=
patch_size, stride=patch_size)
def forward(self, im... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | zoosecretbase/TransGAN | ImgPatches | false | 13,184 | [
"MIT"
] | 0 | f2546aec5b80bdddb2c8621a6e011532df3e2d73 | https://github.com/zoosecretbase/TransGAN/tree/f2546aec5b80bdddb2c8621a6e011532df3e2d73 |
SentenceClassificationModule | from torch.nn import Module
import torch
from torch.nn import functional as F
import torch.onnx
class SentenceClassificationModule(Module):
def __init__(self, input_dimensions: 'int', hidden_dimensions: 'int',
dropout: 'float'=0.3):
super().__init__()
self.layer_1 = torch.nn.Linear(input_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | zolekode/flexudy-multilingual-grammar-checker | SentenceClassificationModule | false | 13,185 | [
"Apache-2.0"
] | 0 | 86ea35acff0b8eea49d9b1ff9193b69eabc26ef9 | https://github.com/zolekode/flexudy-multilingual-grammar-checker/tree/86ea35acff0b8eea49d9b1ff9193b69eabc26ef9 |
ScaledDotProductAttention | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
"""
Compute 'Scaled Dot Product Attention'
"""
def __init__(self, dropout=0.0):
"""
:param dropout: attention dropout rate
"""
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
from torch._inductor.runtime.... | timgianitsos/squad | ScaledDotProductAttention | false | 13,186 | [
"MIT"
] | 0 | 6ab502652e3528cfeeddfb8eba05221443a35294 | https://github.com/timgianitsos/squad/tree/6ab502652e3528cfeeddfb8eba05221443a35294 |
AdaIN2d | import torch
import torch.nn as nn
class AdaIN2d(nn.Module):
def __init__(self, in_channels, in_features):
super(AdaIN2d, self).__init__()
self.norm = nn.InstanceNorm2d(in_channels, affine=False,
track_running_stats=False)
self.net = nn.Linear(in_features, 2 * 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.triton_helpers import libdevice
import torch.nn as ... | wp03052/wolf | AdaIN2d | false | 13,187 | [
"Apache-2.0"
] | 0 | 49a582cafb829a2642db360c7d94c21439247ec7 | https://github.com/wp03052/wolf/tree/49a582cafb829a2642db360c7d94c21439247ec7 |
Policy | import torch
import torch.nn as nn
class Policy(nn.Module):
def __init__(self, num_inputs, num_outputs, discrete=False):
super(Policy, self).__init__()
self.discrete = discrete
self.affine1 = nn.Linear(num_inputs, 64)
self.affine2 = nn.Linear(64, 64)
self.action_mean = nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | zwc662/Safe_GAIL | Policy | false | 13,188 | [
"MIT"
] | 0 | 536dd73c91d277b418ef04efdd42aa6c87fdad33 | https://github.com/zwc662/Safe_GAIL/tree/536dd73c91d277b418ef04efdd42aa6c87fdad33 |
MIRB3 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, groups=3):
super(ConvBlock, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.groups = gro... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | wwjfsfs/wwjyyds | MIRB3 | false | 13,189 | [
"MIT"
] | 0 | 80cd6267fde7cd98838078a0d5178a557ceb7414 | https://github.com/wwjfsfs/wwjyyds/tree/80cd6267fde7cd98838078a0d5178a557ceb7414 |
Pointer | import torch
import torch.nn as nn
import torch.nn.functional as F
def mask_logits(target, mask):
mask = mask.type(torch.float32)
return target * mask + (1 - mask) * -1e+30
class Initialized_Conv1d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,
padding=0, gro... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | timgianitsos/squad | Pointer | false | 13,190 | [
"MIT"
] | 0 | 6ab502652e3528cfeeddfb8eba05221443a35294 | https://github.com/timgianitsos/squad/tree/6ab502652e3528cfeeddfb8eba05221443a35294 |
FSPool | import torch
import torch.nn as nn
import torch.utils.data
def deterministic_sort(s, tau):
"""
"Stochastic Optimization of Sorting Networks via Continuous Relaxations" https://openreview.net/forum?id=H1eSS3CcKX
Aditya Grover, Eric Wang, Aaron Zweig, Stefano Ermon
s: input elements to be sorted. Shap... | 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... | zzirnheld/dspn | FSPool | false | 13,191 | [
"MIT"
] | 0 | e0c248d9e55821847841cf0c67e97225277a6e75 | https://github.com/zzirnheld/dspn/tree/e0c248d9e55821847841cf0c67e97225277a6e75 |
LipschitzCube | import torch
import torch.nn as nn
class LipschitzCube(nn.Module):
def forward(self, x):
return (x >= 1) * (x - 2 / 3) + (x <= -1) * (x + 2 / 3) + (x > -1) * (x
< 1) * x ** 3 / 3
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... | zxydi1992/residual-flows | LipschitzCube | false | 13,192 | [
"MIT"
] | 0 | 4ec289681dc91cff5312b22f7ebed93838b440fb | https://github.com/zxydi1992/residual-flows/tree/4ec289681dc91cff5312b22f7ebed93838b440fb |
ResNetBlockGroupNorm | import torch
import torch.nn as nn
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class ResNetBlockGroupNorm(nn.Module):
def __init__(self, inplanes, planes, num_groups... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | wp03052/wolf | ResNetBlockGroupNorm | false | 13,193 | [
"Apache-2.0"
] | 0 | 49a582cafb829a2642db360c7d94c21439247ec7 | https://github.com/wp03052/wolf/tree/49a582cafb829a2642db360c7d94c21439247ec7 |
DeResNetBlockGroupNorm | import torch
import torch.nn as nn
def deconv3x3(in_planes, out_planes, stride=1, output_padding=0):
"""3x3 deconvolution with padding"""
return nn.ConvTranspose2d(in_planes, out_planes, kernel_size=3, stride=
stride, padding=1, output_padding=output_padding, bias=False)
class DeResNetBlockGroupNorm... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | wp03052/wolf | DeResNetBlockGroupNorm | false | 13,194 | [
"Apache-2.0"
] | 0 | 49a582cafb829a2642db360c7d94c21439247ec7 | https://github.com/wp03052/wolf/tree/49a582cafb829a2642db360c7d94c21439247ec7 |
FullSort | import torch
import torch.nn as nn
class FullSort(nn.Module):
def forward(self, x):
return torch.sort(x, 1)[0]
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | zxydi1992/residual-flows | FullSort | false | 13,195 | [
"MIT"
] | 0 | 4ec289681dc91cff5312b22f7ebed93838b440fb | https://github.com/zxydi1992/residual-flows/tree/4ec289681dc91cff5312b22f7ebed93838b440fb |
CNN | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNN(nn.Module):
def __init__(self):
super(CNN, self).__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=8, kernel_size=3,
padding=1)
self.conv2 = nn.Conv2d(in_channels=8, out_channels=16, kerne... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | zzzzzkjs/quick_draw_clone | CNN | false | 13,196 | [
"MIT"
] | 0 | a80d4c03b4cb88e31ae8e143d4042b37cdacc38e | https://github.com/zzzzzkjs/quick_draw_clone/tree/a80d4c03b4cb88e31ae8e143d4042b37cdacc38e |
CQAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
def mask_logits(target, mask):
mask = mask.type(torch.float32)
return target * mask + (1 - mask) * -1e+30
class CQAttention(nn.Module):
def __init__(self, d_model, dropout=0.1):
super().__init__()
w4C = torch.empty(d_mod... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | timgianitsos/squad | CQAttention | false | 13,197 | [
"MIT"
] | 0 | 6ab502652e3528cfeeddfb8eba05221443a35294 | https://github.com/timgianitsos/squad/tree/6ab502652e3528cfeeddfb8eba05221443a35294 |
LipNormConv2d | 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 | LipNormConv2d | false | 13,198 | [
"MIT"
] | 0 | 4ec289681dc91cff5312b22f7ebed93838b440fb | https://github.com/zxydi1992/residual-flows/tree/4ec289681dc91cff5312b22f7ebed93838b440fb |
ConvStem2 | import torch
import torch.nn as nn
class ConvStem2(nn.Module):
def __init__(self, in_chans=3, out_chans=64, kernel_size=7, stride=2):
super(ConvStem2, self).__init__()
self.conv = nn.Conv2d(in_chans, out_chans, kernel_size=kernel_size,
stride=stride, padding=kernel_size // 2, bias=Fal... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | yoookoo/cnn-transformer | ConvStem2 | false | 13,199 | [
"Apache-2.0"
] | 0 | 8ee54ea944ed752162e3098db7f8f689ec150efe | https://github.com/yoookoo/cnn-transformer/tree/8ee54ea944ed752162e3098db7f8f689ec150efe |
NICEMLPBlock | import torch
import torch.nn as nn
class LinearWeightNorm(nn.Module):
def __init__(self, in_features, out_features, bias=True):
super(LinearWeightNorm, self).__init__()
self.linear = nn.Linear(in_features, out_features, bias=bias)
self.reset_parameters()
def reset_parameters(self):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | wp03052/wolf | NICEMLPBlock | false | 13,200 | [
"Apache-2.0"
] | 0 | 49a582cafb829a2642db360c7d94c21439247ec7 | https://github.com/wp03052/wolf/tree/49a582cafb829a2642db360c7d94c21439247ec7 |
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 |
FusedConvBN | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.quantization
import torch.onnx
import torchaudio.functional as F
import torch.nn.parallel
import torch.utils.data
from torch.functional import F
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
def unsq... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | youkaichao/tutorials | FusedConvBN | false | 13,202 | [
"BSD-3-Clause"
] | 0 | af34b10b70d99659eb016a2a1d5c31b9ae8ba3da | https://github.com/youkaichao/tutorials/tree/af34b10b70d99659eb016a2a1d5c31b9ae8ba3da |
BeitPooler | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.checkpoint
class BeitPooler(nn.Module):
def __init__(self, config):
super().__init__()
self.layernorm = nn.LayerNorm(config.hidden_size, eps=config.
layer_norm_eps) if config.use_mean_po... | 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.utils.checkpoint
assert_size_stride = torch._... | Clemens123/transformers | BeitPooler | false | 13,203 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
AttDec | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | IacoSimoncini/tfvaegan | AttDec | false | 13,204 | [
"MIT"
] | 0 | 157b526d65d0b0d5412f4be6fed02fc7d6325827 | https://github.com/IacoSimoncini/tfvaegan/tree/157b526d65d0b0d5412f4be6fed02fc7d6325827 |
DeiTAttention | from _paritybench_helpers import _mock_config
import math
import torch
from typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Clemens123/transformers | DeiTAttention | false | 13,205 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
Discriminator_D1 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | IacoSimoncini/tfvaegan | Discriminator_D1 | false | 13,206 | [
"MIT"
] | 0 | 157b526d65d0b0d5412f4be6fed02fc7d6325827 | https://github.com/IacoSimoncini/tfvaegan/tree/157b526d65d0b0d5412f4be6fed02fc7d6325827 |
SPPblock | import torch
import torch.nn as nn
import torch.nn.functional as F
class SPPblock(nn.Module):
def __init__(self, in_channels):
super(SPPblock, self).__init__()
self.pool1 = nn.MaxPool2d(kernel_size=[2, 2], stride=2)
self.pool2 = nn.MaxPool2d(kernel_size=[3, 3], stride=3)
self.pool... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | zxg3017/CUSE-Net | SPPblock | false | 13,207 | [
"MIT"
] | 0 | ea1d07027f89130a8a40465de94528f23eb9f5d1 | https://github.com/zxg3017/CUSE-Net/tree/ea1d07027f89130a8a40465de94528f23eb9f5d1 |
SoftMaxAvgPoolModel | import torch
import torch.cuda
import torch.nn
import torch.utils.data
import torch.fx
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class SoftMaxAvgPoolModel(torch.nn.Module):
def __init__(self):
super(SoftMaxAvgPoolModel, self).__init__()
self.sfmax = torch.nn.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.cuda
impo... | quic-kyunggeu/aimet | SoftMaxAvgPoolModel | false | 13,208 | [
"BSD-3-Clause"
] | 0 | 877835d5aafcef17cf12864124977d3c128d4aca | https://github.com/quic-kyunggeu/aimet/tree/877835d5aafcef17cf12864124977d3c128d4aca |
MIRB2 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, groups=3):
super(ConvBlock, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.groups = gro... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | wwjfsfs/wwjyyds | MIRB2 | false | 13,209 | [
"MIT"
] | 0 | 80cd6267fde7cd98838078a0d5178a557ceb7414 | https://github.com/wwjfsfs/wwjyyds/tree/80cd6267fde7cd98838078a0d5178a557ceb7414 |
MIRB1 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, groups=3):
super(ConvBlock, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.groups = gro... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | wwjfsfs/wwjyyds | MIRB1 | false | 13,210 | [
"MIT"
] | 0 | 80cd6267fde7cd98838078a0d5178a557ceb7414 | https://github.com/wwjfsfs/wwjyyds/tree/80cd6267fde7cd98838078a0d5178a557ceb7414 |
BertLayer | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_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 import triton_helpers
from torch._inductor.runtime.... | Abhimanyu08/minbert-assignment | BertLayer | false | 13,211 | [
"Apache-2.0"
] | 0 | 1610364213b1aab2d5446175dffabd7e1742833b | https://github.com/Abhimanyu08/minbert-assignment/tree/1610364213b1aab2d5446175dffabd7e1742833b |
BertOutput | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.checkpoint
class BertOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.intermediate_size, config.hidden_size)
self.LayerNorm = nn.LayerNorm(conf... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | Clemens123/transformers | BertOutput | false | 13,212 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
DeiTSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
import torch.utils.checkpoint
class DeiTSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if (config.hidden_size % config.num_attention_heads != 0 and not
hasattr(config,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Clemens123/transformers | DeiTSelfAttention | false | 13,213 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
IBertClassificationHead | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.checkpoint
class IBertClassificationHead(nn.Module):
"""Head for sentence-level classification tasks."""
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | Clemens123/transformers | IBertClassificationHead | false | 13,214 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
PropMaxPool | from _paritybench_helpers import _mock_config
import torch
import torch.nn.parallel
import torch.nn as nn
import torch.utils.data
import torch.backends.cudnn
class PropMaxPool(nn.Module):
def __init__(self, cfg):
super(PropMaxPool, self).__init__()
num_layers = cfg.NUM_LAYERS
self.layers ... | 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.parallel
import torch.nn as nn
import torch.utils.data
import torch.backe... | MicroTensor-ai/episodic-memory | PropMaxPool | false | 13,215 | [
"MIT"
] | 0 | 295a3752ab94c7a6f45355aa2c54bffbf84b574f | https://github.com/MicroTensor-ai/episodic-memory/tree/295a3752ab94c7a6f45355aa2c54bffbf84b574f |
StructuredAutoencoderNet | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
from collections import OrderedDict
class StructuredAutoencoderNet(nn.Module):
def __init__(self, p, encoder_config, decoder_config, dropout_rate=0):
super().__init__()
self.p = p
self.encoder_config = encode... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from collections import OrderedDict
assert_size_stride = t... | CHuanSite/smautoPy | StructuredAutoencoderNet | false | 13,216 | [
"MIT"
] | 0 | 46c6b2088fc3c488870cee2ab88ac9f1ce779c0d | https://github.com/CHuanSite/smautoPy/tree/46c6b2088fc3c488870cee2ab88ac9f1ce779c0d |
LxmertCrossAttentionLayer | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
import torch.utils.checkpoint
class LxmertAttention(nn.Module):
def __init__(self, config, ctx_dim=None):
super().__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise Value... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Clemens123/transformers | LxmertCrossAttentionLayer | false | 13,217 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
MPNetSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
import torch.utils.checkpoint
class MPNetSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if (config.hidden_size % config.num_attention_heads != 0 and not
hasattr(config... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Clemens123/transformers | MPNetSelfAttention | false | 13,218 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
BertOutAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class BertOutAttention(nn.Module):
def __init__(self, config, ctx_dim=None):
super().__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise ValueError(
'The ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | MarSaKi/Recurrent-VLN-BERT | BertOutAttention | false | 13,219 | [
"MIT"
] | 0 | c1170f9ca48c234a0c3ded19f9273f2fdcd571d6 | https://github.com/MarSaKi/Recurrent-VLN-BERT/tree/c1170f9ca48c234a0c3ded19f9273f2fdcd571d6 |
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... | Clemens123/transformers | IBertLMHead | false | 13,220 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
BoundNeg | from _paritybench_helpers import _mock_config
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
from torch.nn import MSELoss
def isnan(x):
if isinstance(x, Patches):
return False
return torch.isnan(x).any()
class Perturbation... | 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 math
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
assert_size_stride = torch._... | Mahoumaru/auto_LiRPA | BoundNeg | false | 13,221 | [
"BSD-3-Clause"
] | 0 | b03a6c36eb1b921726778359d6d2b94e0cd7e480 | https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480 |
BoundPow | from _paritybench_helpers import _mock_config
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
from torch.nn import MSELoss
def isnan(x):
if isinstance(x, Patches):
return False
return torch.isnan(x).any()
class Perturbation... | 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 math
import numpy as np
import torch.nn as nn
import torch.nn.functional... | Mahoumaru/auto_LiRPA | BoundPow | false | 13,222 | [
"BSD-3-Clause"
] | 0 | b03a6c36eb1b921726778359d6d2b94e0cd7e480 | https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480 |
BoundNot | from _paritybench_helpers import _mock_config
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
from torch.nn import MSELoss
def isnan(x):
if isinstance(x, Patches):
return False
return torch.isnan(x).any()
class Perturbation... | 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 math
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
assert_size_stride = torch._... | Mahoumaru/auto_LiRPA | BoundNot | false | 13,223 | [
"BSD-3-Clause"
] | 0 | b03a6c36eb1b921726778359d6d2b94e0cd7e480 | https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480 |
BoundSqrt | from _paritybench_helpers import _mock_config
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
from torch.nn import MSELoss
def isnan(x):
if isinstance(x, Patches):
return False
return torch.isnan(x).any()
class Perturbation... | 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 math
import numpy as np
import torch.nn as nn
import torch.nn.functional... | Mahoumaru/auto_LiRPA | BoundSqrt | false | 13,224 | [
"BSD-3-Clause"
] | 0 | b03a6c36eb1b921726778359d6d2b94e0cd7e480 | https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480 |
CanineAttention | from _paritybench_helpers import _mock_config
import math
import torch
from typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Clemens123/transformers | CanineAttention | false | 13,225 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
AlbertAttention | from _paritybench_helpers import _mock_config
import math
import torch
from typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Clemens123/transformers | AlbertAttention | false | 13,226 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 |
BoundReciprocal | from _paritybench_helpers import _mock_config
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
from torch.nn import MSELoss
def isnan(x):
if isinstance(x, Patches):
return False
return torch.isnan(x).any()
class Perturbation... | 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 math
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
assert_size_stride = torch._... | Mahoumaru/auto_LiRPA | BoundReciprocal | false | 13,227 | [
"BSD-3-Clause"
] | 0 | b03a6c36eb1b921726778359d6d2b94e0cd7e480 | https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480 |
BoundCos | from _paritybench_helpers import _mock_config
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
from torch.nn import MSELoss
def isnan(x):
if isinstance(x, Patches):
return False
return torch.isnan(x).any()
class Perturbation... | 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 math
import numpy as np
import torch.nn as nn
import torch.nn.func... | Mahoumaru/auto_LiRPA | BoundCos | false | 13,228 | [
"BSD-3-Clause"
] | 0 | b03a6c36eb1b921726778359d6d2b94e0cd7e480 | https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480 |
BoundSub | from _paritybench_helpers import _mock_config
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
from torch.nn import MSELoss
def isnan(x):
if isinstance(x, Patches):
return False
return torch.isnan(x).any()
class Perturbation... | 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 math
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
assert_size_stride = torch._... | Mahoumaru/auto_LiRPA | BoundSub | false | 13,229 | [
"BSD-3-Clause"
] | 0 | b03a6c36eb1b921726778359d6d2b94e0cd7e480 | https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480 |
BoundEqual | from _paritybench_helpers import _mock_config
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
from torch.nn import MSELoss
def isnan(x):
if isinstance(x, Patches):
return False
return torch.isnan(x).any()
class Perturbation... | 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 math
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from numbers import Number
assert_size_stride = torch._... | Mahoumaru/auto_LiRPA | BoundEqual | false | 13,230 | [
"BSD-3-Clause"
] | 0 | b03a6c36eb1b921726778359d6d2b94e0cd7e480 | https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480 |
MMFB | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, groups=3):
super(ConvBlock, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.groups = gro... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | wwjfsfs/wwjyyds | MMFB | false | 13,231 | [
"MIT"
] | 0 | 80cd6267fde7cd98838078a0d5178a557ceb7414 | https://github.com/wwjfsfs/wwjyyds/tree/80cd6267fde7cd98838078a0d5178a557ceb7414 |
Net | import torch
from torch import nn
import torch.nn.functional as F
import torch.optim
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=
3, padding=1)
self.max2 = nn.MaxPool2d(kernel_size=2, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | kawano8811/deep-learning-v2-pytorch | Net | false | 13,232 | [
"MIT"
] | 0 | b7c453728cb85edf3b30e0aeb66b3861747bc043 | https://github.com/kawano8811/deep-learning-v2-pytorch/tree/b7c453728cb85edf3b30e0aeb66b3861747bc043 |
VGGBase | import torch
import torchvision
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
def decimate(tensor, m):
"""
Decimate a tensor by a factor 'm', i.e. downsample by keeping every 'm'th value.
This is used when we convert FC layers to equivalent Convolutional ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torchvision
from torch... | doduythao/ssd | VGGBase | false | 13,233 | [
"MIT"
] | 0 | 170064a3edef05d3274b08ea7f622eb3238b5c5c | https://github.com/doduythao/ssd/tree/170064a3edef05d3274b08ea7f622eb3238b5c5c |
SSD512 | import torch
import torchvision
from math import sqrt
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
def decimate(tensor, m):
"""
Decimate a tensor by a factor 'm', i.e. downsample by keeping every 'm'th value.
This is used when we convert FC layers to equ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | doduythao/ssd | SSD512 | false | 13,234 | [
"MIT"
] | 0 | 170064a3edef05d3274b08ea7f622eb3238b5c5c | https://github.com/doduythao/ssd/tree/170064a3edef05d3274b08ea7f622eb3238b5c5c |
ResNetV2 | import torch
import numpy as np
from collections import OrderedDict
from torch import nn
import torch.nn.functional as F
def conv1x1(cin, cout, stride=1, bias=False):
return StdConv2d(cin, cout, kernel_size=1, stride=stride, padding=0,
bias=bias)
def conv3x3(cin, cout, stride=1, groups=1, bias=False):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | marekb-sci/kaggle_cassava | ResNetV2 | false | 13,235 | [
"Apache-2.0"
] | 0 | 158d1e398e713381c889e071329b96b9c0ba98d2 | https://github.com/marekb-sci/kaggle_cassava/tree/158d1e398e713381c889e071329b96b9c0ba98d2 |
Model | from torch.nn import Module
import torch
import torch.nn.functional
from torch.nn import Parameter
from torch.nn.parameter import Parameter
from torch.nn.modules import Module
import torch.nn.parallel
import torch.utils.data
import torch.optim
import torch.utils.data.distributed
from torch.nn import Module
class Mode... | 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.nn import Module
import torch.nn.functional
from torch.nn import Parameter
from torch.nn.parameter import Parameter
from torch.nn... | DominickZhang/Distillation-Swin-Transformer | Model | false | 13,236 | [
"MIT"
] | 0 | 6fc7b25bd558edb14e6f15715f53612c37e5166f | https://github.com/DominickZhang/Distillation-Swin-Transformer/tree/6fc7b25bd558edb14e6f15715f53612c37e5166f |
L2Norm | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch._utils
from math import sqrt as sqrt
from itertools import product as product
import torch.nn.init as init
class L2Norm(nn.Module):
def __init__(self, n_channels... | 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.nn.parallel
import torch.optim
import torch.... | Abraham-Xu/TF2 | L2Norm | false | 13,237 | [
"Apache-2.0"
] | 144 | a5bc18acb7743dc5b6e85cfbefa8b88c3785ce78 | https://github.com/Abraham-Xu/TF2/tree/a5bc18acb7743dc5b6e85cfbefa8b88c3785ce78 |
ToTensor | from torch.nn import Module
import torch
class ToTensor(Module):
def __init__(self):
super(ToTensor, self).__init__()
def forward(self, x):
x = x / 255
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
from torch.nn import Module
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._em... | AlexMontgomerie/finn | ToTensor | false | 13,238 | [
"BSD-3-Clause"
] | 283 | ec5f67b333ad4db4acf6191c3b5ab5e9067347aa | https://github.com/AlexMontgomerie/finn/tree/ec5f67b333ad4db4acf6191c3b5ab5e9067347aa |
ELUPlus | import torch
import torch.nn as nn
import torch.utils.data
class ELUPlus(nn.Module):
def __init__(self):
super().__init__()
self.elu = nn.ELU()
def forward(self, x):
return self.elu(x) + 1.0
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.triton_helpers import libdevice
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dy... | AWehenkel/UMNN | ELUPlus | false | 13,239 | [
"BSD-3-Clause"
] | 69 | f93cb36040783dd60e14e0eda927899d3919825c | https://github.com/AWehenkel/UMNN/tree/f93cb36040783dd60e14e0eda927899d3919825c |
tofp16 | import torch
import torch.nn as nn
class tofp16(nn.Module):
def __init__(self):
super(tofp16, self).__init__()
def forward(self, input):
return input.half()
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... | AnonymousAuthors444/VEC_VAD | tofp16 | false | 13,240 | [
"MIT"
] | 67 | 0072bf857030e621e2f9c12689407b81e45ed603 | https://github.com/AnonymousAuthors444/VEC_VAD/tree/0072bf857030e621e2f9c12689407b81e45ed603 |
AffineChannel2d | import torch
import torch.nn as nn
import torch.utils.data
class AffineChannel2d(nn.Module):
""" A simple channel-wise affine transformation operation """
def __init__(self, num_features):
super().__init__()
self.num_features = num_features
self.weight = nn.Parameter(torch.Tensor(num_... | 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.... | AmorosTech/RP-R-CNN | AffineChannel2d | false | 13,241 | [
"MIT"
] | 78 | 45557a69ae9789e2662e3b937feb7624319a3e73 | https://github.com/AmorosTech/RP-R-CNN/tree/45557a69ae9789e2662e3b937feb7624319a3e73 |
RankCrossEntropyLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class RankCrossEntropyLoss(nn.Module):
"""Creates a criterion that measures rank cross entropy loss."""
__constants__ = ['num_neg']
def __init__(self, num_neg: 'int'=1):
"""
:class:`RankCrossEntropyLoss` constructor.
... | 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
... | Ambitioner-c/MatchZoo-py | RankCrossEntropyLoss | false | 13,242 | [
"Apache-2.0"
] | 468 | bb088edce8e01c2c2326ca1a8ac647f0d23f088d | https://github.com/Ambitioner-c/MatchZoo-py/tree/bb088edce8e01c2c2326ca1a8ac647f0d23f088d |
Upsample | import torch
import torch.nn as nn
class Upsample(nn.Module):
def __init__(self, stride=2):
super(Upsample, self).__init__()
self.stride = stride
def forward(self, x):
stride = self.stride
assert x.data.dim() == 4
B = x.data.size(0)
C = x.data.size(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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | AlexRogalskiy/smart-social-distancing | Upsample | false | 13,243 | [
"Apache-2.0"
] | 113 | 2def6738038035e67ac79fc9b72ba072e190321f | https://github.com/AlexRogalskiy/smart-social-distancing/tree/2def6738038035e67ac79fc9b72ba072e190321f |
VocabGraphConvolution | import math
import torch
import torch.nn as nn
import torch.nn.init as init
class VocabGraphConvolution(nn.Module):
"""Vocabulary GCN module.
Params:
`voc_dim`: The size of vocabulary graph
`num_adj`: The number of the adjacency matrix of Vocabulary graph
`hid_dim`: The hidden dimensi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.nn as nn
import torch.nn.init as init
assert_size_strid... | Aksh97/VGCN-BERT | VocabGraphConvolution | false | 13,244 | [
"MIT"
] | 106 | 62b5ae5a3c53f4bff555027d87a57d3a994a32bb | https://github.com/Aksh97/VGCN-BERT/tree/62b5ae5a3c53f4bff555027d87a57d3a994a32bb |
LuongAttention | import torch
import torch.nn.functional as F
from torch import nn
class LuongAttention(nn.Module):
"""
Luong Attention from Effective Approaches to Attention-based Neural Machine Translation
https://arxiv.org/pdf/1508.04025.pdf
"""
def __init__(self, attention_dim):
super(LuongAttention, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | A-Jacobson/minimal-nmt | LuongAttention | false | 13,245 | [
"MIT"
] | 45 | dc75e83579a181586acabfa3f22ad269d1e31fbf | https://github.com/A-Jacobson/minimal-nmt/tree/dc75e83579a181586acabfa3f22ad269d1e31fbf |
ConvNorm | import torch
import torch.utils.data
class ConvNorm(torch.nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,
padding=None, dilation=1, bias=True, w_init_gain='linear'):
super(ConvNorm, self).__init__()
if padding is None:
assert kernel_size % 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.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size... | AeroXi/Tacotron2-Mandarin | ConvNorm | false | 13,246 | [
"MIT"
] | 67 | b7bc213d1c1a9c3e2f2e11f69f586c2582010668 | https://github.com/AeroXi/Tacotron2-Mandarin/tree/b7bc213d1c1a9c3e2f2e11f69f586c2582010668 |
Actor | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, obs_dim, action_dim):
super(Actor, self).__init__()
self.obs_dim = obs_dim
self.action_dim = action_dim
self.linear1 = nn.Linear(self.obs_dim, 512)
self.linear2 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | AYUSHKABIRVERMA/Multi-agent-reinforcement-learning | Actor | false | 13,247 | [
"MIT"
] | 62 | cd7c13d723cd74dc278939d81d5dd1b0906cee7c | https://github.com/AYUSHKABIRVERMA/Multi-agent-reinforcement-learning/tree/cd7c13d723cd74dc278939d81d5dd1b0906cee7c |
ReOrgLayer | import torch
import torch.nn as nn
class ReOrgLayer(nn.Module):
def __init__(self, stride=2):
super(ReOrgLayer, self).__init__()
self.stride = stride
def forward(self, x):
assert x.data.dim() == 4
B, C, H, W = x.data.shape
hs = self.stride
ws = self.stride
... | 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... | AlexRogalskiy/smart-social-distancing | ReOrgLayer | false | 13,248 | [
"Apache-2.0"
] | 113 | 2def6738038035e67ac79fc9b72ba072e190321f | https://github.com/AlexRogalskiy/smart-social-distancing/tree/2def6738038035e67ac79fc9b72ba072e190321f |
ConvBlock | import torch
import torch.nn as nn
class ConvBlock(nn.Module):
"""
Simple 3x3 conv with padding size 1 (to leave the input size unchanged), followed by a ReLU.
"""
def __init__(self, input_channels: 'int', output_channels: 'int',
kernel_size: 'Param2D'=3, stride: 'Param2D'=1, padding: 'Param2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | AleksandrLiadov/fsdl-text-recognizer-2021-labs | ConvBlock | false | 13,249 | [
"MIT"
] | 402 | 9495e1457fc82ab83ff7e4141939d603565eb89b | https://github.com/AleksandrLiadov/fsdl-text-recognizer-2021-labs/tree/9495e1457fc82ab83ff7e4141939d603565eb89b |
MeanVoxelFeatureExtractor | import torch
import torch.nn as nn
class VoxelFeatureExtractor(nn.Module):
def __init__(self, **kwargs):
super().__init__()
def get_output_feature_dim(self):
raise NotImplementedError
def forward(self, **kwargs):
raise NotImplementedError
class MeanVoxelFeatureExtractor(VoxelF... | 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 |
Scale | import torch
import torch.nn as nn
import torch.utils.data
class Scale(nn.Module):
def __init__(self, init_value=1.0):
super(Scale, self).__init__()
self.scale = nn.Parameter(torch.FloatTensor([init_value]))
def forward(self, input):
return input * self.scale
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.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | AmorosTech/RP-R-CNN | Scale | false | 13,251 | [
"MIT"
] | 78 | 45557a69ae9789e2662e3b937feb7624319a3e73 | https://github.com/AmorosTech/RP-R-CNN/tree/45557a69ae9789e2662e3b937feb7624319a3e73 |
GaussianKernel | import torch
import torch.nn as nn
class GaussianKernel(nn.Module):
"""
Gaussian kernel module.
:param mu: Float, mean of the kernel.
:param sigma: Float, sigma of the kernel.
Examples:
>>> import torch
>>> kernel = GaussianKernel()
>>> x = torch.randn(4, 5, 10)
>... | 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... | Ambitioner-c/MatchZoo-py | GaussianKernel | false | 13,252 | [
"Apache-2.0"
] | 468 | bb088edce8e01c2c2326ca1a8ac647f0d23f088d | https://github.com/Ambitioner-c/MatchZoo-py/tree/bb088edce8e01c2c2326ca1a8ac647f0d23f088d |
CoordLoss | import torch
import torch.optim
import torch.nn as nn
class CoordLoss(nn.Module):
def __init__(self):
super(CoordLoss, self).__init__()
def forward(self, coord_out, coord_gt, valid, is_3D=None):
loss = torch.abs(coord_out - coord_gt) * valid
if is_3D is not None:
loss_z =... | 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.optim
import torch.nn as nn
assert_size_stride = torch._C._d... | Alan-delete/I2L-MeshNet_RELEASE | CoordLoss | false | 13,253 | [
"MIT"
] | 544 | 22d63becc6f6e558e5180a8718dbaa8dde1cc6e5 | https://github.com/Alan-delete/I2L-MeshNet_RELEASE/tree/22d63becc6f6e558e5180a8718dbaa8dde1cc6e5 |
ScaledDotProductAttention | import torch
import numpy as np
import torch.nn as nn
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super(ScaledDotProductAttention, self).__init__()
self.temperature = temperature
self.dropout = nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Aleph0Inc/HDSA-Dialog | ScaledDotProductAttention | false | 13,254 | [
"MIT"
] | 146 | 88e2604adb5dc38ae32205410b15b2ac39116ecd | https://github.com/Aleph0Inc/HDSA-Dialog/tree/88e2604adb5dc38ae32205410b15b2ac39116ecd |
L1 | import torch
import torch.nn as nn
class L1(nn.Module):
def __init__(self):
super(L1, self).__init__()
def forward(self, output, target):
lossvalue = torch.abs(output - target).mean()
return lossvalue
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | AnonymousAuthors444/VEC_VAD | L1 | false | 13,255 | [
"MIT"
] | 67 | 0072bf857030e621e2f9c12689407b81e45ed603 | https://github.com/AnonymousAuthors444/VEC_VAD/tree/0072bf857030e621e2f9c12689407b81e45ed603 |
FCN_mse | import torch
import torch.nn as nn
class FCN_mse(nn.Module):
"""
Predict whether pixels are part of the object or the background.
"""
def __init__(self, n_class):
super().__init__()
self.n_class = n_class
self.relu = nn.ReLU(inplace=True)
self.conv1 = nn.Conv2d(3, 16, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | AZdet/causal-infogan | FCN_mse | false | 13,256 | [
"MIT"
] | 89 | 146b647863a27542ad4a1a01ddb033cdcab9843d | https://github.com/AZdet/causal-infogan/tree/146b647863a27542ad4a1a01ddb033cdcab9843d |
PositionwiseFeedForward | import torch
import torch.nn as nn
import torch.nn.functional as F
class PositionwiseFeedForward(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_in, d_hid, dropout=0.1):
super(PositionwiseFeedForward, self).__init__()
self.w_1 = nn.Conv1d(d_in, d_hid, 1)
self.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Aleph0Inc/HDSA-Dialog | PositionwiseFeedForward | false | 13,257 | [
"MIT"
] | 146 | 88e2604adb5dc38ae32205410b15b2ac39116ecd | https://github.com/Aleph0Inc/HDSA-Dialog/tree/88e2604adb5dc38ae32205410b15b2ac39116ecd |
Categorical | import torch
import torch.nn as nn
class Categorical(nn.Module):
def __init__(self):
super().__init__()
def forward(self, log_p):
return torch.multinomial(log_p.exp(), 1).long().squeeze(1)
def get_inputs():
return [torch.rand([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.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | ArChiiii/TSP_DRL_PtrNet | Categorical | false | 13,258 | [
"MIT"
] | 59 | 8218a508c563d9641b341dff5a6241d90e4e031b | https://github.com/ArChiiii/TSP_DRL_PtrNet/tree/8218a508c563d9641b341dff5a6241d90e4e031b |
GatedConv2d | import torch
import torch.nn as nn
import torch.utils.data
class GatedConv2d(nn.Module):
def __init__(self, input_channels, output_channels, kernel_size, stride,
padding, dilation=1, activation=None):
super(GatedConv2d, self).__init__()
self.activation = activation
self.sigmoid = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | AWehenkel/UMNN | GatedConv2d | false | 13,259 | [
"BSD-3-Clause"
] | 69 | f93cb36040783dd60e14e0eda927899d3919825c | https://github.com/AWehenkel/UMNN/tree/f93cb36040783dd60e14e0eda927899d3919825c |
ProdAttention | import torch
import torch.nn as nn
import torch.optim
class ProdAttention(nn.Module):
def __init__(self):
super(ProdAttention, self).__init__()
def forward(self, eh, dhx, ax=None):
pax = eh * dhx
pax = torch.sum(pax, dim=2)
ax = nn.functional.softmax(pax, dim=1)
sx = ... | 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
... | AminJun/speech | ProdAttention | false | 13,260 | [
"Apache-2.0"
] | 642 | 95149ca3780d8590a36d8f1adeb8d6508a0ff1cc | https://github.com/AminJun/speech/tree/95149ca3780d8590a36d8f1adeb8d6508a0ff1cc |
L1_Charbonnier_loss | import torch
import torch.nn as nn
class L1_Charbonnier_loss(nn.Module):
"""L1 Charbonnierloss."""
def __init__(self):
super(L1_Charbonnier_loss, self).__init__()
self.eps = 1e-06
def forward(self, X, Y):
diff = torch.add(X, -Y)
error = torch.sqrt(diff * diff + self.eps)
... | 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... | AnimatedRNG/pytorch-LapSRN | L1_Charbonnier_loss | false | 13,261 | [
"MIT"
] | 270 | 1b7737abe6ccaef2d14b673d301edbace3414c02 | https://github.com/AnimatedRNG/pytorch-LapSRN/tree/1b7737abe6ccaef2d14b673d301edbace3414c02 |
MaxPoolStride1 | import torch
import torch.nn as nn
import torch.nn.functional as F
class MaxPoolStride1(nn.Module):
def __init__(self, kernel_size):
super(MaxPoolStride1, self).__init__()
self.kernel_size = kernel_size
self.pad = kernel_size - 1
def forward(self, x):
padded_x = F.pad(x, (0, ... | 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... | AlexRogalskiy/smart-social-distancing | MaxPoolStride1 | false | 13,262 | [
"Apache-2.0"
] | 113 | 2def6738038035e67ac79fc9b72ba072e190321f | https://github.com/AlexRogalskiy/smart-social-distancing/tree/2def6738038035e67ac79fc9b72ba072e190321f |
FocalLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class FocalLoss(nn.modules.loss._WeightedLoss):
def __init__(self, weight=None, gamma=2, reduction='mean'):
super(FocalLoss, self).__init__(weight, reduction=reduction)
self.gamma = gamma
self.weight = weight
def forw... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | AnassBenBouazza/Project-calibration-temperature_scaling | FocalLoss | false | 13,263 | [
"MIT"
] | 724 | cf96350f5e4349404fa092a97a71baf2bb7686ec | https://github.com/AnassBenBouazza/Project-calibration-temperature_scaling/tree/cf96350f5e4349404fa092a97a71baf2bb7686ec |
Attn | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Attn(nn.Module):
def __init__(self, method, hidden_size):
super(Attn, self).__init__()
self.method = method
self.hidden_size = hidden_size
self.attn = nn.Linear(self.hidden_size * 2, hidden_size)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Aleph0Inc/HDSA-Dialog | Attn | false | 13,264 | [
"MIT"
] | 146 | 88e2604adb5dc38ae32205410b15b2ac39116ecd | https://github.com/Aleph0Inc/HDSA-Dialog/tree/88e2604adb5dc38ae32205410b15b2ac39116ecd |
MultiHeadedAttention | import math
import torch
from torch import Tensor
import torch.nn as nn
class MultiHeadedAttention(nn.Module):
"""
Multi-Head Attention module from "Attention is All You Need"
Implementation modified from OpenNMT-py.
https://github.com/OpenNMT/OpenNMT-py
"""
def __init__(self, num_heads: 'in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | AmitMY/joeynmt | MultiHeadedAttention | false | 13,265 | [
"Apache-2.0"
] | 563 | b30d1d53823ced56113def8fb5d5f7905d3c059f | https://github.com/AmitMY/joeynmt/tree/b30d1d53823ced56113def8fb5d5f7905d3c059f |
SiLU | import torch
import torch as th
import torch.nn as nn
class SiLU(nn.Module):
def forward(self, x):
return x * th.sigmoid(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... | AranKomat/Diff-DALLE | SiLU | false | 13,266 | [
"MIT"
] | 53 | 9418e98e97b599c5c65f16ee168fedf76a29095f | https://github.com/AranKomat/Diff-DALLE/tree/9418e98e97b599c5c65f16ee168fedf76a29095f |
L2 | import torch
import torch.nn as nn
class L2(nn.Module):
def __init__(self):
super(L2, self).__init__()
def forward(self, output, target):
lossvalue = torch.norm(output - target, p=2, dim=1).mean()
return lossvalue
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([... | 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_... | AnonymousAuthors444/VEC_VAD | L2 | false | 13,267 | [
"MIT"
] | 67 | 0072bf857030e621e2f9c12689407b81e45ed603 | https://github.com/AnonymousAuthors444/VEC_VAD/tree/0072bf857030e621e2f9c12689407b81e45ed603 |
Flatten | import torch
from torch import nn
from torch.autograd import *
from itertools import product as product
from math import sqrt as sqrt
class Flatten(nn.Module):
def __init__(self):
super(Flatten, self).__init__()
def forward(self, x):
x = x.transpose(3, 2).contiguous()
return x.view(x... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from torch.autograd import *
from itertools import product as product
from math import sqrt as sqrt
assert_size_stride ... | Aristochi/Dangerous_driving_behavior_detection | Flatten | false | 13,268 | [
"MIT"
] | 96 | 596d0544c3ed8cbfbc322cc4cd7859a9ef539810 | https://github.com/Aristochi/Dangerous_driving_behavior_detection/tree/596d0544c3ed8cbfbc322cc4cd7859a9ef539810 |
ScaledLeakyReLU | import math
import torch
from torch import nn
import torch.nn.functional as F
class ScaledLeakyReLU(nn.Module):
def __init__(self, negative_slope=0.2):
super().__init__()
self.negative_slope = negative_slope
def forward(self, input):
out = F.leaky_relu(input, negative_slope=self.nega... | 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... | ArashVahabpour/encoder4editing-contrastive | ScaledLeakyReLU | false | 13,269 | [
"MIT"
] | 1,051 | 1b91afe1693e01a41118e1ce2451b7d14bec51f4 | https://github.com/ArashVahabpour/encoder4editing-contrastive/tree/1b91afe1693e01a41118e1ce2451b7d14bec51f4 |
LocalConv2d | import torch
import torch.nn as nn
import torch.nn.functional as F
class LocalConv2d(nn.Module):
def __init__(self, num_rows, num_feats_in, num_feats_out, kernel=1,
padding=0):
super(LocalConv2d, self).__init__()
self.num_rows = num_rows
self.out_channels = num_feats_out
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | AnuragSahu/M3D-RPN | LocalConv2d | false | 13,270 | [
"MIT"
] | 245 | 078ddfa0a7c48dc1d23e8da679997239ac62a72a | https://github.com/AnuragSahu/M3D-RPN/tree/078ddfa0a7c48dc1d23e8da679997239ac62a72a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.