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
EqualLinear
import math import torch import torch.nn.functional as F from torch import nn class EqualLinear(nn.Module): def __init__(self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1.0, activation=None): """ :param in_dim: :param out_dim: :param bias: :param bias_init: :param lr_mu...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 torch import nn assert_size_stride = torch._C._dynamo.guards.as...
PeterouZh/CIPS-3D
EqualLinear
false
14,175
[ "MIT" ]
308
9b8bfa0fb23f642af042e150ccd70408f9d137c6
https://github.com/PeterouZh/CIPS-3D/tree/9b8bfa0fb23f642af042e150ccd70408f9d137c6
EmbeddingLayer
import torch import torch.nn as nn class EmbeddingLayer(nn.Module): def __init__(self, in_channel, out_channel, img_size, patch_size): super(EmbeddingLayer, self).__init__() self.embedding1 = nn.Conv2d(in_channel, out_channel, kernel_size= patch_size, stride=patch_size, padding=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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Phoenix1153/ViT_OOD_generalization
EmbeddingLayer
false
14,176
[ "MIT" ]
51
7c5b542e5f5279032c9cd20667cc9e09a86b653d
https://github.com/Phoenix1153/ViT_OOD_generalization/tree/7c5b542e5f5279032c9cd20667cc9e09a86b653d
GroupScaling1D
import torch from torch import nn class GroupScaling1D(nn.Module): """Scales inputs by the second moment for the entire layer.""" def __init__(self, eps=1e-05, group_num=4): super(GroupScaling1D, self).__init__() self.eps = eps self.group_num = group_num def extra_repr(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.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Piki1989/spacetimeformer
GroupScaling1D
false
14,177
[ "MIT" ]
209
7e0caf17dd03e5d25e2766c4f7132805779bcc40
https://github.com/Piki1989/spacetimeformer/tree/7e0caf17dd03e5d25e2766c4f7132805779bcc40
FiLMLayerEqualFC
import math import torch import torch.nn.functional as F from torch import nn class EqualLinear(nn.Module): def __init__(self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1.0, activation=None): """ :param in_dim: :param out_dim: :param bias: :param bias_init: :param lr_mu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import math i...
PeterouZh/CIPS-3D
FiLMLayerEqualFC
false
14,178
[ "MIT" ]
308
9b8bfa0fb23f642af042e150ccd70408f9d137c6
https://github.com/PeterouZh/CIPS-3D/tree/9b8bfa0fb23f642af042e150ccd70408f9d137c6
FiLMLayer_PreSin
import torch import numpy as np from torch import nn class FiLMLayer_PreSin(nn.Module): def __init__(self, in_dim, out_dim, style_dim, use_style_fc=True, which_linear=nn.Linear, **kwargs): super(FiLMLayer_PreSin, self).__init__() self.in_dim = in_dim self.out_dim = out_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 math as tl_math import numpy ...
PeterouZh/CIPS-3D
FiLMLayer_PreSin
false
14,179
[ "MIT" ]
308
9b8bfa0fb23f642af042e150ccd70408f9d137c6
https://github.com/PeterouZh/CIPS-3D/tree/9b8bfa0fb23f642af042e150ccd70408f9d137c6
EQ
import torch class EQ(torch.nn.Module): def __init__(self): super(EQ, self).__init__() def forward(self, x, y): return x == y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
EQ
false
14,180
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
ConditionalBatchNorm2d
import torch import torch.nn as nn from torch.nn import Parameter def l2normalize(v, eps=0.0001): return v / (v.norm() + eps) class SpectralNorm(nn.Module): def __init__(self, module, name='weight', power_iterations=1): super(SpectralNorm, self).__init__() self.module = module 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 ...
PeterouZh/Omni-GAN-PyTorch
ConditionalBatchNorm2d
false
14,181
[ "MIT" ]
56
564a586fed6ce51ef73933d8815d94ce077c4e5c
https://github.com/PeterouZh/Omni-GAN-PyTorch/tree/564a586fed6ce51ef73933d8815d94ce077c4e5c
FloorDiv
import torch class FloorDiv(torch.nn.Module): def __init__(self): super(FloorDiv, self).__init__() def forward(self, x, y): return x // y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
FloorDiv
false
14,182
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
FunctionalRelu
import torch class FunctionalRelu(torch.nn.Module): def forward(self, x): return torch.nn.functional.relu(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
FunctionalRelu
false
14,183
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
ATLoss
import torch import torch.nn as nn from torch.nn import functional as F class ATLoss(nn.Module): """ Module for calculating AT Loss :param norm_type (int): Norm to be used in calculating loss """ def __init__(self, norm_type=2): super(ATLoss, self).__init__() self.p = norm_type ...
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...
PiaCuk/KD_Lib
ATLoss
false
14,184
[ "MIT" ]
360
153299d484e4c6b33793749709dbb0f33419f190
https://github.com/PiaCuk/KD_Lib/tree/153299d484e4c6b33793749709dbb0f33419f190
IAdd
import torch class IAdd(torch.nn.Module): def __init__(self): super(IAdd, self).__init__() def forward(self, x, y): x += y return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit def triton_poi_fused_add_0(in_ptr0, in_ptr1, out_ptr1, xnumel,...
PogChamper/torch2trt
IAdd
false
14,185
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
FloorDivAssign
import torch class FloorDivAssign(torch.nn.Module): def __init__(self): super(FloorDivAssign, self).__init__() def forward(self, x, y): x //= y return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit d...
PogChamper/torch2trt
FloorDivAssign
false
14,186
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
Mod
import torch class Mod(torch.nn.Module): def __init__(self): super(Mod, self).__init__() def forward(self, x, y): return x % y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
Mod
false
14,187
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
Div
import torch class Div(torch.nn.Module): def __init__(self): super(Div, self).__init__() def forward(self, x, y): return x / y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
Div
false
14,188
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
GT
import torch class GT(torch.nn.Module): def __init__(self): super(GT, self).__init__() def forward(self, x, y): return x > y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
GT
false
14,189
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
ScaleNorm
import torch from torch import nn class ScaleNorm(nn.Module): def __init__(self, dim, eps=1e-05): super().__init__() self.scale = dim ** -0.5 self.g = nn.Parameter(torch.ones(1)) self.eps = eps def forward(self, x): n = torch.norm(x, dim=-1, keepdim=True).clamp(min=se...
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 from torch import nn assert_...
Piki1989/spacetimeformer
ScaleNorm
false
14,190
[ "MIT" ]
209
7e0caf17dd03e5d25e2766c4f7132805779bcc40
https://github.com/Piki1989/spacetimeformer/tree/7e0caf17dd03e5d25e2766c4f7132805779bcc40
ISub
import torch class ISub(torch.nn.Module): def __init__(self): super(ISub, self).__init__() def forward(self, x, y): x -= y return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit def triton_poi_fused_sub_0(in_ptr0, in_ptr1, out_ptr1, xnumel,...
PogChamper/torch2trt
ISub
false
14,191
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
ModAssign
import torch class ModAssign(torch.nn.Module): def __init__(self): super(ModAssign, self).__init__() def forward(self, x, y): x %= y return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit d...
PogChamper/torch2trt
ModAssign
false
14,192
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
MaxPool1D
import torch class MaxPool1D(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0, ceil_mode=False): super().__init__() self.kernel_size = kernel_size self.stride = stride self.padding = padding self.ceil_mode = ceil_mode def forward(self, x): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
MaxPool1D
false
14,193
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
MinElementwise
import torch class MinElementwise(torch.nn.Module): def forward(self, x, y): return torch.min(x, y) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
MinElementwise
false
14,194
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
IMul
import torch class IMul(torch.nn.Module): def __init__(self): super(IMul, self).__init__() def forward(self, x, y): x *= y return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit def triton_poi_fused_mul_0(in_ptr0, in_ptr1, out_ptr1, xnumel,...
PogChamper/torch2trt
IMul
false
14,195
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
IDiv
import torch class IDiv(torch.nn.Module): def __init__(self): super(IDiv, self).__init__() def forward(self, x, y): x /= y return x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit def triton_poi_fused_div_0(in_ptr0, in_ptr1, out_ptr1, xnumel,...
PogChamper/torch2trt
IDiv
false
14,196
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
Mul
import torch class Mul(torch.nn.Module): def __init__(self): super(Mul, self).__init__() def forward(self, x, y): return x * y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
Mul
false
14,197
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
ModConst
import torch class ModConst(torch.nn.Module): def __init__(self): super(ModConst, self).__init__() def forward(self, x): return x % 2.0 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
ModConst
false
14,198
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
MaxElementwise
import torch class MaxElementwise(torch.nn.Module): def forward(self, x, y): return torch.max(x, y) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
MaxElementwise
false
14,199
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
LT
import torch class LT(torch.nn.Module): def __init__(self): super(LT, self).__init__() def forward(self, x, y): return x < y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
LT
false
14,200
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
FloorDivConst
import torch class FloorDivConst(torch.nn.Module): def __init__(self): super(FloorDivConst, self).__init__() def forward(self, x): return x // 2.0 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
FloorDivConst
false
14,202
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
FunctionalRelu6
import torch class FunctionalRelu6(torch.nn.Module): def forward(self, x): return torch.nn.functional.relu6(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
FunctionalRelu6
false
14,203
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
SequentialPolarizedSelfAttention
import torch from torch import nn class SequentialPolarizedSelfAttention(nn.Module): def __init__(self, channel=512): super().__init__() self.ch_wv = nn.Conv2d(channel, channel // 2, kernel_size=(1, 1)) self.ch_wq = nn.Conv2d(channel, 1, kernel_size=(1, 1)) self.softmax_channel = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Nitin-Mane/External-Attention-pytorch
SequentialPolarizedSelfAttention
false
14,204
[ "MIT" ]
4,466
1ceda306c41063af11c956334747763444a4d83f
https://github.com/Nitin-Mane/External-Attention-pytorch/tree/1ceda306c41063af11c956334747763444a4d83f
RMulInt
import torch class RMulInt(torch.nn.Module): def __init__(self): super(RMulInt, self).__init__() def forward(self, x): return 10 * x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
RMulInt
false
14,205
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
LinearModel
import torch from torch import nn class LinearModel(nn.Module): def __init__(self, context_points: 'int'): super().__init__() self.window = context_points self.linear = nn.Linear(context_points, 1) def forward(self, y_c): _bs, _length, d_y = y_c.shape inp = y_c[:, -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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
Piki1989/spacetimeformer
LinearModel
false
14,206
[ "MIT" ]
209
7e0caf17dd03e5d25e2766c4f7132805779bcc40
https://github.com/Piki1989/spacetimeformer/tree/7e0caf17dd03e5d25e2766c4f7132805779bcc40
NotEqualConst
import torch class NotEqualConst(torch.nn.Module): def __init__(self): super(NotEqualConst, self).__init__() def forward(self, x): return x != 13.62 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
NotEqualConst
false
14,207
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
RAddInt
import torch class RAddInt(torch.nn.Module): def __init__(self): super(RAddInt, self).__init__() def forward(self, x): return 1 + x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
RAddInt
false
14,208
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
SoftKLDivLoss
import torch from torch import Tensor from torch.nn import functional as F class SoftKLDivLoss(torch.nn.Module): def __init__(self, temp=20.0, reduction='batchmean', log_target=False ) ->None: super(SoftKLDivLoss, self).__init__() self.temp = temp self.reduction = reduction ...
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...
PiaCuk/KD_Lib
SoftKLDivLoss
false
14,209
[ "MIT" ]
360
153299d484e4c6b33793749709dbb0f33419f190
https://github.com/PiaCuk/KD_Lib/tree/153299d484e4c6b33793749709dbb0f33419f190
TensorClampMin
import torch class TensorClampMin(torch.nn.Module): def forward(self, x): return x.clamp_min(-0.1) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
TensorClampMin
false
14,210
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
RSubFloat
import torch class RSubFloat(torch.nn.Module): def __init__(self): super(RSubFloat, self).__init__() def forward(self, x): return 1.0 - x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
RSubFloat
false
14,211
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
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....
OlegJakushkin/FragmentVC
Extractor
false
14,212
[ "MIT" ]
136
8aa673157b855bf3b67f06fdb6eb4b2a12ed0005
https://github.com/OlegJakushkin/FragmentVC/tree/8aa673157b855bf3b67f06fdb6eb4b2a12ed0005
RMulFloat
import torch class RMulFloat(torch.nn.Module): def __init__(self): super(RMulFloat, self).__init__() def forward(self, x): return 10.0 * x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
RMulFloat
false
14,213
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TensorClampMax
import torch class TensorClampMax(torch.nn.Module): def forward(self, x): return x.clamp_max(0.1) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
TensorClampMax
false
14,214
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TorchDiv
import torch class TorchDiv(torch.nn.Module): def __init__(self): super(TorchDiv, self).__init__() def forward(self, x, y): return torch.div(x, y) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
TorchDiv
false
14,215
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
RDivInt
import torch class RDivInt(torch.nn.Module): def __init__(self): super(RDivInt, self).__init__() def forward(self, x): return 100 / x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
RDivInt
false
14,216
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
NotEqual
import torch class NotEqual(torch.nn.Module): def __init__(self): super(NotEqual, self).__init__() def forward(self, x, y): return x != y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
NotEqual
false
14,217
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TensorClampOptionMin
import torch class TensorClampOptionMin(torch.nn.Module): def forward(self, x): return x.clamp(min=-0.1) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
TensorClampOptionMin
false
14,218
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
RSubInt
import torch class RSubInt(torch.nn.Module): def __init__(self): super(RSubInt, self).__init__() def forward(self, x): return 1 - x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
RSubInt
false
14,219
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TorchAdd
import torch class TorchAdd(torch.nn.Module): def __init__(self): super(TorchAdd, self).__init__() def forward(self, x, y): return torch.add(x, y) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
TorchAdd
false
14,220
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
Sub
import torch class Sub(torch.nn.Module): def __init__(self): super(Sub, self).__init__() def forward(self, x, y): return x - y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
Sub
false
14,221
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TensorClampOptionMax
import torch class TensorClampOptionMax(torch.nn.Module): def forward(self, x): return x.clamp(max=0.1) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
PogChamper/torch2trt
TensorClampOptionMax
false
14,222
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TorchMod
import torch class TorchMod(torch.nn.Module): def __init__(self): super(TorchMod, self).__init__() def forward(self, x, y): return torch.fmod(x, y) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
TorchMod
false
14,223
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
RpowFloat
import torch class RpowFloat(torch.nn.Module): def __init__(self): super(RpowFloat, self).__init__() def forward(self, x): return 2.0 ** x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
RpowFloat
false
14,224
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TorchSub
import torch class TorchSub(torch.nn.Module): def __init__(self): super(TorchSub, self).__init__() def forward(self, x, y): return torch.sub(x, y) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
TorchSub
false
14,225
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TorchNotEqual
import torch class TorchNotEqual(torch.nn.Module): def __init__(self): super(TorchNotEqual, self).__init__() def forward(self, x, y): return torch.ne(x, y) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
TorchNotEqual
false
14,226
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
TorchFloorDiv
import torch class TorchFloorDiv(torch.nn.Module): def __init__(self): super(TorchFloorDiv, self).__init__() def forward(self, x, y): return torch.floor_divide(x, y) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
TorchFloorDiv
false
14,227
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
RpowInt
import torch class RpowInt(torch.nn.Module): def __init__(self): super(RpowInt, self).__init__() def forward(self, x): return 2 ** x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
RpowInt
false
14,228
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
SinLU
import torch class SinLU(torch.nn.Module): def __init__(self): super(SinLU, self).__init__() self.thr = torch.nn.Threshold(0, 0) def forward(self, x): return self.thr(x) - self.thr(-x).sin() 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 math as tl_math assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_str...
Praneethsv/prob_mbrl
SinLU
false
14,229
[ "MIT" ]
108
7b1adee6bff742b6f90e9b96ea243f12c9153b9b
https://github.com/Praneethsv/prob_mbrl/tree/7b1adee6bff742b6f90e9b96ea243f12c9153b9b
Exp
import torch class Exp(torch.nn.Module): def forward(self, x): return (-0.5 * x ** 2).exp() 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 math as tl_math assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_str...
Praneethsv/prob_mbrl
Exp
false
14,230
[ "MIT" ]
108
7b1adee6bff742b6f90e9b96ea243f12c9153b9b
https://github.com/Praneethsv/prob_mbrl/tree/7b1adee6bff742b6f90e9b96ea243f12c9153b9b
up
import torch import torch.utils.data import torch.nn as nn import torch class up(nn.Module): def __init__(self, in_ch, bilinear=False): super(up, self).__init__() if bilinear: self.up = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True) 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 import torch assert_size_stride = ...
PorscheTan/Siam-NestedUNet
up
false
14,231
[ "MIT" ]
122
a60d3d41f0114387c57dcc7cd2de3b6b0f259ad0
https://github.com/PorscheTan/Siam-NestedUNet/tree/a60d3d41f0114387c57dcc7cd2de3b6b0f259ad0
RDivFloat
import torch class RDivFloat(torch.nn.Module): def __init__(self): super(RDivFloat, self).__init__() def forward(self, x): return 100.0 / x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
RDivFloat
false
14,232
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
CustomKLDivLoss
import torch from torch import Tensor from torch.nn import functional as F class CustomKLDivLoss(torch.nn.Module): def __init__(self, reduction='batchmean', log_target=False, apply_softmax=True) ->None: super(CustomKLDivLoss, self).__init__() self.reduction = reduction self.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 libdevice, math as tl_math assert_size...
PiaCuk/KD_Lib
CustomKLDivLoss
false
14,233
[ "MIT" ]
360
153299d484e4c6b33793749709dbb0f33419f190
https://github.com/PiaCuk/KD_Lib/tree/153299d484e4c6b33793749709dbb0f33419f190
AnyHead
import torch import torch.nn as nn import torch.utils.data class AnyHead(nn.Module): """AnyNet head: AvgPool, 1x1.""" def __init__(self, w_in, nc): super(AnyHead, self).__init__() self.avg_pool = nn.AdaptiveAvgPool2d((1, 1)) self.fc = nn.Linear(w_in, nc, bias=True) def forward(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 import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dyn...
Pre-release/BAKE
AnyHead
false
14,234
[ "MIT" ]
67
2899b38d556a9151f55079c1b9888d462369aec8
https://github.com/Pre-release/BAKE/tree/2899b38d556a9151f55079c1b9888d462369aec8
Pow
import torch class Pow(torch.nn.Module): def __init__(self): super(Pow, self).__init__() def forward(self, x, y): return x ** y def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
PogChamper/torch2trt
Pow
false
14,235
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
KLDivTeacherList
import torch import torch.nn as nn from torch.optim import * from torch.optim.lr_scheduler import * class KLDivTeacherList(nn.Module): def __init__(self): super(KLDivTeacherList, self).__init__() self.kl = torch.nn.KLDivLoss(reduction='batchmean') def forward(self, scores, labels): "...
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...
PranjaliJain/matchmaker
KLDivTeacherList
false
14,236
[ "Apache-2.0" ]
97
b7e22eb8b70cccabf0729076df7cbab3f4ba4a1f
https://github.com/PranjaliJain/matchmaker/tree/b7e22eb8b70cccabf0729076df7cbab3f4ba4a1f
KLDivTeacherPointwise
import torch import torch.nn as nn from torch.optim import * from torch.optim.lr_scheduler import * class KLDivTeacherPointwise(nn.Module): def __init__(self): super(KLDivTeacherPointwise, self).__init__() self.kl = torch.nn.KLDivLoss() def forward(self, scores_pos, scores_neg, label_pos, la...
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...
PranjaliJain/matchmaker
KLDivTeacherPointwise
false
14,237
[ "Apache-2.0" ]
97
b7e22eb8b70cccabf0729076df7cbab3f4ba4a1f
https://github.com/PranjaliJain/matchmaker/tree/b7e22eb8b70cccabf0729076df7cbab3f4ba4a1f
NTimesTanh
import torch import torch.nn as nn class NTimesTanh(nn.Module): def __init__(self, N): super(NTimesTanh, self).__init__() self.N = N self.tanh = nn.Tanh() def forward(self, x): return self.tanh(x) * self.N def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_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 from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
Prinsphield/ELEGANT
NTimesTanh
false
14,238
[ "MIT" ]
276
26827e679cbef2074693ffb0d3f36426e481f7f5
https://github.com/Prinsphield/ELEGANT/tree/26827e679cbef2074693ffb0d3f36426e481f7f5
DiffLoss
import torch import torch.utils.data import torch.optim import torch.utils.data.distributed class DiffLoss(torch.nn.Module): def __init__(self): super(DiffLoss, self).__init__() def forward(self, D1, D2): D1 = D1.view(D1.size(0), -1) D1_norm = torch.norm(D1, p=2, dim=1, keepdim=True)...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.utils....
Prathyusha-Akundi/Adversarial-Continual-Learning
DiffLoss
false
14,239
[ "MIT" ]
237
edf4bbd2c4c61f1cc20818793702ef8c6cf4e0df
https://github.com/Prathyusha-Akundi/Adversarial-Continual-Learning/tree/edf4bbd2c4c61f1cc20818793702ef8c6cf4e0df
SoftCrossEntropyLoss
import torch import torch.nn as nn import torch.utils.data class SoftCrossEntropyLoss(nn.Module): """SoftCrossEntropyLoss (useful for label smoothing and mixup). Identical to torch.nn.CrossEntropyLoss if used with one-hot labels.""" def __init__(self): super(SoftCrossEntropyLoss, self).__init__()...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
Pre-release/BAKE
SoftCrossEntropyLoss
false
14,240
[ "MIT" ]
67
2899b38d556a9151f55079c1b9888d462369aec8
https://github.com/Pre-release/BAKE/tree/2899b38d556a9151f55079c1b9888d462369aec8
DiagGaussianActor
import torch import torch.nn as nn class DiagGaussianActor(nn.Module): """torch.distributions implementation of an diagonal Gaussian policy.""" def __init__(self, log_std_bounds=[-5, 2]): super().__init__() self.log_std_bounds = log_std_bounds def forward(self, mu, log_std): 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 from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.gu...
Purple-PI/rlstructures
DiagGaussianActor
false
14,241
[ "MIT" ]
281
9b201b083715bbda2f3534b010c84e11dfc0a1c7
https://github.com/Purple-PI/rlstructures/tree/9b201b083715bbda2f3534b010c84e11dfc0a1c7
LocalFeatureEncoder
import torch import torch.nn as nn from abc import ABCMeta from torch.utils import model_zoo class BaseModule(nn.Module, metaclass=ABCMeta): @classmethod def load(cls, config, state_dict=None): model = cls.from_cfg(config) if model is not None and state_dict is not None: model.loa...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 abc import ABCMeta from torch.utils import model_zoo ...
Pooya448/leap
LocalFeatureEncoder
false
14,242
[ "BSD-3-Clause" ]
55
b0562baaaad1d4c0bcd514e020185c32a86faf23
https://github.com/Pooya448/leap/tree/b0562baaaad1d4c0bcd514e020185c32a86faf23
SoftDiceLoss
import torch import numpy as np from torch import nn def sum_tensor(inp, axes, keepdim=False): axes = np.unique(axes).astype(int) if keepdim: for ax in axes: inp = inp.sum(int(ax), keepdim=True) else: for ax in sorted(axes, reverse=True): inp = inp.sum(int(ax)) ...
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 numpy as np from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
Project-SwaG/igvc-software
SoftDiceLoss
false
14,243
[ "MIT" ]
100
cfe5ad5ae06199030544560af7e4ebf732cd3004
https://github.com/Project-SwaG/igvc-software/tree/cfe5ad5ae06199030544560af7e4ebf732cd3004
KDLoss
import torch import torch.nn as nn import torch.utils.data class KDLoss(nn.Module): def __init__(self, temp_factor): super(KDLoss, self).__init__() self.temp_factor = temp_factor self.kl_div = nn.KLDivLoss(reduction='sum') def forward(self, input, target): log_p = torch.log_s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
Pre-release/BAKE
KDLoss
false
14,244
[ "MIT" ]
67
2899b38d556a9151f55079c1b9888d462369aec8
https://github.com/Pre-release/BAKE/tree/2899b38d556a9151f55079c1b9888d462369aec8
RAddFloat
import torch class RAddFloat(torch.nn.Module): def __init__(self): super(RAddFloat, self).__init__() def forward(self, x): return 1.0 + x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
RAddFloat
false
14,245
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
DQMLP
import torch import torch.nn as nn class DQMLP(nn.Module): def __init__(self, n_observations, n_actions, n_hidden): super().__init__() self.linear = nn.Linear(n_observations, n_hidden) self.linear_adv = nn.Linear(n_hidden, n_actions) self.linear_value = nn.Linear(n_hidden, 1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
Purple-PI/rlstructures
DQMLP
false
14,246
[ "MIT" ]
281
9b201b083715bbda2f3534b010c84e11dfc0a1c7
https://github.com/Purple-PI/rlstructures/tree/9b201b083715bbda2f3534b010c84e11dfc0a1c7
BaselineModel
import torch import torch.nn as nn class BaselineModel(nn.Module): """The model that computes V(s)""" def __init__(self, n_observations, n_hidden): super().__init__() self.linear = nn.Linear(n_observations, n_hidden) self.linear2 = nn.Linear(n_hidden, 1) def forward(self, 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.triton_helpers import libdevice import torch.nn as ...
Purple-PI/rlstructures
BaselineModel
false
14,247
[ "MIT" ]
281
9b201b083715bbda2f3534b010c84e11dfc0a1c7
https://github.com/Purple-PI/rlstructures/tree/9b201b083715bbda2f3534b010c84e11dfc0a1c7
ActorNetwork
import torch import torch.nn as nn import torch.nn.functional as F class ActorNetwork(nn.Module): def __init__(self, input_shape, output_shape, **kwargs): super(ActorNetwork, self).__init__() n_input = input_shape[-1] n_output = output_shape[0] self._h = nn.Linear(n_input, n_outpu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
PuzeLiu/mushroom-rl
ActorNetwork
false
14,248
[ "MIT" ]
344
99942b425e66b4ddcc26009d7105dde23841e95d
https://github.com/PuzeLiu/mushroom-rl/tree/99942b425e66b4ddcc26009d7105dde23841e95d
CriticNetwork
import torch import torch.nn as nn import torch.nn.functional as F class CriticNetwork(nn.Module): def __init__(self, input_shape, output_shape, **kwargs): super().__init__() n_input = input_shape[-1] n_output = output_shape[0] self._h = nn.Linear(n_input, n_output) nn.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 import triton_helpers import torch.nn as nn assert_...
PuzeLiu/mushroom-rl
CriticNetwork
false
14,249
[ "MIT" ]
344
99942b425e66b4ddcc26009d7105dde23841e95d
https://github.com/PuzeLiu/mushroom-rl/tree/99942b425e66b4ddcc26009d7105dde23841e95d
Normalization
import torch import torch.nn as nn from torch.nn.parameter import Parameter class Normalization(nn.Module): def __init__(self): super(Normalization, self).__init__() self.alpha = Parameter(torch.ones(1)) self.beta = Parameter(torch.zeros(1)) def forward(self, x): x = torch.nn...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn from t...
Prinsphield/ELEGANT
Normalization
false
14,250
[ "MIT" ]
276
26827e679cbef2074693ffb0d3f36426e481f7f5
https://github.com/Prinsphield/ELEGANT/tree/26827e679cbef2074693ffb0d3f36426e481f7f5
Network
import torch import torch.nn as nn class Network(nn.Module): def __init__(self, input_shape, output_shape, n_features, **kwargs): super(Network, self).__init__() n_input = input_shape[-1] n_output = output_shape[0] self._h1 = nn.Linear(n_input, n_features) self._h2 = nn.Li...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
PuzeLiu/mushroom-rl
Network
false
14,251
[ "MIT" ]
344
99942b425e66b4ddcc26009d7105dde23841e95d
https://github.com/PuzeLiu/mushroom-rl/tree/99942b425e66b4ddcc26009d7105dde23841e95d
DIAYNBaselineModel
import torch import torch.nn as nn class DIAYNBaselineModel(nn.Module): """The model that computes V(s)""" def __init__(self, n_observations, n_hidden, n_policies): super().__init__() self.linear = nn.Linear(n_observations, n_hidden) self.linear2 = nn.Linear(n_hidden, n_policies) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
Purple-PI/rlstructures
DIAYNBaselineModel
false
14,252
[ "MIT" ]
281
9b201b083715bbda2f3534b010c84e11dfc0a1c7
https://github.com/Purple-PI/rlstructures/tree/9b201b083715bbda2f3534b010c84e11dfc0a1c7
SoftAttention
import torch import torch.utils.data import torch.nn as nn class SoftAttention(torch.nn.Module): """ v = tanh(hW + b) w = softmax(v*u) out = sum wh see eqs 5-7 in https://www.sciencedirect.com/science/article/abs/pii/S0924271619300115 """ def __init__(self, hidden_dim): super(Sof...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Pratyush1991/crop-type-mapping
SoftAttention
false
14,253
[ "MIT" ]
94
d9d99ec92c3a090ec5576f9e46c89dfcc6f50cf3
https://github.com/Pratyush1991/crop-type-mapping/tree/d9d99ec92c3a090ec5576f9e46c89dfcc6f50cf3
AgentModel
import torch import torch.nn as nn class AgentModel(nn.Module): """The model that computes one score per action""" def __init__(self, n_observations, n_actions, n_hidden): super().__init__() self.linear = nn.Linear(n_observations, n_hidden) self.linear2 = nn.Linear(n_hidden, n_actions...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Purple-PI/rlstructures
AgentModel
false
14,254
[ "MIT" ]
281
9b201b083715bbda2f3534b010c84e11dfc0a1c7
https://github.com/Purple-PI/rlstructures/tree/9b201b083715bbda2f3534b010c84e11dfc0a1c7
ScaledDotProductAttention
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data.distributed class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature 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 torch._inductor.runtime....
QiuhongAnnaWei/IBRNet
ScaledDotProductAttention
false
14,255
[ "Apache-2.0" ]
254
6c8b68e6d95eae04535ff0906387ec7899f5d5ce
https://github.com/QiuhongAnnaWei/IBRNet/tree/6c8b68e6d95eae04535ff0906387ec7899f5d5ce
InfoNCE
import torch import torch.nn.functional as F from torch import nn def normalize(*xs): return [(None if x is None else F.normalize(x, dim=-1)) for x in xs] def transpose(x): return x.transpose(-2, -1) def info_nce(query, positive_key, negative_keys=None, temperature=0.1, reduction='mean', negative_mode...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
RElbers/info-nce-pytorch
InfoNCE
false
14,256
[ "MIT" ]
59
37ceef781b3fb89557c0d2b401a9fadf74be8791
https://github.com/RElbers/info-nce-pytorch/tree/37ceef781b3fb89557c0d2b401a9fadf74be8791
SACQ
import torch import torch.nn as nn class SACQ(nn.Module): def __init__(self, n_observations, action_dim, n_hidden): super().__init__() self.linear = nn.Linear(n_observations, n_hidden) self.linear_2 = nn.Linear(action_dim, n_hidden) self.linear_q = nn.Linear(n_hidden * 2, n_hidden...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Purple-PI/rlstructures
SACQ
false
14,257
[ "MIT" ]
281
9b201b083715bbda2f3534b010c84e11dfc0a1c7
https://github.com/Purple-PI/rlstructures/tree/9b201b083715bbda2f3534b010c84e11dfc0a1c7
conv
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data.distributed class conv(nn.Module): def __init__(self, num_in_layers, num_out_layers, kernel_size, stride): super(conv, self).__init__() self.kernel_size = kernel_size self.conv = nn.Conv2d(num_in_la...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
QiuhongAnnaWei/IBRNet
conv
false
14,258
[ "Apache-2.0" ]
254
6c8b68e6d95eae04535ff0906387ec7899f5d5ce
https://github.com/QiuhongAnnaWei/IBRNet/tree/6c8b68e6d95eae04535ff0906387ec7899f5d5ce
TokenMixer
import torch import torch.nn.functional as F from torch import nn class FeedForward(nn.Module): def __init__(self, num_features, expansion_factor, dropout): super().__init__() num_hidden = expansion_factor * num_features self.fc1 = nn.Linear(num_features, num_hidden) self.fc2 = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn.fun...
RAYTRAC3R/mlp-singer
TokenMixer
false
14,259
[ "MIT" ]
82
a68299b943815353fcc177e4873d24d1d0937cfb
https://github.com/RAYTRAC3R/mlp-singer/tree/a68299b943815353fcc177e4873d24d1d0937cfb
DIAYNActionModel
import torch import torch.nn as nn class DIAYNActionModel(nn.Module): """The model that computes one score per action""" def __init__(self, n_observations, n_actions, n_hidden, n_policies): super().__init__() self.linear = nn.Linear(n_observations, n_hidden) self.linear2 = nn.Linear(n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Purple-PI/rlstructures
DIAYNActionModel
false
14,260
[ "MIT" ]
281
9b201b083715bbda2f3534b010c84e11dfc0a1c7
https://github.com/Purple-PI/rlstructures/tree/9b201b083715bbda2f3534b010c84e11dfc0a1c7
PositionwiseFeedForward
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data.distributed class PositionwiseFeedForward(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1 = nn.Linear(d_in, d_hid) s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
QiuhongAnnaWei/IBRNet
PositionwiseFeedForward
false
14,261
[ "Apache-2.0" ]
254
6c8b68e6d95eae04535ff0906387ec7899f5d5ce
https://github.com/QiuhongAnnaWei/IBRNet/tree/6c8b68e6d95eae04535ff0906387ec7899f5d5ce
SoftQNetwork
import torch import torch.nn.functional as F import torch.nn as nn class SoftQNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size=[400, 300], init_w=0.003): super(SoftQNetwork, self).__init__() self.linear1 = nn.Linear(num_inputs + num_actions, hidden_size[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....
QasimWani/CityLearn
SoftQNetwork
false
14,262
[ "MIT" ]
202
ffc0584508dc9c796c97e6b908b75380b9bc6606
https://github.com/QasimWani/CityLearn/tree/ffc0584508dc9c796c97e6b908b75380b9bc6606
upconv
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data.distributed class conv(nn.Module): def __init__(self, num_in_layers, num_out_layers, kernel_size, stride): super(conv, self).__init__() self.kernel_size = kernel_size self.conv = nn.Conv2d(num_in_la...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
QiuhongAnnaWei/IBRNet
upconv
false
14,263
[ "Apache-2.0" ]
254
6c8b68e6d95eae04535ff0906387ec7899f5d5ce
https://github.com/QiuhongAnnaWei/IBRNet/tree/6c8b68e6d95eae04535ff0906387ec7899f5d5ce
ChamferLoss
import torch import torch.nn as nn def cd_loss(preds, gts): def batch_pairwise_dist(x, y): _bs, num_points_x, _points_dim = x.size() _, num_points_y, _ = y.size() xx = torch.bmm(x, x.transpose(2, 1)) yy = torch.bmm(y, y.transpose(2, 1)) zz = torch.bmm(x, y.transpose(2, 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 import torch.nn as nn assert_...
RRemixx/DMRDenoise
ChamferLoss
false
14,264
[ "MIT" ]
79
026d25f9eaf98fdfd85a67caeb9b49cab71148e9
https://github.com/RRemixx/DMRDenoise/tree/026d25f9eaf98fdfd85a67caeb9b49cab71148e9
ChannelMixer
import torch import torch.nn.functional as F from torch import nn class FeedForward(nn.Module): def __init__(self, num_features, expansion_factor, dropout): super().__init__() num_hidden = expansion_factor * num_features self.fc1 = nn.Linear(num_features, num_hidden) self.fc2 = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn.fun...
RAYTRAC3R/mlp-singer
ChannelMixer
false
14,265
[ "MIT" ]
82
a68299b943815353fcc177e4873d24d1d0937cfb
https://github.com/RAYTRAC3R/mlp-singer/tree/a68299b943815353fcc177e4873d24d1d0937cfb
ConformerEncoderLayer
import torch import torch.nn as nn from torch.optim import * from torch.optim.lr_scheduler import * import torch.nn.functional as F def multi_head_sep_attention_forward(query, key, value, embed_dim_to_check, num_heads, in_proj_weight, in_proj_bias, bias_k, bias_v, add_zero_attn, dropout_p, out_proj_weight, ou...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
PranjaliJain/matchmaker
ConformerEncoderLayer
false
14,266
[ "Apache-2.0" ]
97
b7e22eb8b70cccabf0729076df7cbab3f4ba4a1f
https://github.com/PranjaliJain/matchmaker/tree/b7e22eb8b70cccabf0729076df7cbab3f4ba4a1f
RepulsionLoss
import torch import torch.nn as nn def get_knn_idx_dist(pos: 'torch.FloatTensor', query: 'torch.FloatTensor', k, offset=0): """ :param pos: (B, N, F) :param query: (B, M, F) :return knn_idx: (B, M, k) """ B, N, F = tuple(pos.size()) M = query.size(1) pos = pos.unsqueeze(1)....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
RRemixx/DMRDenoise
RepulsionLoss
false
14,267
[ "MIT" ]
79
026d25f9eaf98fdfd85a67caeb9b49cab71148e9
https://github.com/RRemixx/DMRDenoise/tree/026d25f9eaf98fdfd85a67caeb9b49cab71148e9
BasicBlock
import torch import torch.nn as nn import torch.utils.data.distributed def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dila...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
QiuhongAnnaWei/IBRNet
BasicBlock
false
14,268
[ "Apache-2.0" ]
254
6c8b68e6d95eae04535ff0906387ec7899f5d5ce
https://github.com/QiuhongAnnaWei/IBRNet/tree/6c8b68e6d95eae04535ff0906387ec7899f5d5ce
BasicBlock
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import weight_norm 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=0, bias=True) class BasicBlock(nn.M...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
RaoUmer/SRResCycGAN
BasicBlock
false
14,269
[ "MIT" ]
50
b0999180a1906f519915ba2034fe492aef162109
https://github.com/RaoUmer/SRResCycGAN/tree/b0999180a1906f519915ba2034fe492aef162109
FunctionalConv3d
import torch class FunctionalConv3d(torch.nn.Module): def __init__(self, *args, **kwargs): super().__init__() self.conv = torch.nn.Conv3d(*args, **kwargs) def forward(self, x): x = torch.nn.functional.conv3d(x, self.conv.weight, self.conv.bias, self.conv.stride, self.conv...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride reinterpret_tens...
PogChamper/torch2trt
FunctionalConv3d
false
14,270
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
PositionwiseFeedForward
import torch import torch.nn as nn import torch.nn.functional as F class PositionwiseFeedForward(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1 = nn.Linear(d_in, d_hid) self.w_2 = nn.Linear(d_hid, d_in) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Rajathbharadwaj/algorithmic-efficiency
PositionwiseFeedForward
false
14,271
[ "Apache-2.0" ]
49
47d2928836e0574bc54cc3ad58860dd4daf86cce
https://github.com/Rajathbharadwaj/algorithmic-efficiency/tree/47d2928836e0574bc54cc3ad58860dd4daf86cce
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...
RaresAmbrus/KP3D
ConvBlock
false
14,272
[ "MIT" ]
227
7966c66679d32b81ea6e3181847ab3146e5a3ed2
https://github.com/RaresAmbrus/KP3D/tree/7966c66679d32b81ea6e3181847ab3146e5a3ed2
TensorSigmoid
import torch class TensorSigmoid(torch.nn.Module): def __init__(self): super(TensorSigmoid, self).__init__() def forward(self, x): return x.sigmoid() def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
PogChamper/torch2trt
TensorSigmoid
false
14,273
[ "MIT" ]
3,363
43b12627ec0de4d212efb6d02b07570205085ccc
https://github.com/PogChamper/torch2trt/tree/43b12627ec0de4d212efb6d02b07570205085ccc
MultiHeadAttention
import torch import torch.nn as nn import torch.nn.functional as F class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attn_dropo...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Rajathbharadwaj/algorithmic-efficiency
MultiHeadAttention
false
14,274
[ "Apache-2.0" ]
49
47d2928836e0574bc54cc3ad58860dd4daf86cce
https://github.com/Rajathbharadwaj/algorithmic-efficiency/tree/47d2928836e0574bc54cc3ad58860dd4daf86cce
decoderDepth
import torch import torch.nn as nn import torch.nn.functional as F class decoderDepth(nn.Module): def __init__(self): super(decoderDepth, self).__init__() self.dconv0 = nn.Conv2d(in_channels=512, out_channels=512, kernel_size=3, stride=1, padding=1, bias=True) self.dgn0 = nn.G...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Miles629/TransparentShapeRealData
decoderDepth
false
14,275
[ "MIT" ]
91
b81098a2d1882f5fd33fba6167d7258dbe02d6d2
https://github.com/Miles629/TransparentShapeRealData/tree/b81098a2d1882f5fd33fba6167d7258dbe02d6d2