entry_point
stringlengths
1
65
original_triton_code
stringlengths
4.5k
619k
python_code
stringlengths
208
60.9k
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
pytorch_code
stringlengths
200
4.05k
FakeRKHSConvNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import numpy as np import torch.nn as nn class MaybeBatchNorm2d(nn.Module): def __init__(self, n_ftr, affine, use_bn): super(MaybeBatchNorm2d, self).__init__() self.bn = nn.BatchNorm2d(n_ftr, affine=affine) self.use_bn = use_bn def forward(self, x): i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Luab/pytorch-lightning-bolts
FakeRKHSConvNet
false
11,713
[ "Apache-2.0" ]
0
b8ac85154465956b06fd1005b21b071af5493f11
https://github.com/Luab/pytorch-lightning-bolts/tree/b8ac85154465956b06fd1005b21b071af5493f11
import math import torch import numpy as np import torch.nn as nn class MaybeBatchNorm2d(nn.Module): def __init__(self, n_ftr, affine, use_bn): super().__init__() self.bn = nn.BatchNorm2d(n_ftr, affine=affine) self.use_bn = use_bn def forward(self, x): if self.use_bn: ...
SchedulerTestNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F class SchedulerTestNet(torch.nn.Module): """ adapted from: https://github.com/pytorch/pytorch/blob/master/test/test_optim.py """ def __init__(self): super(SchedulerTestNet, self).__init__() self.conv1 = torch.nn.Conv2d(1, 1, 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 assert_size_stride = torch._C...
Luab/pytorch-lightning-bolts
SchedulerTestNet
false
11,714
[ "Apache-2.0" ]
0
b8ac85154465956b06fd1005b21b071af5493f11
https://github.com/Luab/pytorch-lightning-bolts/tree/b8ac85154465956b06fd1005b21b071af5493f11
import torch from torch.nn import functional as F class Model(torch.nn.Module): """ adapted from: https://github.com/pytorch/pytorch/blob/master/test/test_optim.py """ def __init__(self): super().__init__() self.conv1 = torch.nn.Conv2d(1, 1, 1) self.conv2 = torch.nn.Conv2d(1, ...
Project3D
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
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...
Morbotu/drone-PWS
Project3D
false
11,715
[ "MIT" ]
0
face9cbf30a55783592cce8af59c1c70da982b6a
https://github.com/Morbotu/drone-PWS/tree/face9cbf30a55783592cce8af59c1c70da982b6a
import torch import torch.nn as nn class Model(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().__init__() self.batch_size = batch_size self.height = height ...
BboxHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.cuda class BboxHead(nn.Module): """ BboxHead RetinaFace head for bounding box branch. Args: inchannels (`int`): number of input channels. num_anchors (`int`): number of anchors. """ def __init__(self, inc...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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.cuda assert_size_stride = torch._C._dynamo.gua...
LoveEachDay/towhee
BboxHead
false
11,716
[ "Apache-2.0" ]
0
513c9c2626676cadaaf0a16ac3c828d96bec91a1
https://github.com/LoveEachDay/towhee/tree/513c9c2626676cadaaf0a16ac3c828d96bec91a1
import torch from torch import nn import torch.cuda class Model(nn.Module): """ BboxHead RetinaFace head for bounding box branch. Args: inchannels (`int`): number of input channels. num_anchors (`int`): number of anchors. """ def __init__(self, inchan...
LandmarkHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.cuda class LandmarkHead(nn.Module): """ LandmarkHead RetinaFace head for landmark branch. inchannels (`int`): number of input channels. num_anchors (`int`): number of anchors. """ def __init__(self, inchannel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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.cuda assert_size_stride = torch._C._dynamo.gua...
LoveEachDay/towhee
LandmarkHead
false
11,717
[ "Apache-2.0" ]
0
513c9c2626676cadaaf0a16ac3c828d96bec91a1
https://github.com/LoveEachDay/towhee/tree/513c9c2626676cadaaf0a16ac3c828d96bec91a1
import torch from torch import nn import torch.cuda class Model(nn.Module): """ LandmarkHead RetinaFace head for landmark branch. inchannels (`int`): number of input channels. num_anchors (`int`): number of anchors. """ def __init__(self, inchannels: 'int...
AmdimNCELoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn def tanh_clip(x, clip_val=10.0): """ soft clip values to the range [-clip_val, +clip_val] """ if clip_val is not None: x_clip = clip_val * torch.tanh(1.0 / clip_val * x) else: x_clip = x return x_clip class AmdimNCELoss(nn.Module): """ ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Luab/pytorch-lightning-bolts
AmdimNCELoss
false
11,718
[ "Apache-2.0" ]
0
b8ac85154465956b06fd1005b21b071af5493f11
https://github.com/Luab/pytorch-lightning-bolts/tree/b8ac85154465956b06fd1005b21b071af5493f11
import torch import torch.nn as nn def tanh_clip(x, clip_val=10.0): """ soft clip values to the range [-clip_val, +clip_val] """ if clip_val is not None: x_clip = clip_val * torch.tanh(1.0 / clip_val * x) else: x_clip = x return x_clip class Model(nn.Module): """ Comp...
Conv3x3
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
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....
Morbotu/drone-PWS
Conv3x3
false
11,719
[ "MIT" ]
0
face9cbf30a55783592cce8af59c1c70da982b6a
https://github.com/Morbotu/drone-PWS/tree/face9cbf30a55783592cce8af59c1c70da982b6a
import torch import torch.nn as nn class Model(nn.Module): """Layer to pad and convolve input """ def __init__(self, in_channels, out_channels, use_refl=True): super().__init__() if use_refl: self.pad = nn.ReflectionPad2d(1) else: self.pad = nn.ZeroPad2d(1)...
ConvBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
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...
Morbotu/drone-PWS
ConvBlock
false
11,720
[ "MIT" ]
0
face9cbf30a55783592cce8af59c1c70da982b6a
https://github.com/Morbotu/drone-PWS/tree/face9cbf30a55783592cce8af59c1c70da982b6a
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().__init__() if use_refl: self.pad = nn.ReflectionPad2d(1) else: self.pad = nn.ZeroPad2d(...
Scaled_Dot_Product_Attention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super(Scaled_Dot_Product_Attention, self).__init__() def forward(self, Q, K, V, scale=None): """ Args: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Moon-xm/Chinese-Text-Classification-Pytorch
Scaled_Dot_Product_Attention
false
11,721
[ "MIT" ]
0
19fe64006418bf4296f884e4d1f038c17b34d3de
https://github.com/Moon-xm/Chinese-Text-Classification-Pytorch/tree/19fe64006418bf4296f884e4d1f038c17b34d3de
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super().__init__() def forward(self, Q, K, V, scale=None): """ Args: Q: [batch_size, len_Q, dim_Q] K: [batch_...
Discriminator
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn from torch.nn import functional as F class Discriminator(nn.Module): def __init__(self, img_shape, hidden_dim=1024): super().__init__() in_dim = int(np.prod(img_shape)) self.fc1 = nn.Linear(in_dim, hidden_dim) self.fc2 = nn.Lin...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
Luab/pytorch-lightning-bolts
Discriminator
false
11,722
[ "Apache-2.0" ]
0
b8ac85154465956b06fd1005b21b071af5493f11
https://github.com/Luab/pytorch-lightning-bolts/tree/b8ac85154465956b06fd1005b21b071af5493f11
import torch import numpy as np import torch.nn as nn from torch.nn import functional as F class Model(nn.Module): def __init__(self, img_shape, hidden_dim=1024): super().__init__() in_dim = int(np.prod(img_shape)) self.fc1 = nn.Linear(in_dim, hidden_dim) self.fc2 = nn.Linear(self...
DenseBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn as nn from torch.nn import functional as F class CausalConv1d(nn.Module): """A 1D causal convolution layer. Input: (B, D_in, T), where B is the minibatch size, D_in is the number of dimensions per step, and T is the number of steps. Output: (B, D_out, T), where 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 from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
NagisaZj/ProMP
DenseBlock
false
11,723
[ "MIT" ]
0
539739ae2b7d5fdcad00855da695f643b23df4b3
https://github.com/NagisaZj/ProMP/tree/539739ae2b7d5fdcad00855da695f643b23df4b3
import torch from torch import nn as nn from torch.nn import functional as F class CausalConv1d(nn.Module): """A 1D causal convolution layer. Input: (B, D_in, T), where B is the minibatch size, D_in is the number of dimensions per step, and T is the number of steps. Output: (B, D_out, T), where B...
SSIM
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
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 ...
Morbotu/drone-PWS
SSIM
false
11,724
[ "MIT" ]
0
face9cbf30a55783592cce8af59c1c70da982b6a
https://github.com/Morbotu/drone-PWS/tree/face9cbf30a55783592cce8af59c1c70da982b6a
import torch import torch.nn as nn class Model(nn.Module): """Layer to compute the SSIM loss between a pair of images """ def __init__(self): super().__init__() self.mu_x_pool = nn.AvgPool2d(3, 1) self.mu_y_pool = nn.AvgPool2d(3, 1) self.sig_x_pool = nn.AvgPool2d(3, 1) ...
Multi_Head_Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super(Scaled_Dot_Product_Attention, self).__init__() def forward(self, Q, K, V, scale=None): """ Args: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
Moon-xm/Chinese-Text-Classification-Pytorch
Multi_Head_Attention
false
11,725
[ "MIT" ]
0
19fe64006418bf4296f884e4d1f038c17b34d3de
https://github.com/Moon-xm/Chinese-Text-Classification-Pytorch/tree/19fe64006418bf4296f884e4d1f038c17b34d3de
import torch import torch.nn as nn import torch.nn.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super().__init__() def forward(self, Q, K, V, scale=None): """ Args: Q: [batch_size, len_Q, dim_Q]...
HuberLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn as nn class HuberLoss(nn.Module): def __init__(self, delta=1): super().__init__() self.huber_loss_delta1 = nn.SmoothL1Loss() self.delta = delta def forward(self, x, x_hat): loss = self.huber_loss_delta1(x / self.delta, x_hat / self.delta) ...
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 from torch import nn a...
NagisaZj/ProMP
HuberLoss
false
11,726
[ "MIT" ]
0
539739ae2b7d5fdcad00855da695f643b23df4b3
https://github.com/NagisaZj/ProMP/tree/539739ae2b7d5fdcad00855da695f643b23df4b3
import torch from torch import nn as nn class Model(nn.Module): def __init__(self, delta=1): super().__init__() self.huber_loss_delta1 = nn.SmoothL1Loss() self.delta = delta def forward(self, x, x_hat): loss = self.huber_loss_delta1(x / self.delta, x_hat / self.delta) ...
LayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn as nn class LayerNorm(nn.Module): """ Simple 1D LayerNorm. """ def __init__(self, features, center=True, scale=False, eps=1e-06): super().__init__() self.center = center self.scale = scale self.eps = eps if self.scale: ...
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 as nn assert_size_stride = torch._C._dynamo.guards.assert_...
NagisaZj/ProMP
LayerNorm
false
11,727
[ "MIT" ]
0
539739ae2b7d5fdcad00855da695f643b23df4b3
https://github.com/NagisaZj/ProMP/tree/539739ae2b7d5fdcad00855da695f643b23df4b3
import torch from torch import nn as nn class Model(nn.Module): """ Simple 1D LayerNorm. """ def __init__(self, features, center=True, scale=False, eps=1e-06): super().__init__() self.center = center self.scale = scale self.eps = eps if self.scale: ...
CausalConv1d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn as nn class CausalConv1d(nn.Module): """A 1D causal convolution layer. Input: (B, D_in, T), where B is the minibatch size, D_in is the number of dimensions per step, and T is the number of steps. Output: (B, D_out, T), where B is the minibatch size, D_out is the ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn as nn assert_size_stride = torch._C._dynamo.guards.assert_s...
NagisaZj/ProMP
CausalConv1d
false
11,728
[ "MIT" ]
0
539739ae2b7d5fdcad00855da695f643b23df4b3
https://github.com/NagisaZj/ProMP/tree/539739ae2b7d5fdcad00855da695f643b23df4b3
import torch from torch import nn as nn class Model(nn.Module): """A 1D causal convolution layer. Input: (B, D_in, T), where B is the minibatch size, D_in is the number of dimensions per step, and T is the number of steps. Output: (B, D_out, T), where B is the minibatch size, D_out is the number ...
Stoplinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from collections import OrderedDict import torch.nn as nn class Linear(nn.Module): """ Linear Module """ def __init__(self, in_dim, out_dim, bias=True, w_init='linear'): """ :param in_dim: dimension of input :param out_dim: dimension of output :param bias:...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from collections import Order...
Munna-Manoj/Team7_TTS
Stoplinear
false
11,729
[ "MIT" ]
0
5e2d473a2afe429023876bcc51c2ac966a4938b8
https://github.com/Munna-Manoj/Team7_TTS/tree/5e2d473a2afe429023876bcc51c2ac966a4938b8
import torch from collections import OrderedDict import torch.nn as nn class Linear(nn.Module): """ Linear Module """ def __init__(self, in_dim, out_dim, bias=True, w_init='linear'): """ :param in_dim: dimension of input :param out_dim: dimension of output :param bias:...
FFN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch as t class Conv(nn.Module): """ Convolution Module """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0, dilation=1, bias=True, w_init='linear'): """ :param in_channels: dimension of input ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Munna-Manoj/Team7_TTS
FFN
false
11,730
[ "MIT" ]
0
5e2d473a2afe429023876bcc51c2ac966a4938b8
https://github.com/Munna-Manoj/Team7_TTS/tree/5e2d473a2afe429023876bcc51c2ac966a4938b8
import torch import torch.nn as nn import torch as t class Conv(nn.Module): """ Convolution Module """ def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0, dilation=1, bias=True, w_init='linear'): """ :param in_channels: dimension of input ...
Encoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super(Scaled_Dot_Product_Attention, self).__init__() def forward(self, Q, K, V, scale=None): """ Args: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Moon-xm/Chinese-Text-Classification-Pytorch
Encoder
false
11,731
[ "MIT" ]
0
19fe64006418bf4296f884e4d1f038c17b34d3de
https://github.com/Moon-xm/Chinese-Text-Classification-Pytorch/tree/19fe64006418bf4296f884e4d1f038c17b34d3de
import torch import torch.nn as nn import torch.nn.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super().__init__() def forward(self, Q, K, V, scale=None): """ Args: Q: [batch_size, len_Q, dim_Q]...
Position_wise_Feed_Forward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Position_wise_Feed_Forward(nn.Module): def __init__(self, dim_model, hidden, dropout=0.0): super(Position_wise_Feed_Forward, self).__init__() self.fc1 = nn.Linear(dim_model, hidden) self.fc2 = nn.Linear(hidden, dim_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 import triton_helpers from torch._inductor.runtime....
Moon-xm/Chinese-Text-Classification-Pytorch
Position_wise_Feed_Forward
false
11,732
[ "MIT" ]
0
19fe64006418bf4296f884e4d1f038c17b34d3de
https://github.com/Moon-xm/Chinese-Text-Classification-Pytorch/tree/19fe64006418bf4296f884e4d1f038c17b34d3de
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, dim_model, hidden, dropout=0.0): super().__init__() self.fc1 = nn.Linear(dim_model, hidden) self.fc2 = nn.Linear(hidden, dim_model) self.dropout = nn.Dropout(dropout) ...
MultiheadAttention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import math import torch import torch.nn as nn import torch as t class MultiheadAttention(nn.Module): """ Multihead attention mechanism (dot attention) """ def __init__(self, num_hidden_k): """ :param num_hidden_k: dimension of hidden """ super(MultiheadAttention, sel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Munna-Manoj/Team7_TTS
MultiheadAttention
false
11,733
[ "MIT" ]
0
5e2d473a2afe429023876bcc51c2ac966a4938b8
https://github.com/Munna-Manoj/Team7_TTS/tree/5e2d473a2afe429023876bcc51c2ac966a4938b8
import math import torch import torch.nn as nn import torch as t class Model(nn.Module): """ Multihead attention mechanism (dot attention) """ def __init__(self, num_hidden_k): """ :param num_hidden_k: dimension of hidden """ super().__init__() self.num_hidden...
DiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class DiceLoss(nn.Module): """Sørensen–Dice coefficient loss to calculate the mean loss over a batch of data.This loss mainly calculates the similarity between two samples. To know more about this loss check this link: https://en.wikipedia.org/wiki/S%C3%B8rensen%...
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...
NajusAnaxi/UNet-based-for-Brain-Tumor-Segmentation
DiceLoss
false
11,734
[ "MIT" ]
0
24ca4432873f145ad33810f40c851ac10bf030fa
https://github.com/NajusAnaxi/UNet-based-for-Brain-Tumor-Segmentation/tree/24ca4432873f145ad33810f40c851ac10bf030fa
import torch import torch.nn as nn class Model(nn.Module): """Sørensen–Dice coefficient loss to calculate the mean loss over a batch of data.This loss mainly calculates the similarity between two samples. To know more about this loss check this link: https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%...
BCEDiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class DiceLoss(nn.Module): """Sørensen–Dice coefficient loss to calculate the mean loss over a batch of data.This loss mainly calculates the similarity between two samples. To know more about this loss check this link: https://en.w...
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...
NajusAnaxi/UNet-based-for-Brain-Tumor-Segmentation
BCEDiceLoss
false
11,735
[ "MIT" ]
0
24ca4432873f145ad33810f40c851ac10bf030fa
https://github.com/NajusAnaxi/UNet-based-for-Brain-Tumor-Segmentation/tree/24ca4432873f145ad33810f40c851ac10bf030fa
import torch import torch.nn as nn import torch.nn.functional as F class DiceLoss(nn.Module): """Sørensen–Dice coefficient loss to calculate the mean loss over a batch of data.This loss mainly calculates the similarity between two samples. To know more about this loss check this link: https://en.w...
GraphConv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init class MeanAggregator(nn.Module): def forward(self, features, A): x = torch.bmm(A, features) return x class GraphConv(nn.Module): def __init__(self, in_dim, out_dim): super().__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn from to...
NceBoy/mmocr
GraphConv
false
11,736
[ "Apache-2.0" ]
0
3fb7a18d7eb44799e75c1991e5da2044b458d411
https://github.com/NceBoy/mmocr/tree/3fb7a18d7eb44799e75c1991e5da2044b458d411
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init class MeanAggregator(nn.Module): def forward(self, features, A): x = torch.bmm(A, features) return x class Model(nn.Module): def __init__(self, in_dim, out_dim): super().__init__() ...
Vol
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import math import torch from torch import Tensor import torchaudio.functional as F class Vol(torch.nn.Module): """Add a volume to an waveform. Args: gain (float): Interpreted according to the given gain_type: If ``gain_type`` = ``amplitude``, ``gain`` is a positive amplitude ratio. ...
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...
Nayef211/audio
Vol
false
11,737
[ "BSD-2-Clause" ]
0
241ab1e8284e589262f510ee9411baf2bc374ded
https://github.com/Nayef211/audio/tree/241ab1e8284e589262f510ee9411baf2bc374ded
import math import torch from torch import Tensor import torchaudio.functional as F class Model(torch.nn.Module): """Add a volume to an waveform. Args: gain (float): Interpreted according to the given gain_type: If ``gain_type`` = ``amplitude``, ``gain`` is a positive amplitude ratio. ...
ComputeDeltas
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor import torchaudio.functional as F class ComputeDeltas(torch.nn.Module): """Compute delta coefficients of a tensor, usually a spectrogram. See `torchaudio.functional.compute_deltas` for more details. Args: win_length (int): The window length used for computin...
import torch from torch._inductor.select_algorithm import extern_kernels import 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_cu...
Nayef211/audio
ComputeDeltas
false
11,738
[ "BSD-2-Clause" ]
0
241ab1e8284e589262f510ee9411baf2bc374ded
https://github.com/Nayef211/audio/tree/241ab1e8284e589262f510ee9411baf2bc374ded
import torch from torch import Tensor import torchaudio.functional as F class Model(torch.nn.Module): """Compute delta coefficients of a tensor, usually a spectrogram. See `torchaudio.functional.compute_deltas` for more details. Args: win_length (int): The window length used for computing delta....
MuLawEncoding
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor import torchaudio.functional as F class MuLawEncoding(torch.nn.Module): """Encode signal based on mu-law companding. For more info see the `Wikipedia Entry <https://en.wikipedia.org/wiki/%CE%9C-law_algorithm>`_ This algorithm assumes the signal has been scaled to be...
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 assert_size_stride = torch._C._dynamo.guards.assert_size_strid...
Nayef211/audio
MuLawEncoding
false
11,739
[ "BSD-2-Clause" ]
0
241ab1e8284e589262f510ee9411baf2bc374ded
https://github.com/Nayef211/audio/tree/241ab1e8284e589262f510ee9411baf2bc374ded
import torch from torch import Tensor import torchaudio.functional as F class Model(torch.nn.Module): """Encode signal based on mu-law companding. For more info see the `Wikipedia Entry <https://en.wikipedia.org/wiki/%CE%9C-law_algorithm>`_ This algorithm assumes the signal has been scaled to between -1...
Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(1, 32, 5) self.pool1 = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(32, 32, 3) self.pool2 = nn.MaxPool2d(3, 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 as nn assert_...
MonteYang/P1_Facial_Keypoints
Net
false
11,740
[ "MIT" ]
0
1e3e4c9c6b48ec241f6fc7e072b25c7211cebd18
https://github.com/MonteYang/P1_Facial_Keypoints/tree/1e3e4c9c6b48ec241f6fc7e072b25c7211cebd18
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 32, 5) self.pool1 = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(32, 32, 3) self.pool2 = nn.MaxPool2d(3, 3) self...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch as t class Linear(nn.Module): """ Linear Module """ def __init__(self, in_dim, out_dim, bias=True, w_init='linear'): """ :param in_dim: dimension of input :param out_dim: dimension of output :param bias: boole...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Munna-Manoj/Team7_TTS
Attention
false
11,741
[ "MIT" ]
0
5e2d473a2afe429023876bcc51c2ac966a4938b8
https://github.com/Munna-Manoj/Team7_TTS/tree/5e2d473a2afe429023876bcc51c2ac966a4938b8
import math import torch import torch.nn as nn import torch as t class Linear(nn.Module): """ Linear Module """ def __init__(self, in_dim, out_dim, bias=True, w_init='linear'): """ :param in_dim: dimension of input :param out_dim: dimension of output :param bias: boole...
SlidingWindowCmn
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor import torchaudio.functional as F class SlidingWindowCmn(torch.nn.Module): """ Apply sliding-window cepstral mean (and optionally variance) normalization per utterance. Args: cmn_window (int, optional): Window in frames for running average CMN computation (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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda reinterpret...
Nayef211/audio
SlidingWindowCmn
false
11,742
[ "BSD-2-Clause" ]
0
241ab1e8284e589262f510ee9411baf2bc374ded
https://github.com/Nayef211/audio/tree/241ab1e8284e589262f510ee9411baf2bc374ded
import torch from torch import Tensor import torchaudio.functional as F class Model(torch.nn.Module): """ Apply sliding-window cepstral mean (and optionally variance) normalization per utterance. Args: cmn_window (int, optional): Window in frames for running average CMN computation (int, default ...
AmplitudeToDB
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import math import torch from torch import Tensor import torchaudio.functional as F from typing import Optional class AmplitudeToDB(torch.nn.Module): """Turn a tensor from the power/amplitude scale to the decibel scale. This output depends on the maximum value in the input tensor, and so may return diffe...
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 math from typing impo...
Nayef211/audio
AmplitudeToDB
false
11,743
[ "BSD-2-Clause" ]
0
241ab1e8284e589262f510ee9411baf2bc374ded
https://github.com/Nayef211/audio/tree/241ab1e8284e589262f510ee9411baf2bc374ded
import math import torch from torch import Tensor import torchaudio.functional as F from typing import Optional class Model(torch.nn.Module): """Turn a tensor from the power/amplitude scale to the decibel scale. This output depends on the maximum value in the input tensor, and so may return different val...
DiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class DiceLoss(nn.Module): def __init__(self, eps=1e-06): super().__init__() assert isinstance(eps, float) self.eps = eps def forward(self, pred, target, mask=None): pred = pred.contiguous().view(pred.size()[0], -1) target = target.c...
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...
NceBoy/mmocr
DiceLoss
false
11,744
[ "Apache-2.0" ]
0
3fb7a18d7eb44799e75c1991e5da2044b458d411
https://github.com/NceBoy/mmocr/tree/3fb7a18d7eb44799e75c1991e5da2044b458d411
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, eps=1e-06): super().__init__() assert isinstance(eps, float) self.eps = eps def forward(self, pred, target, mask=None): pred = pred.contiguous().view(pred.size()[0], -1) target = target.cont...
MuLawDecoding
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor import torchaudio.functional as F class MuLawDecoding(torch.nn.Module): """Decode mu-law encoded signal. For more info see the `Wikipedia Entry <https://en.wikipedia.org/wiki/%CE%9C-law_algorithm>`_ This expects an input with values between 0 and quantization_channe...
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...
Nayef211/audio
MuLawDecoding
false
11,745
[ "BSD-2-Clause" ]
0
241ab1e8284e589262f510ee9411baf2bc374ded
https://github.com/Nayef211/audio/tree/241ab1e8284e589262f510ee9411baf2bc374ded
import torch from torch import Tensor import torchaudio.functional as F class Model(torch.nn.Module): """Decode mu-law encoded signal. For more info see the `Wikipedia Entry <https://en.wikipedia.org/wiki/%CE%9C-law_algorithm>`_ This expects an input with values between 0 and quantization_channels - 1 ...
AvgPool2d
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from torch.nn import Module import torch import torch as th class AvgPool2d(Module): """ This class is the beginning of an exact python port of the torch.nn.AvgPool2d module. Because PySyft cannot hook into layers which are implemented in C++, our special functionalities (such as encrypted computation...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._em...
NiWaRe/PySyft
AvgPool2d
false
11,746
[ "Apache-2.0" ]
0
b5abe66ea949d60be14a08d2e4e32e9587c7bf5c
https://github.com/NiWaRe/PySyft/tree/b5abe66ea949d60be14a08d2e4e32e9587c7bf5c
from torch.nn import Module import torch import torch as th class Model(Module): """ This class is the beginning of an exact python port of the torch.nn.AvgPool2d module. Because PySyft cannot hook into layers which are implemented in C++, our special functionalities (such as encrypted computation) do...
MultiHeadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn def scaled_dot_product_attention(query, keys, values, mask=None): d_k = keys.shape[-1] dot_score = query @ keys.transpose(-2, -1) / math.sqrt(d_k) if mask is not None: dot_score = dot_score.masked_fill(mask == 0, -1000000000.0) attn_score = torch....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
NathanYanJing/TransformerReplication
MultiHeadAttention
false
11,748
[ "MIT" ]
0
b20f987dcc507724971f843c2d214c9c76bd8e34
https://github.com/NathanYanJing/TransformerReplication/tree/b20f987dcc507724971f843c2d214c9c76bd8e34
import math import torch import torch.nn as nn def scaled_dot_product_attention(query, keys, values, mask=None): d_k = keys.shape[-1] dot_score = query @ keys.transpose(-2, -1) / math.sqrt(d_k) if mask is not None: dot_score = dot_score.masked_fill(mask == 0, -1000000000.0) attn_score = torch....
EncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F def scaled_dot_product_attention(query, keys, values, mask=None): d_k = keys.shape[-1] dot_score = query @ keys.transpose(-2, -1) / math.sqrt(d_k) if mask is not None: dot_score = dot_score.masked_fill(mask == 0, -10000...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
NathanYanJing/TransformerReplication
EncoderLayer
false
11,749
[ "MIT" ]
0
b20f987dcc507724971f843c2d214c9c76bd8e34
https://github.com/NathanYanJing/TransformerReplication/tree/b20f987dcc507724971f843c2d214c9c76bd8e34
import math import torch import torch.nn as nn import torch.nn.functional as F def scaled_dot_product_attention(query, keys, values, mask=None): d_k = keys.shape[-1] dot_score = query @ keys.transpose(-2, -1) / math.sqrt(d_k) if mask is not None: dot_score = dot_score.masked_fill(mask == 0, -10000...
CustomGruCell
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn class CustomGruCell(nn.Module): """ A forward only GRU cell. Input should be: (sequence length x batch size x input_size). The output is the output of the final forward call. It's not clear if it would be possible to use the output from each ce...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
NiWaRe/PySyft
CustomGruCell
false
11,750
[ "Apache-2.0" ]
0
b5abe66ea949d60be14a08d2e4e32e9587c7bf5c
https://github.com/NiWaRe/PySyft/tree/b5abe66ea949d60be14a08d2e4e32e9587c7bf5c
import torch import numpy as np import torch.nn as nn class Model(nn.Module): """ A forward only GRU cell. Input should be: (sequence length x batch size x input_size). The output is the output of the final forward call. It's not clear if it would be possible to use the output from each cell in a ...
ToLongTensor
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor from typing import List import torch.nn as nn class ToLongTensor(nn.Module): """Convert a list of integers to long tensor """ def __init__(self): super(ToLongTensor, self).__init__() def forward(self, tokens: 'List[List[int]]') ->Tensor: return t...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
NivekT/text
ToLongTensor
false
11,751
[ "BSD-3-Clause" ]
0
4908d3c88f92296a4c23be2f064ccde13cce50ce
https://github.com/NivekT/text/tree/4908d3c88f92296a4c23be2f064ccde13cce50ce
import torch from torch import Tensor from typing import List import torch.nn as nn class Model(nn.Module): """Convert a list of integers to long tensor """ def __init__(self): super().__init__() def forward(self, tokens: 'List[List[int]]') ->Tensor: return torch.tensor(tokens) def...
TransformerEncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class MultiHeadAttention(nn.Module): """Multi-Head Attention module.""" def __init__(self, n_head=8, d_model=512, d_k=64, d_v=64, dropout=0.1, qkv_bias=False, mask_value=0): super().__init__() self.mask_value = mask_value self.n_head = n_head...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
NceBoy/mmocr
TransformerEncoderLayer
false
11,752
[ "Apache-2.0" ]
0
3fb7a18d7eb44799e75c1991e5da2044b458d411
https://github.com/NceBoy/mmocr/tree/3fb7a18d7eb44799e75c1991e5da2044b458d411
import torch import torch.nn as nn class MultiHeadAttention(nn.Module): """Multi-Head Attention module.""" def __init__(self, n_head=8, d_model=512, d_k=64, d_v=64, dropout=0.1, qkv_bias=False, mask_value=0): super().__init__() self.mask_value = mask_value self.n_head = n_head...
Normalize
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class Normalize(nn.Module): def __init__(self, features, epsilon=1e-06): super(Normalize, self).__init__() self.gain = nn.Parameter(torch.ones(features)) self.bias = nn.Parameter(torch.zeros(features)) self.epsilon = epsilon def forward(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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
NingNing-C/neurips19-graph-protein-design
Normalize
false
11,753
[ "MIT" ]
0
9daba22083c04ad2528aed47f4b5dc97e2951132
https://github.com/NingNing-C/neurips19-graph-protein-design/tree/9daba22083c04ad2528aed47f4b5dc97e2951132
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, features, epsilon=1e-06): super().__init__() self.gain = nn.Parameter(torch.ones(features)) self.bias = nn.Parameter(torch.zeros(features)) self.epsilon = epsilon def forward(self, x, dim=-1): ...
DQN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class DQN(nn.Module): def __init__(self, state_size, action_size): super(DQN, self).__init__() self.fc1 = nn.Linear(state_size, 30) self.fc2 = nn.Linear(30, 10) self.fc3 = nn.Linear(10, action_size) def forwar...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
NickHclos/DDPG-PyTorch
DQN
false
11,754
[ "MIT" ]
0
9f6df328c275ff5c579fa0e4f7b30ab234cf236d
https://github.com/NickHclos/DDPG-PyTorch/tree/9f6df328c275ff5c579fa0e4f7b30ab234cf236d
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_size, action_size): super().__init__() self.fc1 = nn.Linear(state_size, 30) self.fc2 = nn.Linear(30, 10) self.fc3 = nn.Linear(10, action_size) def forward(self,...
DAFAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F def masked_softmax(logits, mask, dim=-1, log_softmax=False): """Take the softmax of `logits` over given dimension, and set entries to 0 wherever `mask` is 0. Args: logits (torch.Tensor): Inputs to the softmax function. mas...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
NicholasPaulBrazeauSanchez/squad
DAFAttention
false
11,755
[ "MIT" ]
0
7343f41b186f1647e474824e5035c8dd639028b2
https://github.com/NicholasPaulBrazeauSanchez/squad/tree/7343f41b186f1647e474824e5035c8dd639028b2
import torch import torch.nn as nn import torch.nn.functional as F def masked_softmax(logits, mask, dim=-1, log_softmax=False): """Take the softmax of `logits` over given dimension, and set entries to 0 wherever `mask` is 0. Args: logits (torch.Tensor): Inputs to the softmax function. mas...
GEGLU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn import torch.nn.functional as F 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...
NomadicDaggy/DALLE-pytorch
GEGLU
false
11,756
[ "MIT" ]
0
ecadc12e8063763ad45de50773e5c746262cdfd3
https://github.com/NomadicDaggy/DALLE-pytorch/tree/ecadc12e8063763ad45de50773e5c746262cdfd3
import torch from torch import nn import torch.nn.functional as F class Model(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 []
MNIST_CNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class SqueezeLastTwo(nn.Module): """A module which squeezes the last two dimensions, ordinary squeeze can be a problem for batch size 1""" def __init__(self): super(SqueezeLastTwo, self).__init__() def for...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Neronjust2017/DomainBed
MNIST_CNN
false
11,757
[ "MIT" ]
0
42be49a316a74799b95d6a5e29bb210477c7f828
https://github.com/Neronjust2017/DomainBed/tree/42be49a316a74799b95d6a5e29bb210477c7f828
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class SqueezeLastTwo(nn.Module): """A module which squeezes the last two dimensions, ordinary squeeze can be a problem for batch size 1""" def __init__(self): super().__init__() def forward(self, x): ...
BoundSin
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from _paritybench_helpers import _mock_config import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from numbers import Number from torch.nn import MSELoss def isnan(x): if isinstance(x, Patches): return False return torch.isnan(x).any() class Perturbation...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import math import numpy as np import torch.nn as nn import torch.nn.func...
Mahoumaru/auto_LiRPA
BoundSin
false
11,758
[ "BSD-3-Clause" ]
0
b03a6c36eb1b921726778359d6d2b94e0cd7e480
https://github.com/Mahoumaru/auto_LiRPA/tree/b03a6c36eb1b921726778359d6d2b94e0cd7e480
from _paritybench_helpers import _mock_config import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from numbers import Number from torch.nn import MSELoss def isnan(x): if isinstance(x, Patches): return False return torch.isnan(x).any() class Perturbation...
Mutan
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Mutan(nn.Module): def __init__(self, input_dims, output_dim, mm_dim=1600, rank=15, shared =False, normalize=False, dropout_input=0.0, dropout_pre_lin=0.0, dropout_output=0.0): super(Mutan, self).__init__() se...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
JoannaLXY/block.bootstrap.pytorch
Mutan
false
11,759
[ "BSD-3-Clause" ]
0
42c3e7616b704e05c6ff2376ff68b5b18044fe77
https://github.com/JoannaLXY/block.bootstrap.pytorch/tree/42c3e7616b704e05c6ff2376ff68b5b18044fe77
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_dims, output_dim, mm_dim=1600, rank=15, shared =False, normalize=False, dropout_input=0.0, dropout_pre_lin=0.0, dropout_output=0.0): super().__init__() self.input_di...
CRF
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils.data.dataloader import torch.nn class CRF(torch.nn.Module): """ Conditional Random Field Implementation according to sgrvinod (https://github.com/sgrvinod). Classifier which predicts single tag / class / label for given word based on not just the word, but also on previ...
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.utils.data.dataloader import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
OatsProduction/flair
CRF
false
11,760
[ "MIT" ]
0
1cf2c9a9ae487e279dce9f6b92c41fa32c4563cf
https://github.com/OatsProduction/flair/tree/1cf2c9a9ae487e279dce9f6b92c41fa32c4563cf
import torch import torch.utils.data.dataloader import torch.nn class Model(torch.nn.Module): """ Conditional Random Field Implementation according to sgrvinod (https://github.com/sgrvinod). Classifier which predicts single tag / class / label for given word based on not just the word, but also on pre...
PairwiseBCELoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from abc import abstractmethod import torch.utils.data.dataloader import torch.nn.functional as F from torch import nn import torch.nn class SimilarityLoss(nn.Module): def __init__(self): super(SimilarityLoss, self).__init__() @abstractmethod def forward(self, inputs, targets): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from abc im...
OatsProduction/flair
PairwiseBCELoss
false
11,761
[ "MIT" ]
0
1cf2c9a9ae487e279dce9f6b92c41fa32c4563cf
https://github.com/OatsProduction/flair/tree/1cf2c9a9ae487e279dce9f6b92c41fa32c4563cf
import torch from abc import abstractmethod import torch.utils.data.dataloader import torch.nn.functional as F from torch import nn import torch.nn class SimilarityLoss(nn.Module): def __init__(self): super().__init__() @abstractmethod def forward(self, inputs, targets): pass class Mod...
RankingLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from abc import abstractmethod import torch.utils.data.dataloader import torch.nn.functional as F from torch import nn import torch.nn class SimilarityLoss(nn.Module): def __init__(self): super(SimilarityLoss, self).__init__() @abstractmethod def forward(self, inputs, targets): ...
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 abc import abstractmethod import torch.utils.data.dataloader from torch import nn im...
OatsProduction/flair
RankingLoss
false
11,762
[ "MIT" ]
0
1cf2c9a9ae487e279dce9f6b92c41fa32c4563cf
https://github.com/OatsProduction/flair/tree/1cf2c9a9ae487e279dce9f6b92c41fa32c4563cf
import torch from abc import abstractmethod import torch.utils.data.dataloader import torch.nn.functional as F from torch import nn import torch.nn class SimilarityLoss(nn.Module): def __init__(self): super().__init__() @abstractmethod def forward(self, inputs, targets): pass class Mod...
FrameAvgPool
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch import torch.nn.parallel import torch.nn as nn import torch.utils.data import torch.backends.cudnn class FrameAvgPool(nn.Module): def __init__(self, cfg): super(FrameAvgPool, self).__init__() input_size = cfg.INPUT_SIZE hidden_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 import torch.nn.parallel impo...
MicroTensor-ai/episodic-memory
FrameAvgPool
false
11,763
[ "MIT" ]
0
295a3752ab94c7a6f45355aa2c54bffbf84b574f
https://github.com/MicroTensor-ai/episodic-memory/tree/295a3752ab94c7a6f45355aa2c54bffbf84b574f
from _paritybench_helpers import _mock_config import torch import torch.nn.parallel import torch.nn as nn import torch.utils.data import torch.backends.cudnn class Model(nn.Module): def __init__(self, cfg): super().__init__() input_size = cfg.INPUT_SIZE hidden_size = cfg.HIDDEN_SIZE ...
RobertaClassificationHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from typing import Optional class RobertaClassificationHead(nn.Module): def __init__(self, num_classes, input_dim, inner_dim: 'Optional[int]'= None, dropout: 'float'=0.1, activation=nn.ReLU): super().__init__() if not inner_dim: inner_dim = i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn from ty...
NivekT/text
RobertaClassificationHead
false
11,764
[ "BSD-3-Clause" ]
0
4908d3c88f92296a4c23be2f064ccde13cce50ce
https://github.com/NivekT/text/tree/4908d3c88f92296a4c23be2f064ccde13cce50ce
import torch import torch.nn as nn from typing import Optional class Model(nn.Module): def __init__(self, num_classes, input_dim, inner_dim: 'Optional[int]'= None, dropout: 'float'=0.1, activation=nn.ReLU): super().__init__() if not inner_dim: inner_dim = input_dim sel...
SpatialGather_Module
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch._utils class SpatialGather_Module(nn.Module): """ Aggregate the context features according to the initial predicted probability distribution. Employ the soft-weighted method to aggregate the context. O...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
NikV-JS/semantic-segmentation
SpatialGather_Module
false
11,765
[ "BSD-3-Clause" ]
0
68fd9ddc5498590371f064c8bebb03ac80932766
https://github.com/NikV-JS/semantic-segmentation/tree/68fd9ddc5498590371f064c8bebb03ac80932766
import torch import torch.nn as nn import torch.nn.functional as F import torch._utils class Model(nn.Module): """ Aggregate the context features according to the initial predicted probability distribution. Employ the soft-weighted method to aggregate the context. Output: ...
TextProcessor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F def reset_parameters_util(model): pass class TextProcessor(nn.Module): """Processes sentence representations to the correct hidden dimension""" def __init__(self, desc_dim, hid_dim): super(Te...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 impor...
OfirShechter/NLPMultimodalGame
TextProcessor
false
11,766
[ "BSD-3-Clause" ]
0
79bd8476da0c2f3185ed7241932bc1165558917b
https://github.com/OfirShechter/NLPMultimodalGame/tree/79bd8476da0c2f3185ed7241932bc1165558917b
import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F def reset_parameters_util(model): pass class Model(nn.Module): """Processes sentence representations to the correct hidden dimension""" def __init__(self, desc_dim, hid_dim): super().__init__...
InnerProductDecoder
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.modules.loss class InnerProductDecoder(nn.Module): """Decoder for using inner product for prediction.""" def __init__(self, dropout, act=torch.sigmoid): super(InnerProductDecoder, self).__init__() self.dropout ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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.modules.loss assert_size_stride = torch._C...
PatriciaXiao/gae-pytorch
InnerProductDecoder
false
11,767
[ "MIT" ]
0
eb0e9bdf9a2f23d38941ac731bd481bd6da737b9
https://github.com/PatriciaXiao/gae-pytorch/tree/eb0e9bdf9a2f23d38941ac731bd481bd6da737b9
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.modules.loss class Model(nn.Module): """Decoder for using inner product for prediction.""" def __init__(self, dropout, act=torch.sigmoid): super().__init__() self.dropout = dropout self.act = act d...
ResidualConvUnit
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class ResidualConvUnit(nn.Module): """Residual convolution module. """ def __init__(self, features): """Init. Args: features (int): number of features """ super().__init__() self.conv1 = nn.Conv2d(features, 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 import torch.nn as nn assert_...
Northshoot/3d-photo-inpainting
ResidualConvUnit
false
11,768
[ "MIT" ]
0
49dd36ce4a277929831f09d978721b3fdb87eb25
https://github.com/Northshoot/3d-photo-inpainting/tree/49dd36ce4a277929831f09d978721b3fdb87eb25
import torch import torch.nn as nn class Model(nn.Module): """Residual convolution module. """ def __init__(self, features): """Init. Args: features (int): number of features """ super().__init__() self.conv1 = nn.Conv2d(features, features, kernel_size...
MultiheadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.utils.data from torch import nn from torch.nn import Parameter import torch.onnx.operators import torch.optim import torch.optim.lr_scheduler class MultiheadAttention(nn.Module): """Multi-headed attention. See "Attention Is All You Need" for more deta...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Novemser/fairseq
MultiheadAttention
false
11,769
[ "BSD-3-Clause" ]
0
b9e29a4711a6c0b7923879d5d59f3e879f0f228a
https://github.com/Novemser/fairseq/tree/b9e29a4711a6c0b7923879d5d59f3e879f0f228a
import torch import torch.nn.functional as F import torch.utils.data from torch import nn from torch.nn import Parameter import torch.onnx.operators import torch.optim import torch.optim.lr_scheduler class Model(nn.Module): """Multi-headed attention. See "Attention Is All You Need" for more details. """ ...
RewardEstimator
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F def reset_parameters_util(model): pass class RewardEstimator(nn.Module): """Estimates the reward the agent will receieved. Value used as a baseline in REINFORCE loss""" def __init__(self,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math import torch.util...
OfirShechter/NLPMultimodalGame
RewardEstimator
false
11,770
[ "BSD-3-Clause" ]
0
79bd8476da0c2f3185ed7241932bc1165558917b
https://github.com/OfirShechter/NLPMultimodalGame/tree/79bd8476da0c2f3185ed7241932bc1165558917b
import math import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F def reset_parameters_util(model): pass class Model(nn.Module): """Estimates the reward the agent will receieved. Value used as a baseline in REINFORCE loss""" def __init__(self, hid_dim):...
Encoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import 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, kernel_size, enc_dim, audio_channels): super(Encoder, self).__init__() self.conv1d_U = nn.Conv1d(audio_ch...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
PanagiotisP/demucs
Encoder
false
11,771
[ "MIT" ]
0
d115d0773ca08a081f5b6bfe274cf0e4ed9e2677
https://github.com/PanagiotisP/demucs/tree/d115d0773ca08a081f5b6bfe274cf0e4ed9e2677
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): """Estimation of the nonnegative mixture weight by a 1-D conv layer. """ def __init__(self, kernel_size, enc_dim, audio_channels): super().__init__() self.conv1d_U = nn.Conv1d(audio_channels, enc_dim...
PartialConv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch 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 init_type == 'gaussian': ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.a...
Northshoot/3d-photo-inpainting
PartialConv
false
11,772
[ "MIT" ]
0
49dd36ce4a277929831f09d978721b3fdb87eb25
https://github.com/Northshoot/3d-photo-inpainting/tree/49dd36ce4a277929831f09d978721b3fdb87eb25
import math import torch 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 init_type == 'gaussian': ...
Baseline
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils.data import torch import torch.nn as nn class Baseline(nn.Module): """Baseline """ def __init__(self, hid_dim, x_dim, binary_dim, inp_dim): super(Baseline, self).__init__() self.x_dim = x_dim self.binary_dim = binary_dim self.inp_dim = inp_d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.utils.data impor...
OfirShechter/NLPMultimodalGame
Baseline
false
11,773
[ "BSD-3-Clause" ]
0
79bd8476da0c2f3185ed7241932bc1165558917b
https://github.com/OfirShechter/NLPMultimodalGame/tree/79bd8476da0c2f3185ed7241932bc1165558917b
import torch import torch.utils.data import torch import torch.nn as nn class Model(nn.Module): """Baseline """ def __init__(self, hid_dim, x_dim, binary_dim, inp_dim): super().__init__() self.x_dim = x_dim self.binary_dim = binary_dim self.inp_dim = inp_dim self.h...
CanineSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch from torch import nn import torch.utils.checkpoint class CanineSelfAttention(nn.Module): def __init__(self, config): super().__init__() if (config.hidden_size % config.num_attention_heads != 0 and not hasattr(confi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Clemens123/transformers
CanineSelfAttention
false
11,774
[ "Apache-2.0" ]
0
22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
from _paritybench_helpers import _mock_config import math import torch from torch import nn import torch.utils.checkpoint class Model(nn.Module): def __init__(self, config): super().__init__() if (config.hidden_size % config.num_attention_heads != 0 and not hasattr(config, 'embedding_...
ResidualBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.nn.functional as F class ResidualBlock(nn.Module): """ Residual block from R2D3/IMPALA Taken from [1,2] """ def __init__(self, num_channels, first_conv_weight_scale): super().__init__() self.conv1 = nn.Conv2d(num_channels, num_channe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
Oliver-Tautz/minecraft-bc-2020
ResidualBlock
false
11,775
[ "MIT" ]
0
d18ba1c1afbf92f897e4bbe70c2c71292510f928
https://github.com/Oliver-Tautz/minecraft-bc-2020/tree/d18ba1c1afbf92f897e4bbe70c2c71292510f928
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): """ Residual block from R2D3/IMPALA Taken from [1,2] """ def __init__(self, num_channels, first_conv_weight_scale): super().__init__() self.conv1 = nn.Conv2d(num_channels, num_channels, kern...
OutConv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class OutConv(nn.Module): def __init__(self, in_channels, out_channels): super(OutConv, self).__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1) self.softmax = nn.Softmax(dim=1) def forward(self, x): tmp = self.conv(x...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Orelbenr/acoustic-fencing
OutConv
false
11,776
[ "MIT" ]
0
2d8c6121c915d2f12fae3c9d776e6339f028e35a
https://github.com/Orelbenr/acoustic-fencing/tree/2d8c6121c915d2f12fae3c9d776e6339f028e35a
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channels, out_channels): super().__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1) self.softmax = nn.Softmax(dim=1) def forward(self, x): tmp = self.conv(x) retur...
GraphConvolution
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn.modules.loss class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __init__(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module i...
PatriciaXiao/gae-pytorch
GraphConvolution
false
11,777
[ "MIT" ]
0
eb0e9bdf9a2f23d38941ac731bd481bd6da737b9
https://github.com/PatriciaXiao/gae-pytorch/tree/eb0e9bdf9a2f23d38941ac731bd481bd6da737b9
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn.modules.loss class Model(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __init__(self, in_fe...
GCNModelVAE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn as nn import torch.nn.modules.loss class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
PatriciaXiao/gae-pytorch
GCNModelVAE
false
11,778
[ "MIT" ]
0
eb0e9bdf9a2f23d38941ac731bd481bd6da737b9
https://github.com/PatriciaXiao/gae-pytorch/tree/eb0e9bdf9a2f23d38941ac731bd481bd6da737b9
from torch.nn import Module import torch import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter import torch.nn as nn import torch.nn.modules.loss class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 ...
BothContextGate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.cuda import torch.distributed class ContextGate(nn.Module): """ Context gate is a decoder module that takes as input the previous word embedding, the current decoder state and the attention state, and produces a gate. The gate can be used to select 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 from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
PiescesHusky/OpenNMT-py
BothContextGate
false
11,779
[ "MIT" ]
0
7276cf94f989c50b3169742f64e64142897d1ec0
https://github.com/PiescesHusky/OpenNMT-py/tree/7276cf94f989c50b3169742f64e64142897d1ec0
import torch import torch.nn as nn import torch.cuda import torch.distributed class ContextGate(nn.Module): """ Context gate is a decoder module that takes as input the previous word embedding, the current decoder state and the attention state, and produces a gate. The gate can be used to select t...
ContextGate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.cuda import torch.distributed class ContextGate(nn.Module): """ Context gate is a decoder module that takes as input the previous word embedding, the current decoder state and the attention state, and produces a gate. The gate can be used to select 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.cuda import torch.distributed assert_size_str...
PiescesHusky/OpenNMT-py
ContextGate
false
11,780
[ "MIT" ]
0
7276cf94f989c50b3169742f64e64142897d1ec0
https://github.com/PiescesHusky/OpenNMT-py/tree/7276cf94f989c50b3169742f64e64142897d1ec0
import torch import torch.nn as nn import torch.cuda import torch.distributed class Model(nn.Module): """ Context gate is a decoder module that takes as input the previous word embedding, the current decoder state and the attention state, and produces a gate. The gate can be used to select the inp...
TargetContextGate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.cuda import torch.distributed class ContextGate(nn.Module): """ Context gate is a decoder module that takes as input the previous word embedding, the current decoder state and the attention state, and produces a gate. The gate can be used to select 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 from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
PiescesHusky/OpenNMT-py
TargetContextGate
false
11,781
[ "MIT" ]
0
7276cf94f989c50b3169742f64e64142897d1ec0
https://github.com/PiescesHusky/OpenNMT-py/tree/7276cf94f989c50b3169742f64e64142897d1ec0
import torch import torch.nn as nn import torch.cuda import torch.distributed class ContextGate(nn.Module): """ Context gate is a decoder module that takes as input the previous word embedding, the current decoder state and the attention state, and produces a gate. The gate can be used to select t...
SourceContextGate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.cuda import torch.distributed class ContextGate(nn.Module): """ Context gate is a decoder module that takes as input the previous word embedding, the current decoder state and the attention state, and produces a gate. The gate can be used to select 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 from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
PiescesHusky/OpenNMT-py
SourceContextGate
false
11,782
[ "MIT" ]
0
7276cf94f989c50b3169742f64e64142897d1ec0
https://github.com/PiescesHusky/OpenNMT-py/tree/7276cf94f989c50b3169742f64e64142897d1ec0
import torch import torch.nn as nn import torch.cuda import torch.distributed class ContextGate(nn.Module): """ Context gate is a decoder module that takes as input the previous word embedding, the current decoder state and the attention state, and produces a gate. The gate can be used to select t...
relu
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F from torch import nn class relu(nn.Module): def forward(self, x): return F.relu(x, inplace=True) 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 from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride @t...
PistonY/MobileNetV3.pytorch
relu
false
11,783
[ "MIT" ]
0
9dc56359247d8a63a9a392bb51183ba0f8a94f33
https://github.com/PistonY/MobileNetV3.pytorch/tree/9dc56359247d8a63a9a392bb51183ba0f8a94f33
import torch import torch.nn.functional as F from torch import nn class Model(nn.Module): def forward(self, x): return F.relu(x, inplace=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Hswish
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F from itertools import product as product class Hswish(nn.Module): def __init__(self, inplace=True): super(Hswish, self).__init__() self.inplace = inplace def forward(self, x): return x * F.relu6(x + 3.0, inplace=self....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn from itertools import product as product assert_size_stride = torch...
PoWeiChiao/3DDFA_V2
Hswish
false
11,784
[ "MIT" ]
0
5b4ae883705a1f5b1f15c19203bedbd47fc8a832
https://github.com/PoWeiChiao/3DDFA_V2/tree/5b4ae883705a1f5b1f15c19203bedbd47fc8a832
import torch import torch.nn as nn import torch.nn.functional as F from itertools import product as product class Model(nn.Module): def __init__(self, inplace=True): super().__init__() self.inplace = inplace def forward(self, x): return x * F.relu6(x + 3.0, inplace=self.inplace) / 6....
ConvReLUNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F from torch import nn import torch.utils.data import torch.optim class ConvReLUNorm(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, dropout=0.0): super(ConvReLUNorm, self).__init__() self.conv = nn.Conv1d(in_channels, out_c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
PiotrDabkowski/NeMo
ConvReLUNorm
false
11,785
[ "Apache-2.0" ]
0
7c251e9035b24136cf130f3caf760087e5ccf07c
https://github.com/PiotrDabkowski/NeMo/tree/7c251e9035b24136cf130f3caf760087e5ccf07c
import torch from torch.nn import functional as F from torch import nn import torch.utils.data import torch.optim class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, dropout=0.0): super().__init__() self.conv = nn.Conv1d(in_channels, out_channels, kernel_size= ...
LayerNorm1D
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class LayerNorm1D(nn.Module): def __init__(self, num_outputs, eps=1e-05, affine=True): super(LayerNorm1D, self).__init__() self.eps = eps self.weight = nn.Parameter(torch.ones(1, num_outputs)) self.bias = nn.Parameter(torch.zeros(1, num_outputs))...
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_...
Pluriscient/learn-to-learn
LayerNorm1D
false
11,786
[ "MIT" ]
0
4aa0143522eb90f6439b83ed424d12b434cb344b
https://github.com/Pluriscient/learn-to-learn/tree/4aa0143522eb90f6439b83ed424d12b434cb344b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_outputs, eps=1e-05, affine=True): super().__init__() self.eps = eps self.weight = nn.Parameter(torch.ones(1, num_outputs)) self.bias = nn.Parameter(torch.zeros(1, num_outputs)) def forward(self,...
FC1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class FC1(nn.Module): def __init__(self, nInput, activate, weight): super(FC1, self).__init__() self.nInput = nInput self.fc1 = nn.Linear(self.nInput, self.nInput * 2) self.fc2 = nn.Linear(self.nInput * 2, self.nInput) self.fc3 = nn.Linea...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
Po-Chun-Chien/LUT-Net
FC1
false
11,787
[ "MIT" ]
0
413559027980db2585d939cd4a514a172b62f57d
https://github.com/Po-Chun-Chien/LUT-Net/tree/413559027980db2585d939cd4a514a172b62f57d
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, nInput, activate, weight): super().__init__() self.nInput = nInput self.fc1 = nn.Linear(self.nInput, self.nInput * 2) self.fc2 = nn.Linear(self.nInput * 2, self.nInput) self.fc3 = nn.Linear(self....
DecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F def scaled_dot_product_attention(query, keys, values, mask=None): d_k = keys.shape[-1] dot_score = query @ keys.transpose(-2, -1) / math.sqrt(d_k) if mask is not None: dot_score = dot_score.masked_fill(mask == 0, -10000...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
NathanYanJing/TransformerReplication
DecoderLayer
false
11,788
[ "MIT" ]
0
b20f987dcc507724971f843c2d214c9c76bd8e34
https://github.com/NathanYanJing/TransformerReplication/tree/b20f987dcc507724971f843c2d214c9c76bd8e34
import math import torch import torch.nn as nn import torch.nn.functional as F def scaled_dot_product_attention(query, keys, values, mask=None): d_k = keys.shape[-1] dot_score = query @ keys.transpose(-2, -1) / math.sqrt(d_k) if mask is not None: dot_score = dot_score.masked_fill(mask == 0, -10000...
MaskedInstanceNorm1d
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn import torch.utils.data import torch.optim class MaskedInstanceNorm1d(nn.Module): """Instance norm + masking.""" MAX_CNT = 100000.0 def __init__(self, d_channel: 'int', unbiased: 'bool'=True, affine: 'bool'=False): super().__init__() self.d_channe...
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 import ...
PiotrDabkowski/NeMo
MaskedInstanceNorm1d
false
11,789
[ "Apache-2.0" ]
0
7c251e9035b24136cf130f3caf760087e5ccf07c
https://github.com/PiotrDabkowski/NeMo/tree/7c251e9035b24136cf130f3caf760087e5ccf07c
import torch from torch import nn import torch.utils.data import torch.optim class Model(nn.Module): """Instance norm + masking.""" MAX_CNT = 100000.0 def __init__(self, d_channel: 'int', unbiased: 'bool'=True, affine: 'bool'=False): super().__init__() self.d_channel = d_channel ...
Model_CIFAR10
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Model_CIFAR10(nn.Module): def __init__(self): super(Model_CIFAR10, self).__init__() self.linear1 = nn.Linear(32 * 32, 50) self.linear2 = nn.Linear(50, 10) def forward(self, inputs): x = inputs.view(-1, 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._inductor.runtime....
Pluriscient/learn-to-learn
Model_CIFAR10
false
11,790
[ "MIT" ]
0
4aa0143522eb90f6439b83ed424d12b434cb344b
https://github.com/Pluriscient/learn-to-learn/tree/4aa0143522eb90f6439b83ed424d12b434cb344b
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.linear1 = nn.Linear(32 * 32, 50) self.linear2 = nn.Linear(50, 10) def forward(self, inputs): x = inputs.view(-1, 32 * 32) x = F.relu(...
TransformerDecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn.functional as F from torch import nn def _normalize(tensor, norm_layer): """ Broadcast layer norm """ size = tensor.size() return norm_layer(tensor.view(-1, size[-1])).view(size) class MultiHeadAttention(nn.Module): def __init__(self, n_heads, dim, d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
OneDirection9/Persona-Dialogue-Generation
TransformerDecoderLayer
false
11,791
[ "MIT" ]
0
9696659efe668177bb775dc4192b4b6dd41a9ce1
https://github.com/OneDirection9/Persona-Dialogue-Generation/tree/9696659efe668177bb775dc4192b4b6dd41a9ce1
import math import torch import torch.nn.functional as F from torch import nn def _normalize(tensor, norm_layer): """ Broadcast layer norm """ size = tensor.size() return norm_layer(tensor.view(-1, size[-1])).view(size) class MultiHeadAttention(nn.Module): def __init__(self, n_heads, dim, d...
TransformerEncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn.functional as F from torch import nn def _normalize(tensor, norm_layer): """ Broadcast layer norm """ size = tensor.size() return norm_layer(tensor.view(-1, size[-1])).view(size) class MultiHeadAttention(nn.Module): def __init__(self, n_heads, dim, d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
OneDirection9/Persona-Dialogue-Generation
TransformerEncoderLayer
false
11,792
[ "MIT" ]
0
9696659efe668177bb775dc4192b4b6dd41a9ce1
https://github.com/OneDirection9/Persona-Dialogue-Generation/tree/9696659efe668177bb775dc4192b4b6dd41a9ce1
import math import torch import torch.nn.functional as F from torch import nn def _normalize(tensor, norm_layer): """ Broadcast layer norm """ size = tensor.size() return norm_layer(tensor.view(-1, size[-1])).view(size) class MultiHeadAttention(nn.Module): def __init__(self, n_heads, dim, d...
DeiTEmbeddings
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import collections import torch from torch import nn import torch.utils.checkpoint import collections.abc def to_2tuple(x): if isinstance(x, collections.abc.Iterable): return x return x, x class PatchEmbeddings(nn.Module): """ Image to Patch Embe...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 collections from torch import nn import torch.utils.checkpoint import col...
Clemens123/transformers
DeiTEmbeddings
false
11,793
[ "Apache-2.0" ]
0
22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
from _paritybench_helpers import _mock_config import collections import torch from torch import nn import torch.utils.checkpoint import collections.abc def to_2tuple(x): if isinstance(x, collections.abc.Iterable): return x return x, x class PatchEmbeddings(nn.Module): """ Image to Patch Embe...
Model
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super(Model, self).__init__() self.linear1 = nn.Linear(28 * 28, 32) self.linear2 = nn.Linear(32, 10) def forward(self, inputs): x = inputs.view(-1, 28 * 28) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Pluriscient/learn-to-learn
Model
false
11,794
[ "MIT" ]
0
4aa0143522eb90f6439b83ed424d12b434cb344b
https://github.com/Pluriscient/learn-to-learn/tree/4aa0143522eb90f6439b83ed424d12b434cb344b
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super(Model, self).__init__() self.linear1 = nn.Linear(28 * 28, 32) self.linear2 = nn.Linear(32, 10) def forward(self, inputs): x = inputs.view(-1, 28 * 28) ...
LxmertAttentionOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class LxmertAttentionOutput(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.LayerNorm = nn.LayerNorm...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Clemens123/transformers
LxmertAttentionOutput
false
11,795
[ "Apache-2.0" ]
0
22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class Model(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.LayerNorm = nn.LayerNorm(config.hidden_s...
ResidualBlock
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class ResidualBlock(nn.Module): def __init__(self, in_channels, out_channels): super().__init__() self.in_channels, self.out_channels = in_channels, out_channels self.blocks = nn.Identity() self.shortcut = nn.Identity() 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit def triton_poi_fused_add_0(in_ptr0, out_...
Rachneet/amc-app
ResidualBlock
false
11,796
[ "MIT" ]
0
20b586608d454a3033333e285f0dbc91e5c6e07f
https://github.com/Rachneet/amc-app/tree/20b586608d454a3033333e285f0dbc91e5c6e07f
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channels, out_channels): super().__init__() self.in_channels, self.out_channels = in_channels, out_channels self.blocks = nn.Identity() self.shortcut = nn.Identity() def forward(self, x): ...
StyleResidual
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.utils.data import torch.optim class StyleResidual(nn.Module): """Styling.""" def __init__(self, d_channel: 'int', d_style: 'int', kernel_size: 'int'=1): super().__init__() self.rs = nn.Conv1d(in_channels=d_style, out_channels=d_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 import nn import torch.utils.data import torch.optim assert_size_stri...
PiotrDabkowski/NeMo
StyleResidual
false
11,797
[ "Apache-2.0" ]
0
7c251e9035b24136cf130f3caf760087e5ccf07c
https://github.com/PiotrDabkowski/NeMo/tree/7c251e9035b24136cf130f3caf760087e5ccf07c
import torch from torch import nn import torch.utils.data import torch.optim class Model(nn.Module): """Styling.""" def __init__(self, d_channel: 'int', d_style: 'int', kernel_size: 'int'=1): super().__init__() self.rs = nn.Conv1d(in_channels=d_style, out_channels=d_channel, kerne...
MultiHeadAttn
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F from torch import nn import torch.utils.data import torch.optim class MultiHeadAttn(nn.Module): def __init__(self, n_head, d_model, d_head, dropout, dropatt=0.1, pre_lnorm=False): super(MultiHeadAttn, self).__init__() self.n_head = n_head ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
PiotrDabkowski/NeMo
MultiHeadAttn
false
11,798
[ "Apache-2.0" ]
0
7c251e9035b24136cf130f3caf760087e5ccf07c
https://github.com/PiotrDabkowski/NeMo/tree/7c251e9035b24136cf130f3caf760087e5ccf07c
import torch from torch.nn import functional as F from torch import nn import torch.utils.data import torch.optim class Model(nn.Module): def __init__(self, n_head, d_model, d_head, dropout, dropatt=0.1, pre_lnorm=False): super().__init__() self.n_head = n_head self.d_model = d_mo...
Decoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch from torch import nn def overlap_and_add(signal, frame_step): outer_dimensions = signal.size()[:-2] frames, frame_length = signal.size()[-2:] subframe_length = math.gcd(frame_length, frame_step) subframe_step = frame_step // subframe_length subframes_per_frame = frame_leng...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
PanagiotisP/demucs
Decoder
false
11,799
[ "MIT" ]
0
d115d0773ca08a081f5b6bfe274cf0e4ed9e2677
https://github.com/PanagiotisP/demucs/tree/d115d0773ca08a081f5b6bfe274cf0e4ed9e2677
import math import torch from torch import nn def overlap_and_add(signal, frame_step): outer_dimensions = signal.size()[:-2] frames, frame_length = signal.size()[-2:] subframe_length = math.gcd(frame_length, frame_step) subframe_step = frame_step // subframe_length subframes_per_frame = frame_leng...
FusedLeakyReLU
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import functional as F def fused_leaky_relu(input, bias=None, negative_slope=0.2, scale=2 ** 0.5): if bias is not None: rest_dim = [1] * (input.ndim - bias.ndim - 1) return F.leaky_relu(input + bias.view(1, bias.shape[0], *rest_dim), nega...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn from torch.nn import functional as F assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda...
RaghavaDhanya/stylegan2-pytorch
FusedLeakyReLU
false
11,800
[ "MIT", "BSD-2-Clause", "Apache-2.0" ]
0
6a2b0c228c56830a7e669bc66dc92073d3c81ca8
https://github.com/RaghavaDhanya/stylegan2-pytorch/tree/6a2b0c228c56830a7e669bc66dc92073d3c81ca8
import torch from torch import nn from torch.nn import functional as F def fused_leaky_relu(input, bias=None, negative_slope=0.2, scale=2 ** 0.5): if bias is not None: rest_dim = [1] * (input.ndim - bias.ndim - 1) return F.leaky_relu(input + bias.view(1, bias.shape[0], *rest_dim), nega...
Model_CIFAR10_CNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Model_CIFAR10_CNN(nn.Module): def __init__(self): super(Model_CIFAR10_CNN, self).__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = 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....
Pluriscient/learn-to-learn
Model_CIFAR10_CNN
false
11,801
[ "MIT" ]
0
4aa0143522eb90f6439b83ed424d12b434cb344b
https://github.com/Pluriscient/learn-to-learn/tree/4aa0143522eb90f6439b83ed424d12b434cb344b
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = nn.Linear(16 * 5 * 5, 120) s...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): def __init__(self, embed_dim, hidden_dim=None, out_dim=None, n_head=1, score_function='dot_product', dropout=0): """ Attention Mechanism :param embed_dim: :param hidden_dim: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
RaleLee/conv-emotion
Attention
false
11,802
[ "MIT" ]
0
1b07223cbdfd52eb31e913e982d18ff1ed3daf08
https://github.com/RaleLee/conv-emotion/tree/1b07223cbdfd52eb31e913e982d18ff1ed3daf08
import math import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, embed_dim, hidden_dim=None, out_dim=None, n_head=1, score_function='dot_product', dropout=0): """ Attention Mechanism :param embed_dim: :param hidden_dim: ...
SoftmaxOutputLayer
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class OutputLayer(nn.Module): """ Abstract base class for output layer. Handles projection to output labels """ def __init__(self, hidden_size, output_size): super(OutputLayer, self).__init__() self.output_size = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Ravikiran2402/_MOEL
SoftmaxOutputLayer
false
11,803
[ "MIT" ]
0
57e311712c67e1e554a3a9187709f8e2728d19be
https://github.com/Ravikiran2402/_MOEL/tree/57e311712c67e1e554a3a9187709f8e2728d19be
import torch import torch.nn as nn import torch.nn.functional as F class OutputLayer(nn.Module): """ Abstract base class for output layer. Handles projection to output labels """ def __init__(self, hidden_size, output_size): super().__init__() self.output_size = output_size ...
Net1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim class Net1(nn.Module): def __init__(self): super(Net1, self).__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1) self.conv2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
RadhikaB-97/deep-learning-containers
Net1
false
11,804
[ "Apache-2.0" ]
0
85ad01742613401f42908d75bb4ca23d11895f6c
https://github.com/RadhikaB-97/deep-learning-containers/tree/85ad01742613401f42908d75bb4ca23d11895f6c
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1) self.conv2 = nn.Con...
Conv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class Conv(nn.Module): """ Convenience class that does padding and convolution for inputs in the format [batch_size, sequence length, hidden size] """ def __init__(self, input_size, output_size, kernel_size, pad_type): """ Parameters: ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
Ravikiran2402/_MOEL
Conv
false
11,805
[ "MIT" ]
0
57e311712c67e1e554a3a9187709f8e2728d19be
https://github.com/Ravikiran2402/_MOEL/tree/57e311712c67e1e554a3a9187709f8e2728d19be
import torch import torch.nn as nn class Model(nn.Module): """ Convenience class that does padding and convolution for inputs in the format [batch_size, sequence length, hidden size] """ def __init__(self, input_size, output_size, kernel_size, pad_type): """ Parameters: ...
BertSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn import torch.nn.functional as F class BertSelfAttention(nn.Module): def __init__(self, config): super().__init__() self.num_attention_heads = config.num_attention_heads self.attention_head_size = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Abhimanyu08/minbert-assignment
BertSelfAttention
false
11,806
[ "Apache-2.0" ]
0
1610364213b1aab2d5446175dffabd7e1742833b
https://github.com/Abhimanyu08/minbert-assignment/tree/1610364213b1aab2d5446175dffabd7e1742833b
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, config): super().__init__() self.num_attention_heads = config.num_attention_heads self.attention_head_size = int(config.h...
FunnelClassificationHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class FunnelClassificationHead(nn.Module): def __init__(self, config, n_labels): super().__init__() self.linear_hidden = nn.Linear(config.d_model, config.d_model) self.dropout = 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.triton_helpers import libdevice from torch import n...
Clemens123/transformers
FunnelClassificationHead
false
11,807
[ "Apache-2.0" ]
0
22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class Model(nn.Module): def __init__(self, config, n_labels): super().__init__() self.linear_hidden = nn.Linear(config.d_model, config.d_model) self.dropout = nn.Dropout(config.hi...
Sine
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch.nn as nn class Sine(nn.Module): def __init(self): super().__init__() def forward(self, input): return torch.sin(30 * input) 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 import torch.utils.data import torch.nn as nn assert_size_stride = torch....
RisingStockPrices/sirenized-deepsdf
Sine
false
11,808
[ "MIT" ]
0
c0fb33e26b6bf0753c02adc5186af344e40a6d04
https://github.com/RisingStockPrices/sirenized-deepsdf/tree/c0fb33e26b6bf0753c02adc5186af344e40a6d04
import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init(self): super().__init__() def forward(self, input): return torch.sin(30 * input) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class SimpleAttention(nn.Module): def __init__(self, input_dim): super(SimpleAttention, self).__init__() self.input_dim = input_dim self.scalar = nn.Linear(self.input_dim, 1, bias=False) def forward(self, M, x=None): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
RaleLee/conv-emotion
SimpleAttention
false
11,809
[ "MIT" ]
0
1b07223cbdfd52eb31e913e982d18ff1ed3daf08
https://github.com/RaleLee/conv-emotion/tree/1b07223cbdfd52eb31e913e982d18ff1ed3daf08
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_dim): super().__init__() self.input_dim = input_dim self.scalar = nn.Linear(self.input_dim, 1, bias=False) def forward(self, M, x=None): """ M -> (seq_l...
act_model
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import random import torch import numpy as np import torch.nn as nn import torch.optim as optim from collections import deque class act_model(nn.Module): def __init__(self, inp, hidden, output): super(act_model, self).__init__() self.fc1 = nn.Linear(inp, hidden, bias=True) self.fc2 = nn.L...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import random import numpy as np import torch.nn as nn import torch.optim as opt...
RedRyan111/deep-q-learning
act_model
false
11,811
[ "MIT" ]
0
1c032b9d4ee8ace8002d6ac4b6f4c54987ed8fc1
https://github.com/RedRyan111/deep-q-learning/tree/1c032b9d4ee8ace8002d6ac4b6f4c54987ed8fc1
import random import torch import numpy as np import torch.nn as nn import torch.optim as optim from collections import deque class Model(nn.Module): def __init__(self, inp, hidden, output): super().__init__() self.fc1 = nn.Linear(inp, hidden, bias=True) self.fc2 = nn.Linear(hidden, hidde...
PointWiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch class PointWiseFeedForward(torch.nn.Module): def __init__(self, hidden_units, dropout_rate): super(PointWiseFeedForward, self).__init__() self.conv1 = torch.nn.Conv1d(hidden_units, hidden_units, kernel_size=1) self.dropout1 = torch.nn.Dropout(p=dropout_rate) self.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...
RenqinSS/RecSys
PointWiseFeedForward
false
11,812
[ "MIT" ]
0
932d54e47af79576b67e28364ae6e97d99ededf4
https://github.com/RenqinSS/RecSys/tree/932d54e47af79576b67e28364ae6e97d99ededf4
import torch class Model(torch.nn.Module): def __init__(self, hidden_units, dropout_rate): super().__init__() self.conv1 = torch.nn.Conv1d(hidden_units, hidden_units, kernel_size=1) self.dropout1 = torch.nn.Dropout(p=dropout_rate) self.relu = torch.nn.ReLU() self.conv2 = t...
MegatronBertOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class MegatronBertOutput(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.intermediate_size, config.hidden_size) self.dropout = nn.Dropout(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.utils.checkpoint assert_size_stride = torch._C...
Clemens123/transformers
MegatronBertOutput
false
11,813
[ "Apache-2.0" ]
0
22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class Model(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.intermediate_size, config.hidden_size) self.dropout = nn.Dropout(config.hidden...
DeiTOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class DeiTOutput(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.intermediate_size, config.hidden_size) self.dropout = nn.Dropout(config.h...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.utils.checkpoint assert_size_stride = torch._C...
Clemens123/transformers
DeiTOutput
false
11,814
[ "Apache-2.0" ]
0
22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.checkpoint class Model(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.intermediate_size, config.hidden_size) self.dropout = nn.Dropout(config.hidden...