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 |
|---|---|---|---|---|---|---|---|---|---|---|
Max_AvgPool | import torch
import torch.nn as nn
from itertools import product as product
class Max_AvgPool(nn.Module):
def __init__(self, kernel_size=(3, 3), stride=2, padding=1, dim=128):
super(Max_AvgPool, self).__init__()
self.Maxpool = nn.MaxPool2d(kernel_size=kernel_size, stride=stride,
paddi... | 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
from itertools import product as product
assert_size_stride = torch... | kooBH/EXTD_Pytorch | Max_AvgPool | false | 10,435 | [
"MIT"
] | 0 | e93b196c87054684cc6c757e1dfd26f8b7dc57cf | https://github.com/kooBH/EXTD_Pytorch/tree/e93b196c87054684cc6c757e1dfd26f8b7dc57cf |
my_AvgPool2d | from torch.nn import Module
import torch
import torch.nn.functional as F
from torch.nn.modules.module import Module
class my_AvgPool2d(Module):
def __init__(self, kernel_size, stride=None, padding=0, ceil_mode=False,
count_include_pad=True):
super(my_AvgPool2d, self).__init__()
self.kerne... | 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
from torch.nn.modules.module import Module
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty... | likun97/Low_quality_classification_with_mobilenetv3 | my_AvgPool2d | false | 10,436 | [
"Apache-2.0"
] | 0 | a9e6f66caad937fc7c8e101cddb76f116219b255 | https://github.com/likun97/Low_quality_classification_with_mobilenetv3/tree/a9e6f66caad937fc7c8e101cddb76f116219b255 |
Conv2dLayer | import torch
import torch.nn as nn
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-08, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
self.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | kangzhiq/DeepFillv2_Pytorch | Conv2dLayer | false | 10,437 | [
"MIT"
] | 0 | 9c7ed61b25bb995713f89108b712490737abe1b1 | https://github.com/kangzhiq/DeepFillv2_Pytorch/tree/9c7ed61b25bb995713f89108b712490737abe1b1 |
GatedConv2d | import torch
import torch.nn as nn
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-08, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
self.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | kangzhiq/DeepFillv2_Pytorch | GatedConv2d | false | 10,438 | [
"MIT"
] | 0 | 9c7ed61b25bb995713f89108b712490737abe1b1 | https://github.com/kangzhiq/DeepFillv2_Pytorch/tree/9c7ed61b25bb995713f89108b712490737abe1b1 |
my_MaxPool2d | from torch.nn import Module
import torch
import torch.nn.functional as F
from torch.nn.modules.module import Module
from torch.nn.modules.utils import _pair
class my_MaxPool2d(Module):
def __init__(self, kernel_size, stride=None, padding=0, dilation=1,
return_indices=False, ceil_mode=False):
supe... | 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 import Module
from torch.nn.modules.module import Module
from torch.nn.modu... | likun97/Low_quality_classification_with_mobilenetv3 | my_MaxPool2d | false | 10,439 | [
"Apache-2.0"
] | 0 | a9e6f66caad937fc7c8e101cddb76f116219b255 | https://github.com/likun97/Low_quality_classification_with_mobilenetv3/tree/a9e6f66caad937fc7c8e101cddb76f116219b255 |
BaselineActor | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.functional import F
from torch.nn import functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.distributions
class BaselineActor(nn.Module):
def __init__(se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | greenstar1151/pytorch-benchmark | BaselineActor | false | 10,440 | [
"BSD-3-Clause"
] | 0 | 8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b | https://github.com/greenstar1151/pytorch-benchmark/tree/8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b |
PMA | import math
import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def qkv_attention(queries, keys, values, presence=None):
"""
Transformer-like self-attention.
Args:
queries: Tensor of shape [B, N, d_k].
keys: Tensor of shape [B, M, d_k].
values: : Tensor... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | karayanni/torch-scae | PMA | false | 10,441 | [
"Apache-2.0"
] | 0 | e044662d8942d8d1923d13d071f375144cf4a1e8 | https://github.com/karayanni/torch-scae/tree/e044662d8942d8d1923d13d071f375144cf4a1e8 |
ISAB | import math
import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def qkv_attention(queries, keys, values, presence=None):
"""
Transformer-like self-attention.
Args:
queries: Tensor of shape [B, N, d_k].
keys: Tensor of shape [B, M, d_k].
values: : Tensor... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | karayanni/torch-scae | ISAB | false | 10,442 | [
"Apache-2.0"
] | 0 | e044662d8942d8d1923d13d071f375144cf4a1e8 | https://github.com/karayanni/torch-scae/tree/e044662d8942d8d1923d13d071f375144cf4a1e8 |
adder2d | from torch.autograd import Function
import math
import torch
import torch.nn as nn
def adder2d_function(X, W, stride=1, padding=0):
n_filters, _d_filter, h_filter, w_filter = W.size()
n_x, _d_x, h_x, w_x = X.size()
h_out = (h_x - h_filter + 2 * padding) / stride + 1
w_out = (w_x - w_filter + 2 * paddi... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch.autograd import Function
import math
import torch.nn as nn
ass... | mark531593296/AdderNet | adder2d | false | 10,443 | [
"BSD-3-Clause"
] | 0 | 2936728f537c0cceb8a47727630e5723af86df61 | https://github.com/mark531593296/AdderNet/tree/2936728f537c0cceb8a47727630e5723af86df61 |
BaselineDiscreteCritic | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.functional import F
from torch.nn import functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.distributions
class BaselineDiscreteCritic(nn.Module):
def __... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | greenstar1151/pytorch-benchmark | BaselineDiscreteCritic | false | 10,444 | [
"BSD-3-Clause"
] | 0 | 8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b | https://github.com/greenstar1151/pytorch-benchmark/tree/8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b |
TransposeGatedConv2d | import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-08, affine=True):
super(LayerNorm, self).__init__()
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.triton_helpers import libdevice
import torch.nn as ... | kangzhiq/DeepFillv2_Pytorch | TransposeGatedConv2d | false | 10,445 | [
"MIT"
] | 0 | 9c7ed61b25bb995713f89108b712490737abe1b1 | https://github.com/kangzhiq/DeepFillv2_Pytorch/tree/9c7ed61b25bb995713f89108b712490737abe1b1 |
NextSentencePrediction | 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.distributions
class NextSentencePrediction(nn.Module):
"""
2-class classification model : is_next, is_not_next
"""
def __init__(self, hidden):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | greenstar1151/pytorch-benchmark | NextSentencePrediction | false | 10,446 | [
"BSD-3-Clause"
] | 0 | 8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b | https://github.com/greenstar1151/pytorch-benchmark/tree/8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b |
AttentionPool2d | import math
import torch
from torch import nn
import torch as th
def conv_nd(dims, *args, **kwargs):
"""
Create a 1D, 2D, or 3D convolution module.
"""
if dims == 1:
return nn.Conv1d(*args, **kwargs)
elif dims == 2:
return nn.Conv2d(*args, **kwargs)
elif dims == 3:
retu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | litevxx/glid-3 | AttentionPool2d | false | 10,447 | [
"MIT"
] | 0 | d7bd53e671d642b0cbc8af81197170b585c7e624 | https://github.com/litevxx/glid-3/tree/d7bd53e671d642b0cbc8af81197170b585c7e624 |
ConcreteDenseMixture | import torch
import numpy as np
from torch import nn
class ConcreteDropout(nn.Module):
def __init__(self, weight_regularizer=1e-06, dropout_regularizer=1e-05,
init_min=0.1, init_max=0.1):
super(ConcreteDropout, self).__init__()
self.weight_regularizer = weight_regularizer
self.dro... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libd... | jiwoncpark/fast-forward | ConcreteDenseMixture | false | 10,448 | [
"MIT"
] | 0 | 640a521241a8756be2a0d42282e88d56a2290fca | https://github.com/jiwoncpark/fast-forward/tree/640a521241a8756be2a0d42282e88d56a2290fca |
FirstBlock | import torch
import numpy as np
import torch.nn as nn
class BatchNormLayer(nn.Module):
"""Implements batch normalization layer."""
def __init__(self, channels, gamma=False, beta=True, decay=0.9, epsilon
=1e-05):
"""Initializes with basic settings.
Args:
channels: Number of 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
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | lelechen63/idinvert_pytorch | FirstBlock | false | 10,449 | [
"MIT"
] | 0 | 0469e1e5460ee4dd626c05bd35a83d52f9dc2cac | https://github.com/lelechen63/idinvert_pytorch/tree/0469e1e5460ee4dd626c05bd35a83d52f9dc2cac |
LastBlock | import torch
import numpy as np
import torch.nn as nn
class BatchNormLayer(nn.Module):
"""Implements batch normalization layer."""
def __init__(self, channels, gamma=False, beta=True, decay=0.9, epsilon
=1e-05):
"""Initializes with basic settings.
Args:
channels: Number of 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
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | lelechen63/idinvert_pytorch | LastBlock | false | 10,450 | [
"MIT"
] | 0 | 0469e1e5460ee4dd626c05bd35a83d52f9dc2cac | https://github.com/lelechen63/idinvert_pytorch/tree/0469e1e5460ee4dd626c05bd35a83d52f9dc2cac |
MLP | import torch
import torch.nn as nn
import torch.nn.functional as F
class MLP(nn.Module):
def __init__(self):
super(MLP, self).__init__()
self.fc1 = nn.Linear(28 * 28, 512)
self.fc2 = nn.Linear(512, 256)
self.fc3 = nn.Linear(256, 64)
self.fc4 = nn.Linear(64, 10)
sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | lynfi/Classification | MLP | false | 10,451 | [
"MIT"
] | 0 | 691731629c6577432c8c9eee70b67911011a07b7 | https://github.com/lynfi/Classification/tree/691731629c6577432c8c9eee70b67911011a07b7 |
CausalConv1d | import torch
import torch.nn as nn
import torch.nn.functional as F
class CausalConv1d(nn.Conv1d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
dilation=1, groups=1, bias=True):
super(CausalConv1d, self).__init__(in_channels, out_channels,
kernel_size, stride=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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | marc-moreaux/pytorch_text_generator | CausalConv1d | false | 10,452 | [
"MIT"
] | 0 | 99dd11c67d89f8a09faa28b7032fcc66f90672c0 | https://github.com/marc-moreaux/pytorch_text_generator/tree/99dd11c67d89f8a09faa28b7032fcc66f90672c0 |
PositionwiseFeedForward | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.functional import F
from torch.nn import functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.distributions
class PositionwiseFeedForward(nn.Module):
"""Imp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | greenstar1151/pytorch-benchmark | PositionwiseFeedForward | false | 10,453 | [
"BSD-3-Clause"
] | 0 | 8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b | https://github.com/greenstar1151/pytorch-benchmark/tree/8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b |
Decoder | import torch
import torch.nn as nn
class Decoder(nn.Module):
def __init__(self, latent_size, m):
super(Decoder, self).__init__()
self.latent_size = latent_size
self.fc = nn.Linear(latent_size, m)
self.deconv1 = nn.ConvTranspose2d(m, 128, 5, stride=2)
self.deconv2 = nn.Conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | lshoek/creative-evo-controller | Decoder | false | 10,454 | [
"MIT"
] | 0 | a5f1742c172255cca2338b76ae1c5b4db277bb0d | https://github.com/lshoek/creative-evo-controller/tree/a5f1742c172255cca2338b76ae1c5b4db277bb0d |
TemporalConv | import torch
import torch.nn.functional as F
import torch.nn as nn
class TemporalConv(nn.Module):
"""Temporal convolution block applied to nodes in the STGCN Layer
For details see: `"Spatio-Temporal Graph Convolutional Networks:
A Deep Learning Framework for Traffic Forecasting"
<https://arxiv.org/ab... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | marcdemers/pytorch_geometric_temporal | TemporalConv | false | 10,455 | [
"MIT"
] | 0 | 446aadcd890158bade2e9974f9840ed5a7bba827 | https://github.com/marcdemers/pytorch_geometric_temporal/tree/446aadcd890158bade2e9974f9840ed5a7bba827 |
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 |
PairwiseRankingLoss | import torch
from torch import nn
class PairwiseRankingLoss(nn.Module):
"""
Pairwise ranking loss
"""
def __init__(self, margin):
super(PairwiseRankingLoss, self).__init__()
self.margin = margin
def forward(self, anchor1, anchor2, img_sentc, sent_imgc):
cost_sent = torch.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | maksimovVva/SentEval | PairwiseRankingLoss | false | 10,457 | [
"BSD-3-Clause"
] | 0 | d3aa5f24dd84b48ea476e73f4b59a4e1ace7775c | https://github.com/maksimovVva/SentEval/tree/d3aa5f24dd84b48ea476e73f4b59a4e1ace7775c |
DiscreteNet | import torch
import torch.nn as nn
import torch.nn.functional as F
def set_init(layers):
for layer in layers:
nn.init.normal_(layer.weight, mean=0.0, std=0.1)
nn.init.constant_(layer.bias, 0.0)
class DiscreteNet(nn.Module):
def __init__(self, s_dim, a_dim):
super(DiscreteNet, self).... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | lws803/pytorch-A3C | DiscreteNet | false | 10,458 | [
"MIT"
] | 0 | 944e7f42a8fa54b7d6efbe169d8a3467b20a0f7f | https://github.com/lws803/pytorch-A3C/tree/944e7f42a8fa54b7d6efbe169d8a3467b20a0f7f |
NoiseLayer | import torch
import torch.nn as nn
class NoiseLayer(nn.Module):
"""adds noise. noise is per pixel (constant over channels) with per-channel weight"""
def __init__(self, channels):
super().__init__()
self.weight = nn.Parameter(torch.zeros(channels))
self.noise = None
def forward(s... | 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | justinpinkney/ganspace | NoiseLayer | false | 10,459 | [
"Apache-2.0"
] | 0 | 7dc76d1d2ddad21d946a7ceb375efe5d5316fb3f | https://github.com/justinpinkney/ganspace/tree/7dc76d1d2ddad21d946a7ceb375efe5d5316fb3f |
mlp | import torch
import torch.nn as nn
class mlp(nn.Module):
def __init__(self, seq_len):
super(mlp, self).__init__()
self.lin1 = nn.Linear(seq_len, 2048)
self.lin2 = nn.Linear(2048, 2048)
self.lin3 = nn.Linear(2048, seq_len)
self.relu = nn.ReLU()
def forward(self, input_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | liuziyang1106/sodeep | mlp | false | 10,460 | [
"BSD-3-Clause-Clear"
] | 0 | 47f8a5cbe5b8405624877efc81cb28f104f1e2d7 | https://github.com/liuziyang1106/sodeep/tree/47f8a5cbe5b8405624877efc81cb28f104f1e2d7 |
GetSegPred | import torch
import torch.utils.data.dataset
class GetSegPred(torch.nn.Module):
def __init__(self, scale):
super(GetSegPred, self).__init__()
self.scale = scale // 2
def forward(self, segs, ptcloud):
temp_cloud = torch.round((ptcloud + 1) * self.scale - 0.501).long()
temp_clo... | 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.utils.data.dataset
assert_size_stride = torch._C._dynamo.guards.as... | melisataspinar/Concurrent-Completion-and-Part-Segmentation-for-3D-Missing-Point-Clouds-viaSynergistic-Feature-Mappi | GetSegPred | false | 10,461 | [
"MIT"
] | 0 | 3b03f3c167d9927a660d798ffcd8ecc0f5cbaf89 | https://github.com/melisataspinar/Concurrent-Completion-and-Part-Segmentation-for-3D-Missing-Point-Clouds-viaSynergistic-Feature-Mappi/tree/3b03f3c167d9927a660d798ffcd8ecc0f5cbaf89 |
StyleMod | import torch
import torch.nn as nn
import torch.nn.functional as F
class MyLinear(nn.Module):
"""Linear layer with equalized learning rate and custom learning rate multiplier."""
def __init__(self, input_size, output_size, gain=2 ** 0.5, use_wscale=
False, lrmul=1, bias=True):
super().__init_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional as F
assert_size_stride = torch... | justinpinkney/ganspace | StyleMod | false | 10,462 | [
"Apache-2.0"
] | 0 | 7dc76d1d2ddad21d946a7ceb375efe5d5316fb3f | https://github.com/justinpinkney/ganspace/tree/7dc76d1d2ddad21d946a7ceb375efe5d5316fb3f |
MultiHeadedAttention | import math
import torch
from typing import Optional
import torch.nn.functional as F
from torch import nn
def attention(query, key, value, mask=None, dropout=None):
"""Compute 'Scaled Dot Product Attention'
"""
d_k = query.size(-1)
scores = torch.matmul(query, key.transpose(-2, -1)) / math.sqrt(d_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.... | malhotraa/transformer-experiments | MultiHeadedAttention | false | 10,463 | [
"MIT"
] | 0 | 82931b89b14d26dbd6e4ffef8d6f2fd8b7279c0f | https://github.com/malhotraa/transformer-experiments/tree/82931b89b14d26dbd6e4ffef8d6f2fd8b7279c0f |
GE2ELoss | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.functional import F
from torch.nn import functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.distributions
class GE2ELoss(nn.Module):
def __init__(self, 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.... | greenstar1151/pytorch-benchmark | GE2ELoss | false | 10,464 | [
"BSD-3-Clause"
] | 0 | 8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b | https://github.com/greenstar1151/pytorch-benchmark/tree/8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b |
MyLinear | import torch
import torch.nn as nn
import torch.nn.functional as F
class MyLinear(nn.Module):
"""Linear layer with equalized learning rate and custom learning rate multiplier."""
def __init__(self, input_size, output_size, gain=2 ** 0.5, use_wscale=
False, lrmul=1, bias=True):
super().__init_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | justinpinkney/ganspace | MyLinear | false | 10,465 | [
"Apache-2.0"
] | 0 | 7dc76d1d2ddad21d946a7ceb375efe5d5316fb3f | https://github.com/justinpinkney/ganspace/tree/7dc76d1d2ddad21d946a7ceb375efe5d5316fb3f |
VAE | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class VAE(nn.Module):
def __init__(self):
super(VAE, self).__init__()
self.fc1 = nn.Linear(784, 500)
self.fc21 = nn.Linear(500, 5)
self.fc22 = nn.Linear(500, 5)
self.fc3 = nn.Linear(... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from... | mcabbott/Avalon.jl | VAE | false | 10,466 | [
"MIT"
] | 0 | 6885bcc8204952a2396e762ce51432d9969c4138 | https://github.com/mcabbott/Avalon.jl/tree/6885bcc8204952a2396e762ce51432d9969c4138 |
ContinuousNet | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def set_init(layers):
for layer in layers:
nn.init.normal_(layer.weight, mean=0.0, std=0.1)
nn.init.constant_(layer.bias, 0.0)
class ContinuousNet(nn.Module):
def __init__(self, s_dim, a_dim):
super(Conti... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | lws803/pytorch-A3C | ContinuousNet | false | 10,467 | [
"MIT"
] | 0 | 944e7f42a8fa54b7d6efbe169d8a3467b20a0f7f | https://github.com/lws803/pytorch-A3C/tree/944e7f42a8fa54b7d6efbe169d8a3467b20a0f7f |
FullAttention | from torch.nn import Module
import torch
from torch.nn import Dropout
class FullAttention(Module):
def __init__(self, use_dropout=False, attention_dropout=0.1):
super().__init__()
self.use_dropout = use_dropout
self.dropout = Dropout(attention_dropout)
def forward(self, queries, keys... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | lee-vius/LoFTR | FullAttention | false | 10,468 | [
"Apache-2.0"
] | 0 | dd9add373a20696fb6f020f4fda38bca7a91cdd9 | https://github.com/lee-vius/LoFTR/tree/dd9add373a20696fb6f020f4fda38bca7a91cdd9 |
LRN | import torch
import torch.nn as nn
class LRN(nn.Module):
def __init__(self, local_size=1, alpha=0.0001, beta=0.75,
ACROSS_CHANNELS=False):
super(LRN, self).__init__()
self.ACROSS_CHANNELS = ACROSS_CHANNELS
if self.ACROSS_CHANNELS:
self.average = nn.AvgPool3d(kernel_siz... | 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_... | melster1010/VIAME | LRN | false | 10,469 | [
"BSD-3-Clause"
] | 0 | 0062265088aae65effbfcd130bfb874c343c785f | https://github.com/melster1010/VIAME/tree/0062265088aae65effbfcd130bfb874c343c785f |
LinearAttention | from torch.nn import Module
import torch
def elu_feature_map(x):
return torch.nn.functional.elu(x) + 1
class LinearAttention(Module):
def __init__(self, eps=1e-06):
super().__init__()
self.feature_map = elu_feature_map
self.eps = eps
def forward(self, queries, keys, values, q_m... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn impor... | lee-vius/LoFTR | LinearAttention | false | 10,470 | [
"Apache-2.0"
] | 0 | dd9add373a20696fb6f020f4fda38bca7a91cdd9 | https://github.com/lee-vius/LoFTR/tree/dd9add373a20696fb6f020f4fda38bca7a91cdd9 |
Descendant | import torch
from torch import nn
import torch.nn.functional as F
class Descendant(nn.Module):
"""Descendant descendantEncoder model for ADDA."""
def __init__(self):
"""Init Descendant descendantEncoder."""
super(Descendant, self).__init__()
self.restored = False
self.conv1 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | lindagaw/Kadara | Descendant | false | 10,471 | [
"MIT"
] | 0 | f1059b69a581344ca460c8df02ac3f73f3fbcba1 | https://github.com/lindagaw/Kadara/tree/f1059b69a581344ca460c8df02ac3f73f3fbcba1 |
Block | import math
import torch
from typing import Optional
import torch.nn.functional as F
from torch import nn
def attention(query, key, value, mask=None, dropout=None):
"""Compute 'Scaled Dot Product Attention'
"""
d_k = query.size(-1)
scores = torch.matmul(query, key.transpose(-2, -1)) / math.sqrt(d_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.... | malhotraa/transformer-experiments | Block | false | 10,472 | [
"MIT"
] | 0 | 82931b89b14d26dbd6e4ffef8d6f2fd8b7279c0f | https://github.com/malhotraa/transformer-experiments/tree/82931b89b14d26dbd6e4ffef8d6f2fd8b7279c0f |
BinaryLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class BinaryLoss(nn.Module):
def __init__(self):
super(BinaryLoss, self).__init__()
def forward(self, pos_score, neg_score):
pos_loss = -F.log_softmax(pos_score)[:, 1]
neg_loss = -F.log_softmax(neg_score)[:, 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
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | melster1010/VIAME | BinaryLoss | false | 10,473 | [
"BSD-3-Clause"
] | 0 | 0062265088aae65effbfcd130bfb874c343c785f | https://github.com/melster1010/VIAME/tree/0062265088aae65effbfcd130bfb874c343c785f |
Successor | import torch
from torch import nn
import torch.nn.functional as F
class Successor(nn.Module):
"""Successor successorEncoder model for ADDA."""
def __init__(self):
"""Init Successor successorEncoder."""
super(Successor, self).__init__()
self.restored = False
self.conv1 = nn.Con... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | lindagaw/Kadara | Successor | false | 10,474 | [
"MIT"
] | 0 | f1059b69a581344ca460c8df02ac3f73f3fbcba1 | https://github.com/lindagaw/Kadara/tree/f1059b69a581344ca460c8df02ac3f73f3fbcba1 |
MHSA | import torch
from torch import nn
class MHSA(nn.Module):
def __init__(self, height, width, dim, head):
super(MHSA, self).__init__()
self.head = head
self.r_h = nn.Parameter(data=torch.randn(1, head, dim // head, 1,
height), requires_grad=True)
self.r_w = nn.Parameter(d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | lzu-zhanghr/vision-transformer-zoo | MHSA | false | 10,475 | [
"MIT"
] | 0 | 2cc6e3551c39816acc95ade040bbf9bd115a6b03 | https://github.com/lzu-zhanghr/vision-transformer-zoo/tree/2cc6e3551c39816acc95ade040bbf9bd115a6b03 |
IdentityPadding | import torch
import torch.nn as nn
import torch.nn.functional as F
class IdentityPadding(nn.Module):
def __init__(self, in_channels, out_channels, stride):
super(IdentityPadding, self).__init__()
self.pooling = nn.MaxPool2d(1, stride=stride)
self.add_channels = out_channels - in_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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | moerashidi/deep_ensemble | IdentityPadding | false | 10,476 | [
"MIT"
] | 0 | 51cd890643b0f01849583e6585eef241776b0ef4 | https://github.com/moerashidi/deep_ensemble/tree/51cd890643b0f01849583e6585eef241776b0ef4 |
MutliClassNN | import torch
from torch import nn
class MutliClassNN(nn.Module):
def __init__(self, num_features, num_labels):
super(MutliClassNN, self).__init__()
self.fc1 = torch.nn.Linear(num_features, 1000)
self.fc3 = torch.nn.Linear(1000, num_labels)
def forward(self, x):
x = torch.relu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | mhagenow01/ECE532ClassifierComparison | MutliClassNN | false | 10,477 | [
"MIT"
] | 0 | 5066931d97aae2c25c8b9451fe3d12021f5748a1 | https://github.com/mhagenow01/ECE532ClassifierComparison/tree/5066931d97aae2c25c8b9451fe3d12021f5748a1 |
SymKlCriterion | import torch
import torch.nn.functional as F
from torch.nn.modules.loss import _Loss
from torch.optim.lr_scheduler import *
class Criterion(_Loss):
def __init__(self, alpha=1.0, name='criterion'):
super().__init__()
"""Alpha is used to weight each loss term
"""
self.alpha = alpha
... | 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.... | mahartmann/mt-dnn | SymKlCriterion | false | 10,479 | [
"MIT"
] | 0 | c9aa3379dc255fd8fc40f24b6cd508f6a645b32f | https://github.com/mahartmann/mt-dnn/tree/c9aa3379dc255fd8fc40f24b6cd508f6a645b32f |
KlCriterion | import torch
import torch.nn.functional as F
from torch.nn.modules.loss import _Loss
from torch.optim.lr_scheduler import *
class Criterion(_Loss):
def __init__(self, alpha=1.0, name='criterion'):
super().__init__()
"""Alpha is used to weight each loss term
"""
self.alpha = alpha
... | 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.... | mahartmann/mt-dnn | KlCriterion | false | 10,480 | [
"MIT"
] | 0 | c9aa3379dc255fd8fc40f24b6cd508f6a645b32f | https://github.com/mahartmann/mt-dnn/tree/c9aa3379dc255fd8fc40f24b6cd508f6a645b32f |
FlowHead | import torch
import torch.nn as nn
class FlowHead(nn.Module):
def __init__(self, input_dim=128, hidden_dim=256):
super(FlowHead, self).__init__()
self.conv1 = nn.Conv2d(input_dim, hidden_dim, 3, padding=1)
self.conv2 = nn.Conv2d(hidden_dim, 2, 3, padding=1)
self.relu = nn.ReLU(inp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | luyu94/RAFT | FlowHead | false | 10,481 | [
"BSD-3-Clause"
] | 0 | d0a37db031af49a5d0d9b524d214acc989becf5b | https://github.com/luyu94/RAFT/tree/d0a37db031af49a5d0d9b524d214acc989becf5b |
DPLSTMCell | import math
import torch
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.parallel
from typing import Tuple
class LSTMLinear(nn.Linear):
"""
This function is the same as a nn.Linear layer, except that in the backward pass
the grad_samples get accumulated (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.triton_helpers import libdevice
import math
import ... | madhavajay/opacus | DPLSTMCell | false | 10,482 | [
"Apache-2.0"
] | 0 | 7ae098764b4cf2388c66e263dd8d56bca0a290d0 | https://github.com/madhavajay/opacus/tree/7ae098764b4cf2388c66e263dd8d56bca0a290d0 |
PositionWiseFeedForward | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
def gelu(x):
"""Implementation of the gelu activation function by Hugging Face"""
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
class PositionWiseFeedForward(nn.Module):
""" FeedForward Neural Networks ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | FengMingquan-sjtu/pytorchic-bert | PositionWiseFeedForward | false | 10,483 | [
"Apache-2.0"
] | 0 | 83d616fb9c7e1d5c3646f9b6267ca912e2616d65 | https://github.com/FengMingquan-sjtu/pytorchic-bert/tree/83d616fb9c7e1d5c3646f9b6267ca912e2616d65 |
AttentionUnit | import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import init
class AttentionUnit(nn.Module):
def __init__(self, sDim, xDim, attDim):
super(AttentionUnit, self).__init__()
self.sDim = sDim
self.xDim = xDim
self.attDim = attDim
self.sEmbed = 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.... | lohzhunyewcs/aster.pytorch | AttentionUnit | false | 10,484 | [
"MIT"
] | 0 | 9441d386135a73b1baa3ec8c505f5eba99c26905 | https://github.com/lohzhunyewcs/aster.pytorch/tree/9441d386135a73b1baa3ec8c505f5eba99c26905 |
FeatureResizer | import torch
import torch.utils.data
import torch
import torch.nn
import torch.optim
import torch.utils
from torch import nn
import torch.distributed
class FeatureResizer(nn.Module):
"""
This class takes as input a set of embeddings of dimension C1 and outputs a set of
embedding of dimension C2, after a l... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.... | mmaaz60/mdetr | FeatureResizer | false | 10,485 | [
"Apache-2.0"
] | 0 | fe1394c67e76a6c7e521bbda77d8294714038a3a | https://github.com/mmaaz60/mdetr/tree/fe1394c67e76a6c7e521bbda77d8294714038a3a |
PairwiseRankerModel | import torch
import torch.onnx
import torch.nn as nn
class PairwiseRankerModel(nn.Module):
def __init__(self, embedding_size):
super(PairwiseRankerModel, self).__init__()
self.query_doc_transform = torch.nn.Linear(in_features=
embedding_size * 2, out_features=embedding_size)
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.onnx
import torch.nn as nn
assert_size_stride = torch._C._dynamo.gu... | mikhail-tsir/vespa-exloration | PairwiseRankerModel | false | 10,486 | [
"Apache-2.0"
] | 0 | 9bebc00acb43021fa60c6e144fe4f1fa1d7719fc | https://github.com/mikhail-tsir/vespa-exloration/tree/9bebc00acb43021fa60c6e144fe4f1fa1d7719fc |
DNN_Classifier | import torch
from torch import nn
class DNN_Classifier(torch.nn.Module):
def __init__(self, input_dim, nb_categories, hidden_dim=100):
super(DNN_Classifier, self).__init__()
self.fc_1 = nn.Linear(input_dim, hidden_dim)
self.fc_2 = nn.Linear(hidden_dim, nb_categories)
self.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.... | mleila/AGNews_Document_Classifcation | DNN_Classifier | false | 10,487 | [
"MIT"
] | 0 | 1ff44edf1fcaaee582b79141a419d61df62da56e | https://github.com/mleila/AGNews_Document_Classifcation/tree/1ff44edf1fcaaee582b79141a419d61df62da56e |
PositionEmbs | import torch
import torch.nn as nn
class PositionEmbs(nn.Module):
def __init__(self, num_patches, emb_dim, dropout_rate=0.1):
super(PositionEmbs, self).__init__()
self.pos_embedding = nn.Parameter(torch.randn(1, num_patches + 1,
emb_dim))
if dropout_rate > 0:
self.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | longxianlei/UtilsTools | PositionEmbs | false | 10,488 | [
"MIT"
] | 0 | f45c648eb679ed59bb512b61a1af52938e326ac3 | https://github.com/longxianlei/UtilsTools/tree/f45c648eb679ed59bb512b61a1af52938e326ac3 |
FPNHead | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
class FPNHead(nn.Module):
def __init__(self, num_in, num_mid, num_out):
super().__init__()
self.block0 = nn.Conv2d(num_in, num_mid, kernel_size=3, padding=1,
bias=False)
self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | lePossum/DeblurGANv2 | FPNHead | false | 10,489 | [
"BSD-2-Clause"
] | 0 | b02c86de98f98604e2416a3a6121110ede7a2de9 | https://github.com/lePossum/DeblurGANv2/tree/b02c86de98f98604e2416a3a6121110ede7a2de9 |
ClipLayer | import torch
import torch.nn as nn
def clip_data(data, max_norm):
norms = torch.norm(data.reshape(data.shape[0], -1), dim=-1)
scale = (max_norm / norms).clamp(max=1.0)
data *= scale.reshape(-1, 1, 1, 1)
return data
class ClipLayer(nn.Module):
def __init__(self, max_norm):
super(ClipLaye... | 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... | lxuechen/Handcrafted-DP | ClipLayer | false | 10,490 | [
"MIT"
] | 0 | 64ca4759238027e307d8e88215a0a86fc8f3b395 | https://github.com/lxuechen/Handcrafted-DP/tree/64ca4759238027e307d8e88215a0a86fc8f3b395 |
PolynomialEnvelope | import torch
class PolynomialEnvelope(torch.nn.Module):
"""
Polynomial envelope function that ensures a smooth cutoff.
Parameters
----------
exponent: int
Exponent of the envelope function.
"""
def __init__(self, exponent):
super().__init__()
assert expone... | 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... | krylea/ocp | PolynomialEnvelope | false | 10,491 | [
"MIT"
] | 0 | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | https://github.com/krylea/ocp/tree/00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 |
ScaledSiLU | import torch
class ScaledSiLU(torch.nn.Module):
def __init__(self):
super().__init__()
self.scale_factor = 1 / 0.6
self._activation = torch.nn.SiLU()
def forward(self, x):
return self._activation(x) * self.scale_factor
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | krylea/ocp | ScaledSiLU | false | 10,492 | [
"MIT"
] | 0 | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | https://github.com/krylea/ocp/tree/00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 |
SiQU | import torch
class SiQU(torch.nn.Module):
def __init__(self):
super().__init__()
self._activation = torch.nn.SiLU()
def forward(self, x):
return x * self._activation(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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | krylea/ocp | SiQU | false | 10,493 | [
"MIT"
] | 0 | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | https://github.com/krylea/ocp/tree/00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 |
DPSLTMAdapter | import math
import torch
from torch import Tensor
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.parallel
from typing import Tuple
from typing import List
from typing import Optional
from typing import Dict
from typing import Union
from torch.nn.modules.module import _... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | madhavajay/opacus | DPSLTMAdapter | false | 10,494 | [
"Apache-2.0"
] | 0 | 7ae098764b4cf2388c66e263dd8d56bca0a290d0 | https://github.com/madhavajay/opacus/tree/7ae098764b4cf2388c66e263dd8d56bca0a290d0 |
CombineSlices | import torch
from torch import nn
import torch.utils.data
import torch.utils.data.distributed
import torch.optim
class CombineSlices(nn.Module):
def __init__(self, slice_dim=2):
super().__init__()
self.slice_dim = slice_dim
def forward(self, x):
return torch.index_select(x, dim=self.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.utils.data
import torch.utils.data.distributed
import torch.optim
assert_size_stride = torch._C._dynamo.gu... | kapoor1992/fastMRI | CombineSlices | false | 10,495 | [
"MIT"
] | 0 | 6b0af94663faa55a2dd901a6a5cbb7d7b5f4cf6d | https://github.com/kapoor1992/fastMRI/tree/6b0af94663faa55a2dd901a6a5cbb7d7b5f4cf6d |
Discriminator | import torch
import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self, n_h):
super(Discriminator, self).__init__()
self.f_k = nn.Bilinear(n_h, n_h, 1)
for m in self.modules():
self.weights_init(m)
def weights_init(self, m):
if isinstance(m, nn.Bilin... | 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... | mess-clarifai/DGI | Discriminator | false | 10,496 | [
"MIT"
] | 0 | 3a7c96d59991d448b84d709916d1d5f256e5b9be | https://github.com/mess-clarifai/DGI/tree/3a7c96d59991d448b84d709916d1d5f256e5b9be |
SphericalBesselBasis | import math
import torch
import numpy as np
class SphericalBesselBasis(torch.nn.Module):
"""
1D spherical Bessel basis
Parameters
----------
num_radial: int
Controls maximum frequency.
cutoff: float
Cutoff distance in Angstrom.
"""
def __init__(self, num_radial: 'int'... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import math
import numpy as np
assert_size_stride = torch._C._dynamo.guar... | krylea/ocp | SphericalBesselBasis | false | 10,497 | [
"MIT"
] | 0 | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | https://github.com/krylea/ocp/tree/00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 |
Cartesian | import torch
from torch import nn
import torch.utils.data
import torch.utils.data.distributed
import torch.optim
class Cartesian(nn.Module):
def forward(self, x):
r, phi = x[..., 0], x[..., 1]
return torch.stack((r * torch.cos(phi), r * torch.sin(phi)), dim=-1)
def get_inputs():
return [tor... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
import torch.utils.data
import torch.utils.data.dist... | kapoor1992/fastMRI | Cartesian | false | 10,498 | [
"MIT"
] | 0 | 6b0af94663faa55a2dd901a6a5cbb7d7b5f4cf6d | https://github.com/kapoor1992/fastMRI/tree/6b0af94663faa55a2dd901a6a5cbb7d7b5f4cf6d |
TransformerEncoderLayer | import torch
from typing import Optional
from torch import nn
def _get_activation_fn(activation: 'str'):
if activation == 'relu':
return nn.functional.relu
elif activation == 'gelu':
return nn.functional.gelu
raise RuntimeError('activation should be relu/gelu, not {}'.format(
activ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | marcinwitkowski/icefall | TransformerEncoderLayer | false | 10,499 | [
"Apache-2.0"
] | 0 | 73e917f689fa2ebfcfe5d484a34a262e74b77581 | https://github.com/marcinwitkowski/icefall/tree/73e917f689fa2ebfcfe5d484a34a262e74b77581 |
ExponentialEnvelope | import torch
class ExponentialEnvelope(torch.nn.Module):
"""
Exponential envelope function that ensures a smooth cutoff,
as proposed in Unke, Chmiela, Gastegger, Schütt, Sauceda, Müller 2021.
SpookyNet: Learning Force Fields with Electronic Degrees of Freedom
and Nonlocal Effects
"""
def ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_str... | krylea/ocp | ExponentialEnvelope | false | 10,500 | [
"MIT"
] | 0 | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | https://github.com/krylea/ocp/tree/00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 |
TransformerDecoderLayer | import torch
from typing import Optional
from torch import nn
def _get_activation_fn(activation: 'str'):
if activation == 'relu':
return nn.functional.relu
elif activation == 'gelu':
return nn.functional.gelu
raise RuntimeError('activation should be relu/gelu, not {}'.format(
activ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | marcinwitkowski/icefall | TransformerDecoderLayer | false | 10,501 | [
"Apache-2.0"
] | 0 | 73e917f689fa2ebfcfe5d484a34a262e74b77581 | https://github.com/marcinwitkowski/icefall/tree/73e917f689fa2ebfcfe5d484a34a262e74b77581 |
EQ | import torch
class EQ(torch.nn.Module):
def __init__(self):
super(EQ, self).__init__()
def forward(self, x, y):
return x == y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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... | NVIDIA-AI-IOT-private/torch2trt | EQ | false | 10,502 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
FloorDivConst | import torch
class FloorDivConst(torch.nn.Module):
def __init__(self):
super(FloorDivConst, self).__init__()
def forward(self, x):
return x // 2.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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | NVIDIA-AI-IOT-private/torch2trt | FloorDivConst | false | 10,503 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
FunctionalRelu6 | import torch
class FunctionalRelu6(torch.nn.Module):
def forward(self, x):
return torch.nn.functional.relu6(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | NVIDIA-AI-IOT-private/torch2trt | FunctionalRelu6 | false | 10,504 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
Div | import torch
class Div(torch.nn.Module):
def __init__(self):
super(Div, self).__init__()
def forward(self, x, y):
return x / y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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... | NVIDIA-AI-IOT-private/torch2trt | Div | false | 10,505 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
IMul | import torch
class IMul(torch.nn.Module):
def __init__(self):
super(IMul, self).__init__()
def forward(self, x, y):
x *= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
@triton.jit
def triton_poi_fused_mul_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | NVIDIA-AI-IOT-private/torch2trt | IMul | false | 10,506 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
EncoderBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
class MlpBlock(nn.Module):
""" Transformer Feed-Forward Block """
def __init__(self, in_dim, mlp_dim, out_dim, dropout_rate=0.1):
super(MlpBlock, self).__init__()
self.fc1 = nn.Linear(in_dim, mlp_dim)
self.fc2 = nn.Lin... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | longxianlei/UtilsTools | EncoderBlock | false | 10,507 | [
"MIT"
] | 0 | f45c648eb679ed59bb512b61a1af52938e326ac3 | https://github.com/longxianlei/UtilsTools/tree/f45c648eb679ed59bb512b61a1af52938e326ac3 |
FloorDivAssign | import torch
class FloorDivAssign(torch.nn.Module):
def __init__(self):
super(FloorDivAssign, self).__init__()
def forward(self, x, y):
x //= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
d... | NVIDIA-AI-IOT-private/torch2trt | FloorDivAssign | false | 10,508 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
FloorDiv | import torch
class FloorDiv(torch.nn.Module):
def __init__(self):
super(FloorDiv, self).__init__()
def forward(self, x, y):
return x // y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | NVIDIA-AI-IOT-private/torch2trt | FloorDiv | false | 10,509 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
EncoderBasicBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
class MLPBlock(nn.Module):
def __init__(self, in_dim, mlp_dim, out_dim, dropout_rate=0.1):
super(MLPBlock, self).__init__()
self.fc1 = nn.Linear(in_dim, mlp_dim)
self.fc2 = nn.Linear(mlp_dim, out_dim)
self.Gelu = n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | longxianlei/UtilsTools | EncoderBasicBlock | false | 10,510 | [
"MIT"
] | 0 | f45c648eb679ed59bb512b61a1af52938e326ac3 | https://github.com/longxianlei/UtilsTools/tree/f45c648eb679ed59bb512b61a1af52938e326ac3 |
GT | import torch
class GT(torch.nn.Module):
def __init__(self):
super(GT, self).__init__()
def forward(self, x, y):
return x > y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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... | NVIDIA-AI-IOT-private/torch2trt | GT | false | 10,511 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
IDiv | import torch
class IDiv(torch.nn.Module):
def __init__(self):
super(IDiv, self).__init__()
def forward(self, x, y):
x /= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
@triton.jit
def triton_poi_fused_div_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | NVIDIA-AI-IOT-private/torch2trt | IDiv | false | 10,512 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
FunctionalRelu | import torch
class FunctionalRelu(torch.nn.Module):
def forward(self, x):
return torch.nn.functional.relu(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | NVIDIA-AI-IOT-private/torch2trt | FunctionalRelu | false | 10,513 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
MaxPool1D | import torch
class MaxPool1D(torch.nn.Module):
def __init__(self, kernel_size, stride=None, padding=0, ceil_mode=False):
super().__init__()
self.kernel_size = kernel_size
self.stride = stride
self.padding = padding
self.ceil_mode = ceil_mode
def forward(self, x):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | NVIDIA-AI-IOT-private/torch2trt | MaxPool1D | false | 10,514 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
ModAssign | import torch
class ModAssign(torch.nn.Module):
def __init__(self):
super(ModAssign, self).__init__()
def forward(self, x, y):
x %= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
d... | NVIDIA-AI-IOT-private/torch2trt | ModAssign | false | 10,515 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
ISub | import torch
class ISub(torch.nn.Module):
def __init__(self):
super(ISub, self).__init__()
def forward(self, x, y):
x -= y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
@triton.jit
def triton_poi_fused_sub_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | NVIDIA-AI-IOT-private/torch2trt | ISub | false | 10,516 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
LT | import torch
class LT(torch.nn.Module):
def __init__(self):
super(LT, self).__init__()
def forward(self, x, y):
return x < y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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... | NVIDIA-AI-IOT-private/torch2trt | LT | false | 10,517 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
ModConst | import torch
class ModConst(torch.nn.Module):
def __init__(self):
super(ModConst, self).__init__()
def forward(self, x):
return x % 2.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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | NVIDIA-AI-IOT-private/torch2trt | ModConst | false | 10,518 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
FunctionalConv3d | import torch
class FunctionalConv3d(torch.nn.Module):
def __init__(self, *args, **kwargs):
super().__init__()
self.conv = torch.nn.Conv3d(*args, **kwargs)
def forward(self, x):
x = torch.nn.functional.conv3d(x, self.conv.weight, self.conv.bias,
self.conv.stride, self.conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
reinterpret_tens... | NVIDIA-AI-IOT-private/torch2trt | FunctionalConv3d | false | 10,519 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
Mod | import torch
class Mod(torch.nn.Module):
def __init__(self):
super(Mod, self).__init__()
def forward(self, x, y):
return x % y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | NVIDIA-AI-IOT-private/torch2trt | Mod | false | 10,520 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TensorClampOptionMaxMin | import torch
class TensorClampOptionMaxMin(torch.nn.Module):
def forward(self, x):
return x.clamp(min=-0.1, max=0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | NVIDIA-AI-IOT-private/torch2trt | TensorClampOptionMaxMin | false | 10,521 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
RMulFloat | import torch
class RMulFloat(torch.nn.Module):
def __init__(self):
super(RMulFloat, self).__init__()
def forward(self, x):
return 10.0 * 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
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 | RMulFloat | false | 10,522 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
IAdd | import torch
class IAdd(torch.nn.Module):
def __init__(self):
super(IAdd, self).__init__()
def forward(self, x, y):
x += y
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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
@triton.jit
def triton_poi_fused_add_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | NVIDIA-AI-IOT-private/torch2trt | IAdd | false | 10,523 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
Mul | import torch
class Mul(torch.nn.Module):
def __init__(self):
super(Mul, self).__init__()
def forward(self, x, y):
return x * y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), 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... | NVIDIA-AI-IOT-private/torch2trt | Mul | false | 10,524 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
RAddFloat | import torch
class RAddFloat(torch.nn.Module):
def __init__(self):
super(RAddFloat, self).__init__()
def forward(self, x):
return 1.0 + 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
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 | RAddFloat | false | 10,525 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TensorClampOptionMin | import torch
class TensorClampOptionMin(torch.nn.Module):
def forward(self, x):
return x.clamp(min=-0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | NVIDIA-AI-IOT-private/torch2trt | TensorClampOptionMin | false | 10,526 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TensorClampMax | import torch
class TensorClampMax(torch.nn.Module):
def forward(self, x):
return x.clamp_max(0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | NVIDIA-AI-IOT-private/torch2trt | TensorClampMax | false | 10,527 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
RDivInt | import torch
class RDivInt(torch.nn.Module):
def __init__(self):
super(RDivInt, self).__init__()
def forward(self, x):
return 100 / 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
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 | RDivInt | false | 10,528 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
NotEqualConst | import torch
class NotEqualConst(torch.nn.Module):
def __init__(self):
super(NotEqualConst, self).__init__()
def forward(self, x):
return x != 13.62
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... | NVIDIA-AI-IOT-private/torch2trt | NotEqualConst | false | 10,529 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TensorSigmoid | import torch
class TensorSigmoid(torch.nn.Module):
def __init__(self):
super(TensorSigmoid, self).__init__()
def forward(self, x):
return x.sigmoid()
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... | NVIDIA-AI-IOT-private/torch2trt | TensorSigmoid | false | 10,530 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
RSubFloat | import torch
class RSubFloat(torch.nn.Module):
def __init__(self):
super(RSubFloat, self).__init__()
def forward(self, x):
return 1.0 - 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
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 | RSubFloat | false | 10,531 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
RMulInt | import torch
class RMulInt(torch.nn.Module):
def __init__(self):
super(RMulInt, self).__init__()
def forward(self, x):
return 10 * 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
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 | RMulInt | false | 10,532 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
VAE | import torch
import torch.nn as nn
def reparametrize(mu, logsigma):
sigma = logsigma.exp()
eps = torch.randn_like(sigma)
z = eps.mul(sigma).add_(mu)
return z
class Decoder(nn.Module):
def __init__(self, latent_size, m):
super(Decoder, self).__init__()
self.latent_size = latent_s... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from... | lshoek/creative-evo-controller | VAE | false | 10,533 | [
"MIT"
] | 0 | a5f1742c172255cca2338b76ae1c5b4db277bb0d | https://github.com/lshoek/creative-evo-controller/tree/a5f1742c172255cca2338b76ae1c5b4db277bb0d |
RSubInt | import torch
class RSubInt(torch.nn.Module):
def __init__(self):
super(RSubInt, self).__init__()
def forward(self, x):
return 1 - 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
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 | RSubInt | false | 10,534 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
RpowFloat | import torch
class RpowFloat(torch.nn.Module):
def __init__(self):
super(RpowFloat, self).__init__()
def forward(self, x):
return 2.0 ** x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | NVIDIA-AI-IOT-private/torch2trt | RpowFloat | false | 10,535 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.