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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
ResidualUnit | # 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.model_zoo
def default_conv(in_channels, out_channels, kernel_size, bias=True):
return nn.Conv2d(in_channels, out_channels, kernel_size, padding=
kernel_size // 2, bias=bias)
class ResidualUnit(nn.Module):
def __init__(self, inChannel, outChannel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.model_zoo
assert_size_stride = torch._C... | NawaNae/ESRT-Huawei | ResidualUnit | false | 2,664 | [
"MIT"
] | 0 | edea1c0bafec940dc7ea8e5110c355a83188665c | https://github.com/NawaNae/ESRT-Huawei/tree/edea1c0bafec940dc7ea8e5110c355a83188665c | import torch
import torch.nn as nn
import torch.utils.model_zoo
def default_conv(in_channels, out_channels, kernel_size, bias=True):
return nn.Conv2d(in_channels, out_channels, kernel_size, padding=
kernel_size // 2, bias=bias)
class Model(nn.Module):
def __init__(self, inChannel, outChannel, reSca... |
AdaptiveAvgMaxPool2d | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
from torch import optim as optim
import torch.nn.parallel
def adaptive_avgmax_pool2d(x, output_size=1):
x_avg = F.adaptive_avg_pool2d(x, output_size)
x_max = F.adaptive_max_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as ... | Exir-lxr/crldr-prune-pytorch | AdaptiveAvgMaxPool2d | false | 2,665 | [
"Apache-2.0"
] | 0 | adeb5e0b24ce66ff9531d4d947f72412c1b5c033 | https://github.com/Exir-lxr/crldr-prune-pytorch/tree/adeb5e0b24ce66ff9531d4d947f72412c1b5c033 | import torch
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
from torch import optim as optim
import torch.nn.parallel
def adaptive_avgmax_pool2d(x, output_size=1):
x_avg = F.adaptive_avg_pool2d(x, output_size)
x_max = F.adaptive_max_... |
InverseDepthSmoothnessLoss | # 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 InverseDepthSmoothnessLoss(nn.Module):
"""Criterion that computes image-aware inverse depth smoothness loss.
.. math::
\\text{loss} = \\left | \\partial_x d_{ij} \\right | e^{-\\left \\|
\\partial_x I_{ij} \\right \\|} + \\left |
\\partial_y 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.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | MareenaKunjachan/kornia | InverseDepthSmoothnessLoss | false | 2,666 | [
"Apache-2.0"
] | 0 | 0a3cbb02850ac78059e0615da93144b5a64d3330 | https://github.com/MareenaKunjachan/kornia/tree/0a3cbb02850ac78059e0615da93144b5a64d3330 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Criterion that computes image-aware inverse depth smoothness loss.
.. math::
\\text{loss} = \\left | \\partial_x d_{ij} \\right | e^{-\\left \\|
\\partial_x I_{ij} \\right \\|} + \\left |
\\partial_y d_{ij} \\right | e^{-\... |
CE_Loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils
class CE_Loss(nn.Module):
def __init__(self, temperature=1):
super(CE_Loss, self).__init__()
self.T = temperature
def forward(self, output_batch, teacher_outputs):
output_batch = F.log_softmax(output... | 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
i... | NeutrinoLiu/FedML | CE_Loss | false | 2,667 | [
"Apache-2.0"
] | 0 | 1670b2a3f0b2d63c374a9a4a19449090c694bc78 | https://github.com/NeutrinoLiu/FedML/tree/1670b2a3f0b2d63c374a9a4a19449090c694bc78 | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils
class Model(nn.Module):
def __init__(self, temperature=1):
super().__init__()
self.T = temperature
def forward(self, output_batch, teacher_outputs):
output_batch = F.log_softmax(output_batch / self.T... |
ARFB | # 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.model_zoo
def default_conv(in_channels, out_channels, kernel_size, bias=True):
return nn.Conv2d(in_channels, out_channels, kernel_size, padding=
kernel_size // 2, bias=bias)
class ResidualUnit(nn.Module):
def __init__(self, inChannel, outChannel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.model_zoo
assert_size_stride = torch._C... | NawaNae/ESRT-Huawei | ARFB | false | 2,668 | [
"MIT"
] | 0 | edea1c0bafec940dc7ea8e5110c355a83188665c | https://github.com/NawaNae/ESRT-Huawei/tree/edea1c0bafec940dc7ea8e5110c355a83188665c | import torch
import torch.nn as nn
import torch.utils.model_zoo
def default_conv(in_channels, out_channels, kernel_size, bias=True):
return nn.Conv2d(in_channels, out_channels, kernel_size, padding=
kernel_size // 2, bias=bias)
class ResidualUnit(nn.Module):
def __init__(self, inChannel, outChannel... |
KL_Loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils
class KL_Loss(nn.Module):
def __init__(self, temperature=1):
super(KL_Loss, self).__init__()
self.T = temperature
def forward(self, output_batch, teacher_outputs):
output_batch = F.log_softmax(output... | 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 torch ... | NeutrinoLiu/FedML | KL_Loss | false | 2,669 | [
"Apache-2.0"
] | 0 | 1670b2a3f0b2d63c374a9a4a19449090c694bc78 | https://github.com/NeutrinoLiu/FedML/tree/1670b2a3f0b2d63c374a9a4a19449090c694bc78 | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils
class Model(nn.Module):
def __init__(self, temperature=1):
super().__init__()
self.T = temperature
def forward(self, output_batch, teacher_outputs):
output_batch = F.log_softmax(output_batch / self.T... |
SmallDecoder4_16x | # 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 SmallDecoder4_16x(nn.Module):
def __init__(self):
super(SmallDecoder4_16x, self).__init__()
self.conv41 = nn.Conv2d(128, 64, 3, 1, 0)
self.conv34 = nn.Conv2d(64, 64, 3, 1, 0, dilation=1)
self.conv33 = nn.Conv2d(64, 64, 3, 1, 0, dilation=1)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | MingSun-Tse/pytorch-AdaIN | SmallDecoder4_16x | false | 2,670 | [
"MIT"
] | 0 | 02ae320345232983c754ea233613aedc21e4d348 | https://github.com/MingSun-Tse/pytorch-AdaIN/tree/02ae320345232983c754ea233613aedc21e4d348 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv41 = nn.Conv2d(128, 64, 3, 1, 0)
self.conv34 = nn.Conv2d(64, 64, 3, 1, 0, dilation=1)
self.conv33 = nn.Conv2d(64, 64, 3, 1, 0, dilation=1)
self.conv32 = nn.Conv2d(64,... |
Conv_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
from torchvision.transforms import *
import torch.nn as nn
class Conv_Block(nn.Module):
def __init__(self):
super(Conv_Block, self).__init__()
self.conv = nn.Conv2d(in_channels=64, out_channels=64, kernel_size=
3, stride=1, padding=1, bias=False)
nn.init.xavier_un... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.transforms i... | FYLSunghwan/VDSR-pytorch | Conv_Block | false | 2,671 | [
"MIT"
] | 0 | fb862e97756078db2d5def095d46cc22a07cd014 | https://github.com/FYLSunghwan/VDSR-pytorch/tree/fb862e97756078db2d5def095d46cc22a07cd014 | import torch
from torchvision.transforms import *
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)
nn.init.xavier_uniform_(self.conv.weig... |
CausalConv2d | # 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
class WNConv2d(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, stride=1,
padding=0, bias=True, activation=None):
super().__init__()
self.conv = nn.utils.weight_norm(nn.Conv2d(in_channel, out_channel,
kernel_size, stride=st... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | MioChiu/vqvae2 | CausalConv2d | false | 2,672 | [
"MIT"
] | 0 | e57cc7546d3bd02c61387367936f7cd76b75eaae | https://github.com/MioChiu/vqvae2/tree/e57cc7546d3bd02c61387367936f7cd76b75eaae | import torch
from torch import nn
class WNConv2d(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, stride=1,
padding=0, bias=True, activation=None):
super().__init__()
self.conv = nn.utils.weight_norm(nn.Conv2d(in_channel, out_channel,
kernel_size, stride=st... |
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... | import torch
import torch.nn as nn
class MLP(nn.Module):
def __init__(self, input_dim, hidden_dim, num_layers, output_dim):
super(MLP, self).__init__()
self.hidden_dim = hidden_dim
self.num_layers = num_layers
self.fc1 = nn.Linear(input_dim, hidden_dim)
self.act = nn.ReLU(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | NefeliTav/Stock-Prediction | MLP | false | 2,673 | [
"Apache-2.0"
] | 0 | b422a246c762685ceb94c9714a2322fce71186e1 | https://github.com/NefeliTav/Stock-Prediction/tree/b422a246c762685ceb94c9714a2322fce71186e1 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, hidden_dim, num_layers, output_dim):
super().__init__()
self.hidden_dim = hidden_dim
self.num_layers = num_layers
self.fc1 = nn.Linear(input_dim, hidden_dim)
self.act = nn.ReLU()
... |
Rot180 | # 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 rot180(input: 'torch.Tensor') ->torch.Tensor:
return torch.flip(input, [-2, -1])
class Rot180(nn.Module):
"""Rotate a tensor image or a batch of tensor images
180 degrees. Input must be a tensor of shape (C, H, W)
or a batch of tensors :math:`(*, C, H, W)`.
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | NickleDave/kornia | Rot180 | false | 2,674 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | import torch
import torch.nn as nn
def rot180(input: 'torch.Tensor') ->torch.Tensor:
return torch.flip(input, [-2, -1])
class Model(nn.Module):
"""Rotate a tensor image or a batch of tensor images
180 degrees. Input must be a tensor of shape (C, H, W)
or a batch of tensors :math:`(*, C, H, W)`.
... |
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... | NickleDave/kornia | BinaryFocalLossWithLogits | false | 2,675 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | 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) = -... |
Invertible1x1Conv | # 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.autograd import Variable
import torch.utils.data
class Invertible1x1Conv(torch.nn.Module):
"""
The layer outputs both the convolution, and the log determinant
of its weight matrix. If reverse=True it does convolution with
inverse
"""
de... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional as F
from torch.autograd import Variable
import torch... | Moon-sung-woo/VAE_Tacotron_korean | Invertible1x1Conv | false | 2,676 | [
"BSD-3-Clause"
] | 0 | dafa4ea557235350211b7a2187da1d6855eb5e9f | https://github.com/Moon-sung-woo/VAE_Tacotron_korean/tree/dafa4ea557235350211b7a2187da1d6855eb5e9f | import torch
import torch.nn.functional as F
from torch.autograd import Variable
import torch.utils.data
class Model(torch.nn.Module):
"""
The layer outputs both the convolution, and the log determinant
of its weight matrix. If reverse=True it does convolution with
inverse
"""
def __init__(s... |
RKDAngleLoss | # 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 RKDAngleLoss(nn.Module):
"""
Module for calculating RKD Angle Loss
"""
def forward(self, teacher, student, normalize=True):
"""
Forward function
:param teacher (torch.FloatTensor): Prediction made by the... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | NeelayS/KD_Lib | RKDAngleLoss | false | 2,677 | [
"MIT"
] | 0 | c3f8c7cef76772d14862260e61c1d1c52c58f58e | https://github.com/NeelayS/KD_Lib/tree/c3f8c7cef76772d14862260e61c1d1c52c58f58e | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Module for calculating RKD Angle Loss
"""
def forward(self, teacher, student, normalize=True):
"""
Forward function
:param teacher (torch.FloatTensor): Prediction made by the teache... |
CNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNN(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim):
super(CNN, self).__init__()
self.hidden_dim = hidden_dim
self.conv1 = nn.Conv1d(input_dim, input_dim, kernel_size=1)
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_... | NefeliTav/Stock-Prediction | CNN | false | 2,678 | [
"Apache-2.0"
] | 0 | b422a246c762685ceb94c9714a2322fce71186e1 | https://github.com/NefeliTav/Stock-Prediction/tree/b422a246c762685ceb94c9714a2322fce71186e1 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim):
super().__init__()
self.hidden_dim = hidden_dim
self.conv1 = nn.Conv1d(input_dim, input_dim, kernel_size=1)
self.conv2 = nn.Conv1d(inpu... |
ATLoss | # 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 ATLoss(nn.Module):
"""
Module for calculating AT Loss
:param norm_type (int): Norm to be used in calculating loss
"""
def __init__(self, norm_type=2):
super(ATLoss, self).__init__()
self.p = norm_type
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
import torch.nn as nn
import... | NeelayS/KD_Lib | ATLoss | false | 2,679 | [
"MIT"
] | 0 | c3f8c7cef76772d14862260e61c1d1c52c58f58e | https://github.com/NeelayS/KD_Lib/tree/c3f8c7cef76772d14862260e61c1d1c52c58f58e | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Module for calculating AT Loss
:param norm_type (int): Norm to be used in calculating loss
"""
def __init__(self, norm_type=2):
super().__init__()
self.p = norm_type
def forward(se... |
HFM | # 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.model_zoo
class HFM(nn.Module):
def __init__(self, k=2):
super().__init__()
self.k = k
self.net = nn.Sequential(nn.AvgPool2d(kernel_size=self.k, stride=
self.k), nn.Upsample(scale_factor=self.k, mode='nearest'))
def fo... | 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.model_zoo
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | NawaNae/ESRT-Huawei | HFM | false | 2,680 | [
"MIT"
] | 0 | edea1c0bafec940dc7ea8e5110c355a83188665c | https://github.com/NawaNae/ESRT-Huawei/tree/edea1c0bafec940dc7ea8e5110c355a83188665c | import torch
import torch.nn as nn
import torch.utils.model_zoo
class Model(nn.Module):
def __init__(self, k=2):
super().__init__()
self.k = k
self.net = nn.Sequential(nn.AvgPool2d(kernel_size=self.k, stride=
self.k), nn.Upsample(scale_factor=self.k, mode='nearest'))
def ... |
ExtractTensorPatches | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Tuple
from typing import Union
from typing import Optional
from torch.nn.modules.utils import _pair
def _extract_tensor_patchesnd(input: 'torch.Tensor', window_sizes:
'Tuple[int, ...]', strides: 'Tuple[int, ...]') ->torch.Tensor... | 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.functional as F
from typing import Tuple
from typing import Union
from typing import Optional
from tor... | NickleDave/kornia | ExtractTensorPatches | false | 2,681 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Tuple
from typing import Union
from typing import Optional
from torch.nn.modules.utils import _pair
def _extract_tensor_patchesnd(input: 'torch.Tensor', window_sizes:
'Tuple[int, ...]', strides: 'Tuple[int, ...]') ->torch.Tensor... |
SoftArgmax2D | # 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
from typing import Optional
def create_meshgrid(x: 'torch.Tensor', normalized_coordinates: 'Optional[bool]'
) ->torch.Tensor:
assert len(x.shape) == 4, x.shape
_, _, height, width = x.shape
_device, _dtype = x.device, x.dtype
if normalized_coordinates:
xs... | 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
... | Mykko/Human-Path-Prediction | SoftArgmax2D | false | 2,682 | [
"MIT"
] | 0 | 956fcf16b98c81cf8e23133f9a766192e17e63e0 | https://github.com/Mykko/Human-Path-Prediction/tree/956fcf16b98c81cf8e23133f9a766192e17e63e0 | import torch
import torch.nn as nn
from typing import Optional
def create_meshgrid(x: 'torch.Tensor', normalized_coordinates: 'Optional[bool]'
) ->torch.Tensor:
assert len(x.shape) == 4, x.shape
_, _, height, width = x.shape
_device, _dtype = x.device, x.dtype
if normalized_coordinates:
xs... |
RgbaToBgr | # 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 bgr_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert a BGR image to RGB.
Args:
image (torch.Tensor): BGR Image to be converted to BGR of shape :math:`(*,3,H,W)`.
Returns:
torch.Tensor: RGB version of the image with shape of shape :math:`(*,3... | 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... | NickleDave/kornia | RgbaToBgr | false | 2,683 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | import torch
import torch.nn as nn
def bgr_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert a BGR image to RGB.
Args:
image (torch.Tensor): BGR Image to be converted to BGR of shape :math:`(*,3,H,W)`.
Returns:
torch.Tensor: RGB version of the image with shape of shape :math:`(*,3... |
TotalVariation | # 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 total_variation(img: 'torch.Tensor') ->torch.Tensor:
"""Function that computes Total Variation according to [1].
Args:
img (torch.Tensor): the input image with shape :math:`(N, C, H, W)` or :math:`(C, H, W)`.
Return:
torch.Tensor: a scalar with 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 math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | NickleDave/kornia | TotalVariation | false | 2,684 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | import torch
import torch.nn as nn
def total_variation(img: 'torch.Tensor') ->torch.Tensor:
"""Function that computes Total Variation according to [1].
Args:
img (torch.Tensor): the input image with shape :math:`(N, C, H, W)` or :math:`(C, H, W)`.
Return:
torch.Tensor: a scalar with the ... |
RgbaToRgb | # 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 rgba_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert an image from RGBA to RGB.
Args:
image (torch.Tensor): RGBA Image to be converted to RGB of shape :math:`(*,4,H,W)`.
Returns:
torch.Tensor: RGB version of the image with shape :math:`(*,3... | 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... | NickleDave/kornia | RgbaToRgb | false | 2,685 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | import torch
import torch.nn as nn
def rgba_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert an image from RGBA to RGB.
Args:
image (torch.Tensor): RGBA Image to be converted to RGB of shape :math:`(*,4,H,W)`.
Returns:
torch.Tensor: RGB version of the image with shape :math:`(*,3... |
FocalLoss | # 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 FocalLoss(nn.Module):
def __init__(self, alpha=1, gamma=2):
super().__init__()
self.alpha = alpha
self.gamma = gamma
def forward(self, x, y):
ce = F.binary_cross_entropy_with_logits(x, y)
fc = se... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | Nightmare4214/FracNet | FocalLoss | false | 2,686 | [
"Apache-2.0"
] | 0 | db397adb50f71387155d9d110302a5968f86f756 | https://github.com/Nightmare4214/FracNet/tree/db397adb50f71387155d9d110302a5968f86f756 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, alpha=1, gamma=2):
super().__init__()
self.alpha = alpha
self.gamma = gamma
def forward(self, x, y):
ce = F.binary_cross_entropy_with_logits(x, y)
fc = self.a... |
InvDepth | # 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 InvDepth(nn.Module):
def __init__(self, height, width, min_depth=0.5, max_depth=25.0):
super(InvDepth, self).__init__()
self._min_range = 1.0 / max_depth
self._max_range = 1.0 / min_depth
self.w = nn.Parameter(self._init_weights(height, wid... | 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... | MareenaKunjachan/kornia | InvDepth | false | 2,687 | [
"Apache-2.0"
] | 0 | 0a3cbb02850ac78059e0615da93144b5a64d3330 | https://github.com/MareenaKunjachan/kornia/tree/0a3cbb02850ac78059e0615da93144b5a64d3330 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, height, width, min_depth=0.5, max_depth=25.0):
super().__init__()
self._min_range = 1.0 / max_depth
self._max_range = 1.0 / min_depth
self.w = nn.Parameter(self._init_weights(height, width))
def _in... |
AdaptiveCatAvgMaxPool2d | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
from torch import optim as optim
import torch.nn.parallel
def adaptive_catavgmax_pool2d(x, output_size=1):
x_avg = F.adaptive_avg_pool2d(x, output_size)
x_max = F.adaptive_m... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as ... | Exir-lxr/crldr-prune-pytorch | AdaptiveCatAvgMaxPool2d | false | 2,688 | [
"Apache-2.0"
] | 0 | adeb5e0b24ce66ff9531d4d947f72412c1b5c033 | https://github.com/Exir-lxr/crldr-prune-pytorch/tree/adeb5e0b24ce66ff9531d4d947f72412c1b5c033 | import torch
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
from torch import optim as optim
import torch.nn.parallel
def adaptive_catavgmax_pool2d(x, output_size=1):
x_avg = F.adaptive_avg_pool2d(x, output_size)
x_max = F.adaptive_m... |
GapAggregator | # 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 GapAggregator(nn.Module):
def __init__(self):
super().__init__()
self.pool = nn.AdaptiveAvgPool2d(1)
def forward(self, x):
x = self.pool(x).squeeze(3).squeeze(2)
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def ... | 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... | NeverendingNotification/pytorch-xai-analyze | GapAggregator | false | 2,689 | [
"MIT"
] | 0 | fba91bf98c3281ffee5acaa87f2e44191897e0d7 | https://github.com/NeverendingNotification/pytorch-xai-analyze/tree/fba91bf98c3281ffee5acaa87f2e44191897e0d7 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.pool = nn.AdaptiveAvgPool2d(1)
def forward(self, x):
x = self.pool(x).squeeze(3).squeeze(2)
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init... |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class DiceLoss(nn.Module):
def __init__(self, image=False):
super().__init__()
self.image = image
def forward(self, x, y):
x = x.sigmoid()
i, u = [(t.flatten(1).sum(1) if self.image else t.sum()) for t in [
x * y, x + y]]
... | 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... | Nightmare4214/FracNet | DiceLoss | false | 2,690 | [
"Apache-2.0"
] | 0 | db397adb50f71387155d9d110302a5968f86f756 | https://github.com/Nightmare4214/FracNet/tree/db397adb50f71387155d9d110302a5968f86f756 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, image=False):
super().__init__()
self.image = image
def forward(self, x, y):
x = x.sigmoid()
i, u = [(t.flatten(1).sum(1) if self.image else t.sum()) for t in [
x * y, x + y]]
dc... |
Vflip | # 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 vflip(input: 'torch.Tensor') ->torch.Tensor:
return torch.flip(input, [-2])
class Vflip(nn.Module):
"""Vertically flip a tensor image or a batch of tensor images. Input must
be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`.
Args:
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | NickleDave/kornia | Vflip | false | 2,691 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | import torch
import torch.nn as nn
def vflip(input: 'torch.Tensor') ->torch.Tensor:
return torch.flip(input, [-2])
class Model(nn.Module):
"""Vertically flip a tensor image or a batch of tensor images. Input must
be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`.
Args:
... |
PSNRLoss | # 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
from torch.nn.functional import mse_loss as mse
def psnr(input: 'torch.Tensor', target: 'torch.Tensor', max_val: 'float'
) ->torch.Tensor:
"""Creates a function that calculates the PSNR between 2 images.
PSNR is Peek Signal to Noise Ratio, which is similar to mean squar... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
from t... | NickleDave/kornia | PSNRLoss | false | 2,692 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | import torch
import torch.nn as nn
from torch.nn.functional import mse_loss as mse
def psnr(input: 'torch.Tensor', target: 'torch.Tensor', max_val: 'float'
) ->torch.Tensor:
"""Creates a function that calculates the PSNR between 2 images.
PSNR is Peek Signal to Noise Ratio, which is similar to mean squar... |
dehaze_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.optim
class dehaze_net(nn.Module):
def __init__(self):
super(dehaze_net, self).__init__()
self.relu = nn.ReLU(inplace=True)
self.e_conv1 = nn.Conv2d(3, 3, 1, 1, 0, bias=True)
self.e_conv2 = nn.Conv2d(3, 3, 3, 1, 1, bias=True)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | NeilDG/PyTorch-Image-Dehazing | dehaze_net | false | 2,693 | [
"MIT"
] | 0 | 25aeebd4d5759efc1c7d5c2015cd381f805f99b2 | https://github.com/NeilDG/PyTorch-Image-Dehazing/tree/25aeebd4d5759efc1c7d5c2015cd381f805f99b2 | import torch
import torch.nn as nn
import torch.optim
class Model(nn.Module):
def __init__(self):
super().__init__()
self.relu = nn.ReLU(inplace=True)
self.e_conv1 = nn.Conv2d(3, 3, 1, 1, 0, bias=True)
self.e_conv2 = nn.Conv2d(3, 3, 3, 1, 1, bias=True)
self.e_conv3 = nn.Co... |
TransformDecoder4 | # 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 TransformDecoder4(nn.Module):
def __init__(self):
super(TransformDecoder4, self).__init__()
self.conv41 = nn.Conv2d(1024, 256, 3, 1, 0)
self.conv34 = nn.Conv2d(256, 256, 3, 1, 0)
self.conv33 = nn.Conv2d(256, 256, 3, 1, 0)
self.conv3... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | MingSun-Tse/pytorch-AdaIN | TransformDecoder4 | false | 2,694 | [
"MIT"
] | 0 | 02ae320345232983c754ea233613aedc21e4d348 | https://github.com/MingSun-Tse/pytorch-AdaIN/tree/02ae320345232983c754ea233613aedc21e4d348 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv41 = nn.Conv2d(1024, 256, 3, 1, 0)
self.conv34 = nn.Conv2d(256, 256, 3, 1, 0)
self.conv33 = nn.Conv2d(256, 256, 3, 1, 0)
self.conv32 = nn.Conv2d(256, 256, 3, 1, 0)
... |
DomainAdaptationLayer | # 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 DomainAdaptationLayer(nn.Module):
"""
This class is for the Domain Adaptation Layer. For now, the layer works only in source domain
arguments (function forward):
image: the input image (type: tensor) (size: batch x 384 x W x H)
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | Muntasir13/Face-Spoofing-Detection-using-Depth-Wise-Convolution | DomainAdaptationLayer | false | 2,695 | [
"MIT"
] | 0 | f5b1b5d2ad2f29286afbc14e98075534b572c555 | https://github.com/Muntasir13/Face-Spoofing-Detection-using-Depth-Wise-Convolution/tree/f5b1b5d2ad2f29286afbc14e98075534b572c555 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
This class is for the Domain Adaptation Layer. For now, the layer works only in source domain
arguments (function forward):
image: the input image (type: tensor) (size: batch x 384 x W x H)
return (function forward... |
Hflip | # 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 hflip(input: 'torch.Tensor') ->torch.Tensor:
return torch.flip(input, [-1])
class Hflip(nn.Module):
"""Horizontally flip a tensor image or a batch of tensor images. Input must
be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`.
Args:
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | NickleDave/kornia | Hflip | false | 2,696 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 5392651d0bc268da577fa0a49aa50f957289c7dd | https://github.com/NickleDave/kornia/tree/5392651d0bc268da577fa0a49aa50f957289c7dd | import torch
import torch.nn as nn
def hflip(input: 'torch.Tensor') ->torch.Tensor:
return torch.flip(input, [-1])
class Model(nn.Module):
"""Horizontally flip a tensor image or a batch of tensor images. Input must
be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`.
Args:
... |
SuperPointNet | # 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.optim
import torch.utils.data
class SuperPointNet(torch.nn.Module):
""" Pytorch definition of SuperPoint Network. """
def __init__(self):
super(SuperPointNet, self).__init__()
self.relu = torch.nn.ReLU(inplace=True)
self.pool = torch.nn.MaxPool2d(kernel_size=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Merical/pytorch-superpoint | SuperPointNet | false | 2,697 | [
"MIT"
] | 0 | b1f6e587b0f68a8a647773e4128b4f504edb4d58 | https://github.com/Merical/pytorch-superpoint/tree/b1f6e587b0f68a8a647773e4128b4f504edb4d58 | import torch
import torch.optim
import torch.utils.data
class Model(torch.nn.Module):
""" Pytorch definition of SuperPoint Network. """
def __init__(self):
super().__init__()
self.relu = torch.nn.ReLU(inplace=True)
self.pool = torch.nn.MaxPool2d(kernel_size=2, stride=2)
c1, c2... |
SpatialSELayer3D | # 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 SpatialSELayer3D(nn.Module):
"""
3D extension of SE block -- squeezing spatially and exciting channel-wise described in:
*Roy et al., Concurrent Spatial and Channel Squeeze & Excitation in Fully Convolutional Networks, MICCAI 201... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Nightmare4214/FracNet | SpatialSELayer3D | false | 2,698 | [
"Apache-2.0"
] | 0 | db397adb50f71387155d9d110302a5968f86f756 | https://github.com/Nightmare4214/FracNet/tree/db397adb50f71387155d9d110302a5968f86f756 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
3D extension of SE block -- squeezing spatially and exciting channel-wise described in:
*Roy et al., Concurrent Spatial and Channel Squeeze & Excitation in Fully Convolutional Networks, MICCAI 2018*
"""
... |
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... | NingAnMe/voxelmorph | ResizeTransform | false | 2,699 | [
"Apache-2.0"
] | 0 | 3a1a4c2f456af2dba5552efc1b08c68af38e54dc | https://github.com/NingAnMe/voxelmorph/tree/3a1a4c2f456af2dba5552efc1b08c68af38e54dc | 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... |
MedianPool2d | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from torch.nn.modules.utils import _quadruple
from torch import optim as optim
import torch.nn.parallel
class MedianPool2d(nn.Module):
"... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.utils.data
import torch.nn as nn
from torch.nn.modules.utils... | Exir-lxr/crldr-prune-pytorch | MedianPool2d | false | 2,700 | [
"Apache-2.0"
] | 0 | adeb5e0b24ce66ff9531d4d947f72412c1b5c033 | https://github.com/Exir-lxr/crldr-prune-pytorch/tree/adeb5e0b24ce66ff9531d4d947f72412c1b5c033 | import torch
import torch.utils.data
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from torch.nn.modules.utils import _quadruple
from torch import optim as optim
import torch.nn.parallel
class Model(nn.Module):
""" Medi... |
PlanarNormalizingFlow | # 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 PlanarNormalizingFlow(nn.Module):
"""
Planar normalizing flow [Rezende & Mohamed 2015].
Provides a tighter bound on the ELBO by giving more expressive
power to the approximate distribution, such as by introducing
covariance b... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.gu... | NightmareNyx/semi-supervised-pytorch | PlanarNormalizingFlow | false | 2,701 | [
"MIT"
] | 0 | 43bb86bc6757345bd7a4eb37d6948ee62a268f7e | https://github.com/NightmareNyx/semi-supervised-pytorch/tree/43bb86bc6757345bd7a4eb37d6948ee62a268f7e | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
"""
Planar normalizing flow [Rezende & Mohamed 2015].
Provides a tighter bound on the ELBO by giving more expressive
power to the approximate distribution, such as by introducing
covariance between terms.
... |
Classifier | # 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 Classifier(nn.Module):
def __init__(self, dims):
"""
Single hidden layer classifier
with softmax output.
"""
super(Classifier, self).__init__()
[x_dim, h_dim, y_dim] = dims
self.dense ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | NightmareNyx/semi-supervised-pytorch | Classifier | false | 2,702 | [
"MIT"
] | 0 | 43bb86bc6757345bd7a4eb37d6948ee62a268f7e | https://github.com/NightmareNyx/semi-supervised-pytorch/tree/43bb86bc6757345bd7a4eb37d6948ee62a268f7e | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, dims):
"""
Single hidden layer classifier
with softmax output.
"""
super().__init__()
[x_dim, h_dim, y_dim] = dims
self.dense = nn.Linear(x_dim, h_... |
ProjectExciteLayer | # 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 ProjectExciteLayer(nn.Module):
"""
Project & Excite Module, specifically designed for 3D inputs
*quote*
"""
def __init__(self, num_channels, reduction_ratio=2):
"""
:param num_channels: No of input ch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Nightmare4214/FracNet | ProjectExciteLayer | false | 2,703 | [
"Apache-2.0"
] | 0 | db397adb50f71387155d9d110302a5968f86f756 | https://github.com/Nightmare4214/FracNet/tree/db397adb50f71387155d9d110302a5968f86f756 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Project & Excite Module, specifically designed for 3D inputs
*quote*
"""
def __init__(self, num_channels, reduction_ratio=2):
"""
:param num_channels: No of input channels
... |
ChannelSpatialSELayer3D | # 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 ChannelSELayer3D(nn.Module):
"""
3D extension of Squeeze-and-Excitation (SE) block described in:
*Hu et al., Squeeze-and-Excitation Networks, arXiv:1709.01507*
*Zhu et al., AnatomyNet, arXiv:arXiv:1808.05238*
"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Nightmare4214/FracNet | ChannelSpatialSELayer3D | false | 2,704 | [
"Apache-2.0"
] | 0 | db397adb50f71387155d9d110302a5968f86f756 | https://github.com/Nightmare4214/FracNet/tree/db397adb50f71387155d9d110302a5968f86f756 | import torch
import torch.nn as nn
import torch.nn.functional as F
class ChannelSELayer3D(nn.Module):
"""
3D extension of Squeeze-and-Excitation (SE) block described in:
*Hu et al., Squeeze-and-Excitation Networks, arXiv:1709.01507*
*Zhu et al., AnatomyNet, arXiv:arXiv:1808.05238*
"""
... |
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... | from torch.nn import Module
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | NightmareNyx/pygcn | GCN | false | 2,705 | [
"MIT"
] | 0 | 3972f167ce7fcc41cb21284d75816dfd9a15f7ef | https://github.com/NightmareNyx/pygcn/tree/3972f167ce7fcc41cb21284d75816dfd9a15f7ef | from torch.nn import Module
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __in... |
Join | # 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 Join(torch.nn.Module):
"""Join layer
"""
def forward(self, unary: 'torch.Tensor', binary: 'torch.Tensor', index1:
'torch.Tensor', index2: 'torch.Tensor'):
"""Join the unary and binary tensors.
:param unary: [u, |U|] the tensor with unary predicates pre-activatio... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | NooneBug/entity_typing_framework | Join | false | 2,706 | [
"MIT"
] | 0 | e4c3cf3a6d9c3a3453ce516de855fc22b49ae5c0 | https://github.com/NooneBug/entity_typing_framework/tree/e4c3cf3a6d9c3a3453ce516de855fc22b49ae5c0 | import torch
class Model(torch.nn.Module):
"""Join layer
"""
def forward(self, unary: 'torch.Tensor', binary: 'torch.Tensor', index1:
'torch.Tensor', index2: 'torch.Tensor'):
"""Join the unary and binary tensors.
:param unary: [u, |U|] the tensor with unary predicates pre-activati... |
LR | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.utils.data
class LR(nn.Module):
def __init__(self, dimension, num_class=2):
super(LR, self).__init__()
self.last_layer = nn.Linear(dimension, num_class)
self.softmax = nn.Softmax(dim=1)
def forward(self, x):
x = self.last_layer(x... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Ottovonxu/islide | LR | false | 2,707 | [
"Apache-2.0"
] | 0 | 5ee9954e378f0b5a0722292351cb3cc74b95c1b3 | https://github.com/Ottovonxu/islide/tree/5ee9954e378f0b5a0722292351cb3cc74b95c1b3 | import torch
from torch import nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, dimension, num_class=2):
super().__init__()
self.last_layer = nn.Linear(dimension, num_class)
self.softmax = nn.Softmax(dim=1)
def forward(self, x):
x = self.last_layer(x)
... |
MeanPoolingLayer | # 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 BaseLayer(torch.nn.Module):
def __repr__(self):
return self.__class__.__name__ + '()'
class MeanPoolingLayer(BaseLayer):
def __init__(self):
super(MeanPoolingLayer, self).__init__()
def forward(self, input, dim=2):
length = input.shape[2]
return torc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Otybrian/blogpost | MeanPoolingLayer | false | 2,708 | [
"MIT"
] | 0 | 518599019e11cd7ee11e01470c4d51dfb4583274 | https://github.com/Otybrian/blogpost/tree/518599019e11cd7ee11e01470c4d51dfb4583274 | import torch
class BaseLayer(torch.nn.Module):
def __repr__(self):
return self.__class__.__name__ + '()'
class Model(BaseLayer):
def __init__(self):
super().__init__()
def forward(self, input, dim=2):
length = input.shape[2]
return torch.sum(input, dim=2) / length
de... |
BasicConvTestModel | # 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 torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
def fill_bias(module, value):
module.bias.data.fill_(value)
def fill_conv_weight(conv, value):
conv.weight.data... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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 torchvision import models as models
import torch.nn.pa... | JinYAnGHe/openvino_training_extensions | BasicConvTestModel | false | 2,709 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
def fill_bias(module, value):
module.bias.data.fill_(value)
def fill_conv_weight(conv, value):
conv.weight.data... |
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
import torch.nn as nn
import torch.nn.functional as F
class SimpleNet(nn.Module):
def __init__(self, ni):
super().__init__()
self.linear1 = nn.Linear(ni, 128)
self.linear2 = nn.Linear(128, 128)
self.linear3 = nn.Linear(128, 64)
self.linear4 = nn.Linear(64, 64)... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | P403n1x87/AI-Feynman | SimpleNet | false | 2,710 | [
"MIT"
] | 0 | 73398ad1b739d02b4cb8d9648b208e76d0a9085d | https://github.com/P403n1x87/AI-Feynman/tree/73398ad1b739d02b4cb8d9648b208e76d0a9085d | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, ni):
super().__init__()
self.linear1 = nn.Linear(ni, 128)
self.linear2 = nn.Linear(128, 128)
self.linear3 = nn.Linear(128, 64)
self.linear4 = nn.Linear(64, 64)
... |
HardSwish | # 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 torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
def hard_swish(x: 'torch.Tensor', inplace: 'bool'=False):
"""Hard swish."""
inner = F.relu6(x + 3.0).div_(6.0)
return x.mul_(inner) if inplace else x.mul(inner)
class HardSwish(nn.Module):
... | 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 torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.funct... | Oh-Donggyu/model-optimization-level3-nlp-01 | HardSwish | false | 2,711 | [
"MIT"
] | 0 | 3cfe03fd67fa1c5d08e9548c32dcf3c3981923a8 | https://github.com/Oh-Donggyu/model-optimization-level3-nlp-01/tree/3cfe03fd67fa1c5d08e9548c32dcf3c3981923a8 | import torch
import torchvision.transforms.functional as F
import torch.nn as nn
import torch.nn.functional as F
def hard_swish(x: 'torch.Tensor', inplace: 'bool'=False):
"""Hard swish."""
inner = F.relu6(x + 3.0).div_(6.0)
return x.mul_(inner) if inplace else x.mul(inner)
class Model(nn.Module):
""... |
FocalLoss | # 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 FocalLoss(nn.Module):
def __init__(self, gamma=2):
super().__init__()
self.gamma = gamma
def forward(self, input, target):
if not target.size() == input.size():
raise ValueError(
'Tar... | 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... | OctThe16th/COMP-652-FinalProject | FocalLoss | false | 2,712 | [
"MIT"
] | 0 | 00b8a2328516d8ca76d365004c753a91cc426b30 | https://github.com/OctThe16th/COMP-652-FinalProject/tree/00b8a2328516d8ca76d365004c753a91cc426b30 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, gamma=2):
super().__init__()
self.gamma = gamma
def forward(self, input, target):
if not target.size() == input.size():
raise ValueError(
'Target ... |
UpsamplingPixelShuffle | # 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 torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class shuffle(nn.Module):
def __init__(self, ratio):
super(shuffle, self).__init__()
self.ratio = ra... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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 torchvision import models as models
import torch.nn.pa... | JinYAnGHe/openvino_training_extensions | UpsamplingPixelShuffle | false | 2,713 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class shuffle(nn.Module):
def __init__(self, ratio):
super().__init__()
self.ratio = ratio
def ... |
SmallBlock | # 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 torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class SmallBlock(nn.Module):
def __init__(self, channels):
super(SmallBlock, self).__init__()
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
from tor... | JinYAnGHe/openvino_training_extensions | SmallBlock | false | 2,714 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class Model(nn.Module):
def __init__(self, channels):
super().__init__()
self.conv1 = nn.Conv2d(in_c... |
ReferenceActivationBinarizationModule | # 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
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
def get_per_channel_scale_shape(input_shape, is_weights):
scale_shape = [(1) for _ in input_shape]
if is_weights:... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import tor... | JinYAnGHe/openvino_training_extensions | ReferenceActivationBinarizationModule | false | 2,715 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
def get_per_channel_scale_shape(input_shape, is_weights):
scale_shape = [(1) for _ in input_shape]
if is_weights:... |
ResBlockWithFusedBN | # 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 torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class ResBlockWithFusedBN(nn.Module):
""" Bottleneck Residual Block """
def __init__(self, inplanes, outplanes, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
from tor... | JinYAnGHe/openvino_training_extensions | ResBlockWithFusedBN | false | 2,716 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class Model(nn.Module):
""" Bottleneck Residual Block """
def __init__(self, inplanes, outplanes, innerplanes, s... |
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
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class ResBlock(nn.Module):
def __init__(self, num_of_channels):
super(ResBlock, self).__init__()
sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | JinYAnGHe/openvino_training_extensions | ResBlock | false | 2,717 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class Model(nn.Module):
def __init__(self, num_of_channels):
super().__init__()
self.conv1 = nn.Conv... |
WeightedSumLoss | # 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
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class WeightedSumLoss(nn.Module):
"""Aggregate multiple loss functions in one weighted sum."""
def __init__(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 import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import tor... | JinYAnGHe/openvino_training_extensions | WeightedSumLoss | false | 2,718 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class Model(nn.Module):
"""Aggregate multiple loss functions in one weighted sum."""
def __init__(self, normaliz... |
Decoder4_2 | # 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 Decoder4_2(nn.Module):
def __init__(self, model=None, fixed=False):
super(Decoder4_2, self).__init__()
self.fixed = fixed
self.conv42 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv41 = nn.Conv2d(512, 256, 3, 1, 0)
self.conv34 = nn.Conv2d(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | MingSun-Tse/pytorch-AdaIN | Decoder4_2 | false | 2,719 | [
"MIT"
] | 0 | 02ae320345232983c754ea233613aedc21e4d348 | https://github.com/MingSun-Tse/pytorch-AdaIN/tree/02ae320345232983c754ea233613aedc21e4d348 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv42 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv41 = nn.Conv2d(512, 256, 3, 1, 0)
self.conv34 = nn.Conv2d(256, 256, 3, 1, 0)
... |
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
def weight_init(m):
"""Custom weight init for Conv2D and Linear layers."""
if isinstance(m, nn.Linear):
nn.init.orthogonal_(m.weight.data)
m.bias.data.fill_(0.0)
elif isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | LQNew/SDQ-CAL | Critic | false | 2,720 | [
"MIT"
] | 0 | f24301c84b40b90561527ed192497873bac2051f | https://github.com/LQNew/SDQ-CAL/tree/f24301c84b40b90561527ed192497873bac2051f | import torch
import torch.nn as nn
import torch.nn.functional as F
def weight_init(m):
"""Custom weight init for Conv2D and Linear layers."""
if isinstance(m, nn.Linear):
nn.init.orthogonal_(m.weight.data)
m.bias.data.fill_(0.0)
elif isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspo... |
LayerNorm2D | # 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 LayerNorm2D(nn.Module):
"""Layer normalization for CNN outputs."""
def __init__(self, channel, idim, eps=1e-12):
super(LayerNorm2D, self).__init__()
self.norm = nn.LayerNorm([channel, idim], eps=eps)
def forward(self, xs):
"""Forward pass.... | 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_... | Park-Jong-Min/neural_sp | LayerNorm2D | false | 2,721 | [
"Apache-2.0"
] | 0 | a4f300ae9c16c6e9ea3128292fbc141f68f38081 | https://github.com/Park-Jong-Min/neural_sp/tree/a4f300ae9c16c6e9ea3128292fbc141f68f38081 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Layer normalization for CNN outputs."""
def __init__(self, channel, idim, eps=1e-12):
super().__init__()
self.norm = nn.LayerNorm([channel, idim], eps=eps)
def forward(self, xs):
"""Forward pass.
Args:
... |
downsampled_get_normal | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.sparse
class downsampled_get_normal(nn.Module):
def __init__(self, num_in_layers):
super(downsampled_get_normal, self).__init__()
self.conv1 = nn.Conv2d(num_in_layers, 3, 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
import torch.utils.data
import torch
import torch.nn as nn
import torch.sparse
a... | PrendiProgramming/UprightNet | downsampled_get_normal | false | 2,722 | [
"MIT"
] | 0 | 73a0677079e27a806b48bf9ede70b8377002b2f3 | https://github.com/PrendiProgramming/UprightNet/tree/73a0677079e27a806b48bf9ede70b8377002b2f3 | import torch
import torch.utils.data
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.sparse
class Model(nn.Module):
def __init__(self, num_in_layers):
super().__init__()
self.conv1 = nn.Conv2d(num_in_layers, 3, kernel_size=3, stride=2)
self.sigmoid = torch.... |
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 ... | ParikhKadam/mlflow | IrisClassifier | false | 2,723 | [
"Apache-2.0"
] | 0 | 21d64d45c6131b62bb956f77327aa1abd9df66b2 | https://github.com/ParikhKadam/mlflow/tree/21d64d45c6131b62bb956f77327aa1abd9df66b2 | 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... |
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
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class Identity(nn.Module):
def forward(self, input_):
return input_
class LayerNormalization(nn.Module):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | JinYAnGHe/openvino_training_extensions | PositionwiseFeedForward | false | 2,724 | [
"Apache-2.0"
] | 0 | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | https://github.com/JinYAnGHe/openvino_training_extensions/tree/a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | import torch
from torch import nn
from torchvision import models as models
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.onnx
class Identity(nn.Module):
def forward(self, input_):
return input_
class LayerNormalization(nn.Module):
... |
LinearGLUBlock | # 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 LinearGLUBlock(nn.Module):
"""A linear GLU block.
Args:
size (int): input and output dimension
"""
def __init__(self, size):
super().__init__()
self.fc = nn.Linear(size, size * 2)
def forward(self,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Park-Jong-Min/neural_sp | LinearGLUBlock | false | 2,725 | [
"Apache-2.0"
] | 0 | a4f300ae9c16c6e9ea3128292fbc141f68f38081 | https://github.com/Park-Jong-Min/neural_sp/tree/a4f300ae9c16c6e9ea3128292fbc141f68f38081 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""A linear GLU block.
Args:
size (int): input and output dimension
"""
def __init__(self, size):
super().__init__()
self.fc = nn.Linear(size, size * 2)
def forward(self, xs):
... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Attention(nn.Module):
def __init__(self, dims, method='general', dropout=0.0):
super().__init__()
if method not in ('dot', 'general'):
raise ValueError('Invalid attention type selected')
self.method = method
if method == 'genera... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Palem1988/NeMo | Attention | false | 2,726 | [
"Apache-2.0"
] | 0 | 56c909b4088f345bf28fe0d0730380527df584f6 | https://github.com/Palem1988/NeMo/tree/56c909b4088f345bf28fe0d0730380527df584f6 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, dims, method='general', dropout=0.0):
super().__init__()
if method not in ('dot', 'general'):
raise ValueError('Invalid attention type selected')
self.method = method
if method == 'general':
... |
get_normal | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.sparse
class get_normal(nn.Module):
def __init__(self, num_in_layers, num_out_layers=3):
super(get_normal, self).__init__()
self.conv1 = nn.Conv2d(num_in_layers, num_out_layers, ke... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch
import torch.nn as nn
import torch.sparse
a... | PrendiProgramming/UprightNet | get_normal | false | 2,727 | [
"MIT"
] | 0 | 73a0677079e27a806b48bf9ede70b8377002b2f3 | https://github.com/PrendiProgramming/UprightNet/tree/73a0677079e27a806b48bf9ede70b8377002b2f3 | import torch
import torch.utils.data
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.sparse
class Model(nn.Module):
def __init__(self, num_in_layers, num_out_layers=3):
super().__init__()
self.conv1 = nn.Conv2d(num_in_layers, num_out_layers, kernel_size=3,
... |
SNR_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
import torch.nn.functional as F
import torch.utils.data
class ChannelGate_sub(nn.Module):
"""A mini-network that generates channel-wise gates conditioned on input tensor."""
def __init__(self, in_channels, num_gates=None, return_gates=False,
gate_activation='sigmoid... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Ohyeon5/DN_uncrowding | SNR_block | false | 2,728 | [
"Apache-2.0"
] | 0 | cb13ef2db4b15271517e06e4f323f667d01fcdb1 | https://github.com/Ohyeon5/DN_uncrowding/tree/cb13ef2db4b15271517e06e4f323f667d01fcdb1 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class ChannelGate_sub(nn.Module):
"""A mini-network that generates channel-wise gates conditioned on input tensor."""
def __init__(self, in_channels, num_gates=None, return_gates=False,
gate_activation='sigmoid... |
UpSampling | # 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 UpSampling(nn.Module):
def __init__(self, in_c):
super().__init__()
self.unpool1 = nn.Upsample(scale_factor=2)
self.conv1 = nn.Conv1d(in_c, in_c, 3, padding=1)
self.unpool2 = nn.Upsample(scale_factor=2)
self.conv2 = nn.Conv1d(in_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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | PatrickChoDev/LiDAR-ObjDetect | UpSampling | false | 2,729 | [
"MIT"
] | 0 | a839220d28a1fda045278ded0992e46f408a5442 | https://github.com/PatrickChoDev/LiDAR-ObjDetect/tree/a839220d28a1fda045278ded0992e46f408a5442 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_c):
super().__init__()
self.unpool1 = nn.Upsample(scale_factor=2)
self.conv1 = nn.Conv1d(in_c, in_c, 3, padding=1)
self.unpool2 = nn.Upsample(scale_factor=2)
self.conv2 = nn.Conv1d(in_c, in_c,... |
FocalLoss | # 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 FocalLoss(nn.Module):
def __init__(self, gamma=1.5, alpha=0.25, reduction=torch.mean):
super(FocalLoss, self).__init__()
self.loss_fcn = nn.BCEWithLogitsLoss(reduction='none')
self.gamma = gamma
self.alpha = alpha
self.reduction = r... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | PatrickChoDev/LiDAR-ObjDetect | FocalLoss | false | 2,730 | [
"MIT"
] | 0 | a839220d28a1fda045278ded0992e46f408a5442 | https://github.com/PatrickChoDev/LiDAR-ObjDetect/tree/a839220d28a1fda045278ded0992e46f408a5442 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, gamma=1.5, alpha=0.25, reduction=torch.mean):
super().__init__()
self.loss_fcn = nn.BCEWithLogitsLoss(reduction='none')
self.gamma = gamma
self.alpha = alpha
self.reduction = reduction
def f... |
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
def masked_softmax(x, m=None, dim=-1):
"""
Softmax with mask (optional)
"""
x = torch.clamp(x, min=-15.0, max=15.0)
if m is not None:
m = m.float()
x = x * m
e_x = torch.exp(x - torch.max(x, dim=dim, keepdim=True)[0])
if m is not None:
e_x = e_x * m
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Prasath2001/commonsense-rl | ScaledDotProductAttention | false | 2,731 | [
"Apache-2.0"
] | 0 | ef3e83270d34cf211b2d2086120cccae0621477b | https://github.com/Prasath2001/commonsense-rl/tree/ef3e83270d34cf211b2d2086120cccae0621477b | import torch
def masked_softmax(x, m=None, dim=-1):
"""
Softmax with mask (optional)
"""
x = torch.clamp(x, min=-15.0, max=15.0)
if m is not None:
m = m.float()
x = x * m
e_x = torch.exp(x - torch.max(x, dim=dim, keepdim=True)[0])
if m is not None:
e_x = e_x * m
... |
eca_layer | # 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 eca_layer(nn.Module):
"""Constructs a ECA module.
Args:
channel: Number of channels of the input feature map
k_size: Adaptive selection of kernel size
"""
def __init__(self, channel, k_size=3):
super(eca_layer, self).__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | QJYBall/NNDL-Final-Project | eca_layer | false | 2,732 | [
"MIT"
] | 0 | 9906fb59e888b51b33f3c61dd5a0737a1a0f0761 | https://github.com/QJYBall/NNDL-Final-Project/tree/9906fb59e888b51b33f3c61dd5a0737a1a0f0761 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Constructs a ECA module.
Args:
channel: Number of channels of the input feature map
k_size: Adaptive selection of kernel size
"""
def __init__(self, channel, k_size=3):
super().__init__()
self.avg_pool = nn.... |
TokenLabelSoftTargetCrossEntropy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class TokenLabelSoftTargetCrossEntropy(nn.Module):
"""
Token labeling dense loss with soft target, see more from token labeling
input: x is output of model, target is ground truth
return: loss
"""
def ... | 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
... | QLSong/cv-classify | TokenLabelSoftTargetCrossEntropy | false | 2,733 | [
"Apache-2.0"
] | 0 | 02f53d03868f299a08b5c97a266b50a7fdcd3f2b | https://github.com/QLSong/cv-classify/tree/02f53d03868f299a08b5c97a266b50a7fdcd3f2b | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class Model(nn.Module):
"""
Token labeling dense loss with soft target, see more from token labeling
input: x is output of model, target is ground truth
return: loss
"""
def __init__(self):
sup... |
get_confidence | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.sparse
class get_confidence(nn.Module):
def __init__(self, num_in_layers, num_out_layers=1):
super(get_confidence, self).__init__()
self.conv1 = nn.Conv2d(num_in_layers, num_out_la... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch
import torch.nn as nn
import torch.sparse
a... | PrendiProgramming/UprightNet | get_confidence | false | 2,734 | [
"MIT"
] | 0 | 73a0677079e27a806b48bf9ede70b8377002b2f3 | https://github.com/PrendiProgramming/UprightNet/tree/73a0677079e27a806b48bf9ede70b8377002b2f3 | import torch
import torch.utils.data
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.sparse
class Model(nn.Module):
def __init__(self, num_in_layers, num_out_layers=1):
super().__init__()
self.conv1 = nn.Conv2d(num_in_layers, num_out_layers, kernel_size=3,
... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Attention(nn.Module):
""" Applies attention mechanism on the `context` using the `query`.
**Thank you** to IBM for their initial implementation of :class:`Attention`. Here is
their `License
<https://github.com/IBM/pytorch-seq2seq/blob/master/LICENSE>`__.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Prasath2001/commonsense-rl | Attention | false | 2,735 | [
"Apache-2.0"
] | 0 | ef3e83270d34cf211b2d2086120cccae0621477b | https://github.com/Prasath2001/commonsense-rl/tree/ef3e83270d34cf211b2d2086120cccae0621477b | import torch
import torch.nn as nn
class Model(nn.Module):
""" Applies attention mechanism on the `context` using the `query`.
**Thank you** to IBM for their initial implementation of :class:`Attention`. Here is
their `License
<https://github.com/IBM/pytorch-seq2seq/blob/master/LICENSE>`__.
Args... |
Shifted_softplus | # 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.parallel
class Shifted_softplus(nn.Module):
"""
Performs a Shifter softplus loss, which modifies with a value of log(2)
"""
def __init__(self):
super(Shifted_softplus, self).__init__()
self.act = nn.Softplus()
self.shift = nn.Para... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torch.nn as nn
import torch.nn.parallel
assert_size_str... | QMrpy/deepchem | Shifted_softplus | false | 2,736 | [
"MIT"
] | 0 | f38a21c71e7bc4fd1fa59601be2b79ce7d744bd6 | https://github.com/QMrpy/deepchem/tree/f38a21c71e7bc4fd1fa59601be2b79ce7d744bd6 | import torch
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""
Performs a Shifter softplus loss, which modifies with a value of log(2)
"""
def __init__(self):
super().__init__()
self.act = nn.Softplus()
self.shift = nn.Parameter(torch.tensor([0.6931]), Fal... |
Downsample | # 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
class Downsample(nn.Module):
"""
Image to Patch Embedding, downsampling between stage1 and stage2
"""
def __init__(self, in_embed_dim, out_embed_dim, patch_size):
super().__init__()
self.proj = nn.Conv2d(in_embed_dim, out_emb... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
assert_size_stride = torch._C._dy... | QLSong/cv-classify | Downsample | false | 2,737 | [
"Apache-2.0"
] | 0 | 02f53d03868f299a08b5c97a266b50a7fdcd3f2b | https://github.com/QLSong/cv-classify/tree/02f53d03868f299a08b5c97a266b50a7fdcd3f2b | import torch
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""
Image to Patch Embedding, downsampling between stage1 and stage2
"""
def __init__(self, in_embed_dim, out_embed_dim, patch_size):
super().__init__()
self.proj = nn.Conv2d(in_embed_dim, out_embed_di... |
Custom_dropout | # 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.parallel
class Custom_dropout(nn.Module):
"""
An implementation for few , Given a task perform a rowise sum of 2-d
matrix , you get a zero out the contribution of few of rows in the matrix
Given, X a 2-d matrix consisting of row vectors (1-d) x1 , x2 ,..xn.... | 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | QMrpy/deepchem | Custom_dropout | false | 2,738 | [
"MIT"
] | 0 | f38a21c71e7bc4fd1fa59601be2b79ce7d744bd6 | https://github.com/QMrpy/deepchem/tree/f38a21c71e7bc4fd1fa59601be2b79ce7d744bd6 | import torch
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""
An implementation for few , Given a task perform a rowise sum of 2-d
matrix , you get a zero out the contribution of few of rows in the matrix
Given, X a 2-d matrix consisting of row vectors (1-d) x1 , x2 ,..xn.
Sum = ... |
Atom_Wise_Convolution | # 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
class Shifted_softplus(nn.Module):
"""
Performs a Shifter softplus loss, which modifies with a value of log(2)
"""
def __init__(self):
super(Shifted_softplus, self).__init__()
self.act = nn.Softplus()
self.shift = nn.Para... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | QMrpy/deepchem | Atom_Wise_Convolution | false | 2,739 | [
"MIT"
] | 0 | f38a21c71e7bc4fd1fa59601be2b79ce7d744bd6 | https://github.com/QMrpy/deepchem/tree/f38a21c71e7bc4fd1fa59601be2b79ce7d744bd6 | import torch
import torch.nn as nn
import torch.nn.parallel
class Shifted_softplus(nn.Module):
"""
Performs a Shifter softplus loss, which modifies with a value of log(2)
"""
def __init__(self):
super().__init__()
self.act = nn.Softplus()
self.shift = nn.Parameter(torch.tensor([0.... |
ScaleNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
import torch.nn.parallel
class ScaleNorm(nn.Module):
"""Apply Scale Normalization to input.
The ScaleNorm layer first computes the square root of the scale, then computes the matrix/vector norm of the input tensor.
The norm value is calculated as `sqrt(scale) / ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import math
import torch.nn ... | QMrpy/deepchem | ScaleNorm | false | 2,740 | [
"MIT"
] | 0 | f38a21c71e7bc4fd1fa59601be2b79ce7d744bd6 | https://github.com/QMrpy/deepchem/tree/f38a21c71e7bc4fd1fa59601be2b79ce7d744bd6 | import math
import torch
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""Apply Scale Normalization to input.
The ScaleNorm layer first computes the square root of the scale, then computes the matrix/vector norm of the input tensor.
The norm value is calculated as `sqrt(scale) / matr... |
SqueezeExcitation | # 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
import torch.nn.functional as F
from typing import Optional
import torch.nn.parallel
def _make_divisible(v: 'float', divisor: 'int', min_value: 'Optional[int]'=None
) ->int:
"""
This function is taken from the original tf repo.
It ensures tha... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 Tensor
impo... | QLSong/cv-classify | SqueezeExcitation | false | 2,741 | [
"Apache-2.0"
] | 0 | 02f53d03868f299a08b5c97a266b50a7fdcd3f2b | https://github.com/QLSong/cv-classify/tree/02f53d03868f299a08b5c97a266b50a7fdcd3f2b | import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional
import torch.nn.parallel
def _make_divisible(v: 'float', divisor: 'int', min_value: 'Optional[int]'=None
) ->int:
"""
This function is taken from the original tf repo.
It ensures tha... |
complex_relu_layer | # 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 complex_relu_layer(nn.Module):
def __init__(self):
super(complex_relu_layer, self).__init__()
def complex_relu(self, real, img):
mask = 1.0 * (real >= 0)
return mask * real, mask * img
def forward(self, real, img=None):
if img is ... | 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... | RemyLau/SimpleMagNet | complex_relu_layer | false | 2,742 | [
"MIT"
] | 0 | ee3cc5fc9a7793d2e2cf5a4b635fb690bb5b988e | https://github.com/RemyLau/SimpleMagNet/tree/ee3cc5fc9a7793d2e2cf5a4b635fb690bb5b988e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def complex_relu(self, real, img):
mask = 1.0 * (real >= 0)
return mask * real, mask * img
def forward(self, real, img=None):
if img is None:
img = real[1]
... |
UpSampleBlock | # 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 UpSampleBlock(nn.Module):
def __init__(self, scale_factor=(2, 2), mode='bilinear', p=0.0):
super(UpSampleBlock, self).__init__()
self.upsample = nn.Upsample(scale_factor=scale_factor, mode=mode)
if p:
self.dropout = nn.Dropout(p)
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | Qinaty/input-aware-backdoor-attack-release | UpSampleBlock | false | 2,743 | [
"MIT"
] | 0 | ce897adf4a3ce0d2badbd2b53233561fee6c7db7 | https://github.com/Qinaty/input-aware-backdoor-attack-release/tree/ce897adf4a3ce0d2badbd2b53233561fee6c7db7 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, scale_factor=(2, 2), mode='bilinear', p=0.0):
super().__init__()
self.upsample = nn.Upsample(scale_factor=scale_factor, mode=mode)
if p:
self.dropout = nn.Dropout(p)
def forward(self, x):
... |
GraphConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class GraphConv(nn.Module):
def __init__(self, input_dim, output_dim, add_self=False,
normalize_embedding=False, dropout=0.0, bias=True):
super(GraphConv, self).__init__()
self.add_self = add_self
self.dropout = dr... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Qin-J/Multi-site-transfer-classification-of-major-depressive-disorder | GraphConv | false | 2,744 | [
"Apache-2.0"
] | 0 | f6af292388ec83a9851a2254f38e8d90adfe4e6c | https://github.com/Qin-J/Multi-site-transfer-classification-of-major-depressive-disorder/tree/f6af292388ec83a9851a2254f38e8d90adfe4e6c | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim, output_dim, add_self=False,
normalize_embedding=False, dropout=0.0, bias=True):
super().__init__()
self.add_self = add_self
self.dropout = dropout
if dr... |
ChanNorm | # 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
class ChanNorm(nn.Module):
def __init__(self, dim, eps=1e-05):
super().__init__()
self.eps = eps
self.g = nn.Parameter(torch.ones(1, dim, 1, 1))
self.b = nn.Parameter(torch.zeros(1, dim, 1, 1))
def forward(self, x):
var = torch.var(x,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Rexiome/lightweight-gan | ChanNorm | false | 2,745 | [
"MIT"
] | 0 | 4e5c18046fc105129c33995e0bffeb5f14963f4c | https://github.com/Rexiome/lightweight-gan/tree/4e5c18046fc105129c33995e0bffeb5f14963f4c | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim, eps=1e-05):
super().__init__()
self.eps = eps
self.g = nn.Parameter(torch.ones(1, dim, 1, 1))
self.b = nn.Parameter(torch.zeros(1, dim, 1, 1))
def forward(self, x):
var = torch.var(x, di... |
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... | from torch.nn import Module
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
This class is mod... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | QHwan/GCIceNet | GCN | false | 2,746 | [
"MIT"
] | 0 | 5792f5fa7bd2989b54eddeae5c9f8fca3f004bb5 | https://github.com/QHwan/GCIceNet/tree/5792f5fa7bd2989b54eddeae5c9f8fca3f004bb5 | from torch.nn import Module
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
This class is mod... |
Noise | # 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 exists(val):
return val is not None
class Noise(nn.Module):
def __init__(self):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1))
def forward(self, x, noise=None):
b, _, h, w, device = *x.shape, x.device
if not exists(no... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | Rexiome/lightweight-gan | Noise | false | 2,747 | [
"MIT"
] | 0 | 4e5c18046fc105129c33995e0bffeb5f14963f4c | https://github.com/Rexiome/lightweight-gan/tree/4e5c18046fc105129c33995e0bffeb5f14963f4c | import torch
from torch import nn
def exists(val):
return val is not None
class Model(nn.Module):
def __init__(self):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1))
def forward(self, x, noise=None):
b, _, h, w, device = *x.shape, x.device
if not exists(no... |
Decoder5 | # 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 Decoder5(nn.Module):
def __init__(self, model=None, fixed=False):
super(Decoder5, self).__init__()
self.fixed = fixed
self.conv51 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv44 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv43 = nn.Conv2d(512,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | MingSun-Tse/pytorch-AdaIN | Decoder5 | false | 2,748 | [
"MIT"
] | 0 | 02ae320345232983c754ea233613aedc21e4d348 | https://github.com/MingSun-Tse/pytorch-AdaIN/tree/02ae320345232983c754ea233613aedc21e4d348 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv51 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv44 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv43 = nn.Conv2d(512, 512, 3, 1, 0)
... |
PatchEmbed | # 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
class PatchEmbed(nn.Module):
"""
Image to Patch Embedding.
Different with ViT use 1 conv layer, we use 4 conv layers to do patch embedding
"""
def __init__(self, img_size=224, stem_conv=False, stem_stride=1,
patch_size=8, in_chan... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
assert_size_stride = torch._C._dy... | QLSong/cv-classify | PatchEmbed | false | 2,749 | [
"Apache-2.0"
] | 0 | 02f53d03868f299a08b5c97a266b50a7fdcd3f2b | https://github.com/QLSong/cv-classify/tree/02f53d03868f299a08b5c97a266b50a7fdcd3f2b | import torch
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""
Image to Patch Embedding.
Different with ViT use 1 conv layer, we use 4 conv layers to do patch embedding
"""
def __init__(self, img_size=224, stem_conv=False, stem_stride=1,
patch_size=8, in_chans=3, ... |
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... | Odiurd/deep-reinforcement-learning-continuous-control | Critic | false | 2,750 | [
"MIT"
] | 0 | b1fb17ceab8cf23200dbdada21ba2ab0e33aa1a2 | https://github.com/Odiurd/deep-reinforcement-learning-continuous-control/tree/b1fb17ceab8cf23200dbdada21ba2ab0e33aa1a2 | 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... |
ClassBlock | # 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
class Mlp(nn.Module):
"""Implementation of MLP"""
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | QLSong/cv-classify | ClassBlock | false | 2,751 | [
"Apache-2.0"
] | 0 | 02f53d03868f299a08b5c97a266b50a7fdcd3f2b | https://github.com/QLSong/cv-classify/tree/02f53d03868f299a08b5c97a266b50a7fdcd3f2b | import torch
import torch.nn as nn
import torch.nn.parallel
class Mlp(nn.Module):
"""Implementation of MLP"""
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hi... |
CrossModalAttention | # 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
class CrossModalAttention(nn.Module):
def __init__(self, emb_dim, num_heads, num_latents):
super().__init__()
self.value = nn.Parameter(torch.randn(num_latents, emb_dim))
self.attention = nn.MultiheadAttention(emb_dim, num_heads)
def forward(self, ke... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | QuintinPope/FASTA_Perceiver | CrossModalAttention | false | 2,752 | [
"Apache-2.0"
] | 0 | ad3a8e2333a1dec9b34ae024cb2faf38c6ea284a | https://github.com/QuintinPope/FASTA_Perceiver/tree/ad3a8e2333a1dec9b34ae024cb2faf38c6ea284a | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, emb_dim, num_heads, num_latents):
super().__init__()
self.value = nn.Parameter(torch.randn(num_latents, emb_dim))
self.attention = nn.MultiheadAttention(emb_dim, num_heads)
def forward(self, key, query):
... |
Skew | # 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.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
class Skew(nn.Module):
def forward(self, X):
A = X.triu(1)
return A - A.transpose(-1, -2)
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
import torch.nn as nn
import torch.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import to... | MartinRenaudin/tutorials | Skew | false | 2,753 | [
"BSD-3-Clause"
] | 0 | 035d6827d77c52fed2a927f105e39fd73516f093 | https://github.com/MartinRenaudin/tutorials/tree/035d6827d77c52fed2a927f105e39fd73516f093 | import torch
import torch.nn as nn
import torch.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
class Model(nn.Module):
def forward(self, X):
A = X.triu(1)
return A - A.transpose(-1, -2)
... |
TokenEmbedding | # 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.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
class TokenEmbedding(nn.Module):
def __init__(self, vocab_size: 'int', emb_... | 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.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import to... | MartinRenaudin/tutorials | TokenEmbedding | false | 2,754 | [
"BSD-3-Clause"
] | 0 | 035d6827d77c52fed2a927f105e39fd73516f093 | https://github.com/MartinRenaudin/tutorials/tree/035d6827d77c52fed2a927f105e39fd73516f093 | import math
import torch
from torch import Tensor
import torch.nn as nn
import torch.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
class Model(nn.Module):
def __init__(self, vocab_size: 'int', emb_size):
... |
TracedModule | # 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.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
class TracedModule(torch.nn.Module):
def forward(self, x):
x = x.type(torch.float32)
return torch.floor(torch.sqrt(x) ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.quantization
import torch.onnx
import torch.nn.parallel
import tor... | MartinRenaudin/tutorials | TracedModule | false | 2,755 | [
"BSD-3-Clause"
] | 0 | 035d6827d77c52fed2a927f105e39fd73516f093 | https://github.com/MartinRenaudin/tutorials/tree/035d6827d77c52fed2a927f105e39fd73516f093 | import torch
import torch.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
class Model(torch.nn.Module):
def forward(self, x):
x = x.type(torch.float32)
return torch.floor(torch.sqrt(x) / 5.0)
... |
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
import torch.utils.data
from torch import nn
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():
r... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._... | Rick-960123/centermask-mdf-master | Scale | false | 2,756 | [
"BSD-2-Clause"
] | 0 | 49388b03b9ffb06577cd28b9ddaa68cadb82e926 | https://github.com/Rick-960123/centermask-mdf-master/tree/49388b03b9ffb06577cd28b9ddaa68cadb82e926 | import torch
import torch.utils.data
from torch import nn
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 [torc... |
PairwiseDistance | # 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 PairwiseDistance(torch.nn.Module):
def __init__(self, p=2):
super().__init__()
self.p = p
def forward(self, x, y):
x_ = x.repeat([1] + list(y.shape[1:])).reshape(*y.shape, -1)
y_ = y.repeat([1] + list(x.shape[1:])).reshape(*x.shape, -1).transpose(
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_str... | Rikorose/pytorch-ddtw | PairwiseDistance | false | 2,757 | [
"Apache-2.0"
] | 0 | 131d533349042a6cbcfe8b22596e12926ac7fddb | https://github.com/Rikorose/pytorch-ddtw/tree/131d533349042a6cbcfe8b22596e12926ac7fddb | import torch
class Model(torch.nn.Module):
def __init__(self, p=2):
super().__init__()
self.p = p
def forward(self, x, y):
x_ = x.repeat([1] + list(y.shape[1:])).reshape(*y.shape, -1)
y_ = y.repeat([1] + list(x.shape[1:])).reshape(*x.shape, -1).transpose(
-1, -2)
... |
Encoder5 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
class Encoder5(nn.Module):
def __init__(self, model=None, fixed=False):
super(Encoder5, self).__init__()
self.fixed = fixed
self.conv0 = nn.Conv2d(3, 3, 1, 1, 0)
self.conv0.weight = nn.Parameter(torch.from_numpy(np.array([[[[0]... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | MingSun-Tse/pytorch-AdaIN | Encoder5 | false | 2,758 | [
"MIT"
] | 0 | 02ae320345232983c754ea233613aedc21e4d348 | https://github.com/MingSun-Tse/pytorch-AdaIN/tree/02ae320345232983c754ea233613aedc21e4d348 | import torch
import numpy as np
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv0 = nn.Conv2d(3, 3, 1, 1, 0)
self.conv0.weight = nn.Parameter(torch.from_numpy(np.array([[[[0]],
[[... |
SpatialAttention | # 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
class SpatialAttention(nn.Module):
def __init__(self, kernel_size=3):
super(SpatialAttention, self).__init__()
assert kernel_size in (3, 7), 'kernel size must be 3 or 7'
padding = 3 if kernel_size == 7 else 1
self.conv = nn... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
from ... | Rick-960123/centermask-mdf-master | SpatialAttention | false | 2,759 | [
"BSD-2-Clause"
] | 0 | 49388b03b9ffb06577cd28b9ddaa68cadb82e926 | https://github.com/Rick-960123/centermask-mdf-master/tree/49388b03b9ffb06577cd28b9ddaa68cadb82e926 | import torch
import torch.utils.data
from torch import nn
class Model(nn.Module):
def __init__(self, kernel_size=3):
super().__init__()
assert kernel_size in (3, 7), 'kernel size must be 3 or 7'
padding = 3 if kernel_size == 7 else 1
self.conv = nn.Conv2d(2, 1, kernel_size, paddin... |
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.transforms import functional as F
import torch.utils.data
from torch import nn
import torch.nn.functional as F
class Hsigmoid(nn.Module):
def __init__(self, inplace=True):
super(Hsigmoid, self).__init__()
self.inplace = inplace
def forward(self, x):
retu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.transforms i... | Rick-960123/centermask-mdf-master | SEModule | false | 2,760 | [
"BSD-2-Clause"
] | 0 | 49388b03b9ffb06577cd28b9ddaa68cadb82e926 | https://github.com/Rick-960123/centermask-mdf-master/tree/49388b03b9ffb06577cd28b9ddaa68cadb82e926 | import torch
from torchvision.transforms import functional as F
import torch.utils.data
from torch import nn
import torch.nn.functional as F
class Hsigmoid(nn.Module):
def __init__(self, inplace=True):
super().__init__()
self.inplace = inplace
def forward(self, x):
return F.relu6(x +... |
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 torchvision.transforms import functional as F
import torch.utils.data
from torch import nn
import torch.nn.functional as F
class Hsigmoid(nn.Module):
def __init__(self, inplace=True):
super(Hsigmoid, self).__init__()
self.inplace = inplace
def forward(self, x):
retu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.transforms i... | Rick-960123/centermask-mdf-master | eSEModule | false | 2,761 | [
"BSD-2-Clause"
] | 0 | 49388b03b9ffb06577cd28b9ddaa68cadb82e926 | https://github.com/Rick-960123/centermask-mdf-master/tree/49388b03b9ffb06577cd28b9ddaa68cadb82e926 | import torch
from torchvision.transforms import functional as F
import torch.utils.data
from torch import nn
import torch.nn.functional as F
class Hsigmoid(nn.Module):
def __init__(self, inplace=True):
super().__init__()
self.inplace = inplace
def forward(self, x):
return F.relu6(x +... |
Symmetric | # 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.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
class Symmetric(nn.Module):
def forward(self, X):
return X.triu() + X.triu(1).transpose(-1, -2)
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
import torch.nn as nn
import torch.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import to... | MartinRenaudin/tutorials | Symmetric | false | 2,762 | [
"BSD-3-Clause"
] | 0 | 035d6827d77c52fed2a927f105e39fd73516f093 | https://github.com/MartinRenaudin/tutorials/tree/035d6827d77c52fed2a927f105e39fd73516f093 | import torch
import torch.nn as nn
import torch.quantization
import torch.onnx
import torch.nn.parallel
import torch.utils.data
import torch.fx
import torch.nn
import torch.optim
import torch.profiler
class Model(nn.Module):
def forward(self, X):
return X.triu() + X.triu(1).transpose(-1, -2)
def get_in... |
GAT | # 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 GraphAttentionLayer(nn.Module):
"""
Simple GAT layer, similar to https://arxiv.org/abs/1710.10903
"""
def __init__(self, in_features, out_features, dropout, alpha, concat=True):
super(GraphAttentionLayer, 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.... | Prasath2001/commonsense-rl | GAT | false | 2,763 | [
"Apache-2.0"
] | 0 | ef3e83270d34cf211b2d2086120cccae0621477b | https://github.com/Prasath2001/commonsense-rl/tree/ef3e83270d34cf211b2d2086120cccae0621477b | import torch
import torch.nn as nn
import torch.nn.functional as F
class GraphAttentionLayer(nn.Module):
"""
Simple GAT layer, similar to https://arxiv.org/abs/1710.10903
"""
def __init__(self, in_features, out_features, dropout, alpha, concat=True):
super().__init__()
self.dropout = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.