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 |
|---|---|---|---|---|---|---|---|---|---|---|
SingleBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class DyIntraModalityUpdate(nn.Module):
"""
Dynamic Intra-modality Attention Flow
"""
def __init__(self, v_size, q_size, output_size, num_head, drop=0.0):
super(DyIntraModalityUpdate, self).__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | TranTony/DFAF-for-VQA.pytorch | SingleBlock | false | 12,053 | [
"MIT"
] | 0 | eba1a893e8e5d3d8bf85078611b0bcf4d56eea86 | https://github.com/TranTony/DFAF-for-VQA.pytorch/tree/eba1a893e8e5d3d8bf85078611b0bcf4d56eea86 |
PatchEmbed3D | import torch
import torch.nn.functional as F
import torch.nn as nn
class PatchEmbed3D(nn.Module):
""" Video to Patch Embedding.
Args:
patch_size (int): Patch token size. Default: (2,4,4).
in_chans (int): Number of input video channels. Default: 3.
embed_dim (int): Number of linear pro... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | acewjh/Video-Swin-Transformer | PatchEmbed3D | false | 12,054 | [
"Apache-2.0"
] | 0 | bfbc8dde12e991455b34b921ca45a978b4dbfdbc | https://github.com/acewjh/Video-Swin-Transformer/tree/bfbc8dde12e991455b34b921ca45a978b4dbfdbc |
Vgg16 | import torch
from torch import nn
import torch.nn.functional as F
class Vgg16(nn.Module):
def __init__(self):
super(Vgg16, self).__init__()
self.conv1_1 = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1)
self.conv1_2 = nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=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 import nn
assert_s... | YueZHOU0926/MUNIT_3D | Vgg16 | false | 12,055 | [
"MIT"
] | 0 | 5cb22b5f3cb127d5b2c4eea038254a7881bab372 | https://github.com/YueZHOU0926/MUNIT_3D/tree/5cb22b5f3cb127d5b2c4eea038254a7881bab372 |
SequenceBias | import torch
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.parallel
from torch.nn.parameter import Parameter
class SequenceBias(nn.Module):
"""
Adds one bias element to the end of the sequence.
so if the input has a shape ``(L, N, E)``, where
``L`` i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.parallel
from torch.nn.parameter import Pa... | adriansarstedt/opacus | SequenceBias | false | 12,056 | [
"Apache-2.0"
] | 0 | a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1 | https://github.com/adriansarstedt/opacus/tree/a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1 |
SimpleCNN32Filter | import torch
import torch.nn as nn
import torch.nn.functional as F
class SimpleCNN32Filter(nn.Module):
"""
Defines a simple CNN arhcitecture with 1 layer
"""
def __init__(self, num_classes):
super().__init__()
self.conv1 = nn.Conv2d(3, 32, kernel_size=10, stride=2)
self.fc1 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | adwaykanhere/df-dn-paper | SimpleCNN32Filter | false | 12,057 | [
"MIT"
] | 0 | 5df413e06ce33c6be5d005e6d1141de9fcd45cb4 | https://github.com/adwaykanhere/df-dn-paper/tree/5df413e06ce33c6be5d005e6d1141de9fcd45cb4 |
BinaryFocalLossWithLogits | import torch
import torch.nn as nn
def binary_focal_loss_with_logits(input: 'torch.Tensor', target:
'torch.Tensor', alpha: 'float'=0.25, gamma: 'float'=2.0, reduction:
'str'='none', eps: 'float'=1e-08) ->torch.Tensor:
"""Function that computes Binary Focal loss.
.. math::
\\text{FL}(p_t) = -... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | adi1999/kornia | BinaryFocalLossWithLogits | false | 12,058 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | bb476a36e2725d687d1879b5a0d877c1ba860c25 | https://github.com/adi1999/kornia/tree/bb476a36e2725d687d1879b5a0d877c1ba860c25 |
NeuralNetwork | import torch
import torch.nn as nn
class NeuralNetwork(nn.Module):
def __init__(self, in_dim, out_dim, hidden_dim=None):
""" Simple two-layer neural network.
"""
super(NeuralNetwork, self).__init__()
if hidden_dim is None:
hidden_dim = in_dim * 2
self.l1 = nn.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 import triton_helpers
from torch._inductor.runtime.... | adewynter/Lightboard | NeuralNetwork | false | 12,059 | [
"Apache-2.0"
] | 0 | f02eae64f11a989030b52314aa66709477274eb3 | https://github.com/adewynter/Lightboard/tree/f02eae64f11a989030b52314aa66709477274eb3 |
bodypose_model | import torch
from collections import OrderedDict
import torch.nn as nn
def make_layers(block, no_relu_layers):
layers = []
for layer_name, v in block.items():
if 'pool' in layer_name:
layer = nn.MaxPool2d(kernel_size=v[0], stride=v[1], padding=v[2])
layers.append((layer_name, 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 import triton_helpers
from collections import Order... | Schwartz-Zha/My_Pose_Estimation | bodypose_model | false | 12,060 | [
"MIT"
] | 0 | 0ccaccf58498b2200842c155b735e1103c28c5ba | https://github.com/Schwartz-Zha/My_Pose_Estimation/tree/0ccaccf58498b2200842c155b735e1103c28c5ba |
Scale | import torch
from torch import nn
import torch.nn.parallel
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
from torch import nn
import torch.nn.parallel
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | XDong18/AdelaiDet | Scale | false | 12,061 | [
"BSD-2-Clause"
] | 0 | 837cd1078923892fe6e84ac29fd0963f1b2c474f | https://github.com/XDong18/AdelaiDet/tree/837cd1078923892fe6e84ac29fd0963f1b2c474f |
GCN | import torch
from torch import nn
import torch.nn.functional as F
import torch.nn.parallel
class Conv2D(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', stride=1, dilation=1, groups=1):
super(Conv2D, self).__init__()
assert type(kernel_size) in [int,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.nn.functional as F
import torch.nn.parallel
as... | XDong18/AdelaiDet | GCN | false | 12,062 | [
"BSD-2-Clause"
] | 0 | 837cd1078923892fe6e84ac29fd0963f1b2c474f | https://github.com/XDong18/AdelaiDet/tree/837cd1078923892fe6e84ac29fd0963f1b2c474f |
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 ... | adriansarstedt/opacus | DPLSTMCell | false | 12,063 | [
"Apache-2.0"
] | 0 | a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1 | https://github.com/adriansarstedt/opacus/tree/a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1 |
SimpleAtariNet | import torch
import torch.nn as nn
import torch.nn.functional as functional
class SimpleAtariNet(nn.Module):
def __init__(self):
super(SimpleAtariNet, self).__init__()
self.conv0 = nn.Conv2d(3, 16, 12, stride=(2, 8))
self.conv1 = nn.Conv2d(16, 32, 8, stride=4)
self.conv2 = 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_... | aaronmckinstry706/pytorch-practice | SimpleAtariNet | false | 12,064 | [
"MIT"
] | 0 | d3fd28733ea6de6a2e522ec52ff3e748df21b85a | https://github.com/aaronmckinstry706/pytorch-practice/tree/d3fd28733ea6de6a2e522ec52ff3e748df21b85a |
Conv_ReLU_Block | import torch
import torch.nn as nn
class Conv_ReLU_Block(nn.Module):
def __init__(self):
super(Conv_ReLU_Block, self).__init__()
self.conv = nn.Conv2d(in_channels=64, out_channels=64, kernel_size=
3, stride=1, padding=1, bias=False)
self.relu = nn.ReLU(inplace=True)
def f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | advaza/pytorch-vdsr | Conv_ReLU_Block | false | 12,065 | [
"MIT"
] | 0 | 8011f7323de3c7756df3828612addfb122c2bfef | https://github.com/advaza/pytorch-vdsr/tree/8011f7323de3c7756df3828612addfb122c2bfef |
Gate | import torch
import torch.nn as nn
import torch.nn.functional as F
class Gate(nn.Module):
"""Gate Unit
g = sigmoid(Wx)
x = g * x
"""
def __init__(self, input_size):
super(Gate, self).__init__()
self.linear = nn.Linear(input_size, input_size, bias=False)
def forward(self, x):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | albert-dot-ai/MnemonicReader | Gate | false | 12,066 | [
"BSD-3-Clause"
] | 0 | eb51eb679a58677a405953c0c579568377c0b0f8 | https://github.com/albert-dot-ai/MnemonicReader/tree/eb51eb679a58677a405953c0c579568377c0b0f8 |
ScoreLayer | import torch
from torchvision.transforms import functional as F
from torch.nn import functional as F
import torch.nn as nn
class ScoreLayer(nn.Module):
def __init__(self, k):
super(ScoreLayer, self).__init__()
self.score = nn.Conv2d(k, 1, 1, 1)
def forward(self, x, x_size=None):
x = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | alejodosr/PoolNet | ScoreLayer | false | 12,067 | [
"MIT"
] | 0 | a6a19379933fe02c22f0eb0dd92038fe87cf0bd3 | https://github.com/alejodosr/PoolNet/tree/a6a19379933fe02c22f0eb0dd92038fe87cf0bd3 |
NaiveGroupNorm | from torch.nn import Module
import torch
from torch.nn import Parameter
from torch.nn import init
import torch.nn.parallel
class NaiveGroupNorm(Module):
"""NaiveGroupNorm implements Group Normalization with the high-level matrix operations in PyTorch.
It is a temporary solution to export GN by ONNX before the... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn import Module
from torch.nn import Parameter
from torch.nn import... | XDong18/AdelaiDet | NaiveGroupNorm | false | 12,068 | [
"BSD-2-Clause"
] | 0 | 837cd1078923892fe6e84ac29fd0963f1b2c474f | https://github.com/XDong18/AdelaiDet/tree/837cd1078923892fe6e84ac29fd0963f1b2c474f |
SFU | import torch
import torch.nn as nn
import torch.nn.functional as F
class SFU(nn.Module):
"""Semantic Fusion Unit
The ouput vector is expected to not only retrieve correlative information from fusion vectors,
but also retain partly unchange as the input vector
"""
def __init__(self, input_size, fu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | albert-dot-ai/MnemonicReader | SFU | false | 12,069 | [
"BSD-3-Clause"
] | 0 | eb51eb679a58677a405953c0c579568377c0b0f8 | https://github.com/albert-dot-ai/MnemonicReader/tree/eb51eb679a58677a405953c0c579568377c0b0f8 |
GraphNet | import torch
import torch.nn as nn
class GraphNet(nn.Module):
def __init__(self, input_size, n_classes, num_neurons=32):
super(GraphNet, self).__init__()
self.fc1 = nn.Linear(input_size, num_neurons)
self.fc2 = nn.Linear(num_neurons, num_neurons)
self.fc3 = nn.Linear(num_neurons, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | adam2392/dldo | GraphNet | false | 12,070 | [
"MIT"
] | 0 | fc57f8700eb048558ab205c2c77a064f1a7cc7f6 | https://github.com/adam2392/dldo/tree/fc57f8700eb048558ab205c2c77a064f1a7cc7f6 |
FCLayer | import torch
import torch.nn as nn
class FCLayer(nn.Module):
def __init__(self, input_dim, output_dim, dropout_rate=0.0,
use_activation=True):
super().__init__()
self.use_activation = use_activation
self.dropout = nn.Dropout(dropout_rate)
self.linear = nn.Linear(input_dim,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | alexandre-do/r-bert | FCLayer | false | 12,071 | [
"Apache-2.0"
] | 0 | 4e35bcbb0fe0602e708e18010e2394ebbfb074c4 | https://github.com/alexandre-do/r-bert/tree/4e35bcbb0fe0602e708e18010e2394ebbfb074c4 |
SimpleGCN | import math
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from torch.nn import Parameter
import torch.nn
import torch.autograd
class SimpleGCN(nn.Module):
"""A simple graph convolution layer, similar to the one defined in
Kipf et al. https://arxiv.org/abs/1609.02907
.. note:... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
from torch.nn.parameter import Parameter
from ... | acivgin1/kaolin | SimpleGCN | false | 12,072 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 4c4e0098b2cd9a73709c81fea82de03abbd6cdd5 | https://github.com/acivgin1/kaolin/tree/4c4e0098b2cd9a73709c81fea82de03abbd6cdd5 |
DepthwiseSeperableConv1d | import torch
import torch.nn as nn
class DepthwiseSeperableConv1d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size):
super(DepthwiseSeperableConv1d, self).__init__()
self.depthwise_conv1d = nn.Conv1d(in_channels, in_channels,
kernel_size, groups=in_channels, paddi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | allenye0119/pytorch-modules | DepthwiseSeperableConv1d | false | 12,074 | [
"MIT"
] | 0 | c7683ef63478becca3b79a7498840450da33f468 | https://github.com/allenye0119/pytorch-modules/tree/c7683ef63478becca3b79a7498840450da33f468 |
LRN | import torch
import torch.nn as nn
class LRN(nn.Module):
def __init__(self, local_size=1, alpha=1.0, beta=0.75, ACROSS_CHANNELS=True
):
super(LRN, self).__init__()
self.ACROSS_CHANNELS = ACROSS_CHANNELS
if ACROSS_CHANNELS:
self.average = nn.AvgPool3d(kernel_size=(local... | 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_... | anas-awadalla/dissect | LRN | false | 12,075 | [
"MIT"
] | 0 | d74e9147731c6160274405a39ab1c98191929269 | https://github.com/anas-awadalla/dissect/tree/d74e9147731c6160274405a39ab1c98191929269 |
LayerNorm | import math
import torch
from torch import Tensor
import torch.nn as nn
from torch.nn import Parameter
from torch.autograd import Variable
class LayerNorm(nn.Module):
"""
Layer Normalization based on Ba & al.:
'Layer Normalization'
https://arxiv.org/pdf/1607.06450.pdf
"""
def __init__(self, i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
from torch import Tensor
import torch.nn as nn
from torch.nn import... | alex-kj-chin/universal-computation | LayerNorm | false | 12,076 | [
"MIT"
] | 0 | a41cc7d685a3e0c56c11bc346c25394464da2e06 | https://github.com/alex-kj-chin/universal-computation/tree/a41cc7d685a3e0c56c11bc346c25394464da2e06 |
ResidualBlock | import torch
import torch.nn as nn
class ConvLayer(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride, norm
=None, bias=True):
super(ConvLayer, self).__init__()
reflection_padding = kernel_size // 2
self.reflection_pad = nn.ReflectionPad2d(reflection_pad... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | alhsu713/fast_blind_video_consistency | ResidualBlock | false | 12,078 | [
"MIT"
] | 0 | 2037ec5f68a361b926c31b3a12c1cd04e2331797 | https://github.com/alhsu713/fast_blind_video_consistency/tree/2037ec5f68a361b926c31b3a12c1cd04e2331797 |
InnerProductModel | import torch
class InnerProductModel(torch.nn.Module):
@staticmethod
def is_valid_model_type(model_type):
raise NotImplementedError
@staticmethod
def get_model_from_type(model_type):
raise NotImplementedError
@property
def loss_criterion(self):
return torch.nn.MSELos... | 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
reinterpret... | SheepiesLab/plato | InnerProductModel | false | 12,079 | [
"Apache-2.0"
] | 0 | 9f5bbfa4b6952d1b3af24be409982d303d54a169 | https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169 |
Critic | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
def __init__(self, state_dim, action_dim):
super(Critic, self).__init__()
self.l1 = nn.Linear(state_dim + action_dim, 400)
self.l2 = nn.Linear(400, 300)
self.l3 = nn.Linear(300, 1)
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
assert_... | SheepiesLab/plato | Critic | false | 12,080 | [
"Apache-2.0"
] | 0 | 9f5bbfa4b6952d1b3af24be409982d303d54a169 | https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169 |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.a1 = nn.Conv2d(19, 64, kernel_size=3, padding=1)
self.a2 = nn.Conv2d(64, 128, kernel_size=3, padding=1)
self.a3 = nn.Conv2d(128, 256, 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
import torch.nn as nn
assert_... | afozk95/chess-dataset | Net | false | 12,081 | [
"MIT"
] | 0 | 08de7b251f67cb8553a5ee66f6fd76cefeb14bb4 | https://github.com/afozk95/chess-dataset/tree/08de7b251f67cb8553a5ee66f6fd76cefeb14bb4 |
SimmatModule | import torch
class SimmatModule(torch.nn.Module):
def __init__(self, padding=-1):
super().__init__()
self.padding = padding
self._hamming_index_loaded = None
self._hamming_index = None
def forward(self, query_embed, doc_embed, query_tok, doc_tok):
simmat = []
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | alpers/FlexNeuART | SimmatModule | false | 12,082 | [
"Apache-2.0"
] | 0 | 2ae263f46b6eb2f1435b9073dad629a2fef23ab9 | https://github.com/alpers/FlexNeuART/tree/2ae263f46b6eb2f1435b9073dad629a2fef23ab9 |
PACRRConvMax2dModule | import torch
class PACRRConvMax2dModule(torch.nn.Module):
def __init__(self, shape, n_filters, k, channels):
super().__init__()
self.shape = shape
if shape != 1:
self.pad = torch.nn.ConstantPad2d((0, shape - 1, 0, shape - 1), 0)
else:
self.pad = None
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | alpers/FlexNeuART | PACRRConvMax2dModule | false | 12,083 | [
"Apache-2.0"
] | 0 | 2ae263f46b6eb2f1435b9073dad629a2fef23ab9 | https://github.com/alpers/FlexNeuART/tree/2ae263f46b6eb2f1435b9073dad629a2fef23ab9 |
AverageAttention | import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
class PositionwiseFeedForward(nn.Module):
""" A two-layer Feed-Forward-Network with residual layer norm.
Args:
d_model (int): the size of input for the first-layer of the FFN.
d_ff (int): the hidden layer size of th... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.cuda
import torch.distributed
assert_size_str... | Zer0-dev115/OpenNMT-py | AverageAttention | false | 12,084 | [
"MIT"
] | 0 | 028c76b34779223ee6b3eb224b99617552987100 | https://github.com/Zer0-dev115/OpenNMT-py/tree/028c76b34779223ee6b3eb224b99617552987100 |
BatchLinear | import torch
from torch import nn
from collections import OrderedDict
class MetaModule(nn.Module):
"""
Base class for PyTorch meta-learning modules. These modules accept an
additional argument `params` in their `forward` method.
Notes
-----
Objects inherited from `MetaModule` are fully compat... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | aneesh-dandime/siren | BatchLinear | false | 12,085 | [
"MIT"
] | 0 | 7bc652e32d66c5792d24e8df2fffa565157679bd | https://github.com/aneesh-dandime/siren/tree/7bc652e32d66c5792d24e8df2fffa565157679bd |
BertTextPooler | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class BertTextPooler(nn.Module):
def __init__(self, config):
super(BertTextPooler, self).__init__()
self.dense = nn.Linear(config.hidden_size, config.bi_hidden_size)
self.activation = nn.ReLU()
def forwa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | amitakamath/vilbert-multi-task | BertTextPooler | false | 12,086 | [
"MIT"
] | 0 | 5a11b8265fab3598fcdcd7f7c33453b914d8ff2c | https://github.com/amitakamath/vilbert-multi-task/tree/5a11b8265fab3598fcdcd7f7c33453b914d8ff2c |
IOUloss | import torch
import torch.nn as nn
class IOUloss(nn.Module):
def __init__(self, reduction='none', loss_type='iou'):
super(IOUloss, self).__init__()
self.reduction = reduction
self.loss_type = loss_type
def forward(self, pred, target):
assert pred.shape[0] == target.shape[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... | ankandrew/YOLOX | IOUloss | false | 12,087 | [
"Apache-2.0"
] | 0 | 28da975944887d550f052ebadd8cbdd82d14aed6 | https://github.com/ankandrew/YOLOX/tree/28da975944887d550f052ebadd8cbdd82d14aed6 |
Correct | import torch
from torch import nn
import torch.utils.data.distributed
class Correct(nn.Module):
def forward(self, classifier, target):
return classifier.max(dim=1)[1] == target
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 import nn
import torch.utils.data.distributed
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda ... | amitport/grace | Correct | false | 12,088 | [
"BSD-2-Clause"
] | 0 | b0e442057d2f36f09cd1817a4acb966c6b0b780f | https://github.com/amitport/grace/tree/b0e442057d2f36f09cd1817a4acb966c6b0b780f |
Actor | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, max_action):
super(Actor, self).__init__()
self.l1 = nn.Linear(state_dim, 400)
self.l2 = nn.Linear(400, 300)
self.l3 = nn.Linear(300, action_dim)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | SheepiesLab/plato | Actor | false | 12,089 | [
"Apache-2.0"
] | 0 | 9f5bbfa4b6952d1b3af24be409982d303d54a169 | https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169 |
QNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
def weights_init_(m):
if isinstance(m, nn.Linear):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.constant_(m.bias, 0)
class QNetwork(nn.Module):
def __init__(self, num_inputs, num_actions, hidden_dim):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | SheepiesLab/plato | QNetwork | false | 12,090 | [
"Apache-2.0"
] | 0 | 9f5bbfa4b6952d1b3af24be409982d303d54a169 | https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169 |
UniverseHead | import torch
import torch.nn as nn
import torch.nn.functional as F
class UniverseHead(torch.nn.Module):
""" universe agent example
input: [None, 42, 42, 1]; output: [None, 288];
"""
def __init__(self, n):
super(UniverseHead, self).__init__()
self.conv1 = nn.Conv2d(n, 32, kernel_si... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | andy920262/pytorch-a2c-ppo-acktr | UniverseHead | false | 12,091 | [
"MIT"
] | 0 | 2e7e85219dfe737cb4036de3cf0c8b00706d640e | https://github.com/andy920262/pytorch-a2c-ppo-acktr/tree/2e7e85219dfe737cb4036de3cf0c8b00706d640e |
DQN | import torch
import torch.nn as nn
class DQN(nn.Module):
def __init__(self, state_dim, nb_actions, hidden1=50, hidden2=50):
super(DQN, self).__init__()
self.fc1 = nn.Linear(state_dim, hidden1)
self.fc2 = nn.Linear(hidden1, hidden2)
self.fc3 = nn.Linear(hidden2, nb_actions)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | alvinwan/explore | DQN | false | 12,092 | [
"MIT"
] | 0 | 358c076b8250f561394e32b1ee2de9bc5562dcdb | https://github.com/alvinwan/explore/tree/358c076b8250f561394e32b1ee2de9bc5562dcdb |
Block | import torch
class Block(torch.nn.Module):
def __init__(self, in_channels, mid_channel, out_channels, batch_norm=False
):
super().__init__()
self.conv1 = torch.nn.Conv2d(in_channels=in_channels, out_channels=
mid_channel, kernel_size=3, padding=1)
self.conv2 = torch.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
assert_size_stride = torch._C... | amrane99/lung-segmentation | Block | false | 12,093 | [
"MIT"
] | 0 | ab29db75ac78918da5cbf66b830acaf36cf7b44a | https://github.com/amrane99/lung-segmentation/tree/ab29db75ac78918da5cbf66b830acaf36cf7b44a |
ConvNet | import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvNet(nn.Module):
""" convolutional neural network """
def __init__(self):
super(ConvNet, self).__init__()
nf = 8
self.conv1 = nn.Conv2d(1, nf * 1, 5, 1, 0)
self.conv2 = nn.Conv2d(nf * 1, nf * 2, 4, 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._inductor.runtime.... | animeshbchowdhury/robust-pnr-time | ConvNet | false | 12,094 | [
"BSD-3-Clause"
] | 0 | 301c5d973b8c024a85fdab915986ecf257e7698b | https://github.com/animeshbchowdhury/robust-pnr-time/tree/301c5d973b8c024a85fdab915986ecf257e7698b |
NatureHead | import torch
import torch.nn as nn
import torch.nn.functional as F
class NatureHead(torch.nn.Module):
""" DQN Nature 2015 paper
input: [None, 84, 84, 4]; output: [None, 3136] -> [None, 512];
"""
def __init__(self, n):
super(NatureHead, self).__init__()
self.conv1 = nn.Conv2d(n, 32... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | andy920262/pytorch-a2c-ppo-acktr | NatureHead | false | 12,095 | [
"MIT"
] | 0 | 2e7e85219dfe737cb4036de3cf0c8b00706d640e | https://github.com/andy920262/pytorch-a2c-ppo-acktr/tree/2e7e85219dfe737cb4036de3cf0c8b00706d640e |
SelfAttnPooler | import torch
import torch.nn as nn
class SelfAttnPooler(nn.Module):
def __init__(self, input_dim):
super().__init__()
self.proj = nn.Linear(input_dim, 1)
def forward(self, encoder_out, padding_mask):
"""
encoder_out: T, B, C
padding_mask: T, B (True for padded positio... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ankitapasad/slue-toolkit | SelfAttnPooler | false | 12,096 | [
"MIT"
] | 0 | db8155cf0fc803e21890cf4eee2ef87152aafbfc | https://github.com/ankitapasad/slue-toolkit/tree/db8155cf0fc803e21890cf4eee2ef87152aafbfc |
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... | adriansarstedt/opacus | DPSLTMAdapter | false | 12,097 | [
"Apache-2.0"
] | 0 | a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1 | https://github.com/adriansarstedt/opacus/tree/a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1 |
FCNet | import torch
import torch.nn as nn
import torch.nn.functional as F
class FCNet(nn.Module):
""" fully-connected neural network """
def __init__(self):
super(FCNet, self).__init__()
self.fc1 = nn.Linear(784, 400)
self.fc2 = nn.Linear(400, 200)
self.fc3 = nn.Linear(200, 100)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | animeshbchowdhury/robust-pnr-time | FCNet | false | 12,098 | [
"BSD-3-Clause"
] | 0 | 301c5d973b8c024a85fdab915986ecf257e7698b | https://github.com/animeshbchowdhury/robust-pnr-time/tree/301c5d973b8c024a85fdab915986ecf257e7698b |
StendLoss | import torch
from itertools import chain as chain
import torch.utils.data
import torch.nn as nn
from torch.nn.modules.loss import _Loss
class StendLoss(_Loss):
def __init__(self, size_average=None, reduce=None, reduction='mean'):
super(StendLoss, self).__init__()
self.reduction = reduction
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from iterto... | anton-br/SlowFast | StendLoss | false | 12,099 | [
"Apache-2.0"
] | 0 | 6e8d68bc6f3191886a57f819db1c766c6ca32d21 | https://github.com/anton-br/SlowFast/tree/6e8d68bc6f3191886a57f819db1c766c6ca32d21 |
ZeroLayer | import torch
import torch.nn as nn
import torch.utils.data
class ZeroLayer(nn.Module):
def __init__(self, stride):
super(ZeroLayer, self).__init__()
self.stride = stride
def forward(self, x):
"""n, c, h, w = x.size()
h //= self.stride
w //= self.stride
device ... | 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.... | airglow/nni | ZeroLayer | false | 12,100 | [
"MIT"
] | 0 | 751065b788f66a6b53446620293095b1fe1b1c65 | https://github.com/airglow/nni/tree/751065b788f66a6b53446620293095b1fe1b1c65 |
SpaceToDepth | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class SpaceToDepth(nn.Module):
def __init__(self, block_size=4):
super().__init__()
assert block_size == 4
self.bs = block_size
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distr... | adam-dziedzic/ASL | SpaceToDepth | false | 12,101 | [
"MIT"
] | 0 | cc063f5e7eda1498544ad2c3b224985203b0774a | https://github.com/adam-dziedzic/ASL/tree/cc063f5e7eda1498544ad2c3b224985203b0774a |
HSwish | import torch
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel
import torch.utils.data.distributed
class HSwish(nn.Module):
""" Applies the Hard-Swish function element-wise.
`"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_
Examples:
>>> m = Mish()
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel
import torch.ut... | ardianumam/Vanilla-GAN | HSwish | false | 12,102 | [
"Apache-2.0"
] | 0 | 3fce9b60dca4609aad1d4e5eb834a2cc72cf07b3 | https://github.com/ardianumam/Vanilla-GAN/tree/3fce9b60dca4609aad1d4e5eb834a2cc72cf07b3 |
SpatialAttentionGate | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class SpatialAttentionGate(nn.Module):
def __init__(self, channel, reduction=16):
super(SpatialAttentionGate, self).__init__()
self.fc1 = nn.Conv2d(channel, reduction, kernel_size=1, padding=0)
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 ... | airglow/nni | SpatialAttentionGate | false | 12,103 | [
"MIT"
] | 0 | 751065b788f66a6b53446620293095b1fe1b1c65 | https://github.com/airglow/nni/tree/751065b788f66a6b53446620293095b1fe1b1c65 |
HSigmoid | import torch
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel
import torch.utils.data.distributed
class HSigmoid(nn.Module):
""" Applies the Hard-Sigmoid function element-wise.
`"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_
Examples:
>>> m = Mish()... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel
import torch.ut... | ardianumam/Vanilla-GAN | HSigmoid | false | 12,104 | [
"Apache-2.0"
] | 0 | 3fce9b60dca4609aad1d4e5eb834a2cc72cf07b3 | https://github.com/ardianumam/Vanilla-GAN/tree/3fce9b60dca4609aad1d4e5eb834a2cc72cf07b3 |
_AddNorm | import torch
import torch.nn as nn
import torch.nn.functional as F
class _TimeDistributedInterpolation(nn.Module):
def __init__(self, output_size: 'int', batch_first: 'bool'=False,
trainable: 'bool'=False):
super().__init__()
self.output_size = output_size
self.batch_first = batch... | import torch
import triton
import triton.language 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.functional as F
assert_size_stride = torc... | amadejkocbek/darts | _AddNorm | false | 12,105 | [
"Apache-2.0"
] | 0 | 074be2a76eee11258da066878c564badf40834e9 | https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9 |
_ScaledDotProductAttention | import torch
import torch.nn as nn
class _ScaledDotProductAttention(nn.Module):
def __init__(self, dropout: 'float'=None, scale: 'bool'=True):
super(_ScaledDotProductAttention, self).__init__()
if dropout is not None:
self.dropout = nn.Dropout(p=dropout)
else:
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.... | amadejkocbek/darts | _ScaledDotProductAttention | false | 12,106 | [
"Apache-2.0"
] | 0 | 074be2a76eee11258da066878c564badf40834e9 | https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9 |
_ResampleNorm | import torch
import torch.nn as nn
import torch.nn.functional as F
class _TimeDistributedInterpolation(nn.Module):
def __init__(self, output_size: 'int', batch_first: 'bool'=False,
trainable: 'bool'=False):
super().__init__()
self.output_size = output_size
self.batch_first = batch... | import torch
import triton
import triton.language 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.functional as F
assert_size_stride = torc... | amadejkocbek/darts | _ResampleNorm | false | 12,107 | [
"Apache-2.0"
] | 0 | 074be2a76eee11258da066878c564badf40834e9 | https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9 |
_GateAddNorm | import torch
import torch.nn as nn
import torch.nn.functional as F
class _TimeDistributedInterpolation(nn.Module):
def __init__(self, output_size: 'int', batch_first: 'bool'=False,
trainable: 'bool'=False):
super().__init__()
self.output_size = output_size
self.batch_first = batch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | amadejkocbek/darts | _GateAddNorm | false | 12,108 | [
"Apache-2.0"
] | 0 | 074be2a76eee11258da066878c564badf40834e9 | https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9 |
_GatedLinearUnit | import torch
import torch.nn as nn
import torch.nn.functional as F
class _GatedLinearUnit(nn.Module):
"""Gated Linear Unit"""
def __init__(self, input_size: 'int', hidden_size: 'int'=None, dropout:
'float'=None):
super().__init__()
if dropout is not None:
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | amadejkocbek/darts | _GatedLinearUnit | false | 12,109 | [
"Apache-2.0"
] | 0 | 074be2a76eee11258da066878c564badf40834e9 | https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9 |
TReLU | import torch
import torch.nn as nn
import torch.nn.functional as F
class TReLU(nn.Module):
def __init__(self):
super(TReLU, self).__init__()
self.alpha = nn.Parameter(torch.FloatTensor(1), requires_grad=True)
self.alpha.data.fill_(0)
def forward(self, x):
x = F.relu(x - self.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | archiroid003/ICCV2019-LearningToPaint | TReLU | false | 12,110 | [
"MIT"
] | 0 | 4b5fc263e4843c159a61e5956956b3f7812693f8 | https://github.com/archiroid003/ICCV2019-LearningToPaint/tree/4b5fc263e4843c159a61e5956956b3f7812693f8 |
MLP | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class SharedDropout(torch.nn.Module):
def __init__(self, p):
super(SharedDropout, self).__in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | albertkx/GeDi | MLP | false | 12,111 | [
"BSD-3-Clause"
] | 0 | 27532eb6ac5dd42d817d25a905401504e916f9fb | https://github.com/albertkx/GeDi/tree/27532eb6ac5dd42d817d25a905401504e916f9fb |
_GatedResidualNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
class _TimeDistributedInterpolation(nn.Module):
def __init__(self, output_size: 'int', batch_first: 'bool'=False,
trainable: 'bool'=False):
super().__init__()
self.output_size = output_size
self.batch_first = batch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | amadejkocbek/darts | _GatedResidualNetwork | false | 12,112 | [
"Apache-2.0"
] | 0 | 074be2a76eee11258da066878c564badf40834e9 | https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9 |
SEModule | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class FastAvgPool2d(nn.Module):
def __init__(self, flatten=False):
super(FastAvgPool2d, self).__init__()
self.flatten = flatten
def ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torchvision import datas... | adam-dziedzic/ASL | SEModule | false | 12,113 | [
"MIT"
] | 0 | cc063f5e7eda1498544ad2c3b224985203b0774a | https://github.com/adam-dziedzic/ASL/tree/cc063f5e7eda1498544ad2c3b224985203b0774a |
PreActBlockNoBN | import torch
import torch.nn as nn
import torch.nn.functional as F
class PreActBlockNoBN(nn.Module):
"""Pre-activation version of the BasicBlock."""
expansion = 1
def __init__(self, in_planes, planes, stride=1):
super(PreActBlockNoBN, self).__init__()
self.conv1 = nn.Conv2d(in_planes, pla... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | arhik/LoCo | PreActBlockNoBN | false | 12,114 | [
"MIT"
] | 0 | de3792a8c5650ee1efa0682ad494a3b1b1be3dd0 | https://github.com/arhik/LoCo/tree/de3792a8c5650ee1efa0682ad494a3b1b1be3dd0 |
up | import torch
from torch import nn
import torch.nn.functional as F
class up(nn.Module):
def __init__(self, in_ch, out_ch):
super(up, self).__init__()
self.up_scale = nn.ConvTranspose2d(in_ch, out_ch, 2, stride=2)
def forward(self, x1, x2):
x2 = self.up_scale(x2)
diffY = x1.siz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | aribryan/segmentation_revisit | up | false | 12,115 | [
"MIT"
] | 0 | a37747cfa7bfa7bfd4c0c01983421f632cd719ba | https://github.com/aribryan/segmentation_revisit/tree/a37747cfa7bfa7bfd4c0c01983421f632cd719ba |
ResnetBlock | import torch
from torch import nn
from torch.nn import functional as F
import torch.utils.data
import torch.utils.data.distributed
def actvn(x):
out = F.leaky_relu(x, 0.2)
return out
class ResnetBlock(nn.Module):
def __init__(self, fin, fout, fhidden=None, is_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
from torch import nn
from torch.nn import functional as F
import torch.utils.dat... | arnabgho/GAN_stability | ResnetBlock | false | 12,116 | [
"MIT"
] | 0 | 5037d1d856be58818d1c825cd415e0d90d90aff2 | https://github.com/arnabgho/GAN_stability/tree/5037d1d856be58818d1c825cd415e0d90d90aff2 |
ContrastiveDistanceLoss | import torch
import torch.nn as nn
from torch.nn.modules.loss import *
from torch.nn.modules import *
from torch.optim import *
from torch.optim.lr_scheduler import *
import torch.distributed
class ContrastiveDistanceLoss(nn.Module):
"""
Contrastive distance loss
"""
def __init__(self, margin=1.0, re... | 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 torch.nn.modules.loss import *
from torch.nn.modules import *
... | asmekal/catalyst | ContrastiveDistanceLoss | false | 12,117 | [
"MIT"
] | 0 | e11365c0a9812649ceaef14e53061cd5117d8684 | https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684 |
ContrastivePairwiseEmbeddingLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.loss import *
from torch.nn.modules import *
from torch.optim import *
from torch.optim.lr_scheduler import *
import torch.distributed
class ContrastivePairwiseEmbeddingLoss(nn.Module):
"""
ContrastivePairwiseEmbeddingLos... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | asmekal/catalyst | ContrastivePairwiseEmbeddingLoss | false | 12,118 | [
"MIT"
] | 0 | e11365c0a9812649ceaef14e53061cd5117d8684 | https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684 |
BasicBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils.weight_norm as weightNorm
def conv3x3(in_planes, out_planes, stride=1):
return weightNorm(nn.Conv2d(in_planes, out_planes, kernel_size=3,
stride=stride, padding=1, bias=True))
class TReLU(nn.Module):
def __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.... | archiroid003/ICCV2019-LearningToPaint | BasicBlock | false | 12,119 | [
"MIT"
] | 0 | 4b5fc263e4843c159a61e5956956b3f7812693f8 | https://github.com/archiroid003/ICCV2019-LearningToPaint/tree/4b5fc263e4843c159a61e5956956b3f7812693f8 |
DecoderBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.loss import *
from torch.nn.modules import *
from torch.optim import *
from torch.optim.lr_scheduler import *
import torch.distributed
class ConvRelu(nn.Module):
"""3x3 convolution followed by ReLU activation building block.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | asmekal/catalyst | DecoderBlock | false | 12,120 | [
"MIT"
] | 0 | e11365c0a9812649ceaef14e53061cd5117d8684 | https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684 |
Actor | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Actor(nn.Module):
def __init__(self, state_size, action_size, seed, fc1_units=512,
fc2_units=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | asiliskender/deep-reinforcement-learning | Actor | false | 12,121 | [
"MIT"
] | 0 | dbf96d67477aa9242128b78b081474193e1e4538 | https://github.com/asiliskender/deep-reinforcement-learning/tree/dbf96d67477aa9242128b78b081474193e1e4538 |
ConvRelu | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.loss import *
from torch.nn.modules import *
from torch.optim import *
from torch.optim.lr_scheduler import *
import torch.distributed
class ConvRelu(nn.Module):
"""3x3 convolution followed by ReLU activation building block.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from to... | asmekal/catalyst | ConvRelu | false | 12,122 | [
"MIT"
] | 0 | e11365c0a9812649ceaef14e53061cd5117d8684 | https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684 |
ContrastiveEmbeddingLoss | import torch
import torch.nn as nn
from torch.nn.modules.loss import *
from torch.nn.modules import *
from torch.optim import *
from torch.optim.lr_scheduler import *
import torch.distributed
class ContrastiveEmbeddingLoss(nn.Module):
"""
Contrastive embedding loss
paper: http://yann.lecun.com/exdb/publi... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
from t... | asmekal/catalyst | ContrastiveEmbeddingLoss | false | 12,123 | [
"MIT"
] | 0 | e11365c0a9812649ceaef14e53061cd5117d8684 | https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684 |
SingleHiddenLayer | import torch
class SingleHiddenLayer(torch.nn.Module):
def __init__(self, input_channels, hidden_channels):
super(SingleHiddenLayer, self).__init__()
self.input_channels = input_channels
self.hidden_channels = hidden_channels
self.linear1 = torch.nn.Linear(hidden_channels, 128)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | athon-millane/NeuralCDE | SingleHiddenLayer | false | 12,124 | [
"Apache-2.0"
] | 0 | 4196890fe5bf7a69925a12ff35e86f212963be71 | https://github.com/athon-millane/NeuralCDE/tree/4196890fe5bf7a69925a12ff35e86f212963be71 |
FinalTanh | import torch
class FinalTanh(torch.nn.Module):
def __init__(self, input_channels, hidden_channels,
hidden_hidden_channels, num_hidden_layers):
super(FinalTanh, self).__init__()
self.input_channels = input_channels
self.hidden_channels = hidden_channels
self.hidden_hidden_c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | athon-millane/NeuralCDE | FinalTanh | false | 12,125 | [
"Apache-2.0"
] | 0 | 4196890fe5bf7a69925a12ff35e86f212963be71 | https://github.com/athon-millane/NeuralCDE/tree/4196890fe5bf7a69925a12ff35e86f212963be71 |
_GRU_ODE | import torch
class _GRU_ODE(torch.nn.Module):
def __init__(self, input_channels, hidden_channels):
super(_GRU_ODE, self).__init__()
self.input_channels = input_channels
self.hidden_channels = hidden_channels
self.W_r = torch.nn.Linear(input_channels, hidden_channels, 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.triton_helpers import libdevice
assert_size_stride ... | athon-millane/NeuralCDE | _GRU_ODE | false | 12,126 | [
"Apache-2.0"
] | 0 | 4196890fe5bf7a69925a12ff35e86f212963be71 | https://github.com/athon-millane/NeuralCDE/tree/4196890fe5bf7a69925a12ff35e86f212963be71 |
CDEFunc | import torch
class CDEFunc(torch.nn.Module):
def __init__(self, input_channels, hidden_channels):
super(CDEFunc, self).__init__()
self.input_channels = input_channels
self.hidden_channels = hidden_channels
self.linear1 = torch.nn.Linear(hidden_channels, 128)
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.... | athon-millane/NeuralCDE | CDEFunc | false | 12,127 | [
"Apache-2.0"
] | 0 | 4196890fe5bf7a69925a12ff35e86f212963be71 | https://github.com/athon-millane/NeuralCDE/tree/4196890fe5bf7a69925a12ff35e86f212963be71 |
Critic | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Critic(nn.Module):
"""Critic (Value) Model."""
def __init__(self, state_size, action_size, seed, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.functional as F
import torch.nn as nn
assert_... | arpradha/deep-reinforcement-learning | Critic | false | 12,128 | [
"MIT"
] | 0 | 01cfc7ab19453285886900d9c6332c8cb435df51 | https://github.com/arpradha/deep-reinforcement-learning/tree/01cfc7ab19453285886900d9c6332c8cb435df51 |
SilogLoss | import torch
import torch.nn as nn
class SilogLoss(nn.Module):
def __init__(self, ratio=10, ratio2=0.85):
super().__init__()
self.ratio = ratio
self.ratio2 = ratio2
def forward(self, pred, gt):
log_diff = torch.log(pred * self.ratio) - torch.log(gt * self.ratio)
silog... | 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... | aycatakmaz/packnet-sfm | SilogLoss | false | 12,130 | [
"MIT"
] | 0 | d89cae81290133f136f6a1d1e288affc67eed1f7 | https://github.com/aycatakmaz/packnet-sfm/tree/d89cae81290133f136f6a1d1e288affc67eed1f7 |
MatrixTree | import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
class MatrixTree(nn.Module):
"""Implementation of the matrix-tree theorem for computing marginals
of non-projective dependency parsing. This attention layer is used
in the paper "Learning Structured Text Representations"
:ci... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
import torch.cuda
import torch.distributed
assert_s... | Zer0-dev115/OpenNMT-py | MatrixTree | false | 12,131 | [
"MIT"
] | 0 | 028c76b34779223ee6b3eb224b99617552987100 | https://github.com/Zer0-dev115/OpenNMT-py/tree/028c76b34779223ee6b3eb224b99617552987100 |
Critic | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Critic(nn.Module):
def __init__(self, state_size, action_size, seed, fcs1_units=512,
fc2_unit... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import numpy as np
import tor... | asiliskender/deep-reinforcement-learning | Critic | false | 12,132 | [
"MIT"
] | 0 | dbf96d67477aa9242128b78b081474193e1e4538 | https://github.com/asiliskender/deep-reinforcement-learning/tree/dbf96d67477aa9242128b78b081474193e1e4538 |
CNNCifar | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.nn.functional as F
class CNNCifar(nn.Module):
def __init__(self, args):
super(CNNCifar, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = 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
from torch._inductor.runtime.... | ataML/Federated-Learning-PyTorch | CNNCifar | false | 12,133 | [
"MIT"
] | 0 | 1c28f3e4a2ce2fd4e56d249e358a69408f76e34b | https://github.com/ataML/Federated-Learning-PyTorch/tree/1c28f3e4a2ce2fd4e56d249e358a69408f76e34b |
Discriminator | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils.weight_norm as weightNorm
class TReLU(nn.Module):
def __init__(self):
super(TReLU, self).__init__()
self.alpha = nn.Parameter(torch.FloatTensor(1), requires_grad=True)
self.alpha.data.fill_(0)
de... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | archiroid003/ICCV2019-LearningToPaint | Discriminator | false | 12,134 | [
"MIT"
] | 0 | 4b5fc263e4843c159a61e5956956b3f7812693f8 | https://github.com/archiroid003/ICCV2019-LearningToPaint/tree/4b5fc263e4843c159a61e5956956b3f7812693f8 |
LayerNorm | import torch
import torch.nn as nn
from torch.nn import Parameter
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-08, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
self.affine = affine
self.eps = eps
if self.affine:
... | 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
from torch.nn import Parameter
assert_size_stride = torch... | autocomic/deepfillv2 | LayerNorm | false | 12,135 | [
"MIT"
] | 0 | 4b0f565accbf20ee90093a4504b1cff0099d9cb9 | https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9 |
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... | autocomic/deepfillv2 | GatedConv2d | false | 12,136 | [
"MIT"
] | 0 | 4b0f565accbf20ee90093a4504b1cff0099d9cb9 | https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9 |
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 ... | autocomic/deepfillv2 | Conv2dLayer | false | 12,137 | [
"MIT"
] | 0 | 4b0f565accbf20ee90093a4504b1cff0099d9cb9 | https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9 |
InvDepth | import torch
import torch.nn as nn
class InvDepth(nn.Module):
"""Inverse depth layer"""
def __init__(self, in_channels, out_channels=1, min_depth=0.5):
"""
Initializes an InvDepth object.
Parameters
----------
in_channels : int
Number of input 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 torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | aycatakmaz/packnet-sfm | InvDepth | false | 12,138 | [
"MIT"
] | 0 | d89cae81290133f136f6a1d1e288affc67eed1f7 | https://github.com/aycatakmaz/packnet-sfm/tree/d89cae81290133f136f6a1d1e288affc67eed1f7 |
BBoxTransform | import torch
from torch import nn
class BBoxTransform(nn.Module):
def forward(self, anchors, regression):
"""
decode_box_outputs adapted from https://github.com/google/automl/blob/master/efficientdet/anchors.py
Args:
anchors: [batchsize, boxes, (y1, x1, y2, x2)]
r... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_... | awesome-amy/efficientmask | BBoxTransform | false | 12,139 | [
"MIT"
] | 0 | 2456d52af92f765de771fbb6bd27fe2b9f19533b | https://github.com/awesome-amy/efficientmask/tree/2456d52af92f765de771fbb6bd27fe2b9f19533b |
TransposeConv2dLayer | 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
import torch.nn as nn
from torch.nn import Parameter
assert_size_stride = torch.... | autocomic/deepfillv2 | TransposeConv2dLayer | false | 12,140 | [
"MIT"
] | 0 | 4b0f565accbf20ee90093a4504b1cff0099d9cb9 | https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9 |
AverageRC | import torch
import torch.nn as nn
class AverageRC(nn.Module):
def __init__(self):
super(AverageRC, self).__init__()
def forward(self, input):
input = input[:int(input.shape[0] / 2)] / 2 + input[int(input.shape
[0] / 2):] / 2
return input
def get_inputs():
return [t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | banwang27/models | AverageRC | false | 12,141 | [
"MIT"
] | 0 | 59db29e46f76b630b78c864fb607388dd927b93c | https://github.com/banwang27/models/tree/59db29e46f76b630b78c864fb607388dd927b93c |
OscBase | import torch
import numpy as np
import torch.nn as nn
def init(module, weight_init, bias_init, gain=1):
weight_init(module.weight.data, gain=gain)
bias_init(module.bias.data)
return module
class NNBase(nn.Module):
def __init__(self, recurrent, recurrent_input_size, hidden_size):
super(NNBas... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | aupilot/a2c | OscBase | false | 12,142 | [
"MIT"
] | 0 | cd7e8892f91ce0c8b4c221eb6be31ebbee81d663 | https://github.com/aupilot/a2c/tree/cd7e8892f91ce0c8b4c221eb6be31ebbee81d663 |
CNN | import torch
from torch import nn
import torch.nn.functional as F
class CNN(torch.nn.Module):
"""Basic CNN architecture."""
def __init__(self, in_channels=1):
super(CNN, self).__init__()
self.conv1 = nn.Conv2d(in_channels, 64, 8, 1)
self.conv2 = nn.Conv2d(64, 128, 6, 2)
self.c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | austereantelope/cleverhans | CNN | false | 12,143 | [
"MIT"
] | 0 | 5d68d538c89257693f9a7491994bb5586d3ec310 | https://github.com/austereantelope/cleverhans/tree/5d68d538c89257693f9a7491994bb5586d3ec310 |
UnpackLayerConv2d | import torch
import torch.nn as nn
class Conv2D(nn.Module):
"""
2D convolution with GroupNorm and ELU
Parameters
----------
in_channels : int
Number of input channels
out_channels : int
Number of output channels
kernel_size : int
Kernel size
stride : int
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | aycatakmaz/packnet-sfm | UnpackLayerConv2d | false | 12,144 | [
"MIT"
] | 0 | d89cae81290133f136f6a1d1e288affc67eed1f7 | https://github.com/aycatakmaz/packnet-sfm/tree/d89cae81290133f136f6a1d1e288affc67eed1f7 |
ReCodeAlphabet | import torch
import torch.nn as nn
class ReCodeAlphabet(nn.Module):
def __init__(self):
super(ReCodeAlphabet, self).__init__()
def forward(self, input):
input_reordered = [input[:, i, ...] for i in [0, 2, 1, 3]]
input = torch.stack(input_reordered, dim=1)
return input
def g... | 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... | banwang27/models | ReCodeAlphabet | false | 12,145 | [
"MIT"
] | 0 | 59db29e46f76b630b78c864fb607388dd927b93c | https://github.com/banwang27/models/tree/59db29e46f76b630b78c864fb607388dd927b93c |
SuperSimpleSemSegNet | import torch
import torch.nn as nn
class SuperSimpleSemSegNet(nn.Module):
def __init__(self, in_channel, out_channel):
super().__init__()
self.conv1 = torch.nn.Conv2d(in_channel, out_channel, kernel_size=3,
padding=1, stride=1)
self.ReLU = torch.nn.ReLU()
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.... | benkoger/kasanka | SuperSimpleSemSegNet | false | 12,146 | [
"Apache-2.0"
] | 0 | d5b1d32b7abf54845af0832da577137397089001 | https://github.com/benkoger/kasanka/tree/d5b1d32b7abf54845af0832da577137397089001 |
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 ... | autocomic/deepfillv2 | TransposeGatedConv2d | false | 12,147 | [
"MIT"
] | 0 | 4b0f565accbf20ee90093a4504b1cff0099d9cb9 | https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9 |
Attention | import math
import torch
from torch.nn import functional as F
import torch.nn as nn
class Attention(nn.Module):
def __init__(self, hidden_size):
super(Attention, self).__init__()
self.hidden_size = hidden_size
self.attn = nn.Linear(self.hidden_size * 2, hidden_size)
self.v = nn.Pa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | baduncan/Pytorch-seq2seq-Beam-Search | Attention | false | 12,148 | [
"MIT"
] | 0 | 82e2f12563d4db520a9a9089e7205f398ca53699 | https://github.com/baduncan/Pytorch-seq2seq-Beam-Search/tree/82e2f12563d4db520a9a9089e7205f398ca53699 |
L1Norm | import torch
import torch.nn as nn
class L1Norm(nn.Module):
def __init__(self):
super(L1Norm, self).__init__()
self.eps = 1e-10
def forward(self, x):
norm = torch.sum(torch.abs(x), dim=1) + self.eps
x = x / norm.expand_as(x)
return x
def get_inputs():
return [to... | 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... | bankbiz/Key.Net | L1Norm | false | 12,149 | [
"BSD-3-Clause-Clear"
] | 0 | 5ba46614821e94be1b36d97721bd6c2e5fff9e20 | https://github.com/bankbiz/Key.Net/tree/5ba46614821e94be1b36d97721bd6c2e5fff9e20 |
L2Norm | import torch
import torch.nn as nn
class L2Norm(nn.Module):
def __init__(self):
super(L2Norm, self).__init__()
self.eps = 1e-10
def forward(self, x):
norm = torch.sqrt(torch.sum(x * x, dim=1) + self.eps)
x = x / norm.unsqueeze(-1).expand_as(x)
return x
def get_input... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | bankbiz/Key.Net | L2Norm | false | 12,150 | [
"BSD-3-Clause-Clear"
] | 0 | 5ba46614821e94be1b36d97721bd6c2e5fff9e20 | https://github.com/bankbiz/Key.Net/tree/5ba46614821e94be1b36d97721bd6c2e5fff9e20 |
Swish | import torch
from torch.functional import F
class Swish(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return F.sigmoid(x) * 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... | bglick13/multi-agent-emergence-environments | Swish | false | 12,151 | [
"MIT"
] | 0 | e02d66f0734d95470d15a4508ff369a75fa093a4 | https://github.com/bglick13/multi-agent-emergence-environments/tree/e02d66f0734d95470d15a4508ff369a75fa093a4 |
LinearLR | import torch
import torch.nn as nn
import torch.utils.checkpoint
class LinearLR(nn.Module):
"""[u * v + res] version of torch.nn.Linear"""
def __init__(self, in_features, out_features, rank_ratio=0.25, bias=
True, device=None, dtype=None):
super().__init__()
sliced_rank = int(min(in_f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.checkpoint
assert_size_stride = torch._... | bahducoup/factorized_training | LinearLR | false | 12,152 | [
"MIT"
] | 0 | 0af38f16338a9bcfcc11091b1a6b75befd67f234 | https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234 |
LowRankResidualPositionwiseFeedForward | import torch
import torch.nn as nn
import torch.utils.checkpoint
import torch.nn.functional as F
from torch.cuda.amp import autocast
class LowRankResidualPositionwiseFeedForward(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_in, d_hid, dropout=0.1):
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.... | bahducoup/factorized_training | LowRankResidualPositionwiseFeedForward | false | 12,153 | [
"MIT"
] | 0 | 0af38f16338a9bcfcc11091b1a6b75befd67f234 | https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234 |
PyramidModule | import torch
import torch.nn as nn
from torchvision.transforms import *
class ConvBlock(nn.Module):
def __init__(self, input_size, output_size, kernel_size=3, stride=1,
padding=1, bias=True, activation='prelu', norm=None):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(input_size... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torchvision.transforms import *
assert_size_stride = ... | arnon-weinberg/Upscale-interpolate-STARnet | PyramidModule | false | 12,154 | [
"MIT"
] | 0 | d898d38364a36f4633cfba8f914db20d9b900217 | https://github.com/arnon-weinberg/Upscale-interpolate-STARnet/tree/d898d38364a36f4633cfba8f914db20d9b900217 |
LowRankPositionwiseFeedForward | import torch
import torch.nn as nn
import torch.utils.checkpoint
import torch.nn.functional as F
from torch.cuda.amp import autocast
class LowRankPositionwiseFeedForward(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_in, d_hid, dropout=0.1):
super().__init__()
self.w... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | bahducoup/factorized_training | LowRankPositionwiseFeedForward | false | 12,155 | [
"MIT"
] | 0 | 0af38f16338a9bcfcc11091b1a6b75befd67f234 | https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.