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
BasicModel_ConvNet_MaxPool1d
# 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 Tensor import torch.nn as nn from typing import no_type_check class BasicModel_ConvNet_MaxPool1d(nn.Module): """Same as above, but with the MaxPool2d replaced with a MaxPool1d. This is useful because the MaxPool modules behave differently to other modules from the perspectiv...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
YNNEKUW/captum
BasicModel_ConvNet_MaxPool1d
false
12,015
[ "BSD-3-Clause" ]
0
c8b5357b21f2ddf440e5f0ce25635977292aa5d1
https://github.com/YNNEKUW/captum/tree/c8b5357b21f2ddf440e5f0ce25635977292aa5d1
import torch from torch import Tensor import torch.nn as nn from typing import no_type_check class Model(nn.Module): """Same as above, but with the MaxPool2d replaced with a MaxPool1d. This is useful because the MaxPool modules behave differently to other modules from the perspective of the DeepLift A...
BasicModel3
# 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 BasicModel3(nn.Module): """ Example model two from the paper https://arxiv.org/pdf/1703.01365.pdf f(x1, x2) = RELU(ReLU(x1 - 1) - ReLU(x2)) """ def __init__(self) ->None: super().__init__() 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 import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
YNNEKUW/captum
BasicModel3
false
12,016
[ "BSD-3-Clause" ]
0
c8b5357b21f2ddf440e5f0ce25635977292aa5d1
https://github.com/YNNEKUW/captum/tree/c8b5357b21f2ddf440e5f0ce25635977292aa5d1
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Example model two from the paper https://arxiv.org/pdf/1703.01365.pdf f(x1, x2) = RELU(ReLU(x1 - 1) - ReLU(x2)) """ def __init__(self) ->None: super().__init__() def forward(self, inpu...
make_style
# 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 make_style(nn.Module): def __init__(self): super().__init__() self.flatten = nn.Flatten() def forward(self, x0): style = F.avg_pool2d(x0, kernel_size=(x0.shape[-2], x0.shape[-1])) style = self.flatten(st...
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_...
YinuoJin/cellpose
make_style
false
12,017
[ "BSD-3-Clause" ]
0
eb8df70f295ac8465633f468d487aee1dd13a181
https://github.com/YinuoJin/cellpose/tree/eb8df70f295ac8465633f468d487aee1dd13a181
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.flatten = nn.Flatten() def forward(self, x0): style = F.avg_pool2d(x0, kernel_size=(x0.shape[-2], x0.shape[-1])) style = self.flatten(style) ...
PositionwiseFeedForward
# 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 LayerNormalization(nn.Module): """ Layer normalization module """ def __init__(self, d_hid, eps=0.001): super(LayerNormalization, self).__init__() self.eps = eps self.a_2 = nn.Parameter(torch.ones(d_hid), requires_grad=True) self.b_2 = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
YunjieJi/attention-is-all-you-need-pytorch
PositionwiseFeedForward
false
12,018
[ "MIT" ]
0
636117b438d584ccba0ae5d6998fc02f3888f46e
https://github.com/YunjieJi/attention-is-all-you-need-pytorch/tree/636117b438d584ccba0ae5d6998fc02f3888f46e
import torch import torch.nn as nn class LayerNormalization(nn.Module): """ Layer normalization module """ def __init__(self, d_hid, eps=0.001): super().__init__() self.eps = eps self.a_2 = nn.Parameter(torch.ones(d_hid), requires_grad=True) self.b_2 = nn.Parameter(torch.zeros...
NormLayer
# 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 NormLayer(nn.Module): def __init__(self, mean, std, n=None, eps=1e-08) ->None: super().__init__() self.mean = mean self.std = std self.eps = eps def forward(self, x): return (x - self.mean) / (self.std + self.eps) def get_inp...
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...
YNNEKUW/captum
NormLayer
false
12,019
[ "BSD-3-Clause" ]
0
c8b5357b21f2ddf440e5f0ce25635977292aa5d1
https://github.com/YNNEKUW/captum/tree/c8b5357b21f2ddf440e5f0ce25635977292aa5d1
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, mean, std, n=None, eps=1e-08) ->None: super().__init__() self.mean = mean self.std = std self.eps = eps def forward(self, x): return (x - self.mean) / (self.std + self.eps) def get_inputs(...
WingLoss
# 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 class WingLoss(nn.Module): """Wing Loss 'Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks' Feng et al. CVPR'2018. Args: omega (float), epsilon (float) are hyper-parameters. use_target_weight (bool): Option ...
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 torch.nn as nn assert_size_stride = torch._C._dynamo.g...
ZephyrII/mmpose_charger
WingLoss
false
12,020
[ "Apache-2.0" ]
0
ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
https://github.com/ZephyrII/mmpose_charger/tree/ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
import math import torch import torch.nn as nn class Model(nn.Module): """Wing Loss 'Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks' Feng et al. CVPR'2018. Args: omega (float), epsilon (float) are hyper-parameters. use_target_weight (bool): Option to ...
ExtResNetBlock
# 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 def conv3d(in_channels, out_channels, kernel_size, bias, padding): return nn.Conv3d(in_channels, out_channels, kernel_size, padding= padding, bias=bias) def create_conv(in_channels, out_channels, kernel_size, order, num_groups, padding): """ Create a list of...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
YinanZYN/pytorch-3dunet
ExtResNetBlock
false
12,021
[ "MIT" ]
0
d1494f421a836af54c3dde65c54e3e62d5c00800
https://github.com/YinanZYN/pytorch-3dunet/tree/d1494f421a836af54c3dde65c54e3e62d5c00800
import torch from torch import nn def conv3d(in_channels, out_channels, kernel_size, bias, padding): return nn.Conv3d(in_channels, out_channels, kernel_size, padding= padding, bias=bias) def create_conv(in_channels, out_channels, kernel_size, order, num_groups, padding): """ Create a list of...
Conv2dBlock
# 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 def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-05, affine=True): super(LayerNorm, self).__init__() self.num_features = num_features self....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
YueZHOU0926/MUNIT_3D
Conv2dBlock
false
12,022
[ "MIT" ]
0
5cb22b5f3cb127d5b2c4eea038254a7881bab372
https://github.com/YueZHOU0926/MUNIT_3D/tree/5cb22b5f3cb127d5b2c4eea038254a7881bab372
import torch from torch import nn import torch.nn.functional as F def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-05, affine=True): super().__init__() self.num_features = num_features self.affine = affine...
BCELoss
# 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 BCELoss(nn.Module): """Binary Cross Entropy loss.""" def __init__(self, use_target_weight=False, loss_weight=1.0): super().__init__() self.criterion = F.binary_cross_entropy self.use_target_weight = use_target_we...
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...
ZephyrII/mmpose_charger
BCELoss
false
12,023
[ "Apache-2.0" ]
0
ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
https://github.com/ZephyrII/mmpose_charger/tree/ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Binary Cross Entropy loss.""" def __init__(self, use_target_weight=False, loss_weight=1.0): super().__init__() self.criterion = F.binary_cross_entropy self.use_target_weight = use_target_weig...
CombinedTargetMSELoss
# 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 CombinedTargetMSELoss(nn.Module): """MSE loss for combined target. CombinedTarget: The combination of classification target (response map) and regression target (offset map). Paper ref: Huang et al. The Devil is in the Details: Delving into ...
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...
ZephyrII/mmpose_charger
CombinedTargetMSELoss
false
12,024
[ "Apache-2.0" ]
0
ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
https://github.com/ZephyrII/mmpose_charger/tree/ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
import torch import torch.nn as nn class Model(nn.Module): """MSE loss for combined target. CombinedTarget: The combination of classification target (response map) and regression target (offset map). Paper ref: Huang et al. The Devil is in the Details: Delving into Unbiased Data Pr...
FCDiscriminator
# 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 FCDiscriminator(nn.Module): def __init__(self, num_classes, ndf=64): super(FCDiscriminator, self).__init__() self.conv1 = nn.Conv2d(num_classes, ndf, kernel_size=4, stride=2, padding=1) self.conv2 = nn.Conv2d(ndf, ndf * 2, kernel_size=4...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
YoNyeoSeok/AsymTri
FCDiscriminator
false
12,025
[ "MIT" ]
0
a5a9a4b92074d770ed57802ff26b149a301cf4a4
https://github.com/YoNyeoSeok/AsymTri/tree/a5a9a4b92074d770ed57802ff26b149a301cf4a4
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_classes, ndf=64): super().__init__() self.conv1 = nn.Conv2d(num_classes, ndf, kernel_size=4, stride=2, padding=1) self.conv2 = nn.Conv2d(ndf, ndf * 2, kernel_size=4, stride=2, padding=1 ...
VertexDirectEmbedder
# 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 from torch import nn def normalize_embeddings(embeddings: 'torch.Tensor', epsilon: 'float'=1e-06 ) ->torch.Tensor: """ Normalize N D-dimensional embedding vectors arranged in a tensor [N, D] Args: embeddings (tensor [N, D]): N D-dimensional embedding vecto...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.utils.data from...
YutouTaro/detectron2
VertexDirectEmbedder
false
12,026
[ "Apache-2.0" ]
0
29f90062fa2978a35f1d599bb30768a2370378ca
https://github.com/YutouTaro/detectron2/tree/29f90062fa2978a35f1d599bb30768a2370378ca
import torch import torch.utils.data from torch import nn def normalize_embeddings(embeddings: 'torch.Tensor', epsilon: 'float'=1e-06 ) ->torch.Tensor: """ Normalize N D-dimensional embedding vectors arranged in a tensor [N, D] Args: embeddings (tensor [N, D]): N D-dimensional embedding vecto...
Affine
# 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.parallel import torch.utils.data class Affine(nn.Module): def __init__(self, dim): super().__init__() self.alpha = nn.Parameter(torch.ones((1, 1, dim))) self.beta = nn.Parameter(torch.zeros((1, 1, dim))) 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 import torch.nn.parallel import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty...
Yuki-Tanaka-33937424/pytorch-image-models
Affine
false
12,027
[ "Apache-2.0" ]
0
6c1da622dcb2a0421aeb6cdcadd03cc366331f66
https://github.com/Yuki-Tanaka-33937424/pytorch-image-models/tree/6c1da622dcb2a0421aeb6cdcadd03cc366331f66
import torch import torch.nn as nn import torch.nn.parallel import torch.utils.data class Model(nn.Module): def __init__(self, dim): super().__init__() self.alpha = nn.Parameter(torch.ones((1, 1, dim))) self.beta = nn.Parameter(torch.zeros((1, 1, dim))) def forward(self, x): ...
ResizeTransform
# 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 nnf class ResizeTransform(nn.Module): """ Resize a transform, which involves resizing the vector field *and* rescaling it. """ def __init__(self, vel_resize, ndims): super().__init__() self.factor = 1.0 / vel_resize ...
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...
Zer0-00/voxelmorph
ResizeTransform
false
12,028
[ "Apache-2.0" ]
0
ed2e0384cf22d19f7e57bea5887fc197d55f60bc
https://github.com/Zer0-00/voxelmorph/tree/ed2e0384cf22d19f7e57bea5887fc197d55f60bc
import torch import torch.nn as nn import torch.nn.functional as nnf class Model(nn.Module): """ Resize a transform, which involves resizing the vector field *and* rescaling it. """ def __init__(self, vel_resize, ndims): super().__init__() self.factor = 1.0 / vel_resize self.m...
MPJPELoss
# 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 MPJPELoss(nn.Module): """MPJPE (Mean Per Joint Position Error) loss. Args: use_target_weight (bool): Option to use weighted MSE loss. Different joint types may have different target weights. loss_weight (float): Weight of the loss. Default:...
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_...
ZephyrII/mmpose_charger
MPJPELoss
false
12,029
[ "Apache-2.0" ]
0
ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
https://github.com/ZephyrII/mmpose_charger/tree/ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
import torch import torch.nn as nn class Model(nn.Module): """MPJPE (Mean Per Joint Position Error) loss. Args: use_target_weight (bool): Option to use weighted MSE loss. Different joint types may have different target weights. loss_weight (float): Weight of the loss. Default: 1.0...
FocalLossBinary
# 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.jit import torch.nn.functional as F import torch.nn.functional from functools import partial from torch.nn.modules.loss import _Loss def reduced_focal_loss(outputs: 'torch.Tensor', targets: 'torch.Tensor', threshold: 'float'=0.5, gamma: 'float'=2.0, reduction='mean'): """ Compute...
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...
ZhongYingMatrix/nnUNet
FocalLossBinary
false
12,030
[ "Apache-2.0" ]
0
c3f028e79d4d5c3f2eb58396ffd0ae54048c132b
https://github.com/ZhongYingMatrix/nnUNet/tree/c3f028e79d4d5c3f2eb58396ffd0ae54048c132b
import torch import torch.jit import torch.nn.functional as F import torch.nn.functional from functools import partial from torch.nn.modules.loss import _Loss def reduced_focal_loss(outputs: 'torch.Tensor', targets: 'torch.Tensor', threshold: 'float'=0.5, gamma: 'float'=2.0, reduction='mean'): """ Compute...
ArcMarginProduct
# 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 torchvision.transforms.functional as F from torch import nn from torch.nn import functional as F class ArcMarginProduct(nn.Module): def __init__(self, in_features, out_features): super().__init__() self.weight = nn.Parameter(torch.FloatTensor(out_features, in_featu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
aaron276h/kaggle-rcic-1st
ArcMarginProduct
false
12,031
[ "MIT" ]
0
d35e97847df3c29f548e60bc936d3fec7a0a4c08
https://github.com/aaron276h/kaggle-rcic-1st/tree/d35e97847df3c29f548e60bc936d3fec7a0a4c08
import math import torch import torchvision.transforms.functional as F from torch import nn from torch.nn import functional as F class Model(nn.Module): def __init__(self, in_features, out_features): super().__init__() self.weight = nn.Parameter(torch.FloatTensor(out_features, in_features) ...
LinearNet
# 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 LinearNet(nn.Module): def __init__(self, board_width, board_height): super(LinearNet, self).__init__() self.board_width = board_width self.board_height = board_height self.model = nn.Linear(in_features=4 * 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...
ZiwenZhuang/AlphaZero_Gomoku
LinearNet
false
12,032
[ "MIT" ]
0
72db1c3eda1f6133da24c924da6032ea3569076e
https://github.com/ZiwenZhuang/AlphaZero_Gomoku/tree/72db1c3eda1f6133da24c924da6032ea3569076e
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, board_width, board_height): super().__init__() self.board_width = board_width self.board_height = board_height self.model = nn.Linear(in_features=4 * self.board_width * se...
ScaleLayer
# 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._utils class ScaleLayer(nn.Module): def __init__(self, init_value=1.0, lr_mult=1): super().__init__() self.lr_mult = lr_mult self.scale = nn.Parameter(torch.full((1,), init_value / lr_mult, dtype=torch.float32)) def forward(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn import torch._utils assert_size_stride = torch._C._...
aagaard/ritm_interactive_segmentation
ScaleLayer
false
12,033
[ "MIT" ]
0
c68b45a54e99eb5401f50e62f7e43a11e34964ee
https://github.com/aagaard/ritm_interactive_segmentation/tree/c68b45a54e99eb5401f50e62f7e43a11e34964ee
import torch import torch.nn as nn import torch._utils class Model(nn.Module): def __init__(self, init_value=1.0, lr_mult=1): super().__init__() self.lr_mult = lr_mult self.scale = nn.Parameter(torch.full((1,), init_value / lr_mult, dtype=torch.float32)) def forward(self,...
SoftIoU
# 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._utils class SoftIoU(nn.Module): def __init__(self, from_sigmoid=False, ignore_label=-1): super().__init__() self._from_sigmoid = from_sigmoid self._ignore_label = ignore_label def forward(self, pred, label): label = label.view(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch._utils assert_size_stride = torch._C._dynamo.guards.as...
aagaard/ritm_interactive_segmentation
SoftIoU
false
12,034
[ "MIT" ]
0
c68b45a54e99eb5401f50e62f7e43a11e34964ee
https://github.com/aagaard/ritm_interactive_segmentation/tree/c68b45a54e99eb5401f50e62f7e43a11e34964ee
import torch import torch.nn as nn import torch._utils class Model(nn.Module): def __init__(self, from_sigmoid=False, ignore_label=-1): super().__init__() self._from_sigmoid = from_sigmoid self._ignore_label = ignore_label def forward(self, pred, label): label = label.view(pr...
PatchMerging
# 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.nn as nn class PatchMerging(nn.Module): """ Patch Merging Layer Args: dim (int): Number of input channels. norm_layer (nn.Module, optional): Normalization layer. Default: nn.LayerNorm """ def __init__(self, dim, norm_layer=nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
acewjh/Video-Swin-Transformer
PatchMerging
false
12,035
[ "Apache-2.0" ]
0
bfbc8dde12e991455b34b921ca45a978b4dbfdbc
https://github.com/acewjh/Video-Swin-Transformer/tree/bfbc8dde12e991455b34b921ca45a978b4dbfdbc
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): """ Patch Merging Layer Args: dim (int): Number of input channels. norm_layer (nn.Module, optional): Normalization layer. Default: nn.LayerNorm """ def __init__(self, dim, norm_layer=nn.LayerN...
IrisClassifier
# 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.onnx class IrisClassifier(nn.Module): def __init__(self): super(IrisClassifier, self).__init__() self.fc1 = nn.Linear(4, 10) self.fc2 = nn.Linear(10, 10) self.fc3 = nn.Linear(10, 3) def forward(se...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
abhinavthomas/mlflow
IrisClassifier
false
12,036
[ "Apache-2.0" ]
0
1942d788e98e565229615373b4fd6c0899b4026b
https://github.com/abhinavthomas/mlflow/tree/1942d788e98e565229615373b4fd6c0899b4026b
import torch import torch.nn as nn import torch.nn.functional as F import torch.onnx class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(4, 10) self.fc2 = nn.Linear(10, 10) self.fc3 = nn.Linear(10, 3) def forward(self, x): x = F.relu(se...
MaskedLoss
# 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 class MaskedLoss(torch.nn.Module): def __init__(self): super().__init__() def forward(self, y, Y, mask): diff = (y - Y) / 5.0 return torch.mean(torch.square(diff[mask])) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.ones( ...
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...
acycliq/cellpose
MaskedLoss
false
12,037
[ "BSD-3-Clause" ]
0
6d7a3f692206bf791e3ea7bd9524ee6df628ed8a
https://github.com/acycliq/cellpose/tree/6d7a3f692206bf791e3ea7bd9524ee6df628ed8a
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, y, Y, mask): diff = (y - Y) / 5.0 return torch.mean(torch.square(diff[mask])) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.ones( [4...
DenseCrossEntropy
# 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 class DenseCrossEntropy(nn.Module): def forward(self, x, target): x = x.float() target = target.float() logprobs = torch.nn.functional.log_softmax(x, dim=-1) loss = -logprobs * target loss = loss.sum(-1) return loss.mean() def ge...
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...
aaron276h/kaggle-rcic-1st
DenseCrossEntropy
false
12,038
[ "MIT" ]
0
d35e97847df3c29f548e60bc936d3fec7a0a4c08
https://github.com/aaron276h/kaggle-rcic-1st/tree/d35e97847df3c29f548e60bc936d3fec7a0a4c08
import torch from torch import nn class Model(nn.Module): def forward(self, x, target): x = x.float() target = target.float() logprobs = torch.nn.functional.log_softmax(x, dim=-1) loss = -logprobs * target loss = loss.sum(-1) return loss.mean() def get_inputs(): ...
L1Loss
# 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 L1Loss(nn.Module): """L1Loss loss .""" def __init__(self, use_target_weight=False, loss_weight=1.0): super().__init__() self.criterion = F.l1_loss self.use_target_weight = use_target_weight self.loss_weig...
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 ...
ZephyrII/mmpose_charger
L1Loss
false
12,039
[ "Apache-2.0" ]
0
ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
https://github.com/ZephyrII/mmpose_charger/tree/ca5f7ab439ae40c4ceab2c6fd1d58112dc0ea7cd
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """L1Loss loss .""" def __init__(self, use_target_weight=False, loss_weight=1.0): super().__init__() self.criterion = F.l1_loss self.use_target_weight = use_target_weight self.loss_weigh...
ArcFaceLoss
# 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 nn class DenseCrossEntropy(nn.Module): def forward(self, x, target): x = x.float() target = target.float() logprobs = torch.nn.functional.log_softmax(x, dim=-1) loss = -logprobs * target loss = loss.sum(-1) return loss.mea...
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 math...
aaron276h/kaggle-rcic-1st
ArcFaceLoss
false
12,040
[ "MIT" ]
0
d35e97847df3c29f548e60bc936d3fec7a0a4c08
https://github.com/aaron276h/kaggle-rcic-1st/tree/d35e97847df3c29f548e60bc936d3fec7a0a4c08
import math import torch from torch import nn class DenseCrossEntropy(nn.Module): def forward(self, x, target): x = x.float() target = target.float() logprobs = torch.nn.functional.log_softmax(x, dim=-1) loss = -logprobs * target loss = loss.sum(-1) return loss.mea...
SplAtConv2d
# 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 as nn import torch.nn.functional as F from torch.nn import Conv2d from torch.nn import ReLU from torch.nn.modules.utils import _pair class DropBlock2D(object): def __init__(self, *args, **kwargs): raise NotImplementedError class rSoftMax(nn.Modul...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
XuYongi/KiNet
SplAtConv2d
false
12,041
[ "MIT" ]
0
fab8865a09e3779baf0daf1db1bf59a9cfbde450
https://github.com/XuYongi/KiNet/tree/fab8865a09e3779baf0daf1db1bf59a9cfbde450
from torch.nn import Module import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Conv2d from torch.nn import ReLU from torch.nn.modules.utils import _pair class DropBlock2D(object): def __init__(self, *args, **kwargs): raise NotImplementedError class rSoftMax(nn.Modul...
Simplenet
# 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.optim.lr_scheduler import * import torch.nn.functional as F import torch.optim import torch.nn as nn import torch.nn.parallel import torch.utils.data import torch.onnx import torch.testing class Simplenet(nn.Module): def __init__(self): super(Simplenet, 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 from torch._inductor.runtime import triton_helpers from torch.optim.lr_scheduler...
aam12/distiller
Simplenet
false
12,042
[ "Apache-2.0" ]
0
fd06fcba028d023e430cd37d1531bc2ac5202ea6
https://github.com/aam12/distiller/tree/fd06fcba028d023e430cd37d1531bc2ac5202ea6
import torch from torch.optim.lr_scheduler import * import torch.nn.functional as F import torch.optim import torch.nn as nn import torch.nn.parallel import torch.utils.data import torch.onnx import torch.testing class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2...
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): """policy-value network module""" def __init__(self, board_width, board_height): super(Net, self).__init__() self.board_width = board_width self.board_height = board_height self.conv1 = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ZiwenZhuang/AlphaZero_Gomoku
Net
false
12,043
[ "MIT" ]
0
72db1c3eda1f6133da24c924da6032ea3569076e
https://github.com/ZiwenZhuang/AlphaZero_Gomoku/tree/72db1c3eda1f6133da24c924da6032ea3569076e
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """policy-value network module""" def __init__(self, board_width, board_height): super().__init__() self.board_width = board_width self.board_height = board_height self.conv1 = nn.Conv2d...
ResBlock
# 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 torch.nn import functional as F class ResBlock(nn.Module): """Residual block with bilinear upsampling/downsampling. Args: in_channels (int): Channel number of the input. out_channels (int): Channel number of the output. mode (str): Upsampling/do...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
abhishekm47/GFPGAN
ResBlock
false
12,044
[ "BSD-3-Clause" ]
0
39d063749433b38d98c75740b052934ae8bc80f6
https://github.com/abhishekm47/GFPGAN/tree/39d063749433b38d98c75740b052934ae8bc80f6
import torch import torch.nn as nn from torch.nn import functional as F class Model(nn.Module): """Residual block with bilinear upsampling/downsampling. Args: in_channels (int): Channel number of the input. out_channels (int): Channel number of the output. mode (str): Upsampling/downs...
NormLoss
# 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 class NormLoss(torch.nn.Module): def __init__(self): super().__init__() def forward(self, y, Y, w, mask): ny = torch.linalg.norm(y, dim=1, keepdim=False) / 5.0 nY = torch.linalg.norm(Y, dim=1, keepdim=False) / 5.0 diff = ny - nY return torch.mean(torch.sq...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_c...
acycliq/cellpose
NormLoss
false
12,045
[ "BSD-3-Clause" ]
0
6d7a3f692206bf791e3ea7bd9524ee6df628ed8a
https://github.com/acycliq/cellpose/tree/6d7a3f692206bf791e3ea7bd9524ee6df628ed8a
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, y, Y, w, mask): ny = torch.linalg.norm(y, dim=1, keepdim=False) / 5.0 nY = torch.linalg.norm(Y, dim=1, keepdim=False) / 5.0 diff = ny - nY return torch.mean(torch.squar...
ArcCosDotLoss
# 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 class ArcCosDotLoss(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x, y, w, mask): eps = 1e-12 denom = torch.multiply(torch.linalg.norm(x, dim=1), torch.linalg. norm(y, dim=1)) + eps dot = x[:, 0, :, :] * y[:, 0, :, :] + x[...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._...
acycliq/cellpose
ArcCosDotLoss
false
12,046
[ "BSD-3-Clause" ]
0
6d7a3f692206bf791e3ea7bd9524ee6df628ed8a
https://github.com/acycliq/cellpose/tree/6d7a3f692206bf791e3ea7bd9524ee6df628ed8a
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x, y, w, mask): eps = 1e-12 denom = torch.multiply(torch.linalg.norm(x, dim=1), torch.linalg. norm(y, dim=1)) + eps dot = x[:, 0, :, :] * y[:, 0, :, :] + x[:, 1, :,...
WeightedLoss
# 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 class WeightedLoss(torch.nn.Module): def __init__(self): super().__init__() def forward(self, y, Y, w): diff = (y - Y) / 5.0 return torch.mean(torch.square(diff) * w) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( ...
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...
acycliq/cellpose
WeightedLoss
false
12,047
[ "BSD-3-Clause" ]
0
6d7a3f692206bf791e3ea7bd9524ee6df628ed8a
https://github.com/acycliq/cellpose/tree/6d7a3f692206bf791e3ea7bd9524ee6df628ed8a
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, y, Y, w): diff = (y - Y) / 5.0 return torch.mean(torch.square(diff) * w) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( [4, 4, ...
MyLoss
# 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 MyLoss(nn.Module): def __init__(self): super(MyLoss, self).__init__() None self.reduce_var = True pass """ weights has shape (n), multiply loss of point i with weights[i] """ def forward(self, outputs, y, weights, calculate_add...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
abrar-fahim/ann-benchmarks
MyLoss
false
12,048
[ "MIT" ]
0
e5493ddda333bf6a930415566d4f1c697b439aca
https://github.com/abrar-fahim/ann-benchmarks/tree/e5493ddda333bf6a930415566d4f1c697b439aca
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() None self.reduce_var = True pass """ weights has shape (n), multiply loss of point i with weights[i] """ def forward(self, outputs, y, weights, calculate_add=True): ...
LocalizationNet
# 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 from torch import nn class LocalizationNet(nn.Module): def __init__(self, num_bbox=2, num_digits=2): super(LocalizationNet, self).__init__() self.conv1 = nn.Conv2d(1, 64, 3, padding=1) self.conv2 = nn.Conv2d(64, 64, 3, padding=1) self.c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
YIFEI-MA/MultiDigitRecognition
LocalizationNet
false
12,049
[ "MIT" ]
0
f1f9567c31102ccdc7464a35b8a7c533b5d46734
https://github.com/YIFEI-MA/MultiDigitRecognition/tree/f1f9567c31102ccdc7464a35b8a7c533b5d46734
import torch import torch.nn.functional as F from torch import nn class Model(nn.Module): def __init__(self, num_bbox=2, num_digits=2): super().__init__() self.conv1 = nn.Conv2d(1, 64, 3, padding=1) self.conv2 = nn.Conv2d(64, 64, 3, padding=1) self.conv3 = nn.Conv2d(64, 64, 3, pad...
Critic
# 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.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Critic(nn.Module): """Critic (Value) Model.""" def __init__(self, state_size, action_size, seed, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np import tor...
adriaciurana/adriaciurana-udacity-project-2
Critic
false
12,050
[ "MIT" ]
0
a0af7086df586b537cd10a880f1d354240ff31a5
https://github.com/adriaciurana/adriaciurana-udacity-project-2/tree/a0af7086df586b537cd10a880f1d354240ff31a5
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Model(nn.Module): """Critic (Value) Model.""" def __init__(self, state_size, action_size, seed, f...
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...
import torch import torch.nn as nn import torch.nn.init as init class GraphConvolution(nn.Module): def __init__(self, input_dim, output_dim, use_bias=True): """ 图卷积: L*X*theta :param input_dim: int 节点输入特征的维度 :param out_put_dim: int 输出特征维度 :param use_bias: boolean | opt...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.init as init assert_size_stride = torch._C...
acproject/knowledge-graph-learning
GraphConvolution
false
12,051
[ "MIT" ]
0
fa62db6720f6da8e35de01b68acf82f1a367671f
https://github.com/acproject/knowledge-graph-learning/tree/fa62db6720f6da8e35de01b68acf82f1a367671f
import torch import torch.nn as nn import torch.nn.init as init class Model(nn.Module): def __init__(self, input_dim, output_dim, use_bias=True): """ 图卷积: L*X*theta :param input_dim: int 节点输入特征的维度 :param out_put_dim: int 输出特征维度 :param use_bias: boolean | optional 是否使用偏...
eSEModule
# 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 import torch.nn.parallel class Hsigmoid(nn.Module): def __init__(self, inplace=True): super(Hsigmoid, self).__init__() self.inplace = inplace def forward(self, x): return F.relu6(x + 3.0, inplace=self.inplace) / 6.0 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
XDong18/AdelaiDet
eSEModule
false
12,052
[ "BSD-2-Clause" ]
0
837cd1078923892fe6e84ac29fd0963f1b2c474f
https://github.com/XDong18/AdelaiDet/tree/837cd1078923892fe6e84ac29fd0963f1b2c474f
import torch from torch import nn import torch.nn.functional as F import torch.nn.parallel class Hsigmoid(nn.Module): def __init__(self, inplace=True): super().__init__() self.inplace = inplace def forward(self, x): return F.relu6(x + 3.0, inplace=self.inplace) / 6.0 class Model(nn...
SingleBlock
# 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 DyIntraModalityUpdate(nn.Module): """ Dynamic Intra-modality Attention Flow """ def __init__(self, v_size, q_size, output_size, num_head, drop=0.0): super(DyIntraModalityUpdate, self).__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
TranTony/DFAF-for-VQA.pytorch
SingleBlock
false
12,053
[ "MIT" ]
0
eba1a893e8e5d3d8bf85078611b0bcf4d56eea86
https://github.com/TranTony/DFAF-for-VQA.pytorch/tree/eba1a893e8e5d3d8bf85078611b0bcf4d56eea86
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class DyIntraModalityUpdate(nn.Module): """ Dynamic Intra-modality Attention Flow """ def __init__(self, v_size, q_size, output_size, num_head, drop=0.0): super().__init__() self.v_size = v_size...
PatchEmbed3D
# 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.nn as nn class PatchEmbed3D(nn.Module): """ Video to Patch Embedding. Args: patch_size (int): Patch token size. Default: (2,4,4). in_chans (int): Number of input video channels. Default: 3. embed_dim (int): Number of linear pro...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
acewjh/Video-Swin-Transformer
PatchEmbed3D
false
12,054
[ "Apache-2.0" ]
0
bfbc8dde12e991455b34b921ca45a978b4dbfdbc
https://github.com/acewjh/Video-Swin-Transformer/tree/bfbc8dde12e991455b34b921ca45a978b4dbfdbc
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): """ Video to Patch Embedding. Args: patch_size (int): Patch token size. Default: (2,4,4). in_chans (int): Number of input video channels. Default: 3. embed_dim (int): Number of linear projection...
Vgg16
# 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 Vgg16(nn.Module): def __init__(self): super(Vgg16, self).__init__() self.conv1_1 = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1) self.conv1_2 = nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=1) self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
YueZHOU0926/MUNIT_3D
Vgg16
false
12,055
[ "MIT" ]
0
5cb22b5f3cb127d5b2c4eea038254a7881bab372
https://github.com/YueZHOU0926/MUNIT_3D/tree/5cb22b5f3cb127d5b2c4eea038254a7881bab372
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1_1 = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1) self.conv1_2 = nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=1) self.conv2_1 = ...
SequenceBias
# 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.utils.data import torch.utils.data.distributed import torch.nn.parallel from torch.nn.parameter import Parameter class SequenceBias(nn.Module): """ Adds one bias element to the end of the sequence. so if the input has a shape ``(L, N, E)``, where ``L`` i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from torch.nn.parameter import Pa...
adriansarstedt/opacus
SequenceBias
false
12,056
[ "Apache-2.0" ]
0
a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1
https://github.com/adriansarstedt/opacus/tree/a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from torch.nn.parameter import Parameter class Model(nn.Module): """ Adds one bias element to the end of the sequence. so if the input has a shape ``(L, N, E)``, where ``L`` is the s...
SimpleCNN32Filter
# 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 SimpleCNN32Filter(nn.Module): """ Defines a simple CNN arhcitecture with 1 layer """ def __init__(self, num_classes): super().__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=10, stride=2) self.fc1 = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
adwaykanhere/df-dn-paper
SimpleCNN32Filter
false
12,057
[ "MIT" ]
0
5df413e06ce33c6be5d005e6d1141de9fcd45cb4
https://github.com/adwaykanhere/df-dn-paper/tree/5df413e06ce33c6be5d005e6d1141de9fcd45cb4
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Defines a simple CNN arhcitecture with 1 layer """ def __init__(self, num_classes): super().__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=10, stride=2) self.fc1 = nn.Linear(14...
BinaryFocalLossWithLogits
# 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 binary_focal_loss_with_logits(input: 'torch.Tensor', target: 'torch.Tensor', alpha: 'float'=0.25, gamma: 'float'=2.0, reduction: 'str'='none', eps: 'float'=1e-08) ->torch.Tensor: """Function that computes Binary Focal loss. .. math:: \\text{FL}(p_t) = -...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
adi1999/kornia
BinaryFocalLossWithLogits
false
12,058
[ "ECL-2.0", "Apache-2.0" ]
0
bb476a36e2725d687d1879b5a0d877c1ba860c25
https://github.com/adi1999/kornia/tree/bb476a36e2725d687d1879b5a0d877c1ba860c25
import torch import torch.nn as nn def binary_focal_loss_with_logits(input: 'torch.Tensor', target: 'torch.Tensor', alpha: 'float'=0.25, gamma: 'float'=2.0, reduction: 'str'='none', eps: 'float'=1e-08) ->torch.Tensor: """Function that computes Binary Focal loss. .. math:: \\text{FL}(p_t) = -...
NeuralNetwork
# 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 NeuralNetwork(nn.Module): def __init__(self, in_dim, out_dim, hidden_dim=None): """ Simple two-layer neural network. """ super(NeuralNetwork, self).__init__() if hidden_dim is None: hidden_dim = in_dim * 2 self.l1 = nn.L...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
adewynter/Lightboard
NeuralNetwork
false
12,059
[ "Apache-2.0" ]
0
f02eae64f11a989030b52314aa66709477274eb3
https://github.com/adewynter/Lightboard/tree/f02eae64f11a989030b52314aa66709477274eb3
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_dim, out_dim, hidden_dim=None): """ Simple two-layer neural network. """ super().__init__() if hidden_dim is None: hidden_dim = in_dim * 2 self.l1 = nn.Linear(in_dim, hidden_dim) ...
bodypose_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 from collections import OrderedDict import torch.nn as nn def make_layers(block, no_relu_layers): layers = [] for layer_name, v in block.items(): if 'pool' in layer_name: layer = nn.MaxPool2d(kernel_size=v[0], stride=v[1], padding=v[2]) layers.append((layer_name, l...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from collections import Order...
Schwartz-Zha/My_Pose_Estimation
bodypose_model
false
12,060
[ "MIT" ]
0
0ccaccf58498b2200842c155b735e1103c28c5ba
https://github.com/Schwartz-Zha/My_Pose_Estimation/tree/0ccaccf58498b2200842c155b735e1103c28c5ba
import torch from collections import OrderedDict import torch.nn as nn def make_layers(block, no_relu_layers): layers = [] for layer_name, v in block.items(): if 'pool' in layer_name: layer = nn.MaxPool2d(kernel_size=v[0], stride=v[1], padding=v[2]) layers.append((layer_name, l...
Scale
# 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.parallel class Scale(nn.Module): def __init__(self, init_value=1.0): super(Scale, self).__init__() self.scale = nn.Parameter(torch.FloatTensor([init_value])) def forward(self, input): return input * self.scale def get_inputs(): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.nn.parallel assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
XDong18/AdelaiDet
Scale
false
12,061
[ "BSD-2-Clause" ]
0
837cd1078923892fe6e84ac29fd0963f1b2c474f
https://github.com/XDong18/AdelaiDet/tree/837cd1078923892fe6e84ac29fd0963f1b2c474f
import torch from torch import nn import torch.nn.parallel class Model(nn.Module): def __init__(self, init_value=1.0): super().__init__() self.scale = nn.Parameter(torch.FloatTensor([init_value])) def forward(self, input): return input * self.scale def get_inputs(): return [tor...
GCN
# 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 import torch.nn.parallel class Conv2D(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, padding= 'same', stride=1, dilation=1, groups=1): super(Conv2D, self).__init__() assert type(kernel_size) in [int,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.nn.functional as F import torch.nn.parallel as...
XDong18/AdelaiDet
GCN
false
12,062
[ "BSD-2-Clause" ]
0
837cd1078923892fe6e84ac29fd0963f1b2c474f
https://github.com/XDong18/AdelaiDet/tree/837cd1078923892fe6e84ac29fd0963f1b2c474f
import torch from torch import nn import torch.nn.functional as F import torch.nn.parallel class Conv2D(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, padding= 'same', stride=1, dilation=1, groups=1): super().__init__() assert type(kernel_size) in [int, tuple ...
DPLSTMCell
# 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.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Tuple class LSTMLinear(nn.Linear): """ This function is the same as a nn.Linear layer, except that in the backward pass the grad_samples get accumulated (i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
adriansarstedt/opacus
DPLSTMCell
false
12,063
[ "Apache-2.0" ]
0
a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1
https://github.com/adriansarstedt/opacus/tree/a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1
import math import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Tuple class LSTMLinear(nn.Linear): """ This function is the same as a nn.Linear layer, except that in the backward pass the grad_samples get accumulated (i...
SimpleAtariNet
# 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 functional class SimpleAtariNet(nn.Module): def __init__(self): super(SimpleAtariNet, self).__init__() self.conv0 = nn.Conv2d(3, 16, 12, stride=(2, 8)) self.conv1 = nn.Conv2d(16, 32, 8, stride=4) self.conv2 = nn.Conv...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
aaronmckinstry706/pytorch-practice
SimpleAtariNet
false
12,064
[ "MIT" ]
0
d3fd28733ea6de6a2e522ec52ff3e748df21b85a
https://github.com/aaronmckinstry706/pytorch-practice/tree/d3fd28733ea6de6a2e522ec52ff3e748df21b85a
import torch import torch.nn as nn import torch.nn.functional as functional class Model(nn.Module): def __init__(self): super().__init__() self.conv0 = nn.Conv2d(3, 16, 12, stride=(2, 8)) self.conv1 = nn.Conv2d(16, 32, 8, stride=4) self.conv2 = nn.Conv2d(32, 64, 4, stride=2) ...
Conv_ReLU_Block
# 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_ReLU_Block(nn.Module): def __init__(self): super(Conv_ReLU_Block, self).__init__() self.conv = nn.Conv2d(in_channels=64, out_channels=64, kernel_size= 3, stride=1, padding=1, bias=False) self.relu = nn.ReLU(inplace=True) def f...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
advaza/pytorch-vdsr
Conv_ReLU_Block
false
12,065
[ "MIT" ]
0
8011f7323de3c7756df3828612addfb122c2bfef
https://github.com/advaza/pytorch-vdsr/tree/8011f7323de3c7756df3828612addfb122c2bfef
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.conv = nn.Conv2d(in_channels=64, out_channels=64, kernel_size= 3, stride=1, padding=1, bias=False) self.relu = nn.ReLU(inplace=True) def forward(self, x): return...
Gate
# 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 Gate(nn.Module): """Gate Unit g = sigmoid(Wx) x = g * x """ def __init__(self, input_size): super(Gate, self).__init__() self.linear = nn.Linear(input_size, input_size, bias=False) def forward(self, x): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
albert-dot-ai/MnemonicReader
Gate
false
12,066
[ "BSD-3-Clause" ]
0
eb51eb679a58677a405953c0c579568377c0b0f8
https://github.com/albert-dot-ai/MnemonicReader/tree/eb51eb679a58677a405953c0c579568377c0b0f8
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Gate Unit g = sigmoid(Wx) x = g * x """ def __init__(self, input_size): super().__init__() self.linear = nn.Linear(input_size, input_size, bias=False) def forward(self, x): "...
ScoreLayer
# 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 torchvision.transforms import functional as F from torch.nn import functional as F import torch.nn as nn class ScoreLayer(nn.Module): def __init__(self, k): super(ScoreLayer, self).__init__() self.score = nn.Conv2d(k, 1, 1, 1) def forward(self, x, x_size=None): x = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
alejodosr/PoolNet
ScoreLayer
false
12,067
[ "MIT" ]
0
a6a19379933fe02c22f0eb0dd92038fe87cf0bd3
https://github.com/alejodosr/PoolNet/tree/a6a19379933fe02c22f0eb0dd92038fe87cf0bd3
import torch from torchvision.transforms import functional as F from torch.nn import functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, k): super().__init__() self.score = nn.Conv2d(k, 1, 1, 1) def forward(self, x, x_size=None): x = self.score(x) ...
NaiveGroupNorm
# 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 from torch.nn import Parameter from torch.nn import init import torch.nn.parallel class NaiveGroupNorm(Module): """NaiveGroupNorm implements Group Normalization with the high-level matrix operations in PyTorch. It is a temporary solution to export GN by ONNX before the...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn import Module from torch.nn import Parameter from torch.nn import...
XDong18/AdelaiDet
NaiveGroupNorm
false
12,068
[ "BSD-2-Clause" ]
0
837cd1078923892fe6e84ac29fd0963f1b2c474f
https://github.com/XDong18/AdelaiDet/tree/837cd1078923892fe6e84ac29fd0963f1b2c474f
from torch.nn import Module import torch from torch.nn import Parameter from torch.nn import init import torch.nn.parallel class Model(Module): """NaiveGroupNorm implements Group Normalization with the high-level matrix operations in PyTorch. It is a temporary solution to export GN by ONNX before the official...
SFU
# 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 SFU(nn.Module): """Semantic Fusion Unit The ouput vector is expected to not only retrieve correlative information from fusion vectors, but also retain partly unchange as the input vector """ def __init__(self, input_size, fu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
albert-dot-ai/MnemonicReader
SFU
false
12,069
[ "BSD-3-Clause" ]
0
eb51eb679a58677a405953c0c579568377c0b0f8
https://github.com/albert-dot-ai/MnemonicReader/tree/eb51eb679a58677a405953c0c579568377c0b0f8
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Semantic Fusion Unit The ouput vector is expected to not only retrieve correlative information from fusion vectors, but also retain partly unchange as the input vector """ def __init__(self, input_size, ...
GraphNet
# 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 GraphNet(nn.Module): def __init__(self, input_size, n_classes, num_neurons=32): super(GraphNet, self).__init__() self.fc1 = nn.Linear(input_size, num_neurons) self.fc2 = nn.Linear(num_neurons, num_neurons) self.fc3 = nn.Linear(num_neurons, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
adam2392/dldo
GraphNet
false
12,070
[ "MIT" ]
0
fc57f8700eb048558ab205c2c77a064f1a7cc7f6
https://github.com/adam2392/dldo/tree/fc57f8700eb048558ab205c2c77a064f1a7cc7f6
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_size, n_classes, num_neurons=32): super().__init__() self.fc1 = nn.Linear(input_size, num_neurons) self.fc2 = nn.Linear(num_neurons, num_neurons) self.fc3 = nn.Linear(num_neurons, n_classes) ...
FCLayer
# 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 FCLayer(nn.Module): def __init__(self, input_dim, output_dim, dropout_rate=0.0, use_activation=True): super().__init__() self.use_activation = use_activation self.dropout = nn.Dropout(dropout_rate) self.linear = nn.Linear(input_dim,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
alexandre-do/r-bert
FCLayer
false
12,071
[ "Apache-2.0" ]
0
4e35bcbb0fe0602e708e18010e2394ebbfb074c4
https://github.com/alexandre-do/r-bert/tree/4e35bcbb0fe0602e708e18010e2394ebbfb074c4
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_dim, output_dim, dropout_rate=0.0, use_activation=True): super().__init__() self.use_activation = use_activation self.dropout = nn.Dropout(dropout_rate) self.linear = nn.Linear(input_dim, o...
SimpleGCN
# 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 from torch.nn.parameter import Parameter from torch.nn import Parameter import torch.nn import torch.autograd class SimpleGCN(nn.Module): """A simple graph convolution layer, similar to the one defined in Kipf et al. https://arxiv.org/abs/1609.02907 .. note:...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn from torch.nn.parameter import Parameter from ...
acivgin1/kaolin
SimpleGCN
false
12,072
[ "ECL-2.0", "Apache-2.0" ]
0
4c4e0098b2cd9a73709c81fea82de03abbd6cdd5
https://github.com/acivgin1/kaolin/tree/4c4e0098b2cd9a73709c81fea82de03abbd6cdd5
import math import torch import torch.nn as nn from torch.nn.parameter import Parameter from torch.nn import Parameter import torch.nn import torch.autograd class Model(nn.Module): """A simple graph convolution layer, similar to the one defined in Kipf et al. https://arxiv.org/abs/1609.02907 .. note:: ...
DepthwiseSeperableConv1d
# 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 DepthwiseSeperableConv1d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size): super(DepthwiseSeperableConv1d, self).__init__() self.depthwise_conv1d = nn.Conv1d(in_channels, in_channels, kernel_size, groups=in_channels, paddi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
allenye0119/pytorch-modules
DepthwiseSeperableConv1d
false
12,074
[ "MIT" ]
0
c7683ef63478becca3b79a7498840450da33f468
https://github.com/allenye0119/pytorch-modules/tree/c7683ef63478becca3b79a7498840450da33f468
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size): super().__init__() self.depthwise_conv1d = nn.Conv1d(in_channels, in_channels, kernel_size, groups=in_channels, padding=kernel_size // 2) self.pointwise_conv1...
LRN
# 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 LRN(nn.Module): def __init__(self, local_size=1, alpha=1.0, beta=0.75, ACROSS_CHANNELS=True ): super(LRN, self).__init__() self.ACROSS_CHANNELS = ACROSS_CHANNELS if ACROSS_CHANNELS: self.average = nn.AvgPool3d(kernel_size=(local...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
anas-awadalla/dissect
LRN
false
12,075
[ "MIT" ]
0
d74e9147731c6160274405a39ab1c98191929269
https://github.com/anas-awadalla/dissect/tree/d74e9147731c6160274405a39ab1c98191929269
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, local_size=1, alpha=1.0, beta=0.75, ACROSS_CHANNELS=True ): super().__init__() self.ACROSS_CHANNELS = ACROSS_CHANNELS if ACROSS_CHANNELS: self.average = nn.AvgPool3d(kernel_size=(local_size, ...
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 math import torch from torch import Tensor import torch.nn as nn from torch.nn import Parameter from torch.autograd import Variable class LayerNorm(nn.Module): """ Layer Normalization based on Ba & al.: 'Layer Normalization' https://arxiv.org/pdf/1607.06450.pdf """ def __init__(self, i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math from torch import Tensor import torch.nn as nn from torch.nn import...
alex-kj-chin/universal-computation
LayerNorm
false
12,076
[ "MIT" ]
0
a41cc7d685a3e0c56c11bc346c25394464da2e06
https://github.com/alex-kj-chin/universal-computation/tree/a41cc7d685a3e0c56c11bc346c25394464da2e06
import math import torch from torch import Tensor import torch.nn as nn from torch.nn import Parameter from torch.autograd import Variable class Model(nn.Module): """ Layer Normalization based on Ba & al.: 'Layer Normalization' https://arxiv.org/pdf/1607.06450.pdf """ def __init__(self, input...
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 import torch.nn as nn class ConvLayer(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride, norm =None, bias=True): super(ConvLayer, self).__init__() reflection_padding = kernel_size // 2 self.reflection_pad = nn.ReflectionPad2d(reflection_pad...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
alhsu713/fast_blind_video_consistency
ResidualBlock
false
12,078
[ "MIT" ]
0
2037ec5f68a361b926c31b3a12c1cd04e2331797
https://github.com/alhsu713/fast_blind_video_consistency/tree/2037ec5f68a361b926c31b3a12c1cd04e2331797
import torch import torch.nn as nn class ConvLayer(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride, norm =None, bias=True): super().__init__() reflection_padding = kernel_size // 2 self.reflection_pad = nn.ReflectionPad2d(reflection_padding) s...
InnerProductModel
# 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 InnerProductModel(torch.nn.Module): @staticmethod def is_valid_model_type(model_type): raise NotImplementedError @staticmethod def get_model_from_type(model_type): raise NotImplementedError @property def loss_criterion(self): return torch.nn.MSELos...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda reinterpret...
SheepiesLab/plato
InnerProductModel
false
12,079
[ "Apache-2.0" ]
0
9f5bbfa4b6952d1b3af24be409982d303d54a169
https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169
import torch class Model(torch.nn.Module): @staticmethod def is_valid_model_type(model_type): raise NotImplementedError @staticmethod def get_model_from_type(model_type): raise NotImplementedError @property def loss_criterion(self): return torch.nn.MSELoss() def...
Critic
# 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 Critic(nn.Module): def __init__(self, state_dim, action_dim): super(Critic, self).__init__() self.l1 = nn.Linear(state_dim + action_dim, 400) self.l2 = nn.Linear(400, 300) self.l3 = nn.Linear(300, 1) def...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
SheepiesLab/plato
Critic
false
12,080
[ "Apache-2.0" ]
0
9f5bbfa4b6952d1b3af24be409982d303d54a169
https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim): super().__init__() self.l1 = nn.Linear(state_dim + action_dim, 400) self.l2 = nn.Linear(400, 300) self.l3 = nn.Linear(300, 1) def forward(self...
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.a1 = nn.Conv2d(19, 64, kernel_size=3, padding=1) self.a2 = nn.Conv2d(64, 128, kernel_size=3, padding=1) self.a3 = nn.Conv2d(128, 256, kerne...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
afozk95/chess-dataset
Net
false
12,081
[ "MIT" ]
0
08de7b251f67cb8553a5ee66f6fd76cefeb14bb4
https://github.com/afozk95/chess-dataset/tree/08de7b251f67cb8553a5ee66f6fd76cefeb14bb4
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.a1 = nn.Conv2d(19, 64, kernel_size=3, padding=1) self.a2 = nn.Conv2d(64, 128, kernel_size=3, padding=1) self.a3 = nn.Conv2d(128, 256, kernel_size=...
SimmatModule
# 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 class SimmatModule(torch.nn.Module): def __init__(self, padding=-1): super().__init__() self.padding = padding self._hamming_index_loaded = None self._hamming_index = None def forward(self, query_embed, doc_embed, query_tok, doc_tok): simmat = [] ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride ...
alpers/FlexNeuART
SimmatModule
false
12,082
[ "Apache-2.0" ]
0
2ae263f46b6eb2f1435b9073dad629a2fef23ab9
https://github.com/alpers/FlexNeuART/tree/2ae263f46b6eb2f1435b9073dad629a2fef23ab9
import torch class Model(torch.nn.Module): def __init__(self, padding=-1): super().__init__() self.padding = padding self._hamming_index_loaded = None self._hamming_index = None def forward(self, query_embed, doc_embed, query_tok, doc_tok): simmat = [] for a_e...
PACRRConvMax2dModule
# 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 PACRRConvMax2dModule(torch.nn.Module): def __init__(self, shape, n_filters, k, channels): super().__init__() self.shape = shape if shape != 1: self.pad = torch.nn.ConstantPad2d((0, shape - 1, 0, shape - 1), 0) else: self.pad = None ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
alpers/FlexNeuART
PACRRConvMax2dModule
false
12,083
[ "Apache-2.0" ]
0
2ae263f46b6eb2f1435b9073dad629a2fef23ab9
https://github.com/alpers/FlexNeuART/tree/2ae263f46b6eb2f1435b9073dad629a2fef23ab9
import torch class Model(torch.nn.Module): def __init__(self, shape, n_filters, k, channels): super().__init__() self.shape = shape if shape != 1: self.pad = torch.nn.ConstantPad2d((0, shape - 1, 0, shape - 1), 0) else: self.pad = None self.conv = t...
AverageAttention
# 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 PositionwiseFeedForward(nn.Module): """ A two-layer Feed-Forward-Network with residual layer norm. Args: d_model (int): the size of input for the first-layer of the FFN. d_ff (int): the hidden layer size of th...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.cuda import torch.distributed assert_size_str...
Zer0-dev115/OpenNMT-py
AverageAttention
false
12,084
[ "MIT" ]
0
028c76b34779223ee6b3eb224b99617552987100
https://github.com/Zer0-dev115/OpenNMT-py/tree/028c76b34779223ee6b3eb224b99617552987100
import torch import torch.nn as nn import torch.cuda import torch.distributed class PositionwiseFeedForward(nn.Module): """ A two-layer Feed-Forward-Network with residual layer norm. Args: d_model (int): the size of input for the first-layer of the FFN. d_ff (int): the hidden layer size of th...
BatchLinear
# 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 collections import OrderedDict class MetaModule(nn.Module): """ Base class for PyTorch meta-learning modules. These modules accept an additional argument `params` in their `forward` method. Notes ----- Objects inherited from `MetaModule` are fully compat...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
aneesh-dandime/siren
BatchLinear
false
12,085
[ "MIT" ]
0
7bc652e32d66c5792d24e8df2fffa565157679bd
https://github.com/aneesh-dandime/siren/tree/7bc652e32d66c5792d24e8df2fffa565157679bd
import torch from torch import nn from collections import OrderedDict class MetaModule(nn.Module): """ Base class for PyTorch meta-learning modules. These modules accept an additional argument `params` in their `forward` method. Notes ----- Objects inherited from `MetaModule` are fully compat...
BertTextPooler
# 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 as nn class BertTextPooler(nn.Module): def __init__(self, config): super(BertTextPooler, self).__init__() self.dense = nn.Linear(config.hidden_size, config.bi_hidden_size) self.activation = nn.ReLU() def forwa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
amitakamath/vilbert-multi-task
BertTextPooler
false
12,086
[ "MIT" ]
0
5a11b8265fab3598fcdcd7f7c33453b914d8ff2c
https://github.com/amitakamath/vilbert-multi-task/tree/5a11b8265fab3598fcdcd7f7c33453b914d8ff2c
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.bi_hidden_size) self.activation = nn.ReLU() def forward(self, hidden_states): ...
IOUloss
# 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 IOUloss(nn.Module): def __init__(self, reduction='none', loss_type='iou'): super(IOUloss, self).__init__() self.reduction = reduction self.loss_type = loss_type def forward(self, pred, target): assert pred.shape[0] == target.shape[0] ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
ankandrew/YOLOX
IOUloss
false
12,087
[ "Apache-2.0" ]
0
28da975944887d550f052ebadd8cbdd82d14aed6
https://github.com/ankandrew/YOLOX/tree/28da975944887d550f052ebadd8cbdd82d14aed6
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, reduction='none', loss_type='iou'): super().__init__() self.reduction = reduction self.loss_type = loss_type def forward(self, pred, target): assert pred.shape[0] == target.shape[0] pred = p...
Correct
# 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.distributed class Correct(nn.Module): def forward(self, classifier, target): return classifier.max(dim=1)[1] == target def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.utils.data.distributed assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda ...
amitport/grace
Correct
false
12,088
[ "BSD-2-Clause" ]
0
b0e442057d2f36f09cd1817a4acb966c6b0b780f
https://github.com/amitport/grace/tree/b0e442057d2f36f09cd1817a4acb966c6b0b780f
import torch from torch import nn import torch.utils.data.distributed class Model(nn.Module): def forward(self, classifier, target): return classifier.max(dim=1)[1] == target def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Actor
# 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 Actor(nn.Module): def __init__(self, state_dim, action_dim, max_action): super(Actor, self).__init__() self.l1 = nn.Linear(state_dim, 400) self.l2 = nn.Linear(400, 300) self.l3 = nn.Linear(300, action_dim) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SheepiesLab/plato
Actor
false
12,089
[ "Apache-2.0" ]
0
9f5bbfa4b6952d1b3af24be409982d303d54a169
https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim, max_action): super().__init__() self.l1 = nn.Linear(state_dim, 400) self.l2 = nn.Linear(400, 300) self.l3 = nn.Linear(300, action_dim) self....
QNetwork
# 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 weights_init_(m): if isinstance(m, nn.Linear): torch.nn.init.xavier_uniform_(m.weight, gain=1) torch.nn.init.constant_(m.bias, 0) class QNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_dim): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
SheepiesLab/plato
QNetwork
false
12,090
[ "Apache-2.0" ]
0
9f5bbfa4b6952d1b3af24be409982d303d54a169
https://github.com/SheepiesLab/plato/tree/9f5bbfa4b6952d1b3af24be409982d303d54a169
import torch import torch.nn as nn import torch.nn.functional as F def weights_init_(m): if isinstance(m, nn.Linear): torch.nn.init.xavier_uniform_(m.weight, gain=1) torch.nn.init.constant_(m.bias, 0) class Model(nn.Module): def __init__(self, num_inputs, num_actions, hidden_dim): s...
UniverseHead
# 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 UniverseHead(torch.nn.Module): """ universe agent example input: [None, 42, 42, 1]; output: [None, 288]; """ def __init__(self, n): super(UniverseHead, self).__init__() self.conv1 = nn.Conv2d(n, 32, kernel_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
andy920262/pytorch-a2c-ppo-acktr
UniverseHead
false
12,091
[ "MIT" ]
0
2e7e85219dfe737cb4036de3cf0c8b00706d640e
https://github.com/andy920262/pytorch-a2c-ppo-acktr/tree/2e7e85219dfe737cb4036de3cf0c8b00706d640e
import torch import torch.nn as nn import torch.nn.functional as F class Model(torch.nn.Module): """ universe agent example input: [None, 42, 42, 1]; output: [None, 288]; """ def __init__(self, n): super().__init__() self.conv1 = nn.Conv2d(n, 32, kernel_size=(3, 3), stride=(2, 2),...
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 class DQN(nn.Module): def __init__(self, state_dim, nb_actions, hidden1=50, hidden2=50): super(DQN, self).__init__() self.fc1 = nn.Linear(state_dim, hidden1) self.fc2 = nn.Linear(hidden1, hidden2) self.fc3 = nn.Linear(hidden2, nb_actions) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
alvinwan/explore
DQN
false
12,092
[ "MIT" ]
0
358c076b8250f561394e32b1ee2de9bc5562dcdb
https://github.com/alvinwan/explore/tree/358c076b8250f561394e32b1ee2de9bc5562dcdb
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, state_dim, nb_actions, hidden1=50, hidden2=50): super().__init__() self.fc1 = nn.Linear(state_dim, hidden1) self.fc2 = nn.Linear(hidden1, hidden2) self.fc3 = nn.Linear(hidden2, nb_actions) self.r...
Block
# 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 Block(torch.nn.Module): def __init__(self, in_channels, mid_channel, out_channels, batch_norm=False ): super().__init__() self.conv1 = torch.nn.Conv2d(in_channels=in_channels, out_channels= mid_channel, kernel_size=3, padding=1) self.conv2 = torch.nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
amrane99/lung-segmentation
Block
false
12,093
[ "MIT" ]
0
ab29db75ac78918da5cbf66b830acaf36cf7b44a
https://github.com/amrane99/lung-segmentation/tree/ab29db75ac78918da5cbf66b830acaf36cf7b44a
import torch class Model(torch.nn.Module): def __init__(self, in_channels, mid_channel, out_channels, batch_norm=False ): super().__init__() self.conv1 = torch.nn.Conv2d(in_channels=in_channels, out_channels= mid_channel, kernel_size=3, padding=1) self.conv2 = torch.nn...
ConvNet
# 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 ConvNet(nn.Module): """ convolutional neural network """ def __init__(self): super(ConvNet, self).__init__() nf = 8 self.conv1 = nn.Conv2d(1, nf * 1, 5, 1, 0) self.conv2 = nn.Conv2d(nf * 1, nf * 2, 4, 2, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
animeshbchowdhury/robust-pnr-time
ConvNet
false
12,094
[ "BSD-3-Clause" ]
0
301c5d973b8c024a85fdab915986ecf257e7698b
https://github.com/animeshbchowdhury/robust-pnr-time/tree/301c5d973b8c024a85fdab915986ecf257e7698b
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ convolutional neural network """ def __init__(self): super().__init__() nf = 8 self.conv1 = nn.Conv2d(1, nf * 1, 5, 1, 0) self.conv2 = nn.Conv2d(nf * 1, nf * 2, 4, 2, 1) self...
NatureHead
# 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 NatureHead(torch.nn.Module): """ DQN Nature 2015 paper input: [None, 84, 84, 4]; output: [None, 3136] -> [None, 512]; """ def __init__(self, n): super(NatureHead, self).__init__() self.conv1 = nn.Conv2d(n, 32...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
andy920262/pytorch-a2c-ppo-acktr
NatureHead
false
12,095
[ "MIT" ]
0
2e7e85219dfe737cb4036de3cf0c8b00706d640e
https://github.com/andy920262/pytorch-a2c-ppo-acktr/tree/2e7e85219dfe737cb4036de3cf0c8b00706d640e
import torch import torch.nn as nn import torch.nn.functional as F class Model(torch.nn.Module): """ DQN Nature 2015 paper input: [None, 84, 84, 4]; output: [None, 3136] -> [None, 512]; """ def __init__(self, n): super().__init__() self.conv1 = nn.Conv2d(n, 32, kernel_size=(8, 8),...
SelfAttnPooler
# 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 SelfAttnPooler(nn.Module): def __init__(self, input_dim): super().__init__() self.proj = nn.Linear(input_dim, 1) def forward(self, encoder_out, padding_mask): """ encoder_out: T, B, C padding_mask: T, B (True for padded positio...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ankitapasad/slue-toolkit
SelfAttnPooler
false
12,096
[ "MIT" ]
0
db8155cf0fc803e21890cf4eee2ef87152aafbfc
https://github.com/ankitapasad/slue-toolkit/tree/db8155cf0fc803e21890cf4eee2ef87152aafbfc
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_dim): super().__init__() self.proj = nn.Linear(input_dim, 1) def forward(self, encoder_out, padding_mask): """ encoder_out: T, B, C padding_mask: T, B (True for padded positions) ...
DPSLTMAdapter
# 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 Tensor import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Tuple from typing import List from typing import Optional from typing import Dict from typing import Union from torch.nn.modules.module import _...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math from to...
adriansarstedt/opacus
DPSLTMAdapter
false
12,097
[ "Apache-2.0" ]
0
a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1
https://github.com/adriansarstedt/opacus/tree/a6c89e3d6a3a4e3e4b82bc8c68d53265a9a7cba1
import math import torch from torch import Tensor import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Tuple from typing import List from typing import Optional from typing import Dict from typing import Union from torch.nn.modules.module import _...
FCNet
# 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 FCNet(nn.Module): """ fully-connected neural network """ def __init__(self): super(FCNet, self).__init__() self.fc1 = nn.Linear(784, 400) self.fc2 = nn.Linear(400, 200) self.fc3 = nn.Linear(200, 100) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
animeshbchowdhury/robust-pnr-time
FCNet
false
12,098
[ "BSD-3-Clause" ]
0
301c5d973b8c024a85fdab915986ecf257e7698b
https://github.com/animeshbchowdhury/robust-pnr-time/tree/301c5d973b8c024a85fdab915986ecf257e7698b
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ fully-connected neural network """ def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 400) self.fc2 = nn.Linear(400, 200) self.fc3 = nn.Linear(200, 100) self.fc...
StendLoss
# 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 itertools import chain as chain import torch.utils.data import torch.nn as nn from torch.nn.modules.loss import _Loss class StendLoss(_Loss): def __init__(self, size_average=None, reduce=None, reduction='mean'): super(StendLoss, self).__init__() self.reduction = reduction d...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from iterto...
anton-br/SlowFast
StendLoss
false
12,099
[ "Apache-2.0" ]
0
6e8d68bc6f3191886a57f819db1c766c6ca32d21
https://github.com/anton-br/SlowFast/tree/6e8d68bc6f3191886a57f819db1c766c6ca32d21
import torch from itertools import chain as chain import torch.utils.data import torch.nn as nn from torch.nn.modules.loss import _Loss class Model(_Loss): def __init__(self, size_average=None, reduce=None, reduction='mean'): super().__init__() self.reduction = reduction def forward(self, ou...
ZeroLayer
# 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.utils.data class ZeroLayer(nn.Module): def __init__(self, stride): super(ZeroLayer, self).__init__() self.stride = stride def forward(self, x): """n, c, h, w = x.size() h //= self.stride w //= self.stride device ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
airglow/nni
ZeroLayer
false
12,100
[ "MIT" ]
0
751065b788f66a6b53446620293095b1fe1b1c65
https://github.com/airglow/nni/tree/751065b788f66a6b53446620293095b1fe1b1c65
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, stride): super().__init__() self.stride = stride def forward(self, x): """n, c, h, w = x.size() h //= self.stride w //= self.stride device = x.get_device() if...
SpaceToDepth
# 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 torchvision import datasets as datasets import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data.distributed class SpaceToDepth(nn.Module): def __init__(self, block_size=4): super().__init__() assert block_size == 4 self.bs = block_size ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torchvision import datasets as datasets import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data.distr...
adam-dziedzic/ASL
SpaceToDepth
false
12,101
[ "MIT" ]
0
cc063f5e7eda1498544ad2c3b224985203b0774a
https://github.com/adam-dziedzic/ASL/tree/cc063f5e7eda1498544ad2c3b224985203b0774a
import torch from torchvision import datasets as datasets import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data.distributed class Model(nn.Module): def __init__(self, block_size=4): super().__init__() assert block_size == 4 self.bs = block_size def...
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 import torch.nn.parallel import torch.utils.data.distributed class HSwish(nn.Module): """ Applies the Hard-Swish function element-wise. `"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_ Examples: >>> m = Mish() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn.functional import torch.nn.parallel import torch.ut...
ardianumam/Vanilla-GAN
HSwish
false
12,102
[ "Apache-2.0" ]
0
3fce9b60dca4609aad1d4e5eb834a2cc72cf07b3
https://github.com/ardianumam/Vanilla-GAN/tree/3fce9b60dca4609aad1d4e5eb834a2cc72cf07b3
import torch import torch.nn as nn import torch.nn.functional import torch.nn.parallel import torch.utils.data.distributed class Model(nn.Module): """ Applies the Hard-Swish function element-wise. `"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_ Examples: >>> m = Mish() ...
SpatialAttentionGate
# 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 SpatialAttentionGate(nn.Module): def __init__(self, channel, reduction=16): super(SpatialAttentionGate, self).__init__() self.fc1 = nn.Conv2d(channel, reduction, kernel_size=1, padding=0) self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
airglow/nni
SpatialAttentionGate
false
12,103
[ "MIT" ]
0
751065b788f66a6b53446620293095b1fe1b1c65
https://github.com/airglow/nni/tree/751065b788f66a6b53446620293095b1fe1b1c65
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): def __init__(self, channel, reduction=16): super().__init__() self.fc1 = nn.Conv2d(channel, reduction, kernel_size=1, padding=0) self.fc2 = nn.Conv2d(reduction, 1, kernel_siz...
HSigmoid
# 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 import torch.nn.parallel import torch.utils.data.distributed class HSigmoid(nn.Module): """ Applies the Hard-Sigmoid function element-wise. `"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_ Examples: >>> m = Mish()...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.nn.functional import torch.nn.parallel import torch.ut...
ardianumam/Vanilla-GAN
HSigmoid
false
12,104
[ "Apache-2.0" ]
0
3fce9b60dca4609aad1d4e5eb834a2cc72cf07b3
https://github.com/ardianumam/Vanilla-GAN/tree/3fce9b60dca4609aad1d4e5eb834a2cc72cf07b3
import torch import torch.nn as nn import torch.nn.functional import torch.nn.parallel import torch.utils.data.distributed class Model(nn.Module): """ Applies the Hard-Sigmoid function element-wise. `"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_ Examples: >>> m = Mish() ...
_AddNorm
# 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 _TimeDistributedInterpolation(nn.Module): def __init__(self, output_size: 'int', batch_first: 'bool'=False, trainable: 'bool'=False): super().__init__() self.output_size = output_size self.batch_first = batch...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.functional as F assert_size_stride = torc...
amadejkocbek/darts
_AddNorm
false
12,105
[ "Apache-2.0" ]
0
074be2a76eee11258da066878c564badf40834e9
https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9
import torch import torch.nn as nn import torch.nn.functional as F class _TimeDistributedInterpolation(nn.Module): def __init__(self, output_size: 'int', batch_first: 'bool'=False, trainable: 'bool'=False): super().__init__() self.output_size = output_size self.batch_first = batch...
_ScaledDotProductAttention
# 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 _ScaledDotProductAttention(nn.Module): def __init__(self, dropout: 'float'=None, scale: 'bool'=True): super(_ScaledDotProductAttention, self).__init__() if dropout is not None: self.dropout = nn.Dropout(p=dropout) else: self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
amadejkocbek/darts
_ScaledDotProductAttention
false
12,106
[ "Apache-2.0" ]
0
074be2a76eee11258da066878c564badf40834e9
https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, dropout: 'float'=None, scale: 'bool'=True): super().__init__() if dropout is not None: self.dropout = nn.Dropout(p=dropout) else: self.dropout = dropout self.softmax = nn.Softmax(...
_ResampleNorm
# 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 _TimeDistributedInterpolation(nn.Module): def __init__(self, output_size: 'int', batch_first: 'bool'=False, trainable: 'bool'=False): super().__init__() self.output_size = output_size self.batch_first = batch...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.functional as F assert_size_stride = torc...
amadejkocbek/darts
_ResampleNorm
false
12,107
[ "Apache-2.0" ]
0
074be2a76eee11258da066878c564badf40834e9
https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9
import torch import torch.nn as nn import torch.nn.functional as F class _TimeDistributedInterpolation(nn.Module): def __init__(self, output_size: 'int', batch_first: 'bool'=False, trainable: 'bool'=False): super().__init__() self.output_size = output_size self.batch_first = batch...
_GateAddNorm
# 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 _TimeDistributedInterpolation(nn.Module): def __init__(self, output_size: 'int', batch_first: 'bool'=False, trainable: 'bool'=False): super().__init__() self.output_size = output_size self.batch_first = batch...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
amadejkocbek/darts
_GateAddNorm
false
12,108
[ "Apache-2.0" ]
0
074be2a76eee11258da066878c564badf40834e9
https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9
import torch import torch.nn as nn import torch.nn.functional as F class _TimeDistributedInterpolation(nn.Module): def __init__(self, output_size: 'int', batch_first: 'bool'=False, trainable: 'bool'=False): super().__init__() self.output_size = output_size self.batch_first = batch...
_GatedLinearUnit
# 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 _GatedLinearUnit(nn.Module): """Gated Linear Unit""" def __init__(self, input_size: 'int', hidden_size: 'int'=None, dropout: 'float'=None): super().__init__() if dropout is not None: self.dropout = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
amadejkocbek/darts
_GatedLinearUnit
false
12,109
[ "Apache-2.0" ]
0
074be2a76eee11258da066878c564badf40834e9
https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Gated Linear Unit""" def __init__(self, input_size: 'int', hidden_size: 'int'=None, dropout: 'float'=None): super().__init__() if dropout is not None: self.dropout = nn.Dropout(dr...
TReLU
# 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 TReLU(nn.Module): def __init__(self): super(TReLU, self).__init__() self.alpha = nn.Parameter(torch.FloatTensor(1), requires_grad=True) self.alpha.data.fill_(0) def forward(self, x): x = F.relu(x - self....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
archiroid003/ICCV2019-LearningToPaint
TReLU
false
12,110
[ "MIT" ]
0
4b5fc263e4843c159a61e5956956b3f7812693f8
https://github.com/archiroid003/ICCV2019-LearningToPaint/tree/4b5fc263e4843c159a61e5956956b3f7812693f8
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.alpha = nn.Parameter(torch.FloatTensor(1), requires_grad=True) self.alpha.data.fill_(0) def forward(self, x): x = F.relu(x - self.alpha) + se...
MLP
# 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 def gelu(x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class SharedDropout(torch.nn.Module): def __init__(self, p): super(SharedDropout, self).__in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
albertkx/GeDi
MLP
false
12,111
[ "BSD-3-Clause" ]
0
27532eb6ac5dd42d817d25a905401504e916f9fb
https://github.com/albertkx/GeDi/tree/27532eb6ac5dd42d817d25a905401504e916f9fb
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn def gelu(x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class SharedDropout(torch.nn.Module): def __init__(self, p): super().__init__() self...
_GatedResidualNetwork
# 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 _TimeDistributedInterpolation(nn.Module): def __init__(self, output_size: 'int', batch_first: 'bool'=False, trainable: 'bool'=False): super().__init__() self.output_size = output_size self.batch_first = batch...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
amadejkocbek/darts
_GatedResidualNetwork
false
12,112
[ "Apache-2.0" ]
0
074be2a76eee11258da066878c564badf40834e9
https://github.com/amadejkocbek/darts/tree/074be2a76eee11258da066878c564badf40834e9
import torch import torch.nn as nn import torch.nn.functional as F class _TimeDistributedInterpolation(nn.Module): def __init__(self, output_size: 'int', batch_first: 'bool'=False, trainable: 'bool'=False): super().__init__() self.output_size = output_size self.batch_first = batch...
SEModule
# 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 torchvision import datasets as datasets import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data.distributed class FastAvgPool2d(nn.Module): def __init__(self, flatten=False): super(FastAvgPool2d, self).__init__() self.flatten = flatten def ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torchvision import datas...
adam-dziedzic/ASL
SEModule
false
12,113
[ "MIT" ]
0
cc063f5e7eda1498544ad2c3b224985203b0774a
https://github.com/adam-dziedzic/ASL/tree/cc063f5e7eda1498544ad2c3b224985203b0774a
import torch from torchvision import datasets as datasets import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data.distributed class FastAvgPool2d(nn.Module): def __init__(self, flatten=False): super().__init__() self.flatten = flatten def forward(self, x): ...
PreActBlockNoBN
# 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 PreActBlockNoBN(nn.Module): """Pre-activation version of the BasicBlock.""" expansion = 1 def __init__(self, in_planes, planes, stride=1): super(PreActBlockNoBN, self).__init__() self.conv1 = nn.Conv2d(in_planes, pla...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
arhik/LoCo
PreActBlockNoBN
false
12,114
[ "MIT" ]
0
de3792a8c5650ee1efa0682ad494a3b1b1be3dd0
https://github.com/arhik/LoCo/tree/de3792a8c5650ee1efa0682ad494a3b1b1be3dd0
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Pre-activation version of the BasicBlock.""" expansion = 1 def __init__(self, in_planes, planes, stride=1): super().__init__() self.conv1 = nn.Conv2d(in_planes, planes, kernel_size=3, stride= ...
up
# 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 up(nn.Module): def __init__(self, in_ch, out_ch): super(up, self).__init__() self.up_scale = nn.ConvTranspose2d(in_ch, out_ch, 2, stride=2) def forward(self, x1, x2): x2 = self.up_scale(x2) diffY = x1.siz...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
aribryan/segmentation_revisit
up
false
12,115
[ "MIT" ]
0
a37747cfa7bfa7bfd4c0c01983421f632cd719ba
https://github.com/aribryan/segmentation_revisit/tree/a37747cfa7bfa7bfd4c0c01983421f632cd719ba
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_ch, out_ch): super().__init__() self.up_scale = nn.ConvTranspose2d(in_ch, out_ch, 2, stride=2) def forward(self, x1, x2): x2 = self.up_scale(x2) diffY = x1.size()[2...
ResnetBlock
# 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 import torch.utils.data import torch.utils.data.distributed def actvn(x): out = F.leaky_relu(x, 0.2) return out class ResnetBlock(nn.Module): def __init__(self, fin, fout, fhidden=None, is_bias=True): super().__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn from torch.nn import functional as F import torch.utils.dat...
arnabgho/GAN_stability
ResnetBlock
false
12,116
[ "MIT" ]
0
5037d1d856be58818d1c825cd415e0d90d90aff2
https://github.com/arnabgho/GAN_stability/tree/5037d1d856be58818d1c825cd415e0d90d90aff2
import torch from torch import nn from torch.nn import functional as F import torch.utils.data import torch.utils.data.distributed def actvn(x): out = F.leaky_relu(x, 0.2) return out class Model(nn.Module): def __init__(self, fin, fout, fhidden=None, is_bias=True): super().__init__() se...