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 |
|---|---|---|---|---|---|---|---|---|---|---|
LSN | import torch
from torch import Tensor
import torch.nn as nn
import torch.utils.data
import torch.nn.parallel
import torch.nn.functional as F
class LSN(nn.Module):
""" Custom Linear layer that modifies standard ReLU layer"""
__constants__ = ['inplace']
inplace: 'bool'
def __init__(self, scale: 'int'=2... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
import torch.nn.parallel
assert_size_stride... | SindiLab/ACTIVA | LSN | false | 17,923 | [
"MIT"
] | 6 | 599f57478c5e13868d27879632c54964bf7b02ad | https://github.com/SindiLab/ACTIVA/tree/599f57478c5e13868d27879632c54964bf7b02ad |
EncoderImagePrecomp | import torch
import numpy as np
from torch import nn
from collections import OrderedDict
import torch.nn.init
def l2norm(X):
"""L2-normalize columns of X
"""
norm = torch.pow(X, 2).sum(dim=1, keepdim=True).sqrt()
X = torch.div(X, norm)
return X
class EncoderImagePrecomp(nn.Module):
def __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 numpy as np
... | Shiyang-Yan/Discrete-continous-PG-for-Retrieval | EncoderImagePrecomp | false | 17,924 | [
"Apache-2.0"
] | 8 | 39fd7a81f732ae043c2ea20352a0c55b72834639 | https://github.com/Shiyang-Yan/Discrete-continous-PG-for-Retrieval/tree/39fd7a81f732ae043c2ea20352a0c55b72834639 |
SSSNET | import torch
from typing import Optional
from typing import Tuple
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from typing import Union
class SIMPA(nn.Module):
"""The signed mixed-path aggregation model.
Args:
hop (int): Number of hops to consider.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | SherylHYX/SSSNET_Signed_Clustering | SSSNET | false | 17,925 | [
"MIT"
] | 5 | 85736c18e86b396d64177d22b8c7f9859dfd794c | https://github.com/SherylHYX/SSSNET_Signed_Clustering/tree/85736c18e86b396d64177d22b8c7f9859dfd794c |
DenseNet_conv | import torch
import torch.nn as nn
def xavier_init(module, gain=1, bias=0, distribution='normal'):
assert distribution in ['uniform', 'normal']
if distribution == 'uniform':
nn.init.xavier_uniform_(module.weight, gain=gain)
else:
nn.init.xavier_normal_(module.weight, gain=gain)
if hasa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | Shiaoming/DensefromRGBS | DenseNet_conv | false | 17,926 | [
"MIT"
] | 7 | d69f5f60c5512da876b002a2007ec42d4a3fbb8e | https://github.com/Shiaoming/DensefromRGBS/tree/d69f5f60c5512da876b002a2007ec42d4a3fbb8e |
TripletLoss | import torch
from torchvision.transforms import functional as F
import torch.utils.data
from torch import nn
import torch.nn.functional as F
class TripletLoss(nn.Module):
"""
Triplet loss
Takes embeddings [N*dim_embed] of an anchor sample, a positive sample and a negative sample
"""
def __init__(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
from torch import nn
assert_size_stride = torch._C._dynamo.guards... | Sigma10010/nuclei_cells_det | TripletLoss | false | 17,927 | [
"MIT"
] | 4 | c074175fec8938472bb4cddabd83d1d0ea78f230 | https://github.com/Sigma10010/nuclei_cells_det/tree/c074175fec8938472bb4cddabd83d1d0ea78f230 |
CPULayerNorm | import torch
import torch.nn as nn
class CPULayerNorm(nn.Module):
def __init__(self, features, eps=1e-06):
super().__init__()
self.features = features
self.eps = eps
def forward(self, x, gamma, beta):
mean = x.mean(-1, keepdim=True)
std = x.std(-1, keepdim=True)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | Smerity/pytorch-qrnn | CPULayerNorm | false | 17,928 | [
"BSD-3-Clause"
] | 4 | 907c8ea53f689136fcc50996b6474de967745202 | https://github.com/Smerity/pytorch-qrnn/tree/907c8ea53f689136fcc50996b6474de967745202 |
MixerBlock | import torch
import torch.nn as nn
def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False):
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
This is the same as the DropConnect impl I created for EfficientNet, etc networks, however,
the original name is ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Sense-GVT/BigPretrain | MixerBlock | false | 17,929 | [
"Apache-2.0"
] | 8 | d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e | https://github.com/Sense-GVT/BigPretrain/tree/d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e |
SelfAttention | import torch
import torch.nn as nn
class SelfAttention(nn.Module):
def __init__(self, embed_dims, heads):
super(SelfAttention, self).__init__()
self.heads = heads
self.embed_dims = embed_dims
self.depth = embed_dims // heads
self.query = nn.Linear(self.depth, self.depth)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ShivamRajSharma/Transformer-Text-To-Spech | SelfAttention | false | 17,930 | [
"MIT"
] | 10 | 2e1cf84a791497e414fb72ae04d954fce934a32a | https://github.com/ShivamRajSharma/Transformer-Text-To-Spech/tree/2e1cf84a791497e414fb72ae04d954fce934a32a |
ContrastiveLoss | import torch
from torchvision.transforms import functional as F
import torch.utils.data
from torch import nn
import torch.nn.functional as F
class ContrastiveLoss(nn.Module):
"""
Contrastive loss
Takes embeddings of two samples and a target label == 1 if samples are from the same class and label == 0 othe... | 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.utils.data
from... | Sigma10010/nuclei_cells_det | ContrastiveLoss | false | 17,931 | [
"MIT"
] | 4 | c074175fec8938472bb4cddabd83d1d0ea78f230 | https://github.com/Sigma10010/nuclei_cells_det/tree/c074175fec8938472bb4cddabd83d1d0ea78f230 |
AttentionLayer | import math
import torch
from torch import nn
from torch.nn import functional as F
import torch.nn.init
def Linear(in_features, out_features, dropout=0.0):
m = nn.Linear(in_features, out_features)
m.weight.data.normal_(mean=0, std=math.sqrt((1 - dropout) / in_features))
m.bias.data.zero_()
return nn.u... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Shiyang-Yan/Discrete-continous-PG-for-Retrieval | AttentionLayer | false | 17,932 | [
"Apache-2.0"
] | 8 | 39fd7a81f732ae043c2ea20352a0c55b72834639 | https://github.com/Shiyang-Yan/Discrete-continous-PG-for-Retrieval/tree/39fd7a81f732ae043c2ea20352a0c55b72834639 |
wide_basic | import torch
import torch.nn as nn
import torch.utils
import torch.utils.data
def get_norm(n_filters, norm):
if norm is None:
return Identity()
elif norm == 'batch':
return nn.BatchNorm2d(n_filters, momentum=0.9)
elif norm == 'instance':
return nn.InstanceNorm2d(n_filters, affine=T... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils
import torch.utils.data
assert_size_str... | Silent-Zebra/JEM | wide_basic | false | 17,933 | [
"Apache-2.0"
] | 6 | 33440aff8429d9a24a8ba858d0209f4b48be8e05 | https://github.com/Silent-Zebra/JEM/tree/33440aff8429d9a24a8ba858d0209f4b48be8e05 |
CPUReverseForgetMult | import torch
class CPUReverseForgetMult(torch.nn.Module):
def __init__(self):
super(CPUReverseForgetMult, self).__init__()
def forward(self, f, x, hidden_init=None):
result = []
forgets = f.split(1, dim=0)[::-1]
inputs = (f * x).split(1, dim=0)[::-1]
prev_h = hidden_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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret... | Smerity/pytorch-qrnn | CPUReverseForgetMult | false | 17,934 | [
"BSD-3-Clause"
] | 4 | 907c8ea53f689136fcc50996b6474de967745202 | https://github.com/Smerity/pytorch-qrnn/tree/907c8ea53f689136fcc50996b6474de967745202 |
Project3D | import torch
import torch.nn as nn
class Project3D(nn.Module):
"""Layer which projects 3D points into a camera with intrinsics K and at position T
"""
def __init__(self, batch_size, height, width, eps=1e-07):
super(Project3D, self).__init__()
self.batch_size = batch_size
self.heig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Sid1057/sid1057.github.io | Project3D | false | 17,935 | [
"MIT"
] | 4 | 623d1731e308b42b6f86304dcfd671a061b414bf | https://github.com/Sid1057/sid1057.github.io/tree/623d1731e308b42b6f86304dcfd671a061b414bf |
ConvBlock | import torch
import torch.nn as nn
class Conv3x3(nn.Module):
"""Layer to pad and convolve input
"""
def __init__(self, in_channels, out_channels, use_refl=True):
super(Conv3x3, self).__init__()
if use_refl:
self.pad = nn.ReflectionPad2d(1)
else:
self.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 libdevice, math as tl_math
im... | Sid1057/sid1057.github.io | ConvBlock | false | 17,936 | [
"MIT"
] | 4 | 623d1731e308b42b6f86304dcfd671a061b414bf | https://github.com/Sid1057/sid1057.github.io/tree/623d1731e308b42b6f86304dcfd671a061b414bf |
VirtualBatchNorm1d | from torch.nn import Module
import torch
import torch.utils
import torch.utils.data
from torch.nn.parameter import Parameter
from torch.nn.modules import Module
class VirtualBatchNorm1d(Module):
"""
Module for Virtual Batch Normalization.
Implementation borrowed and modified from Rafael_Valle's code + hel... | 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
import torch.utils
import torch.utils.data
from tor... | Silent-Zebra/JEM | VirtualBatchNorm1d | false | 17,937 | [
"Apache-2.0"
] | 6 | 33440aff8429d9a24a8ba858d0209f4b48be8e05 | https://github.com/Silent-Zebra/JEM/tree/33440aff8429d9a24a8ba858d0209f4b48be8e05 |
WeightNet_DW | import torch
import torch.nn as nn
import torch.nn.functional as F
class WeightNet_DW(nn.Module):
""" Here we show a grouping manner when we apply
WeightNet to a depthwise convolution. The grouped
fc layer directly generates the convolutional kernel,
has fewer parameters while achieving comparable res... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Sense-GVT/BigPretrain | WeightNet_DW | false | 17,938 | [
"Apache-2.0"
] | 8 | d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e | https://github.com/Sense-GVT/BigPretrain/tree/d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e |
SSIM | import torch
import torch.nn as nn
class SSIM(nn.Module):
"""Layer to compute the SSIM loss between a pair of images
"""
def __init__(self):
super(SSIM, self).__init__()
self.mu_x_pool = nn.AvgPool2d(3, 1)
self.mu_y_pool = nn.AvgPool2d(3, 1)
self.sig_x_pool = nn.AvgPool2d(... | 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
... | Sid1057/sid1057.github.io | SSIM | false | 17,939 | [
"MIT"
] | 4 | 623d1731e308b42b6f86304dcfd671a061b414bf | https://github.com/Sid1057/sid1057.github.io/tree/623d1731e308b42b6f86304dcfd671a061b414bf |
GraphConvolution | from torch.nn import Module
import torch
import torch.autograd
import torch.nn as nn
from torch.nn.modules.module import Module
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907.
"""
def __init__(self, state_dim, name='', out_state_dim=None):
su... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import torch.autograd
import torch.nn as nn
from tor... | SowmyaAitha/Palmira | GraphConvolution | false | 17,940 | [
"MIT"
] | 6 | c3ae884e35b8b3703a5e4ba52d7b0bdae6da1bad | https://github.com/SowmyaAitha/Palmira/tree/c3ae884e35b8b3703a5e4ba52d7b0bdae6da1bad |
Decoder | import torch
import torch.nn as nn
class Decoder(nn.Module):
def __init__(self):
super(Decoder, self).__init__()
self.pre11 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv11 = nn.Conv2d(in_channels=512, out_channels=256,
kernel_size=3, stride=1)
self.relu11 = nn.ReLU(inpl... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ShiZhuming/StyleTransfer | Decoder | false | 17,941 | [
"MIT"
] | 10 | cba2a3ceb733a2d129d52d4a3cac07c7651bd928 | https://github.com/ShiZhuming/StyleTransfer/tree/cba2a3ceb733a2d129d52d4a3cac07c7651bd928 |
SH2Signal | import torch
import numpy as np
import torch.nn as nn
from scipy import special as sci
def cart2sph(x, y, z):
"""
cart2sph(x, y, z) -> theta, phi, r
Computes the corresponding spherical coordinate of the given input parameters :attr:`x`, :attr:`y` and :attr:`x`.
Args:
x (Number): x position
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
from scipy import special as sci
assert... | SimonKoppers/DELIMIT | SH2Signal | false | 17,942 | [
"MIT"
] | 7 | d778a567bbec1beef2395ead60aa1e30086bb07c | https://github.com/SimonKoppers/DELIMIT/tree/d778a567bbec1beef2395ead60aa1e30086bb07c |
GraphResConvolution | from torch.nn import Module
import torch
import torch.autograd
import torch.nn as nn
from torch.nn.modules.module import Module
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907.
"""
def __init__(self, state_dim, name='', out_state_dim=None):
su... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
i... | SowmyaAitha/Palmira | GraphResConvolution | false | 17,943 | [
"MIT"
] | 6 | c3ae884e35b8b3703a5e4ba52d7b0bdae6da1bad | https://github.com/SowmyaAitha/Palmira/tree/c3ae884e35b8b3703a5e4ba52d7b0bdae6da1bad |
SharedDropoutMLP | import torch
import torch.nn as nn
class SharedDropout(nn.Module):
"""
SharedDropout differs from the vanilla dropout strategy in that
the dropout mask is shared across one dimension.
Args:
p (float):
The probability of an element to be zeroed. Default: 0.5.
batch_first (b... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Spico197/REx | SharedDropoutMLP | false | 17,944 | [
"MIT"
] | 4 | bb3cdb845765a63e9bd18070068af52a1b2db3f3 | https://github.com/Spico197/REx/tree/bb3cdb845765a63e9bd18070068af52a1b2db3f3 |
SubjObjSpan | import torch
import numpy as np
from typing import Iterable
from typing import Optional
import torch.nn as nn
def find_closest_span_pairs(head: 'Iterable', tail: 'Iterable', backtrace:
'Optional[bool]'=True):
"""
Find all span pairs.
Args:
head: list of start position predictions, either 1 or... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
from typing import Iterable
from typing import Optional
impor... | Spico197/REx | SubjObjSpan | false | 17,945 | [
"MIT"
] | 4 | bb3cdb845765a63e9bd18070068af52a1b2db3f3 | https://github.com/Spico197/REx/tree/bb3cdb845765a63e9bd18070068af52a1b2db3f3 |
make_dense | import torch
import torch.nn as nn
import torch.utils.model_zoo
class make_dense(nn.Module):
def __init__(self, channels_in, channels_out, kernel_size=3):
super(make_dense, self).__init__()
self.leaky_relu = nn.LeakyReLU(0.1, inplace=True)
self.conv = nn.Conv2d(channels_in, channels_out, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.model_zoo
assert_size_stride = torch._C... | SeleSchaefer/super_resolution | make_dense | false | 17,946 | [
"MIT"
] | 5 | bf28a959fb150ceeadbd9f0bcfc12f3025cf82f4 | https://github.com/SeleSchaefer/super_resolution/tree/bf28a959fb150ceeadbd9f0bcfc12f3025cf82f4 |
CE_loss | import torch
import torch.nn as nn
import torch.utils.model_zoo
class CE_loss(nn.Module):
def __init__(self):
super().__init__()
self.loss = nn.CrossEntropyLoss()
def forward(self, predict, target):
n, _c, h, w = target.data.shape
predict = predict.permute(0, 2, 3, 1).contigu... | 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
... | SeleSchaefer/super_resolution | CE_loss | false | 17,947 | [
"MIT"
] | 5 | bf28a959fb150ceeadbd9f0bcfc12f3025cf82f4 | https://github.com/SeleSchaefer/super_resolution/tree/bf28a959fb150ceeadbd9f0bcfc12f3025cf82f4 |
LogSTFTMagnitude | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class LogSTFTMagnitude(nn.Module):
def __init__(self):
super().__init__()
def forward(self, predicts_mag, targets_mag):
log_predicts_mag = torch.log(predicts_mag)
log_targets_mag = torch.log(ta... | 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
... | SolomidHero/speech-regeneration-enhancer | LogSTFTMagnitude | false | 17,948 | [
"MIT"
] | 8 | eb43907ff085d68a707ff7bc3af14e93ff66fd65 | https://github.com/SolomidHero/speech-regeneration-enhancer/tree/eb43907ff085d68a707ff7bc3af14e93ff66fd65 |
Smoother | from torch.nn import Module
import torch
from torch import Tensor
from typing import Optional
import torch.nn.functional as F
from torch.nn import Dropout
from torch.nn import LayerNorm
from torch.nn import Conv1d
from torch.nn import MultiheadAttention
class Smoother(Module):
"""Convolutional Transformer Encoder... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | SolomidHero/FragmentVC-with-RAdam | Smoother | false | 17,949 | [
"MIT"
] | 6 | a0ee884155a4e8f47d8950a35258e58987f6289e | https://github.com/SolomidHero/FragmentVC-with-RAdam/tree/a0ee884155a4e8f47d8950a35258e58987f6289e |
Extractor | from torch.nn import Module
import torch
from torch import Tensor
from typing import Optional
from typing import Tuple
import torch.nn.functional as F
from torch.nn import Dropout
from torch.nn import LayerNorm
from torch.nn import Conv1d
from torch.nn import MultiheadAttention
class Extractor(Module):
"""Convolu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | SolomidHero/FragmentVC-with-RAdam | Extractor | false | 17,950 | [
"MIT"
] | 6 | a0ee884155a4e8f47d8950a35258e58987f6289e | https://github.com/SolomidHero/FragmentVC-with-RAdam/tree/a0ee884155a4e8f47d8950a35258e58987f6289e |
State_Autoencoder | import torch
import torch.nn as nn
from collections import OrderedDict
class State_Autoencoder(nn.Module):
def __init__(self, frame_stacks=1, channels=3):
super(State_Autoencoder, self).__init__()
self.encoder = nn.Sequential(OrderedDict([('encoder_conv1', nn.
Conv2d(channels * frame_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 co... | Squishy123/GDE_net | State_Autoencoder | false | 17,951 | [
"Apache-2.0"
] | 4 | 9094cbf58edbf0d62a2b2cd66743322597f66269 | https://github.com/Squishy123/GDE_net/tree/9094cbf58edbf0d62a2b2cd66743322597f66269 |
SmallMnistNoDropout | import torch
import torch.nn as nn
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class SmallMnistNoDropout(nn.Module):
def __init__(self):
super(SmallMnistNoDropout, self).__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_siz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Rohan-Chaudhury/aimet | SmallMnistNoDropout | false | 17,952 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
SmallMnist | import torch
import torch.nn as nn
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class SmallMnist(nn.Module):
def __init__(self):
super(SmallMnist, self).__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
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.... | Rohan-Chaudhury/aimet | SmallMnist | false | 17,953 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
SingleBlock | import torch
import torch.nn as nn
import torch.nn.functional as F
class FCNet(nn.Module):
def __init__(self, in_size, out_size, activate=None, drop=0.0):
super(FCNet, self).__init__()
self.lin = nn.Linear(in_size, out_size)
self.drop_value = drop
self.drop = nn.Dropout(drop)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Ruiver/CTCNet | SingleBlock | false | 17,954 | [
"Apache-2.0"
] | 6 | 539e55ec9fed06028379d35dfd5cd4074755ffd8 | https://github.com/Ruiver/CTCNet/tree/539e55ec9fed06028379d35dfd5cd4074755ffd8 |
Subtract | import torch
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class Subtract(torch.nn.Module):
""" Subtract module for a functional subtract"""
def forward(self, x, y):
"""
Forward-pass routine for subtact op
"""
... | 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
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
assert_size_stride =... | Rohan-Chaudhury/aimet | Subtract | false | 17,955 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
SpectralConvergence | import torch
import torch.nn as nn
import torch.utils.data
class SpectralConvergence(nn.Module):
def __init__(self):
"""Initilize spectral convergence loss module."""
super().__init__()
def forward(self, predicts_mag, targets_mag):
"""Calculate norm of difference operator.
Args:
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dy... | SolomidHero/speech-regeneration-enhancer | SpectralConvergence | false | 17,956 | [
"MIT"
] | 8 | eb43907ff085d68a707ff7bc3af14e93ff66fd65 | https://github.com/SolomidHero/speech-regeneration-enhancer/tree/eb43907ff085d68a707ff7bc3af14e93ff66fd65 |
GumbelSoftmaxLayer | import torch
import torch.nn as nn
from torch.distributions import RelaxedOneHotCategorical
import torch.nn.parallel
import torch.utils.data
import torch.distributions
def gumbel_softmax_sample(logits: 'torch.Tensor', temperature: 'float'=1.0,
training: 'bool'=True, straight_through: 'bool'=False):
size = log... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torch.distributions import RelaxedOneHotCategorical
import torch.nn.parallel
import torch.utils.data
import torch... | Slowika/GameBias-EmeCom2020 | GumbelSoftmaxLayer | false | 17,957 | [
"MIT"
] | 5 | 5b94c47559f8202bca99c26fc1bcb078dd0509a6 | https://github.com/Slowika/GameBias-EmeCom2020/tree/5b94c47559f8202bca99c26fc1bcb078dd0509a6 |
Hsigmoid | import torch
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
class Hsigmoid(nn.Module):
def __init__(self, add_stub=False):
super().__init__()
self.quant = QuantStub()
self.dequant = DeQuantStub()
self.add_stub = add_stub
... | 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.quantization import QuantStub
from torch.quantization im... | T-head-Semi/tvm | Hsigmoid | false | 17,958 | [
"Apache-2.0"
] | 4 | c1b8e06685c92fb7cacbe989e147b0622aee4503 | https://github.com/T-head-Semi/tvm/tree/c1b8e06685c92fb7cacbe989e147b0622aee4503 |
_TestNetStrided | import torch
import torch.nn.functional as F
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class _TestNetStrided(torch.nn.Module):
def __init__(self):
super(_TestNetStrided, self).__init__()
self.conv1 = torch.nn.Conv2d(1, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Rohan-Chaudhury/aimet | _TestNetStrided | false | 17,959 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
Divide | import torch
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class Divide(torch.nn.Module):
""" Divide module for a functional divide"""
def forward(self, x, y):
"""
Forward-pass routine for divide op
"""
... | 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
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
assert_size_stride =... | Rohan-Chaudhury/aimet | Divide | false | 17,960 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
Hswish | import torch
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
class Hswish(nn.Module):
def __init__(self, add_stub=False):
super().__init__()
self.quant = QuantStub()
self.dequant = DeQuantStub()
self.add_stub = add_stub
... | 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.quantization import QuantStub
from torch.quantization im... | T-head-Semi/tvm | Hswish | false | 17,961 | [
"Apache-2.0"
] | 4 | c1b8e06685c92fb7cacbe989e147b0622aee4503 | https://github.com/T-head-Semi/tvm/tree/c1b8e06685c92fb7cacbe989e147b0622aee4503 |
VirtualBatchNormNN | from torch.nn import Module
import torch
import torch.utils
import torch.utils.data
from torch.nn.parameter import Parameter
from torch.nn.modules import Module
class VirtualBatchNormNN(Module):
"""
Module for Virtual Batch Normalization.
Implementation borrowed and modified from Rafael_Valle's code + hel... | 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
import torch.utils
import torch.utils.data
from tor... | Silent-Zebra/JEM | VirtualBatchNormNN | false | 17,962 | [
"Apache-2.0"
] | 6 | 33440aff8429d9a24a8ba858d0209f4b48be8e05 | https://github.com/Silent-Zebra/JEM/tree/33440aff8429d9a24a8ba858d0209f4b48be8e05 |
GEGLU | import torch
import torch.nn.functional as F
from torch import nn
class GEGLU(nn.Module):
def forward(self, x):
x, gates = x.chunk(2, dim=-1)
return x * F.gelu(gates)
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
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | TabbenBenchmark/tabben | GEGLU | false | 17,963 | [
"MIT"
] | 5 | d74114afc4b6f67be488ab6bf8ad6fd316fdb888 | https://github.com/TabbenBenchmark/tabben/tree/d74114afc4b6f67be488ab6bf8ad6fd316fdb888 |
Conv3x3 | import torch
import torch.nn as nn
class Conv3x3(nn.Module):
"""Layer to pad and convolve input
"""
def __init__(self, in_channels, out_channels, use_refl=True):
super(Conv3x3, self).__init__()
if use_refl:
self.pad = nn.ReflectionPad2d(1)
else:
self.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.... | Sid1057/sid1057.github.io | Conv3x3 | false | 17,964 | [
"MIT"
] | 4 | 623d1731e308b42b6f86304dcfd671a061b414bf | https://github.com/Sid1057/sid1057.github.io/tree/623d1731e308b42b6f86304dcfd671a061b414bf |
ReinforcedReceiver | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.utils.data
from torch.distributions import Bernoulli
import torch.distributions
class ReinforcedReceiver(nn.Module):
def __init__(self, n_bits, n_hidden):
super(ReinforcedReceiver, 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
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
import to... | Slowika/GameBias-EmeCom2020 | ReinforcedReceiver | false | 17,965 | [
"MIT"
] | 5 | 5b94c47559f8202bca99c26fc1bcb078dd0509a6 | https://github.com/Slowika/GameBias-EmeCom2020/tree/5b94c47559f8202bca99c26fc1bcb078dd0509a6 |
VonmisesLossBiternion | import torch
class VonmisesLossBiternion(torch.nn.Module):
"""Von mises loss function for biternion inputs
see: Beyer et al.: Biternion Nets: Continuous Head Pose Regression from
Discrete Training Labels, GCPR 2015.
"""
def __init__(self, kappa):
super(VonmisesLossBiternion, 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 math as tl_math
assert_size_s... | TUI-NICR/multi-task-person-perception | VonmisesLossBiternion | false | 17,966 | [
"BSD-3-Clause"
] | 4 | 81666eb42be9522fd726448e82e8bbf04138ffa3 | https://github.com/TUI-NICR/multi-task-person-perception/tree/81666eb42be9522fd726448e82e8bbf04138ffa3 |
MulScalarNegative | import torch
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
class MulScalarNegative(nn.Module):
def __init__(self):
super().__init__()
self.float_op = nn.quantized.FloatFunctional()
self.quant = QuantStub()
self.dequant = ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
assert_size_stride = torch._C._dyn... | T-head-Semi/tvm | MulScalarNegative | false | 17,967 | [
"Apache-2.0"
] | 4 | c1b8e06685c92fb7cacbe989e147b0622aee4503 | https://github.com/T-head-Semi/tvm/tree/c1b8e06685c92fb7cacbe989e147b0622aee4503 |
InformedSender | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.utils.data
import torch.distributions
class InformedSender(nn.Module):
def __init__(self, game_size, feat_size, embedding_size, hidden_size,
vocab_size=100, temp=1.0):
super(InformedSender, 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.... | Slowika/GameBias-EmeCom2020 | InformedSender | false | 17,968 | [
"MIT"
] | 5 | 5b94c47559f8202bca99c26fc1bcb078dd0509a6 | https://github.com/Slowika/GameBias-EmeCom2020/tree/5b94c47559f8202bca99c26fc1bcb078dd0509a6 |
UpsamplingBilinear | import torch
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
class UpsamplingBilinear(nn.Module):
def __init__(self):
super().__init__()
self.quant = QuantStub()
self.dequant = DeQuantStub()
def forward(self, x):
x = s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization im... | T-head-Semi/tvm | UpsamplingBilinear | false | 17,969 | [
"Apache-2.0"
] | 4 | c1b8e06685c92fb7cacbe989e147b0622aee4503 | https://github.com/T-head-Semi/tvm/tree/c1b8e06685c92fb7cacbe989e147b0622aee4503 |
SmallMnistNoDropoutWithPassThrough | import torch
import torch.nn as nn
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class PassThroughOp(torch.nn.Module):
"""
This is a pass-through op, used for purpose of making an op a no-op
"""
def forward(self, inputx):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Rohan-Chaudhury/aimet | SmallMnistNoDropoutWithPassThrough | false | 17,970 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
CovSepBlock | import torch
import torch.nn as M
def DepthwiseConv(in_channels, kernel_size, stride, padding):
return M.Conv2d(in_channels=in_channels, out_channels=in_channels,
kernel_size=kernel_size, stride=stride, padding=padding, groups=
in_channels, bias=False)
def PointwiseConv(in_channels, out_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 M
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | SuperbTUM/RAW-image-denoising | CovSepBlock | false | 17,971 | [
"MIT"
] | 4 | 9f81be8da6a576f641022707d98b8c37f5c599ab | https://github.com/SuperbTUM/RAW-image-denoising/tree/9f81be8da6a576f641022707d98b8c37f5c599ab |
Upsample | import torch
import torch.nn as M
class Upsample(M.Module):
def __init__(self, in_channels, out_channels):
super(Upsample, self).__init__()
self.upsample = M.Upsample(scale_factor=2, mode='bilinear',
align_corners=True)
self.ordinaryConv = M.Conv2d(in_channels=in_channels, out... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 M
assert_s... | SuperbTUM/RAW-image-denoising | Upsample | false | 17,972 | [
"MIT"
] | 4 | 9f81be8da6a576f641022707d98b8c37f5c599ab | https://github.com/SuperbTUM/RAW-image-denoising/tree/9f81be8da6a576f641022707d98b8c37f5c599ab |
DownSample | import torch
import torch.nn as M
def DepthwiseConv(in_channels, kernel_size, stride, padding):
return M.Conv2d(in_channels=in_channels, out_channels=in_channels,
kernel_size=kernel_size, stride=stride, padding=padding, groups=
in_channels, bias=False)
def PointwiseConv(in_channels, out_channels... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as M
assert_s... | SuperbTUM/RAW-image-denoising | DownSample | false | 17,973 | [
"MIT"
] | 4 | 9f81be8da6a576f641022707d98b8c37f5c599ab | https://github.com/SuperbTUM/RAW-image-denoising/tree/9f81be8da6a576f641022707d98b8c37f5c599ab |
Net_1 | import torch
from torch import nn
import torch.nn.functional as F
class Net_1(nn.Module):
def __init__(self):
super(Net_1, self).__init__()
self.conv1 = nn.Conv1d(1, 25, 9, padding=4)
self.conv2 = nn.Conv1d(25, 16, 7, padding=3)
self.conv3 = nn.Conv1d(16, 10, 7, padding=3)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | TakaraResearch/Signal-Detection-with-Wasserstein-Loss | Net_1 | false | 17,974 | [
"BSD-3-Clause"
] | 9 | f210bd0da7492a72bc204a5517e74ba515b5ad12 | https://github.com/TakaraResearch/Signal-Detection-with-Wasserstein-Loss/tree/f210bd0da7492a72bc204a5517e74ba515b5ad12 |
GCN | import torch
import torch.nn.functional as F
import torch.autograd
import torch.nn as nn
class GraphConv(nn.Module):
def __init__(self, in_features, out_features, bias=False):
super(GraphConv, self).__init__()
self.in_features = in_features
self.out_features = out_features
self.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.... | SsGood/MMGL | GCN | false | 17,975 | [
"MIT"
] | 6 | ea769e46fffb42559e764e2912c5b1dc17c10af2 | https://github.com/SsGood/MMGL/tree/ea769e46fffb42559e764e2912c5b1dc17c10af2 |
PositionwiseFeedForward | import torch
import torch.nn as nn
import torch.nn.functional as F
class PositionwiseFeedForward(nn.Module):
def __init__(self, individual_featured):
super(PositionwiseFeedForward, self).__init__()
self.w_1 = nn.Linear(individual_featured, 2 * individual_featured)
self.w_2 = nn.Linear(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
import torch.nn as nn
assert_... | Sunner4nwpu/RA-UWML-AU-Pytorch | PositionwiseFeedForward | false | 17,976 | [
"Apache-2.0"
] | 5 | 7d20b2f1ffa8a00595d1e75e0d1c15518a37a920 | https://github.com/Sunner4nwpu/RA-UWML-AU-Pytorch/tree/7d20b2f1ffa8a00595d1e75e0d1c15518a37a920 |
FeedForwardLayer | import torch
import torch.nn.functional as F
import torch.autograd
import torch.nn as nn
class FeedForwardLayer(nn.Module):
def __init__(self, d_in, d_hid, dropout=0.1):
super().__init__()
self.w_1 = nn.Linear(d_in, d_hid)
self.w_2 = nn.Linear(d_hid, d_in)
self.layer_norm = nn.Lay... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.autogr... | SsGood/MMGL | FeedForwardLayer | false | 17,977 | [
"MIT"
] | 6 | ea769e46fffb42559e764e2912c5b1dc17c10af2 | https://github.com/SsGood/MMGL/tree/ea769e46fffb42559e764e2912c5b1dc17c10af2 |
Upsampling | import torch
import torch.nn as M
class Upsampling(M.Module):
def __init__(self, in_channels, out_channels, kernel_size=2):
super().__init__()
self.upsample = M.ConvTranspose2d(in_channels, out_channels,
kernel_size=kernel_size, stride=2)
def forward(self, x):
return 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
import torch.nn as M
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | SuperbTUM/RAW-image-denoising | Upsampling | false | 17,978 | [
"MIT"
] | 4 | 9f81be8da6a576f641022707d98b8c37f5c599ab | https://github.com/SuperbTUM/RAW-image-denoising/tree/9f81be8da6a576f641022707d98b8c37f5c599ab |
Signal2SH | import torch
import numpy as np
import torch.nn as nn
from scipy import special as sci
def cart2sph(x, y, z):
"""
cart2sph(x, y, z) -> theta, phi, r
Computes the corresponding spherical coordinate of the given input parameters :attr:`x`, :attr:`y` and :attr:`x`.
Args:
x (Number): x position
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
from scipy import special as sci
assert... | SimonKoppers/DELIMIT | Signal2SH | false | 17,979 | [
"MIT"
] | 7 | d778a567bbec1beef2395ead60aa1e30086bb07c | https://github.com/SimonKoppers/DELIMIT/tree/d778a567bbec1beef2395ead60aa1e30086bb07c |
TransformerEncoderLayer | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.utils.data
import torch.distributions
class TransformerEncoderLayer(nn.Module):
def __init__(self, embed_dim, num_heads, hidden_size, dropout=0.0,
attention_dropout=0.0, activation_dropout=0.0):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Slowika/GameBias-EmeCom2020 | TransformerEncoderLayer | false | 17,980 | [
"MIT"
] | 5 | 5b94c47559f8202bca99c26fc1bcb078dd0509a6 | https://github.com/Slowika/GameBias-EmeCom2020/tree/5b94c47559f8202bca99c26fc1bcb078dd0509a6 |
PartialConv | import math
import torch
from itertools import product as product
import torch.nn as nn
def weights_init(init_type='gaussian'):
def init_fun(m):
classname = m.__class__.__name__
if (classname.find('Conv') == 0 or classname.find('Linear') == 0
) and hasattr(m, 'weight'):
if... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
from itertools import product as product
import torch.nn as nn
asser... | TaroNakasendo/MaskEraser | PartialConv | false | 17,981 | [
"MIT"
] | 3 | 373af686194aff716f53785e40252beae7b26cff | https://github.com/TaroNakasendo/MaskEraser/tree/373af686194aff716f53785e40252beae7b26cff |
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... | Tanveer81/BoxVOS | NaiveGroupNorm | false | 17,982 | [
"BSD-2-Clause"
] | 4 | c30aa319f18f3fbee2a25e0ed25cb006a4598300 | https://github.com/Tanveer81/BoxVOS/tree/c30aa319f18f3fbee2a25e0ed25cb006a4598300 |
eSEModule | import torch
from torch import nn
import torch.nn.functional as F
import torch.nn.parallel
class Hsigmoid(nn.Module):
def __init__(self, inplace=True):
super(Hsigmoid, self).__init__()
self.inplace = inplace
def forward(self, x):
return F.relu6(x + 3.0, inplace=self.inplace) / 6.0
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | Tanveer81/BoxVOS | eSEModule | false | 17,983 | [
"BSD-2-Clause"
] | 4 | c30aa319f18f3fbee2a25e0ed25cb006a4598300 | https://github.com/Tanveer81/BoxVOS/tree/c30aa319f18f3fbee2a25e0ed25cb006a4598300 |
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... | Tanveer81/BoxVOS | GCN | false | 17,984 | [
"BSD-2-Clause"
] | 4 | c30aa319f18f3fbee2a25e0ed25cb006a4598300 | https://github.com/Tanveer81/BoxVOS/tree/c30aa319f18f3fbee2a25e0ed25cb006a4598300 |
AnchorBoxTransform | import torch
from torch import Tensor
from typing import Optional
import torch.nn as nn
class AnchorBoxTransform(nn.Module):
def __init__(self, mean: 'Optional[Tensor]'=None, std:
'Optional[Tensor]'=None, log_length: 'bool'=False):
super(AnchorBoxTransform, self).__init__()
self.mean = me... | 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 Tensor
from typing import Optional
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
e... | TidalPaladin/combustion | AnchorBoxTransform | false | 17,985 | [
"Apache-2.0"
] | 3 | 69b9a2b9baf90b81ed9098b4f0391f5c15efaee7 | https://github.com/TidalPaladin/combustion/tree/69b9a2b9baf90b81ed9098b4f0391f5c15efaee7 |
TransposedConvModel | import torch
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class TransposedConvModel(torch.nn.Module):
def __init__(self):
super(TransposedConvModel, self).__init__()
self.conv1 = torch.nn.ConvTranspose2d(10, 10, 3)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
import torch.... | Rohan-Chaudhury/aimet | TransposedConvModel | false | 17,986 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
Downsampling | import torch
import torch.nn as M
def DepthwiseConv(in_channels, kernel_size, stride, padding):
return M.Conv2d(in_channels=in_channels, out_channels=in_channels,
kernel_size=kernel_size, stride=stride, padding=padding, groups=
in_channels, bias=False)
def PointwiseConv(in_channels, out_channels... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as M
assert_s... | SuperbTUM/RAW-image-denoising | Downsampling | false | 17,987 | [
"MIT"
] | 4 | 9f81be8da6a576f641022707d98b8c37f5c599ab | https://github.com/SuperbTUM/RAW-image-denoising/tree/9f81be8da6a576f641022707d98b8c37f5c599ab |
SoftCrossEntropyLoss | import torch
import torch.nn as nn
class SoftCrossEntropyLoss(nn.Module):
"""Cross entropy loss with soft label as target
"""
def __init__(self, num_classes, epsilon=0.1, use_gpu=True, label_smooth
=False, batch_average=True):
super(SoftCrossEntropyLoss, self).__init__()
self.num_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | Terminator8758/Precise-ICS-master | SoftCrossEntropyLoss | false | 17,988 | [
"MIT"
] | 4 | 9f4591fee6ab64d9dd91f551355d29562bf663cb | https://github.com/Terminator8758/Precise-ICS-master/tree/9f4591fee6ab64d9dd91f551355d29562bf663cb |
Normalize | import torch
from torch import nn
class Normalize(nn.Module):
""" Ln normalization copied from
https://github.com/salesforce/CoMatch
"""
def __init__(self, power=2):
super(Normalize, self).__init__()
self.power = power
def forward(self, x):
norm = x.pow(self.power).sum(1,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | TencentYoutuResearch/Classification-SemiCLS | Normalize | false | 17,989 | [
"Apache-2.0"
] | 4 | ceb5546f8d8ba08e18de3b5d9426e6cda177e55e | https://github.com/TencentYoutuResearch/Classification-SemiCLS/tree/ceb5546f8d8ba08e18de3b5d9426e6cda177e55e |
SoftmaxAttention | import torch
import torch.nn as nn
def masked_softmax(tensor, mask):
"""
Apply a masked softmax on the last dimension of a tensor.
The input tensor and mask should be of size (batch, *, sequence_length).
Args:
tensor: The tensor on which the softmax function must be applied along
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Taoooo9/Cail_Text_similarity_esimtribert | SoftmaxAttention | false | 17,990 | [
"Apache-2.0"
] | 5 | 10b0314fdc3fcc60e39737ac563e8538b96ceb19 | https://github.com/Taoooo9/Cail_Text_similarity_esimtribert/tree/10b0314fdc3fcc60e39737ac563e8538b96ceb19 |
Edg_Capture | import torch
import torch.nn as nn
import torch.nn.functional as F
class Edg_Capture(nn.Module):
def __init__(self):
super(Edg_Capture, self).__init__()
kernel = [[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]]
kernel = torch.FloatTensor(kernel).unsqueeze(0).unsqueeze(0)
self.weight = 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... | TaoWangzj/PCFAN | Edg_Capture | false | 17,991 | [
"MIT"
] | 7 | f6ddc8fd2e72a45431891acf0b25135499c84485 | https://github.com/TaoWangzj/PCFAN/tree/f6ddc8fd2e72a45431891acf0b25135499c84485 |
Encoder | import torch
import torch.nn
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
"""Estimation of the nonnegative mixture weight by a 1-D conv layer.
"""
def __init__(self, L, N):
super(Encoder, self).__init__()
self.L, self.N = L, N
self.conv1d_U = 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
import torch.nn
import torch.... | ThomasRigoni7/Audio-emotion-recognition-RAVDESS | Encoder | false | 17,992 | [
"MIT"
] | 5 | ae44256edfcb320a32696444cd301264e1800866 | https://github.com/ThomasRigoni7/Audio-emotion-recognition-RAVDESS/tree/ae44256edfcb320a32696444cd301264e1800866 |
GAT | import torch
import torch.nn.functional as F
import torch.autograd
import torch.nn as nn
class GraphAttConv(nn.Module):
def __init__(self, in_features, out_features, dropout, alpha, concat=True):
super(GraphAttConv, self).__init__()
self.dropout = dropout
self.in_features = in_features
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | SsGood/MMGL | GAT | false | 17,993 | [
"MIT"
] | 6 | ea769e46fffb42559e764e2912c5b1dc17c10af2 | https://github.com/SsGood/MMGL/tree/ea769e46fffb42559e764e2912c5b1dc17c10af2 |
SCANLoss | import torch
from torch import nn
import torch.nn.functional as F
def entropy(x, input_as_probabilities):
"""
Helper function to compute the entropy over the batch
input: batch w/ shape [b, num_classes]
output: entropy value [is ideally -log(num_classes)]
"""
if input_as_probabilities:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | TencentYoutuResearch/ActiveLearning-SDM | SCANLoss | false | 17,994 | [
"Apache-2.0"
] | 4 | 0ee700e59451131536b7509ff3d4b266835ac01b | https://github.com/TencentYoutuResearch/ActiveLearning-SDM/tree/0ee700e59451131536b7509ff3d4b266835ac01b |
Concat | import torch
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class Concat(torch.nn.Module):
""" Concat module for a functional concat"""
def __init__(self, axis: 'int'=0):
super(Concat, self).__init__()
self.axis = axis
... | 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
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
assert_size_stride =... | Rohan-Chaudhury/aimet | Concat | false | 17,995 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
BasicBlock | import torch
import torch.nn.functional as F
from torch import nn
class BasicBlock(nn.Module):
def __init__(self, input_dim, width, block_depth):
super(BasicBlock, self).__init__()
self.block_depth = block_depth
self.conv1 = nn.Conv2d(input_dim, width, kernel_size=3, padding=1)
if... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | TomHeaven/Pixel-wise-Estimation-of-Signal-Dependent-Image-Noise-using-Deep-Residual-Learning | BasicBlock | false | 17,996 | [
"MIT"
] | 10 | 7f2a57312f7cec76e5d7016825f75ee9bbd170f5 | https://github.com/TomHeaven/Pixel-wise-Estimation-of-Signal-Dependent-Image-Noise-using-Deep-Residual-Learning/tree/7f2a57312f7cec76e5d7016825f75ee9bbd170f5 |
KLDivLoss | import torch
class KLDivLoss(torch.nn.KLDivLoss):
def __init__(self, reduction='none'):
super().__init__(reduction=reduction)
def forward(self, preds, targets):
"""
Applies ``log_softmax`` to ``pred`` and ``softmax`` to ``targets``
prior to computing KL-Divergence loss. These... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
assert_size... | Thesys-lab/learned-coded-computation | KLDivLoss | false | 17,997 | [
"Apache-2.0"
] | 8 | c5c32bcfb7cc4a9f52079f648373e6972c19eff9 | https://github.com/Thesys-lab/learned-coded-computation/tree/c5c32bcfb7cc4a9f52079f648373e6972c19eff9 |
CharbonnierLoss | import torch
import torch.utils.data
import torch.nn as nn
class CharbonnierLoss(nn.Module):
"""Charbonnier Loss (L1)"""
def __init__(self, eps=1e-06):
super(CharbonnierLoss, self).__init__()
self.eps = eps
def forward(self, x, y):
diff = x - y
loss = torch.sum(torch.sqrt... | 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.utils.data
impo... | TevenLeScao/BasicSR | CharbonnierLoss | false | 17,998 | [
"Apache-2.0"
] | 4 | 1a7bd8754de00f3a9c9f2031acfc447350459ea0 | https://github.com/TevenLeScao/BasicSR/tree/1a7bd8754de00f3a9c9f2031acfc447350459ea0 |
ResNetV2 | import torch
import torch.nn.functional as F
from collections import OrderedDict
import torch.nn as nn
def conv1x1(cin, cout, stride=1, bias=False):
return StdConv2d(cin, cout, kernel_size=1, stride=stride, padding=0,
bias=bias)
def conv3x3(cin, cout, stride=1, groups=1, bias=False):
return StdConv2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | MetaMain/ViTRobust | ResNetV2 | false | 17,999 | [
"BSD-3-Clause"
] | 6 | 5bca523f430933469d9f82022e334839388cee7a | https://github.com/MetaMain/ViTRobust/tree/5bca523f430933469d9f82022e334839388cee7a |
ConcatConv2d | import torch
import torch.utils.data
import torch.nn as nn
class ConcatConv2d(nn.Module):
def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0,
dilation=1, groups=1, bias=True, transpose=False):
super(ConcatConv2d, self).__init__()
module = nn.ConvTranspose2d if transpose else... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dyn... | TevenLeScao/BasicSR | ConcatConv2d | false | 18,000 | [
"Apache-2.0"
] | 4 | 1a7bd8754de00f3a9c9f2031acfc447350459ea0 | https://github.com/TevenLeScao/BasicSR/tree/1a7bd8754de00f3a9c9f2031acfc447350459ea0 |
INN_loss | import torch
from torch import nn
class INN_loss(nn.Module):
def __init__(self, num_dim):
super(INN_loss, self).__init__()
self.num_dim = num_dim
def forward(self, Z, log_jac_det):
losses = 0.5 * torch.sum(Z ** 2, 1) - log_jac_det
loss = losses.mean() / self.num_dim
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 import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | ThorstenBuss/jet-inn | INN_loss | false | 18,001 | [
"Apache-2.0"
] | 4 | 3777aac712fc99aa2c48031db0c09eaebee70f37 | https://github.com/ThorstenBuss/jet-inn/tree/3777aac712fc99aa2c48031db0c09eaebee70f37 |
Upsample | import torch
from torch import nn
class Upsample(nn.Module):
def __init__(self, scale_factor, mode='bilinear'):
super().__init__()
self.scale_factor = scale_factor
self.mode = mode
def forward(self, input):
return nn.functional.interpolate(input, scale_factor=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
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | Tomaz-Vieira/tiktorch | Upsample | false | 18,002 | [
"MIT"
] | 8 | 2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 | https://github.com/Tomaz-Vieira/tiktorch/tree/2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 |
SelfAttention | import torch
import torch.nn.functional as F
import torch.nn as nn
class SelfAttention(nn.Module):
def __init__(self, input_size, heads, embed_size):
super().__init__()
self.input_size = input_size
self.heads = heads
self.emb_size = embed_size
self.tokeys = nn.Linear(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.... | Sud0x67/mrmix | SelfAttention | false | 18,003 | [
"Apache-2.0"
] | 4 | 4f4784e421c768509bd007e21b4455b56edc7cd2 | https://github.com/Sud0x67/mrmix/tree/4f4784e421c768509bd007e21b4455b56edc7cd2 |
Conv2dTime | import torch
import torch.utils.data
import torch.nn as nn
class Conv2dTime(nn.Conv2d):
"""
Implements time dependent 2d convolutions, by appending the time variable as
an extra channel.
"""
def __init__(self, in_channels, *args, **kwargs):
super(Conv2dTime, self).__init__(in_channels + 1... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dyn... | TevenLeScao/BasicSR | Conv2dTime | false | 18,004 | [
"Apache-2.0"
] | 4 | 1a7bd8754de00f3a9c9f2031acfc447350459ea0 | https://github.com/TevenLeScao/BasicSR/tree/1a7bd8754de00f3a9c9f2031acfc447350459ea0 |
ResBlock | import torch
import torch.utils.data
import torch.nn as nn
def norm(dim):
return nn.GroupNorm(min(32, dim), dim)
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class R... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | TevenLeScao/BasicSR | ResBlock | false | 18,005 | [
"Apache-2.0"
] | 4 | 1a7bd8754de00f3a9c9f2031acfc447350459ea0 | https://github.com/TevenLeScao/BasicSR/tree/1a7bd8754de00f3a9c9f2031acfc447350459ea0 |
LayerNorm | import torch
import torch.nn as nn
class LayerNorm(nn.LayerNorm):
def __init__(self, normalized_shape, eps=1e-05, elementwise_affine=True):
"""Layer Norm."""
super(LayerNorm, self).__init__(normalized_shape, eps=eps,
elementwise_affine=elementwise_affine)
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.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | TraceOnBrainOff/pytorch-dc-tts | LayerNorm | false | 18,006 | [
"MIT"
] | 4 | 993a0fbace561729b04df2179b41a0a7ea502e93 | https://github.com/TraceOnBrainOff/pytorch-dc-tts/tree/993a0fbace561729b04df2179b41a0a7ea502e93 |
CrossEntropy | import torch
import torch.nn as nn
from torch.nn import functional as F
import torch.optim
class CrossEntropy(nn.Module):
def __init__(self, ignore_label=-1, weight=None, reduction='mean'):
super(CrossEntropy, self).__init__()
self.ignore_label = ignore_label
self.criterion = nn.CrossEntr... | 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
... | TotalVariation/Flattenet | CrossEntropy | false | 18,007 | [
"MIT"
] | 3 | 828d1f95f6f77dd0b681318f2a544e84cf4be834 | https://github.com/TotalVariation/Flattenet/tree/828d1f95f6f77dd0b681318f2a544e84cf4be834 |
DistillLoss | import torch
import torch.nn as nn
class DistillLoss(nn.Module):
def __init__(self):
super(DistillLoss, self).__init__()
def forward(self, t_feat, feat, cams):
assert len(cams) == feat.shape[0] and feat.shape[0] == t_feat.shape[0]
t_feat = t_feat / t_feat.norm(p=2, dim=1, keepdim=Tru... | 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... | Terminator8758/Precise-ICS-master | DistillLoss | false | 18,009 | [
"MIT"
] | 4 | 9f4591fee6ab64d9dd91f551355d29562bf663cb | https://github.com/Terminator8758/Precise-ICS-master/tree/9f4591fee6ab64d9dd91f551355d29562bf663cb |
Coral | import torch
import torch.nn as nn
import torch.nn.init
class Coral(nn.Module):
def __init__(self):
super(Coral, self).__init__()
def forward(self, a, b):
"""
Arguments:
a: a float tensor with shape [n, d].
b: a float tensor with shape [m, d].
Returns:... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.init
assert_size_stride = torch._C._dynamo... | TropComplique/associative-domain-adaptation | Coral | false | 18,010 | [
"MIT"
] | 8 | a2ec0a9e678af20624f79e40c8042c969a69e8f3 | https://github.com/TropComplique/associative-domain-adaptation/tree/a2ec0a9e678af20624f79e40c8042c969a69e8f3 |
TotalVariationLoss | import torch
import torch.nn as nn
class TotalVariationLoss(nn.Module):
def __init__(self):
super(TotalVariationLoss, self).__init__()
def forward(self, x):
"""
Arguments:
x: a float tensor with shape [b, 3, h, w].
It represents a RGB image with pixel values 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | TropComplique/CNNMRF | TotalVariationLoss | false | 18,011 | [
"MIT"
] | 3 | 602f861b14ed240acac89e6502e69f797d4f4a49 | https://github.com/TropComplique/CNNMRF/tree/602f861b14ed240acac89e6502e69f797d4f4a49 |
LayerNorm | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-05, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.... | ToniChopp/MIRACLE-Paper-Sharing-Album | LayerNorm | false | 18,012 | [
"MIT"
] | 7 | 72a3843101483fc8b53df2746c488da066eda2a1 | https://github.com/ToniChopp/MIRACLE-Paper-Sharing-Album/tree/72a3843101483fc8b53df2746c488da066eda2a1 |
DistillKL | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class DistillKL(nn.Module):
"""Distilling the Knowledge in a Neural Network"""
def __init__(self, T):
super(DistillKL, self).__ini... | 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... | ToniChopp/MIRACLE-Paper-Sharing-Album | DistillKL | false | 18,013 | [
"MIT"
] | 7 | 72a3843101483fc8b53df2746c488da066eda2a1 | https://github.com/ToniChopp/MIRACLE-Paper-Sharing-Album/tree/72a3843101483fc8b53df2746c488da066eda2a1 |
TwoLinearsModel | import torch
import torch.nn as nn
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class TwoLinearsModel(nn.Module):
def __init__(self, per_sample_shape: 'list', hidden_size: 'int',
output_size: 'int'):
super(TwoLinearsModel,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Rohan-Chaudhury/aimet | TwoLinearsModel | false | 18,014 | [
"BSD-3-Clause"
] | 3 | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | https://github.com/Rohan-Chaudhury/aimet/tree/1c38cac8cc0fd32dca40ce5e39940805d29f7a4a |
PrefModel | import torch
import torch.nn as nn
class PrefModel(nn.Module):
def __init__(self, input_dim):
super(PrefModel, self).__init__()
self.combination = nn.Linear(input_dim, 2)
self.softmax = nn.Softmax(1)
def forward(self, features):
h = self.combination(features)
out = 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.... | UKPLab/ijcai2019-relis | PrefModel | false | 18,015 | [
"MIT"
] | 5 | 8a40762dcfa90c075a4f6591cbdceb468026ef17 | https://github.com/UKPLab/ijcai2019-relis/tree/8a40762dcfa90c075a4f6591cbdceb468026ef17 |
TinyConvNet2d | import torch
class TinyConvNet2d(torch.nn.Module):
def __init__(self, in_channels=1, out_channels=1):
super().__init__()
self.conv1 = torch.nn.Conv2d(in_channels, 16, 1)
self.nlin1 = torch.nn.ReLU()
self.conv2 = torch.nn.Conv2d(16, 64, 1)
self.nlin2 = torch.nn.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
assert_size_stride = torch._C... | Tomaz-Vieira/tiktorch | TinyConvNet2d | false | 18,016 | [
"MIT"
] | 8 | 2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 | https://github.com/Tomaz-Vieira/tiktorch/tree/2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 |
TVLoss | import torch
import torch.nn as nn
import torch.nn.init
class TVLoss(nn.Module):
def __init__(self):
super(TVLoss, self).__init__()
def forward(self, x):
"""
Arguments:
x: a float tensor with shape [b, 3, h, w].
It represents a RGB image with pixel values in [... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.init
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dy... | TropComplique/WESPE | TVLoss | false | 18,017 | [
"MIT"
] | 5 | 84738f1ed802a3f6a4a0549677d8137997fac617 | https://github.com/TropComplique/WESPE/tree/84738f1ed802a3f6a4a0549677d8137997fac617 |
Grayscale | import torch
import torch.nn as nn
import torch.nn.init
class Grayscale(nn.Module):
def __init__(self):
super(Grayscale, self).__init__()
def forward(self, x):
"""
Arguments:
x: a float tensor with shape [b, 3, h, w].
It represents a RGB image with pixel value... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.init
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dy... | TropComplique/WESPE | Grayscale | false | 18,018 | [
"MIT"
] | 5 | 84738f1ed802a3f6a4a0549677d8137997fac617 | https://github.com/TropComplique/WESPE/tree/84738f1ed802a3f6a4a0549677d8137997fac617 |
TinyConvNet3d | import torch
class TinyConvNet3d(torch.nn.Module):
def __init__(self, in_channels=1, out_channels=1):
super().__init__()
self.conv1 = torch.nn.Conv3d(in_channels, 16, 1)
self.nlin1 = torch.nn.ReLU()
self.conv2 = torch.nn.Conv3d(16, 64, 1)
self.nlin2 = torch.nn.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
assert_size_stride = torch._C... | Tomaz-Vieira/tiktorch | TinyConvNet3d | false | 18,019 | [
"MIT"
] | 8 | 2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 | https://github.com/Tomaz-Vieira/tiktorch/tree/2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 |
Dummy | import torch
from torch import nn
class Dummy(nn.Module):
def forward(self, input):
x = input
return x + 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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | Tomaz-Vieira/tiktorch | Dummy | false | 18,020 | [
"MIT"
] | 8 | 2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 | https://github.com/Tomaz-Vieira/tiktorch/tree/2d6803c4ba5e26e4b27bf8af6638040fa4fc5628 |
AttPool | import torch
from torch import nn
from torch.nn import functional as F
class AttPool(nn.Module):
"""
Pool representations along a dimension with learned softmax scores.
Args:
input_size (int): Input size.
dim (int): Dimension on which to apply the attention pooling.
"""
def __ini... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 im... | TorchSpatiotemporal/tsl | AttPool | false | 18,021 | [
"MIT"
] | 4 | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | https://github.com/TorchSpatiotemporal/tsl/tree/da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 |
Sobel | import torch
import torch.nn as nn
import torch.nn.init
import torch.nn.functional as F
class Sobel(nn.Module):
def __init__(self):
super(Sobel, self).__init__()
kernel = [[[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]], [[-1, -2, -1], [0,
0, 0], [1, 2, 1]]]
kernel = torch.Tensor(kernel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.init
assert_size_stride = torch._C._dynamo... | TropComplique/WESPE | Sobel | false | 18,023 | [
"MIT"
] | 5 | 84738f1ed802a3f6a4a0549677d8137997fac617 | https://github.com/TropComplique/WESPE/tree/84738f1ed802a3f6a4a0549677d8137997fac617 |
MaxPool3x3 | import torch
import torch.nn as nn
class MaxPool3x3(nn.Module):
"""3x3 max pool with no subsampling."""
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1):
super(MaxPool3x3, self).__init__()
self.maxpool = nn.MaxPool2d(kernel_size, stride, padding)
... | 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... | VascoLopes/GEA | MaxPool3x3 | false | 18,024 | [
"MIT"
] | 4 | ab80dbb9851dfc215102e5222e8d5f70e855dd15 | https://github.com/VascoLopes/GEA/tree/ab80dbb9851dfc215102e5222e8d5f70e855dd15 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.