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
Fire
# 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.nn as nn class Fire(nn.Module): def __init__(self, inplanes, squeeze_planes, expand1x1_planes, expand3x3_planes): super(Fire, self).__init__() self.inplanes = inplanes self.squeeze = nn.Conv1d(inplanes, squeeze_planes, 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 import torch.utils.data impor...
botcs/dsp-lr
Fire
false
9,890
[ "Apache-2.0" ]
0
15856def3c91821cbcbf37803337630a68dd1f86
https://github.com/botcs/dsp-lr/tree/15856def3c91821cbcbf37803337630a68dd1f86
import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self, inplanes, squeeze_planes, expand1x1_planes, expand3x3_planes): super().__init__() self.inplanes = inplanes self.squeeze = nn.Conv1d(inplanes, squeeze_planes, kernel_size=1) ...
ModMBStddevLayer
# 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 ModMBStddevLayer(nn.Module): """Modified MiniBatch Stddev Layer. This layer is modified from ``MiniBatchStddevLayer`` used in PGGAN. In StyleGAN2, the authors add a new feature, `channel_groups`, into this layer. """ def __init__(self, group_size=4, c...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
Sardhendu/mmediting
ModMBStddevLayer
false
9,891
[ "Apache-2.0" ]
0
623b59ac758d856abc9fab7e845beeab61074d8f
https://github.com/Sardhendu/mmediting/tree/623b59ac758d856abc9fab7e845beeab61074d8f
import torch import torch.nn as nn class Model(nn.Module): """Modified MiniBatch Stddev Layer. This layer is modified from ``MiniBatchStddevLayer`` used in PGGAN. In StyleGAN2, the authors add a new feature, `channel_groups`, into this layer. """ def __init__(self, group_size=4, channel_grou...
PlainRefiner
# 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 PlainRefiner(nn.Module): """Simple refiner from Deep Image Matting. Args: conv_channels (int): Number of channels produced by the three main convolutional layer. loss_refine (dict): Config of the loss of the refiner. Default: None. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Sardhendu/mmediting
PlainRefiner
false
9,892
[ "Apache-2.0" ]
0
623b59ac758d856abc9fab7e845beeab61074d8f
https://github.com/Sardhendu/mmediting/tree/623b59ac758d856abc9fab7e845beeab61074d8f
import torch import torch.nn as nn class Model(nn.Module): """Simple refiner from Deep Image Matting. Args: conv_channels (int): Number of channels produced by the three main convolutional layer. loss_refine (dict): Config of the loss of the refiner. Default: None. pretrai...
SRCNN
# 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 logging import torch import torch.nn as nn def get_root_logger(log_file=None, log_level=logging.INFO): """Get the root logger. The logger will be initialized if it has not been initialized. By default a StreamHandler will be added. If `log_file` is specified, a FileHandler will also be added. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Sardhendu/mmediting
SRCNN
false
9,893
[ "Apache-2.0" ]
0
623b59ac758d856abc9fab7e845beeab61074d8f
https://github.com/Sardhendu/mmediting/tree/623b59ac758d856abc9fab7e845beeab61074d8f
import logging import torch import torch.nn as nn def get_root_logger(log_file=None, log_level=logging.INFO): """Get the root logger. The logger will be initialized if it has not been initialized. By default a StreamHandler will be added. If `log_file` is specified, a FileHandler will also be added. ...
AsymmetricLossMultiLabel
# 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.onnx import torch.utils.data import torch.nn.parallel from torch import optim as optim class AsymmetricLossMultiLabel(nn.Module): def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): super(Asymmetri...
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 ...
cagery/pytorch-image-models
AsymmetricLossMultiLabel
false
9,894
[ "Apache-2.0" ]
0
9211b0bd368cecf970165cfad81770dc14e25d45
https://github.com/cagery/pytorch-image-models/tree/9211b0bd368cecf970165cfad81770dc14e25d45
import torch from torch import nn import torch.onnx import torch.utils.data import torch.nn.parallel from torch import optim as optim class Model(nn.Module): def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): super().__init__() self.ga...
KLDivLoss
# 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 KLDivLoss(nn.Module): """ ## KL-Divergence loss This calculates the KL divergence between a given normal distribution and $\\mathcal{N}(0, 1)$ """ def forward(self, sigma_hat, mu): return -0.5 * torch.mean(1 + sigma_hat - mu ** 2 - torch.exp(sigma...
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 ...
chrissarmstrong/PL-Sketch-RNN
KLDivLoss
false
9,895
[ "MIT" ]
0
82a34718b10f7a2a1458dbad41ba85f0036267c0
https://github.com/chrissarmstrong/PL-Sketch-RNN/tree/82a34718b10f7a2a1458dbad41ba85f0036267c0
import torch import torch.nn as nn class Model(nn.Module): """ ## KL-Divergence loss This calculates the KL divergence between a given normal distribution and $\\mathcal{N}(0, 1)$ """ def forward(self, sigma_hat, mu): return -0.5 * torch.mean(1 + sigma_hat - mu ** 2 - torch.exp(sigma_hat...
Lookahead
# 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.distributed import torch.nn as nn import torch.nn.functional as F class Lookahead(nn.Module): def __init__(self, n_features, context): super(Lookahead, self).__init__() assert context > 0 self.context = context self.n_features = n_features ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data.distributed import torch.nn as nn assert_size_stride = t...
chaiyujin/deepspeech.pytorch
Lookahead
false
9,896
[ "MIT" ]
0
b4edbafb955f35316869ce3fda2dc9cd47968038
https://github.com/chaiyujin/deepspeech.pytorch/tree/b4edbafb955f35316869ce3fda2dc9cd47968038
import torch import torch.utils.data.distributed import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, n_features, context): super().__init__() assert context > 0 self.context = context self.n_features = n_features self.pad = 0, s...
Reorg
# 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 Reorg(nn.Module): dump_patches = True def __init__(self): super(Reorg, self).__init__() def forward(self, x): ss = x.size() out = x.view(ss[0], ss[1], ss[2] // 2, 2, ss[3]).view(ss[0], ss[1], ss[2] // 2, 2, ss[3] // 2, 2).permu...
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...
ahmedelhodaiby/HandMesh
Reorg
false
9,897
[ "MIT" ]
0
d86ec322b7627c5756bd9ae9e152bcd4f2debfa6
https://github.com/ahmedelhodaiby/HandMesh/tree/d86ec322b7627c5756bd9ae9e152bcd4f2debfa6
import torch import torch.nn as nn class Model(nn.Module): dump_patches = True def __init__(self): super().__init__() def forward(self, x): ss = x.size() out = x.view(ss[0], ss[1], ss[2] // 2, 2, ss[3]).view(ss[0], ss[1], ss[2] // 2, 2, ss[3] // 2, 2).permute(0, 1, 3,...
DNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn.functional as F import torch.nn as nn class DNN(nn.Module): def __init__(self, n_concat, freq_bins, *, dropout=0.2): super().__init__() hidden_units = 2048 self.dropout = dropout self.fc1 = nn.Linear(n_concat * freq_bins, hidden_units) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math import torch.nn a...
cHemingway/sednn_pytorch_ignite
DNN
false
9,898
[ "MIT" ]
0
5b82dcc92829513acc382f0b189003cca206468b
https://github.com/cHemingway/sednn_pytorch_ignite/tree/5b82dcc92829513acc382f0b189003cca206468b
import math import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, n_concat, freq_bins, *, dropout=0.2): super().__init__() hidden_units = 2048 self.dropout = dropout self.fc1 = nn.Linear(n_concat * freq_bins, hidden_units) ...
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 from torch import nn import torch.onnx import torch.utils.data import torchvision.transforms.functional as F import torch.nn.functional as F import torch.nn.parallel from torch import optim as optim def adaptive_avgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_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 from torch import nn import torch.onnx import torch.utils.data import torchvision.transfo...
cagery/pytorch-image-models
AdaptiveAvgMaxPool2d
false
9,899
[ "Apache-2.0" ]
0
9211b0bd368cecf970165cfad81770dc14e25d45
https://github.com/cagery/pytorch-image-models/tree/9211b0bd368cecf970165cfad81770dc14e25d45
import torch from torch import nn import torch.onnx import torch.utils.data import torchvision.transforms.functional as F import torch.nn.functional as F import torch.nn.parallel from torch import optim as optim def adaptive_avgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_max ...
AvgPoolStride1
# 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 AvgPoolStride1(nn.Module): def __init__(self): super(AvgPoolStride1, self).__init__() def forward(self, x): x = F.avg_pool2d(F.pad(x, (0, 1, 0, 1), mode='replicate'), 2, stride=1) return x def get_inputs(): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
ciodar/YOLOv3_PyTorch
AvgPoolStride1
false
9,900
[ "MIT" ]
0
50209393b3e6c1fdc1a7f9299eb77189fffe6740
https://github.com/ciodar/YOLOv3_PyTorch/tree/50209393b3e6c1fdc1a7f9299eb77189fffe6740
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): x = F.avg_pool2d(F.pad(x, (0, 1, 0, 1), mode='replicate'), 2, stride=1) return x def get_inputs(): return [torch.rand([4, 4, 4...
ModulatedToRGB
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from functools import partial from torch.nn import functional as F from copy import deepcopy from torch.nn.init import _calculate_correct_fan def equalized_lr(module, name='weight', gain=2 ** 0.5, mode='fan_in', lr_mul=1.0): """Equalized Learning Rate. This trick is pro...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from functools import partial from torch.nn import functio...
Sardhendu/mmediting
ModulatedToRGB
false
9,901
[ "Apache-2.0" ]
0
623b59ac758d856abc9fab7e845beeab61074d8f
https://github.com/Sardhendu/mmediting/tree/623b59ac758d856abc9fab7e845beeab61074d8f
import torch import torch.nn as nn from functools import partial from torch.nn import functional as F from copy import deepcopy from torch.nn.init import _calculate_correct_fan def equalized_lr(module, name='weight', gain=2 ** 0.5, mode='fan_in', lr_mul=1.0): """Equalized Learning Rate. This trick is pro...
SelfAttention
# 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 SelfAttention(nn.Module): def __init__(self, in_dim): super(SelfAttention, self).__init__() self.query_conv = nn.Linear(in_dim, in_dim) self.key_conv = nn.Linear(in_dim, in_dim) self.value_conv = nn.Linear(in_dim, in_dim) for name, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
ahmedelhodaiby/HandMesh
SelfAttention
false
9,902
[ "MIT" ]
0
d86ec322b7627c5756bd9ae9e152bcd4f2debfa6
https://github.com/ahmedelhodaiby/HandMesh/tree/d86ec322b7627c5756bd9ae9e152bcd4f2debfa6
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_dim): super().__init__() self.query_conv = nn.Linear(in_dim, in_dim) self.key_conv = nn.Linear(in_dim, in_dim) self.value_conv = nn.Linear(in_dim, in_dim) for name, param in self.named_paramet...
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 from torch import nn import torch.onnx import torch.utils.data import torchvision.transforms.functional as F import torch.nn.functional as F import torch.nn.parallel from torch import optim as optim def adaptive_catavgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_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 from torch import nn import torch.onnx import torch.utils.data import torchvision.transfo...
cagery/pytorch-image-models
AdaptiveCatAvgMaxPool2d
false
9,903
[ "Apache-2.0" ]
0
9211b0bd368cecf970165cfad81770dc14e25d45
https://github.com/cagery/pytorch-image-models/tree/9211b0bd368cecf970165cfad81770dc14e25d45
import torch from torch import nn import torch.onnx import torch.utils.data import torchvision.transforms.functional as F import torch.nn.functional as F import torch.nn.parallel from torch import optim as optim def adaptive_catavgmax_pool2d(x, output_size=1): x_avg = F.adaptive_avg_pool2d(x, output_size) x_m...
LinearBlock
# 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 scipy.stats import truncnorm def truncated_normal_(tensor, mean=0.0, std=1.0): values = truncnorm.rvs(-2, 2, size=tensor.shape) values = mean + std * values tensor.copy_(torch.from_numpy(values)) return tensor def fc_init_(module): if hasattr(module, 'weight') and module.weight...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
aylagulcu/TripletMAML
LinearBlock
false
9,904
[ "MIT" ]
0
98cb4a23847ec24937963292cd6f162bcbf724ba
https://github.com/aylagulcu/TripletMAML/tree/98cb4a23847ec24937963292cd6f162bcbf724ba
import torch from scipy.stats import truncnorm def truncated_normal_(tensor, mean=0.0, std=1.0): values = truncnorm.rvs(-2, 2, size=tensor.shape) values = mean + std * values tensor.copy_(torch.from_numpy(values)) return tensor def fc_init_(module): if hasattr(module, 'weight') and module.weight...
SpeakNet
# 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.optim def xavier_init(module): """ Xavier initializer for module parameters. """ for parameter in module.parameters(): if len(parameter.data.shape) == 1: parameter.data.fill_(0) else: fan_in = parameter...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
christiancosgrove/cs767hw3
SpeakNet
false
9,905
[ "MIT" ]
0
7c906d7b92394cc30ed94a714b199467c269cadf
https://github.com/christiancosgrove/cs767hw3/tree/7c906d7b92394cc30ed94a714b199467c269cadf
import math import torch import torch.nn as nn import torch.optim def xavier_init(module): """ Xavier initializer for module parameters. """ for parameter in module.parameters(): if len(parameter.data.shape) == 1: parameter.data.fill_(0) else: fan_in = parameter...
ConvModel
# 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 ConvModel(nn.Module): def __init__(self): super(ConvModel, self).__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = nn.Linear(16 * 5 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
chetanseth/pytorch
ConvModel
false
9,906
[ "MIT" ]
0
001aaf56ee72e0a8b4df5fe8ad84fda6354a084c
https://github.com/chetanseth/pytorch/tree/001aaf56ee72e0a8b4df5fe8ad84fda6354a084c
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = nn.Linear(16 * 5 * 5, 200) s...
PixelwiseNorm
# 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 as th class PixelwiseNorm(th.nn.Module): def __init__(self): super(PixelwiseNorm, self).__init__() def forward(self, x, alpha=1e-08): """ forward pass of the module :param x: input activations volume :param alpha: small number for numerical s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch as th assert_size_stride = torch._C._dynamo.guards.assert_size_str...
alexeyhorkin/ProGAN-PyTorch
PixelwiseNorm
false
9,907
[ "MIT" ]
0
731ba596e9366c602a771a40b81957cd12386836
https://github.com/alexeyhorkin/ProGAN-PyTorch/tree/731ba596e9366c602a771a40b81957cd12386836
import torch import torch as th class Model(th.nn.Module): def __init__(self): super().__init__() def forward(self, x, alpha=1e-08): """ forward pass of the module :param x: input activations volume :param alpha: small number for numerical stability :return: y...
MinibatchStdDev
# 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 as th class MinibatchStdDev(th.nn.Module): """ Minibatch standard deviation layer for the discriminator """ def __init__(self): """ derived class constructor """ super(MinibatchStdDev, self).__init__() def forward(self, x, alpha=1e-08): ...
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 as th assert_size_stride = torch._C._dynamo.guards.assert_size_str...
alexeyhorkin/ProGAN-PyTorch
MinibatchStdDev
false
9,908
[ "MIT" ]
0
731ba596e9366c602a771a40b81957cd12386836
https://github.com/alexeyhorkin/ProGAN-PyTorch/tree/731ba596e9366c602a771a40b81957cd12386836
import torch import torch as th class Model(th.nn.Module): """ Minibatch standard deviation layer for the discriminator """ def __init__(self): """ derived class constructor """ super().__init__() def forward(self, x, alpha=1e-08): """ forward pass...
CoxPHLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor def cox_ph_loss_sorted(log_h: 'Tensor', events: 'Tensor', eps: 'float'=1e-07 ) ->Tensor: """Requires the input to be sorted by descending duration time. See DatasetDurationSorted. We calculate the negative log of $( rac{h_i}{\\sum_{j \\in R_i} h_j})^d$, where...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid, split_scan_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 ...
bseewald/pycox
CoxPHLoss
false
9,909
[ "BSD-2-Clause" ]
0
366348d51ecd902a01ab830b2f0a4cf1694d9ae2
https://github.com/bseewald/pycox/tree/366348d51ecd902a01ab830b2f0a4cf1694d9ae2
import torch from torch import Tensor def cox_ph_loss_sorted(log_h: 'Tensor', events: 'Tensor', eps: 'float'=1e-07 ) ->Tensor: """Requires the input to be sorted by descending duration time. See DatasetDurationSorted. We calculate the negative log of $( rac{h_i}{\\sum_{j \\in R_i} h_j})^d$, where...
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, smooth=0, eps=1e-07): super(DiceLoss, self).__init__() self.smooth = smooth self.eps = eps def forward(self, output, target): return 1 - (2 * torch.sum(output * target) + self.smooth) / (torch. ...
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...
bielrv/open-solution-salt-identification-solution-6
DiceLoss
false
9,910
[ "MIT" ]
0
5993494aa2e446991c7f43e0cf1ec996620dfa80
https://github.com/bielrv/open-solution-salt-identification-solution-6/tree/5993494aa2e446991c7f43e0cf1ec996620dfa80
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, smooth=0, eps=1e-07): super().__init__() self.smooth = smooth self.eps = eps def forward(self, output, target): return 1 - (2 * torch.sum(output * target) + self.smooth) / (torch. sum(ou...
Generator
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F from torch import nn class Generator(nn.Module): def __init__(self, d_model, vocab_size): super(Generator, self).__init__() self.proj = nn.Linear(d_model, vocab_size) def forward(self, x, temperature): return F.log_softmax(self.proj(x) / t...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
chanhee0222/feed2resp
Generator
false
9,911
[ "MIT" ]
0
16dc7071f17af56cbf019eeabcd12a5dbd0693e7
https://github.com/chanhee0222/feed2resp/tree/16dc7071f17af56cbf019eeabcd12a5dbd0693e7
import torch import torch.nn.functional as F from torch import nn class Model(nn.Module): def __init__(self, d_model, vocab_size): super().__init__() self.proj = nn.Linear(d_model, vocab_size) def forward(self, x, temperature): return F.log_softmax(self.proj(x) / temperature, dim=-1)...
ShakeResNet
# 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.nn import functional as F from torch import nn class ShakeShake(torch.autograd.Function): @staticmethod def forward(ctx, x1, x2, training=True): if training: alpha = torch.FloatTensor(x1.size(0)).uniform_() alpha = alpha.view(alpha.size(0), ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math from torch.nn imp...
ang421/dda
ShakeResNet
false
9,912
[ "MIT" ]
0
391ad696ec8479ce41a0d7d6bfbfae06edaddf67
https://github.com/ang421/dda/tree/391ad696ec8479ce41a0d7d6bfbfae06edaddf67
import math import torch from torch.nn import functional as F from torch import nn class ShakeShake(torch.autograd.Function): @staticmethod def forward(ctx, x1, x2, training=True): if training: alpha = torch.FloatTensor(x1.size(0)).uniform_() alpha = alpha.view(alpha.size(0), ...
ShakeResNeXt
# 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.nn import functional as F from torch import nn class ShakeShake(torch.autograd.Function): @staticmethod def forward(ctx, x1, x2, training=True): if training: alpha = torch.FloatTensor(x1.size(0)).uniform_() alpha = alpha.view(alpha.size(0), ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math from torch.nn imp...
ang421/dda
ShakeResNeXt
false
9,913
[ "MIT" ]
0
391ad696ec8479ce41a0d7d6bfbfae06edaddf67
https://github.com/ang421/dda/tree/391ad696ec8479ce41a0d7d6bfbfae06edaddf67
import math import torch from torch.nn import functional as F from torch import nn class ShakeShake(torch.autograd.Function): @staticmethod def forward(ctx, x1, x2, training=True): if training: alpha = torch.FloatTensor(x1.size(0)).uniform_() alpha = alpha.view(alpha.size(0), ...
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 from torch import nn from torch import einsum class Attention(nn.Module): def __init__(self, dim_in, dim_out, dim_inner, causal=False): super().__init__() self.scale = dim_inner ** -0.5 self.causal = causal self.to_qkv = nn.Linear(dim_in, dim_inner * 3, bias=False) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
cpmolnar/gMLP-Disaster-Tweets
Attention
false
9,914
[ "MIT" ]
0
7b13651c2260bc112d706a99466c069fb9348205
https://github.com/cpmolnar/gMLP-Disaster-Tweets/tree/7b13651c2260bc112d706a99466c069fb9348205
import torch from torch import nn from torch import einsum class Model(nn.Module): def __init__(self, dim_in, dim_out, dim_inner, causal=False): super().__init__() self.scale = dim_inner ** -0.5 self.causal = causal self.to_qkv = nn.Linear(dim_in, dim_inner * 3, bias=False) ...
EqualLinearActModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from functools import partial from copy import deepcopy from torch.nn.init import _calculate_correct_fan def equalized_lr(module, name='weight', gain=2 ** 0.5, mode='fan_in', lr_mul=1.0): """Equalized Learning Rate. This trick is proposed in: Progressive Growing of ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from functools import partial from copy import deepcopy fr...
Sardhendu/mmediting
EqualLinearActModule
false
9,915
[ "Apache-2.0" ]
0
623b59ac758d856abc9fab7e845beeab61074d8f
https://github.com/Sardhendu/mmediting/tree/623b59ac758d856abc9fab7e845beeab61074d8f
import torch import torch.nn as nn from functools import partial from copy import deepcopy from torch.nn.init import _calculate_correct_fan def equalized_lr(module, name='weight', gain=2 ** 0.5, mode='fan_in', lr_mul=1.0): """Equalized Learning Rate. This trick is proposed in: Progressive Growing of ...
RecognizeNet
# 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 RecognizeNet(nn.Module): def __init__(self, num_classes=3): super(RecognizeNet, self).__init__() self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size= 3, stride=1, padding=1) self.relu1 = nn.ReLU() self.pool1 = nn....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
ckfanzhe/Face_recognize-Pytorch-
RecognizeNet
false
9,916
[ "Apache-2.0" ]
0
0cf0853a26a25d0166f0082d8171160daa4cf747
https://github.com/ckfanzhe/Face_recognize-Pytorch-/tree/0cf0853a26a25d0166f0082d8171160daa4cf747
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_classes=3): super().__init__() self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size= 3, stride=1, padding=1) self.relu1 = nn.ReLU() self.pool1 = nn.MaxPool2d(kernel_size=2) ...
AdversarialNetwork
# 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 AdversarialNetwork(nn.Module): def __init__(self, in_feature): super(AdversarialNetwork, self).__init__() self.ad_layer1 = nn.Linear(in_feature, 1024) self.ad_layer2 = nn.Linear(1024, 1024) self.ad_layer3 = nn.Linear(1024, 1) self.a...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
caozhangjie/kinetics_i3d_pytorch
AdversarialNetwork
false
9,917
[ "MIT" ]
0
237713bb76cf71b6d60d1a4df98f00df3a489cc3
https://github.com/caozhangjie/kinetics_i3d_pytorch/tree/237713bb76cf71b6d60d1a4df98f00df3a489cc3
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_feature): super().__init__() self.ad_layer1 = nn.Linear(in_feature, 1024) self.ad_layer2 = nn.Linear(1024, 1024) self.ad_layer3 = nn.Linear(1024, 1) self.ad_layer1.weight.data.normal_(0, 0.01)...
TemporalConvModel
# 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 TemporalConvModel(nn.Module): def __init__(self, in_feature, seq_len): super(TemporalConvModel, self).__init__() self.conv1 = nn.Conv1d(in_feature, 256, 1, 1) self.conv2 = nn.Conv1d(256, 256, 3, 1, 1) self.conv3 = nn.Conv1d(256, 256, 3, 1, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
caozhangjie/kinetics_i3d_pytorch
TemporalConvModel
false
9,918
[ "MIT" ]
0
237713bb76cf71b6d60d1a4df98f00df3a489cc3
https://github.com/caozhangjie/kinetics_i3d_pytorch/tree/237713bb76cf71b6d60d1a4df98f00df3a489cc3
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_feature, seq_len): super().__init__() self.conv1 = nn.Conv1d(in_feature, 256, 1, 1) self.conv2 = nn.Conv1d(256, 256, 3, 1, 1) self.conv3 = nn.Conv1d(256, 256, 3, 1, 1) self.fc = nn.Linear(256 ...
UpsampleConvLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch class UpsampleConvLayer(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride, upsample=None): super().__init__() self.upsample = upsample reflectpad = kernel_size // 2 self.reflectionpad = torch.nn.ReflectionPad2d(reflectpad) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
bruchano/ImageStyler
UpsampleConvLayer
false
9,919
[ "MIT" ]
0
7bde13bc954566088c477065adb5c4e4214c28bb
https://github.com/bruchano/ImageStyler/tree/7bde13bc954566088c477065adb5c4e4214c28bb
import torch class Model(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride, upsample=None): super().__init__() self.upsample = upsample reflectpad = kernel_size // 2 self.reflectionpad = torch.nn.ReflectionPad2d(reflectpad) self.co...
BilinearClassifyBlock
# 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.nn.parallel import torch.optim class BilinearClassifyBlock(nn.Module): def __init__(self, in_channels, out_channels): super(BilinearClassifyBlock, self).__init__() self.compress = nn.Conv3d(in_channels=in_channels, ou...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
caijh33/I3D_CTC
BilinearClassifyBlock
false
9,920
[ "Apache-2.0" ]
0
dd73ece2b810eed775fc847b7017080902e9c260
https://github.com/caijh33/I3D_CTC/tree/dd73ece2b810eed775fc847b7017080902e9c260
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.optim class Model(nn.Module): def __init__(self, in_channels, out_channels): super().__init__() self.compress = nn.Conv3d(in_channels=in_channels, out_channels= out_channels, kerne...
OrthogonalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F from torch import nn class OrthogonalLoss(nn.Module): def __init__(self): super(OrthogonalLoss, self).__init__() def forward(self, features, descriptor, labels): features = F.normalize(features, dim=1) labels_equal = torch.eq(labels.unsque...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
chrisbyd/ContrastiveVehicleQuant
OrthogonalLoss
false
9,921
[ "MIT" ]
0
bf471988868cf0cb9713002dd1d6726272ecce7f
https://github.com/chrisbyd/ContrastiveVehicleQuant/tree/bf471988868cf0cb9713002dd1d6726272ecce7f
import torch import torch.nn.functional as F from torch import nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, features, descriptor, labels): features = F.normalize(features, dim=1) labels_equal = torch.eq(labels.unsqueeze(1), labels.unsqueeze(0)) ...
SoftQNetwork
# 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 SoftQNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size=[400, 300], init_w=0.003): super(SoftQNetwork, self).__init__() self.linear1 = nn.Linear(num_inputs + num_actions, hidden_size[0]) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
constancecrozier/CityLearn
SoftQNetwork
false
9,922
[ "MIT" ]
0
c92f981771d29181cffce448a31d8f367a668175
https://github.com/constancecrozier/CityLearn/tree/c92f981771d29181cffce448a31d8f367a668175
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size=[400, 300], init_w=0.003): super().__init__() self.linear1 = nn.Linear(num_inputs + num_actions, hidden_size[0]) self.linear2 = nn.Lin...
SmallAdversarialNetwork
# 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 SmallAdversarialNetwork(nn.Module): def __init__(self, in_feature): super(SmallAdversarialNetwork, self).__init__() self.ad_layer1 = nn.Linear(in_feature, 256) self.ad_layer2 = nn.Linear(256, 1) self.ad_layer1.weight.data.normal_(0, 0.01) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
caozhangjie/kinetics_i3d_pytorch
SmallAdversarialNetwork
false
9,923
[ "MIT" ]
0
237713bb76cf71b6d60d1a4df98f00df3a489cc3
https://github.com/caozhangjie/kinetics_i3d_pytorch/tree/237713bb76cf71b6d60d1a4df98f00df3a489cc3
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_feature): super().__init__() self.ad_layer1 = nn.Linear(in_feature, 256) self.ad_layer2 = nn.Linear(256, 1) self.ad_layer1.weight.data.normal_(0, 0.01) self.ad_layer2.weight.data.normal_(0, 0....
VGG19Decoder1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from collections import OrderedDict class VGG19Decoder1(nn.Module): def __init__(self): super(VGG19Decoder1, self).__init__() self.blocks = OrderedDict([('pad1_1', nn.ReflectionPad2d(1)), ( 'conv1_1', nn.Conv2d(64, 3, 3, 1, 0))]) self.seq = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
chenhsiu48/PytorchWCT
VGG19Decoder1
false
9,924
[ "MIT" ]
0
c3346ebaec95358ad1d4d5a519d5d0e7de73bc75
https://github.com/chenhsiu48/PytorchWCT/tree/c3346ebaec95358ad1d4d5a519d5d0e7de73bc75
import torch import torch.nn as nn from collections import OrderedDict class Model(nn.Module): def __init__(self): super().__init__() self.blocks = OrderedDict([('pad1_1', nn.ReflectionPad2d(1)), ( 'conv1_1', nn.Conv2d(64, 3, 3, 1, 0))]) self.seq = nn.Sequential(self.blocks) ...
Convlayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch class Convlayer(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1): super().__init__() padding = kernel_size // 2 self.refl = torch.nn.ReflectionPad2d(padding) self.conv = torch.nn.Conv2d(in_channels, out_channels, 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.triton_helpers import math as tl_math assert_size_s...
bruchano/ImageStyler
Convlayer
false
9,925
[ "MIT" ]
0
7bde13bc954566088c477065adb5c4e4214c28bb
https://github.com/bruchano/ImageStyler/tree/7bde13bc954566088c477065adb5c4e4214c28bb
import torch class Model(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1): super().__init__() padding = kernel_size // 2 self.refl = torch.nn.ReflectionPad2d(padding) self.conv = torch.nn.Conv2d(in_channels, out_channels, kernel_size, ...
Generator
# 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 Generator(nn.Module): """Define standard linear + softmax generation step.""" def __init__(self, d_model, vocab): super(Generator, self).__init__() self.d_model = d_model self.proj1 = nn.Linear(self.d_model, self.d_model) self.proj = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
context-aware-Failure-Identification/CLog
Generator
false
9,926
[ "MIT" ]
0
ef2c87605fa3cdb6db6666c754311ab9c3fed371
https://github.com/context-aware-Failure-Identification/CLog/tree/ef2c87605fa3cdb6db6666c754311ab9c3fed371
import torch import torch.nn as nn class Model(nn.Module): """Define standard linear + softmax generation step.""" def __init__(self, d_model, vocab): super().__init__() self.d_model = d_model self.proj1 = nn.Linear(self.d_model, self.d_model) self.proj = nn.Linear(self.d_mode...
GaussianBlock
# 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.optim import torch.multiprocessing from torch.nn.parameter import Parameter class FullyConnected(nn.Module): def __init__(self, in_features, out_features, bias=True): """ Fully connected layer of learnable weights with learnable bias ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import math import torch.nn a...
bouracha/Gen_Motion
GaussianBlock
false
9,927
[ "MIT" ]
0
873caa496d14c9a9723581cdf1464f44db4cf358
https://github.com/bouracha/Gen_Motion/tree/873caa496d14c9a9723581cdf1464f44db4cf358
import math import torch import torch.nn as nn import torch.optim import torch.multiprocessing from torch.nn.parameter import Parameter class FullyConnected(nn.Module): def __init__(self, in_features, out_features, bias=True): """ Fully connected layer of learnable weights with learnable bias ...
Residential
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch class Convlayer(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1): super().__init__() padding = kernel_size // 2 self.refl = torch.nn.ReflectionPad2d(padding) self.conv = torch.nn.Conv2d(in_channels, out_channels, 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....
bruchano/ImageStyler
Residential
false
9,928
[ "MIT" ]
0
7bde13bc954566088c477065adb5c4e4214c28bb
https://github.com/bruchano/ImageStyler/tree/7bde13bc954566088c477065adb5c4e4214c28bb
import torch class Convlayer(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1): super().__init__() padding = kernel_size // 2 self.refl = torch.nn.ReflectionPad2d(padding) self.conv = torch.nn.Conv2d(in_channels, out_channels, kernel_size, ...
FC_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 math import torch import torch.nn as nn import torch.optim import torch.multiprocessing from torch.nn.parameter import Parameter class FullyConnected(nn.Module): def __init__(self, in_features, out_features, bias=True): """ Fully connected layer of learnable weights with learnable bias ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.nn as nn import torch.optim import torch.multiprocessin...
bouracha/Gen_Motion
FC_Block
false
9,929
[ "MIT" ]
0
873caa496d14c9a9723581cdf1464f44db4cf358
https://github.com/bouracha/Gen_Motion/tree/873caa496d14c9a9723581cdf1464f44db4cf358
import math import torch import torch.nn as nn import torch.optim import torch.multiprocessing from torch.nn.parameter import Parameter class FullyConnected(nn.Module): def __init__(self, in_features, out_features, bias=True): """ Fully connected layer of learnable weights with learnable bias ...
_BoundaryRefineModule
# 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 _BoundaryRefineModule(nn.Module): def __init__(self, dim): super(_BoundaryRefineModule, self).__init__() self.relu = nn.ReLU(inplace=True) self.conv1 = nn.Conv2d(dim, dim, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(dim, dim, kernel_siz...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
adynathos/pytorch-semantic-segmentation
_BoundaryRefineModule
false
9,930
[ "MIT" ]
0
44d1784984cfd0926821c3fdbc20d371bb074296
https://github.com/adynathos/pytorch-semantic-segmentation/tree/44d1784984cfd0926821c3fdbc20d371bb074296
import torch from torch import nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.relu = nn.ReLU(inplace=True) self.conv1 = nn.Conv2d(dim, dim, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(dim, dim, kernel_size=3, padding=1) def forward(self, x): ...
GraphGaussianBlock
# 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.optim import torch.multiprocessing from torch.nn.parameter import Parameter class GraphConvolution(nn.Module): def __init__(self, in_features, out_features, bias=True, node_n=48, out_node_n=None): super(GraphConvolution, 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 import math import torch.nn a...
bouracha/Gen_Motion
GraphGaussianBlock
false
9,931
[ "MIT" ]
0
873caa496d14c9a9723581cdf1464f44db4cf358
https://github.com/bouracha/Gen_Motion/tree/873caa496d14c9a9723581cdf1464f44db4cf358
import math import torch import torch.nn as nn import torch.optim import torch.multiprocessing from torch.nn.parameter import Parameter class GraphConvolution(nn.Module): def __init__(self, in_features, out_features, bias=True, node_n=48, out_node_n=None): super().__init__() if out_node_n...
SpatialAttention2d
# 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 SpatialAttention2d(nn.Module): def __init__(self, channel): super(SpatialAttention2d, self).__init__() self.squeeze = nn.Conv2d(channel, 1, kernel_size=1, bias=False) self.sigmoid = nn.Sigmoid() def forward(self, x): z = self.squeeze(x...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
advian123/kaggle-birdsong-recognition
SpatialAttention2d
false
9,932
[ "MIT" ]
0
a4ca8ab81e166b919452fb5d6ca4c2912c65e904
https://github.com/advian123/kaggle-birdsong-recognition/tree/a4ca8ab81e166b919452fb5d6ca4c2912c65e904
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, channel): super().__init__() self.squeeze = nn.Conv2d(channel, 1, kernel_size=1, bias=False) self.sigmoid = nn.Sigmoid() def forward(self, x): z = self.squeeze(x) z = self.sigmoid(z) ...
LSoftLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.nn as nn class LSoftLoss(nn.Module): def __init__(self): super().__init__() def forward(self, y_pred, y_true, beta): with torch.no_grad(): y_true_updated = beta * y_true + (1 - beta) * y_pred return F.binary_cross_...
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...
advian123/kaggle-birdsong-recognition
LSoftLoss
false
9,933
[ "MIT" ]
0
a4ca8ab81e166b919452fb5d6ca4c2912c65e904
https://github.com/advian123/kaggle-birdsong-recognition/tree/a4ca8ab81e166b919452fb5d6ca4c2912c65e904
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, y_pred, y_true, beta): with torch.no_grad(): y_true_updated = beta * y_true + (1 - beta) * y_pred return F.binary_cross_entr...
LanguageModelCriterion
# 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.autograd import * def to_contiguous(tensor): if tensor.is_contiguous(): return tensor else: return tensor.contiguous() class LanguageModelCriterion(nn.Module): def __init__(self): super(LanguageModelCriterion, self).__init__() 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 from torch.autograd import * assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
curlG0/videotime
LanguageModelCriterion
false
9,934
[ "MIT" ]
0
4eba44d148ba2d11f9bf2e9ba3ea9a3ecac70721
https://github.com/curlG0/videotime/tree/4eba44d148ba2d11f9bf2e9ba3ea9a3ecac70721
import torch import torch.nn as nn from torch.autograd import * def to_contiguous(tensor): if tensor.is_contiguous(): return tensor else: return tensor.contiguous() class Model(nn.Module): def __init__(self): super().__init__() def forward(self, input, target, mask): ...
DownsampleA
# 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 DownsampleA(nn.Module): def __init__(self, nIn, nOut, stride): super(DownsampleA, self).__init__() self.avg = nn.AvgPool2d(kernel_size=1, stride=stride) def forward(self, x): x = self.avg(x) return torch.cat((x, x.mul(0)), 1) def get...
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...
code-inter/leak
DownsampleA
false
9,935
[ "MIT" ]
0
0e2b12a42f5fbaac4c5fa68627a21aa9a2f3d1d6
https://github.com/code-inter/leak/tree/0e2b12a42f5fbaac4c5fa68627a21aa9a2f3d1d6
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, nIn, nOut, stride): super().__init__() self.avg = nn.AvgPool2d(kernel_size=1, stride=stride) def forward(self, x): x = self.avg(x) return torch.cat((x, x.mul(0)), 1) def get_inputs(): return [...
VGG19Decoder2
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from collections import OrderedDict class VGG19Decoder2(nn.Module): def __init__(self): super(VGG19Decoder2, self).__init__() self.blocks = OrderedDict([('pad2_1', nn.ReflectionPad2d(1)), ( 'conv2_1', nn.Conv2d(128, 64, 3, 1, 0)), ('relu2_1', 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 from torch._inductor.runtime....
chenhsiu48/PytorchWCT
VGG19Decoder2
false
9,936
[ "MIT" ]
0
c3346ebaec95358ad1d4d5a519d5d0e7de73bc75
https://github.com/chenhsiu48/PytorchWCT/tree/c3346ebaec95358ad1d4d5a519d5d0e7de73bc75
import torch import torch.nn as nn from collections import OrderedDict class Model(nn.Module): def __init__(self): super().__init__() self.blocks = OrderedDict([('pad2_1', nn.ReflectionPad2d(1)), ( 'conv2_1', nn.Conv2d(128, 64, 3, 1, 0)), ('relu2_1', nn.ReLU( inplace=True)...
SCse
# 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 SpatialAttention2d(nn.Module): def __init__(self, channel): super(SpatialAttention2d, self).__init__() self.squeeze = nn.Conv2d(channel, 1, kernel_size=1, bias=False) self.sigmoid = nn.Sigmoid() def forward(self, x): z = self.squeeze(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 import torch.nn as nn assert_...
advian123/kaggle-birdsong-recognition
SCse
false
9,937
[ "MIT" ]
0
a4ca8ab81e166b919452fb5d6ca4c2912c65e904
https://github.com/advian123/kaggle-birdsong-recognition/tree/a4ca8ab81e166b919452fb5d6ca4c2912c65e904
import torch import torch.nn as nn class SpatialAttention2d(nn.Module): def __init__(self, channel): super().__init__() self.squeeze = nn.Conv2d(channel, 1, kernel_size=1, bias=False) self.sigmoid = nn.Sigmoid() def forward(self, x): z = self.squeeze(x) z = self.sigmo...
Model
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super(Model, self).__init__() self.linear1 = nn.Linear(28 * 28, 32) self.linear2 = nn.Linear(32, 10) def forward(self, inputs): x = inputs.view(-1, 28 * 28) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
codeislife99/pytorch-meta-optimizer
Model
false
9,938
[ "MIT" ]
0
24f00be05e6e173efa67fe953e466bdf1dcb50e9
https://github.com/codeislife99/pytorch-meta-optimizer/tree/24f00be05e6e173efa67fe953e466bdf1dcb50e9
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super(Model, self).__init__() self.linear1 = nn.Linear(28 * 28, 32) self.linear2 = nn.Linear(32, 10) def forward(self, inputs): x = inputs.view(-1, 28 * 28) ...
CatRepr
# 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 CatRepr(nn.Module): def __init__(self): super().__init__() def forward(self, data_list): cat_regions = [torch.cat([hidden[0], torch.mean(hidden, dim=0), hidden[-1]], dim=-1).view(1, -1) for hidden in data_list] cat_out = torch.cat(...
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...
csJd/CRANN
CatRepr
false
9,939
[ "MIT" ]
0
8139b19b84ec11eff3c801185e4bfa974766d599
https://github.com/csJd/CRANN/tree/8139b19b84ec11eff3c801185e4bfa974766d599
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, data_list): cat_regions = [torch.cat([hidden[0], torch.mean(hidden, dim=0), hidden[-1]], dim=-1).view(1, -1) for hidden in data_list] cat_out = torch.cat(ca...
Residual_module
# 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 Residual_module(nn.Module): def __init__(self, in_ch): super(Residual_module, self).__init__() self.prelu1 = nn.PReLU(in_ch, 0) self.prelu2 = nn.PReLU(in_ch, 0) self.conv1_1by1 = nn.Conv2d(in_channels=in_ch, out_channels=in_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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
csm9493/FC-AIDE-Pytorch
Residual_module
false
9,940
[ "MIT" ]
0
8ac7e4ee675824af002419650428948e60930712
https://github.com/csm9493/FC-AIDE-Pytorch/tree/8ac7e4ee675824af002419650428948e60930712
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_ch): super().__init__() self.prelu1 = nn.PReLU(in_ch, 0) self.prelu2 = nn.PReLU(in_ch, 0) self.conv1_1by1 = nn.Conv2d(in_channels=in_ch, out_channels=in_ch, kernel_size=1) self.con...
LayerNorm1D
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class LayerNorm1D(nn.Module): def __init__(self, num_outputs, eps=1e-05, affine=True): super(LayerNorm1D, self).__init__() self.eps = eps self.weight = nn.Parameter(torch.ones(1, num_outputs)) self.bias = nn.Parameter(torch.zeros(1, num_outputs))...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
codeislife99/pytorch-meta-optimizer
LayerNorm1D
false
9,941
[ "MIT" ]
0
24f00be05e6e173efa67fe953e466bdf1dcb50e9
https://github.com/codeislife99/pytorch-meta-optimizer/tree/24f00be05e6e173efa67fe953e466bdf1dcb50e9
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_outputs, eps=1e-05, affine=True): super().__init__() self.eps = eps self.weight = nn.Parameter(torch.ones(1, num_outputs)) self.bias = nn.Parameter(torch.zeros(1, num_outputs)) def forward(self,...
PhonyLanguageModel
# 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 PhonyLanguageModel(nn.Module): def __init__(self): super().__init__() def forward(self, x): lm_x = x.clone().detach().float() * 0 return F.log_softmax(lm_x, 1) def get_inputs(): return [torch.rand([4, 4, 4...
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 ...
daemon/vivi
PhonyLanguageModel
false
9,942
[ "MIT" ]
0
6b7819006c944a756bf8a7b6d8beed92d19eb51a
https://github.com/daemon/vivi/tree/6b7819006c944a756bf8a7b6d8beed92d19eb51a
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): lm_x = x.clone().detach().float() * 0 return F.log_softmax(lm_x, 1) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def ...
CDCM
# 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 CDCM(nn.Module): """ Compact Dilation Convolution based Module """ def __init__(self, in_channels, out_channels): super(CDCM, self).__init__() self.relu1 = nn.ReLU() self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=1, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
arkel23/mmgeneration
CDCM
false
9,943
[ "Apache-2.0" ]
0
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
https://github.com/arkel23/mmgeneration/tree/41a30e2972f2037f6aac60ed761bed3fe47bfe4d
import torch import torch.nn as nn class Model(nn.Module): """ Compact Dilation Convolution based Module """ def __init__(self, in_channels, out_channels): super().__init__() self.relu1 = nn.ReLU() self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=1, pa...
DenoisingDownsample
# 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 DenoisingDownsample(nn.Module): """Downsampling operation used in the denoising network. Support average pooling and convolution for downsample operation. Args: in_channels (int): Number of channels of the input feature map to be downsampled. ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
arkel23/mmgeneration
DenoisingDownsample
false
9,944
[ "Apache-2.0" ]
0
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
https://github.com/arkel23/mmgeneration/tree/41a30e2972f2037f6aac60ed761bed3fe47bfe4d
import torch import torch.nn as nn class Model(nn.Module): """Downsampling operation used in the denoising network. Support average pooling and convolution for downsample operation. Args: in_channels (int): Number of channels of the input feature map to be downsampled. with_co...
Transformer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch class Convlayer(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1): super().__init__() padding = kernel_size // 2 self.refl = torch.nn.ReflectionPad2d(padding) self.conv = torch.nn.Conv2d(in_channels, out_channels, 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....
bruchano/ImageStyler
Transformer
false
9,945
[ "MIT" ]
0
7bde13bc954566088c477065adb5c4e4214c28bb
https://github.com/bruchano/ImageStyler/tree/7bde13bc954566088c477065adb5c4e4214c28bb
import torch class Convlayer(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1): super().__init__() padding = kernel_size // 2 self.refl = torch.nn.ReflectionPad2d(padding) self.conv = torch.nn.Conv2d(in_channels, out_channels, kernel_size, ...
CSAM
# 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 CSAM(nn.Module): """ Compact Spatial Attention Module """ def __init__(self, channels): super(CSAM, self).__init__() mid_channels = 4 self.relu1 = nn.ReLU() self.conv1 = nn.Conv2d(channels, mid_channels, kernel_size=1, padding=0...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
arkel23/mmgeneration
CSAM
false
9,946
[ "Apache-2.0" ]
0
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
https://github.com/arkel23/mmgeneration/tree/41a30e2972f2037f6aac60ed761bed3fe47bfe4d
import torch import torch.nn as nn class Model(nn.Module): """ Compact Spatial Attention Module """ def __init__(self, channels): super().__init__() mid_channels = 4 self.relu1 = nn.ReLU() self.conv1 = nn.Conv2d(channels, mid_channels, kernel_size=1, padding=0 ...
MiniBatchStddevLayer
# 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.distributed as dist import torch.autograd as autograd class AllGatherLayer(autograd.Function): """All gather layer with backward propagation path. Indeed, this module is to make ``dist.all_gather()`` in the backward graph. Such kind of operation has been wi...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.distributed as dist import torch.autograd as...
arkel23/mmgeneration
MiniBatchStddevLayer
false
9,947
[ "Apache-2.0" ]
0
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
https://github.com/arkel23/mmgeneration/tree/41a30e2972f2037f6aac60ed761bed3fe47bfe4d
import torch import torch.nn as nn import torch.distributed as dist import torch.autograd as autograd class AllGatherLayer(autograd.Function): """All gather layer with backward propagation path. Indeed, this module is to make ``dist.all_gather()`` in the backward graph. Such kind of operation has been wi...
AdaptiveInstanceNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn.init import _calculate_correct_fan def equalized_lr(module, name='weight', gain=2 ** 0.5, mode='fan_in', lr_mul=1.0): """Equalized Learning Rate. This trick is proposed in: Progressive Growing of GANs for Improved Quality, Stability, and Variation ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
arkel23/mmgeneration
AdaptiveInstanceNorm
false
9,948
[ "Apache-2.0" ]
0
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
https://github.com/arkel23/mmgeneration/tree/41a30e2972f2037f6aac60ed761bed3fe47bfe4d
import torch import torch.nn as nn from torch.nn.init import _calculate_correct_fan def equalized_lr(module, name='weight', gain=2 ** 0.5, mode='fan_in', lr_mul=1.0): """Equalized Learning Rate. This trick is proposed in: Progressive Growing of GANs for Improved Quality, Stability, and Variation ...
PDCBlock_converted
# 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 PDCBlock_converted(nn.Module): """ CPDC, APDC can be converted to vanilla 3x3 convolution RPDC can be converted to vanilla 5x5 convolution """ def __init__(self, pdc, inplane, ouplane, stride=1): super(PDCBlock_converted, self).__init__() s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
arkel23/mmgeneration
PDCBlock_converted
false
9,949
[ "Apache-2.0" ]
0
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
https://github.com/arkel23/mmgeneration/tree/41a30e2972f2037f6aac60ed761bed3fe47bfe4d
import torch import torch.nn as nn class Model(nn.Module): """ CPDC, APDC can be converted to vanilla 3x3 convolution RPDC can be converted to vanilla 5x5 convolution """ def __init__(self, pdc, inplane, ouplane, stride=1): super().__init__() self.stride = stride if self.s...
Sine
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class Sine(nn.Module): def __init__(self, w0: 'float'=30.0): super(Sine, self).__init__() self.w0 = w0 def forward(self, x: 'torch.Tensor') ->torch.Tensor: return torch.sin(self.w0 * 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 from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
brandstetter-johannes/ocp
Sine
false
9,950
[ "MIT", "BSD-3-Clause" ]
0
69cc90e6bed8aa09222cd77b926d7a34e96302ed
https://github.com/brandstetter-johannes/ocp/tree/69cc90e6bed8aa09222cd77b926d7a34e96302ed
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, w0: 'float'=30.0): super().__init__() self.w0 = w0 def forward(self, x: 'torch.Tensor') ->torch.Tensor: return torch.sin(self.w0 * x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init...
wide_basic
# 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 def get_norm(n_filters, norm): if norm is None: return Identity() elif norm == 'batch': return nn.BatchNorm2d(n_filters, momentum=0.9) elif norm == 'instance': return nn.InstanceNorm2d(n_filters, affine=True) elif norm == 'layer': 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
csadrian/JEM
wide_basic
false
9,951
[ "Apache-2.0" ]
0
72d9af20126cf1410506b2c149d740a41ef04e78
https://github.com/csadrian/JEM/tree/72d9af20126cf1410506b2c149d740a41ef04e78
import torch import torch.nn as nn def get_norm(n_filters, norm): if norm is None: return Identity() elif norm == 'batch': return nn.BatchNorm2d(n_filters, momentum=0.9) elif norm == 'instance': return nn.InstanceNorm2d(n_filters, affine=True) elif norm == 'layer': retu...
BertPooler
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class BertPooler(nn.Module): def __init__(self, config): super(BertPooler, self).__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.activation = nn.Tanh() def forward(self, 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.triton_helpers import libdevice import torch.nn as ...
Ago3/VLP
BertPooler
false
9,952
[ "Apache-2.0" ]
0
4dec0e04b8592f4a74fe66c253dbb92574e7e2ba
https://github.com/Ago3/VLP/tree/4dec0e04b8592f4a74fe66c253dbb92574e7e2ba
from _paritybench_helpers import _mock_config import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.activation = nn.Tanh() def forward(self, hidden_states): ...
DuelingDeepQNetwork
# 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 as T import torch.nn as nn import torch.nn.functional as F import torch.optim as optim class DuelingDeepQNetwork(nn.Module): def __init__(self, lr, input_dim, output_dim, fc1_dim, fc2_dim): super(DuelingDeepQNetwork, self).__init__() self.fc1 = nn.Linear(input_dim, fc1_d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch as T import torc...
MonteyMontey/deep-reinforcement-learning-sandbox
DuelingDeepQNetwork
false
9,953
[ "MIT" ]
0
0e93760a994b6af54f0a665f5bc4f9d5ffd45c0a
https://github.com/MonteyMontey/deep-reinforcement-learning-sandbox/tree/0e93760a994b6af54f0a665f5bc4f9d5ffd45c0a
import torch import torch as T import torch.nn as nn import torch.nn.functional as F import torch.optim as optim class Model(nn.Module): def __init__(self, lr, input_dim, output_dim, fc1_dim, fc2_dim): super().__init__() self.fc1 = nn.Linear(input_dim, fc1_dim) self.fc2 = nn.Linear(fc1_di...
BertIntermediate
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch from torch import nn def gelu(x): """Gaussian Error Linear Unitという活性化関数です。 LeLUが0でカクっと不連続なので、そこを連続になるように滑らかにした形のLeLUです。 """ return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0))) class BertIntermediate(nn.Module): """BERTのTra...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math from to...
Cyndi-Tokyotech/Fin_Text_Analysis_ML
BertIntermediate
false
9,954
[ "MIT" ]
0
7f9b6c1ea78f8e6f32c003b2de32809722df88d4
https://github.com/Cyndi-Tokyotech/Fin_Text_Analysis_ML/tree/7f9b6c1ea78f8e6f32c003b2de32809722df88d4
from _paritybench_helpers import _mock_config import math import torch from torch import nn def gelu(x): """Gaussian Error Linear Unitという活性化関数です。 LeLUが0でカクっと不連続なので、そこを連続になるように滑らかにした形のLeLUです。 """ return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0))) class Model(nn.Module): """BERTのTransformerBlo...
PyTorchMLP
# 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 PyTorchMLP(nn.Module): """ A feed forward network to make single step predictions on 1D time series data. """ def __init__(self, inputsize, prefix): super(PyTorchMLP, self).__init__() self.fc1 = nn.Linear(in_features=inputsize, out_features=rou...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
danvran/ASM
PyTorchMLP
false
9,955
[ "MIT" ]
0
e678fa507f847ec2ff947ec4ca123858ffe46d4d
https://github.com/danvran/ASM/tree/e678fa507f847ec2ff947ec4ca123858ffe46d4d
import torch import torch.nn as nn class Model(nn.Module): """ A feed forward network to make single step predictions on 1D time series data. """ def __init__(self, inputsize, prefix): super().__init__() self.fc1 = nn.Linear(in_features=inputsize, out_features=round( input...
GaussianSmearing
# 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 GaussianSmearing(nn.Module): def __init__(self, in_features, start=0, end=1, num_freqs=50): super(GaussianSmearing, self).__init__() self.num_freqs = num_freqs offset = torch.linspace(start, end, num_freqs) self.coeff = -0.5 / (offset[1] - ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
brandstetter-johannes/ocp
GaussianSmearing
false
9,956
[ "MIT", "BSD-3-Clause" ]
0
69cc90e6bed8aa09222cd77b926d7a34e96302ed
https://github.com/brandstetter-johannes/ocp/tree/69cc90e6bed8aa09222cd77b926d7a34e96302ed
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_features, start=0, end=1, num_freqs=50): super().__init__() self.num_freqs = num_freqs offset = torch.linspace(start, end, num_freqs) self.coeff = -0.5 / (offset[1] - offset[0]).item() ** 2 se...
GatedLinear
# 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 GatedLinear(nn.Module): def __init__(self, input_size, output_size): super(GatedLinear, self).__init__() self.linear = nn.Linear(input_size, output_size * 2) self.glu = nn.GLU(dim=-1) def forward(self, x, y=None, x_mask=None, y_mask=None, rel_...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
cuiyuhao1996/mmnas
GatedLinear
false
9,957
[ "Apache-2.0" ]
0
d62e0b3ddc6d15e8f01d0d66367e05fc9691cd3b
https://github.com/cuiyuhao1996/mmnas/tree/d62e0b3ddc6d15e8f01d0d66367e05fc9691cd3b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_size, output_size): super().__init__() self.linear = nn.Linear(input_size, output_size * 2) self.glu = nn.GLU(dim=-1) def forward(self, x, y=None, x_mask=None, y_mask=None, rel_embed=None): re...
LayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.init import torch.optim.lr_scheduler import torch.nn import torch.autograd class LayerNorm(torch.nn.Module): """ An implementation of `Layer Normalization <https://www.semanticscholar.org/paper/Layer-Normalization-Ba-Kiros/97fb4e3d45bb098e27e0071448b6152217bd35a5>`_ . Lay...
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.init import torch.optim.lr_scheduler import torch.nn import tor...
codedecde/BiMPM
LayerNorm
false
9,958
[ "Apache-2.0" ]
0
818602fcf7a018632707b8fbfe33200036795731
https://github.com/codedecde/BiMPM/tree/818602fcf7a018632707b8fbfe33200036795731
import torch import torch.nn.init import torch.optim.lr_scheduler import torch.nn import torch.autograd class Model(torch.nn.Module): """ An implementation of `Layer Normalization <https://www.semanticscholar.org/paper/Layer-Normalization-Ba-Kiros/97fb4e3d45bb098e27e0071448b6152217bd35a5>`_ . Layer N...
Linear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn import Parameter import torch.cuda import torch.distributed def quantize_weights(W, numbits=8): W = W.clamp(-2 ** (numbits - 1), 2 ** (numbits - 1)) W = W.mu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
csk7/CS550-NLP-McGill-
Linear
false
9,959
[ "MIT" ]
0
a6f295b88539015d8accdbd410357c42df7c4287
https://github.com/csk7/CS550-NLP-McGill-/tree/a6f295b88539015d8accdbd410357c42df7c4287
import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn import Parameter import torch.cuda import torch.distributed def quantize_weights(W, numbits=8): W = W.clamp(-2 ** (numbits - 1), 2 ** (numbits - 1)) W = W.mu...
FCN32s
# 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 from torch import nn def get_upsampling_weight(in_channels, out_channels, kernel_size): """Make a 2D bilinear kernel suitable for upsampling""" factor = (kernel_size + 1) // 2 if kernel_size % 2 == 1: center = factor - 1 else: center = factor - 0.5 o...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np from torch...
Yusoi/mmdetection
FCN32s
false
9,960
[ "Apache-2.0" ]
0
cbb5fb00f6e124fbb2c15e7e3438d7fa76b8850a
https://github.com/Yusoi/mmdetection/tree/cbb5fb00f6e124fbb2c15e7e3438d7fa76b8850a
import torch import numpy as np from torch import nn def get_upsampling_weight(in_channels, out_channels, kernel_size): """Make a 2D bilinear kernel suitable for upsampling""" factor = (kernel_size + 1) // 2 if kernel_size % 2 == 1: center = factor - 1 else: center = factor - 0.5 o...
ResBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class ResBlock(nn.Module): def __init__(self, input_channels: 'int', output_channels: 'int', batch_norm=False) ->None: super().__init__() self.conv1 = nn.Conv2d(input_channels, output_channels, kernel_size =3, stride=1, padding=1) 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 import torch.nn as nn assert_...
cluePrints/fsdl-text-recognizer-2021-labs
ResBlock
false
9,961
[ "MIT" ]
0
d166dcbd00513b2f0031fbc991af3a852bc2d605
https://github.com/cluePrints/fsdl-text-recognizer-2021-labs/tree/d166dcbd00513b2f0031fbc991af3a852bc2d605
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_channels: 'int', output_channels: 'int', batch_norm=False) ->None: super().__init__() self.conv1 = nn.Conv2d(input_channels, output_channels, kernel_size =3, stride=1, padding=1) self.b...
Critic
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Critic(nn.Module): def __init__(self, state_dim, action_dim): super(Critic, self).__init__() self.l1 = nn.Linear(state_dim + action_dim, 1024) self.l2 = nn.Linear(1024, 512) self.l3 = nn.Linear(512, 256) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
ctoto93/TD3
Critic
false
9,962
[ "MIT" ]
0
88482b9f1fb4441d74426ece60d5da13414aeb77
https://github.com/ctoto93/TD3/tree/88482b9f1fb4441d74426ece60d5da13414aeb77
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim): super().__init__() self.l1 = nn.Linear(state_dim + action_dim, 1024) self.l2 = nn.Linear(1024, 512) self.l3 = nn.Linear(512, 256) self.l4 =...
Swish
# 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 Swish(nn.Module): def __init__(self, beta=1): super(Swish, self).__init__() self.beta = beta def forward(self, x): return x * torch.sigmoid(self.beta * x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_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.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
brandstetter-johannes/ocp
Swish
false
9,963
[ "MIT", "BSD-3-Clause" ]
0
69cc90e6bed8aa09222cd77b926d7a34e96302ed
https://github.com/brandstetter-johannes/ocp/tree/69cc90e6bed8aa09222cd77b926d7a34e96302ed
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, beta=1): super().__init__() self.beta = beta def forward(self, x): return x * torch.sigmoid(self.beta * x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Module_CharbonnierLoss
# 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 Module_CharbonnierLoss(nn.Module): def __init__(self, epsilon=0.001): super(Module_CharbonnierLoss, self).__init__() self.epsilon = epsilon def forward(self, output, gt): return torch.mean(torch.sqrt((output - gt) ** 2 + self.epsilon ** 2)) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
danielism97/FLAVR
Module_CharbonnierLoss
false
9,964
[ "Apache-2.0" ]
0
17f62c681bb2a5799e3bc23cf60936ac4d2b9407
https://github.com/danielism97/FLAVR/tree/17f62c681bb2a5799e3bc23cf60936ac4d2b9407
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, epsilon=0.001): super().__init__() self.epsilon = epsilon def forward(self, output, gt): return torch.mean(torch.sqrt((output - gt) ** 2 + self.epsilon ** 2)) def get_inputs(): return [torch.rand([4, ...
Actor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Actor(nn.Module): def __init__(self, state_dim, action_dim, max_action): super(Actor, self).__init__() self.l1 = nn.Linear(state_dim, 1024) self.l2 = nn.Linear(1024, 512) self.l3 = nn.Linear(512, 256) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
ctoto93/TD3
Actor
false
9,965
[ "MIT" ]
0
88482b9f1fb4441d74426ece60d5da13414aeb77
https://github.com/ctoto93/TD3/tree/88482b9f1fb4441d74426ece60d5da13414aeb77
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim, max_action): super().__init__() self.l1 = nn.Linear(state_dim, 1024) self.l2 = nn.Linear(1024, 512) self.l3 = nn.Linear(512, 256) self.l4 = ...
SeqRNN
# 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 SeqRNN(nn.Module): def __init__(self, input_size, hidden_size, output_size, n_layers): super(SeqRNN, self).__init__() self.hidden_size = hidden_size self.i2h = nn.Linear(in_features=input_size + hidden_size, out_features=hidden_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....
dblakely/FastSK
SeqRNN
false
9,966
[ "Apache-2.0" ]
0
bd0d4cef89c3d7d661f4c6abc094423ab6d1c7e1
https://github.com/dblakely/FastSK/tree/bd0d4cef89c3d7d661f4c6abc094423ab6d1c7e1
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, input_size, hidden_size, output_size, n_layers): super().__init__() self.hidden_size = hidden_size self.i2h = nn.Linear(in_features=input_size + hidden_size, out_features=hidden_size) self.i2...
ToeplitzBlock
# 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 def expand_toeplitz(diag, lower_diags, upper_diags): pattern = torch.cat([upper_diags, diag, lower_diags], 0) d = lower_diags.size(0) columns = [] for i in range(d + 1): columns.append(pattern[d - i:d - i + d + 1]) return torch.stack(columns, 0) class T...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
daemon/toepl.it.z
ToeplitzBlock
false
9,967
[ "MIT" ]
0
b16754b11f03f33bbfa05cf8544ef0dca3574ed4
https://github.com/daemon/toepl.it.z/tree/b16754b11f03f33bbfa05cf8544ef0dca3574ed4
import torch import torch.nn as nn def expand_toeplitz(diag, lower_diags, upper_diags): pattern = torch.cat([upper_diags, diag, lower_diags], 0) d = lower_diags.size(0) columns = [] for i in range(d + 1): columns.append(pattern[d - i:d - i + d + 1]) return torch.stack(columns, 0) class M...
GlobalAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn import Parameter import torch.cuda import torch.distributed def quantize_weights(W, numbits=8): W = W.clamp(-2 ** (numbits - 1), 2 ** (numbits - 1)) W = W.mu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
csk7/CS550-NLP-McGill-
GlobalAttention
false
9,968
[ "MIT" ]
0
a6f295b88539015d8accdbd410357c42df7c4287
https://github.com/csk7/CS550-NLP-McGill-/tree/a6f295b88539015d8accdbd410357c42df7c4287
import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn import Parameter import torch.cuda import torch.distributed def quantize_weights(W, numbits=8): W = W.clamp(-2 ** (numbits - 1), 2 ** (numbits - 1)) W = W.mu...
BBoxTransform
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn class BBoxTransform(nn.Module): def forward(self, anchors, regression): """ decode_box_outputs adapted from https://github.com/google/automl/blob/master/efficientdet/anchors.py Args: anchors: [batchsize, boxes, (y1, x1, y2, x2)] 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.triton_helpers import math as tl_math from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_...
cosmos1982/pytorch_efficientdet_openvino_demo
BBoxTransform
false
9,969
[ "Apache-2.0" ]
0
f626af448a827c0df655eb2af52ae3dbd10f2478
https://github.com/cosmos1982/pytorch_efficientdet_openvino_demo/tree/f626af448a827c0df655eb2af52ae3dbd10f2478
import torch from torch import nn class Model(nn.Module): def forward(self, anchors, regression): """ decode_box_outputs adapted from https://github.com/google/automl/blob/master/efficientdet/anchors.py Args: anchors: [batchsize, boxes, (y1, x1, y2, x2)] regressio...
DuelingQNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.functional as F class DuelingQNetwork(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, config_dict): """Initialize parameters and build model. Params ===...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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_...
czarrar/udacity_rl
DuelingQNetwork
false
9,970
[ "MIT" ]
0
d5e9a878b24e6234ab4ac9f612be103bb7f933c4
https://github.com/czarrar/udacity_rl/tree/d5e9a878b24e6234ab4ac9f612be103bb7f933c4
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, config_dict): """Initialize parameters and build model. Params ====== ...
GlyphNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import functional as f class GlyphNet(nn.Module): def __init__(self, dimension): super().__init__() self.conv1 = nn.Conv2d(3, 32, 3, padding=1) self.conv2 = nn.Conv2d(32, 32, 3, padding=1) self.fc = nn.Linear(32, dimension) n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
cmsflash/ocean-text
GlyphNet
false
9,971
[ "MIT" ]
0
d2f98077cb5e6949aec87f88a369ba4c2e99d178
https://github.com/cmsflash/ocean-text/tree/d2f98077cb5e6949aec87f88a369ba4c2e99d178
import torch from torch import nn from torch.nn import functional as f class Model(nn.Module): def __init__(self, dimension): super().__init__() self.conv1 = nn.Conv2d(3, 32, 3, padding=1) self.conv2 = nn.Conv2d(32, 32, 3, padding=1) self.fc = nn.Linear(32, dimension) nn.i...
NanoNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import functional as f class NanoNet(nn.Module): def __init__(self, dimension): super().__init__() self.conv1 = nn.Conv2d(1, 32, 3, padding=1) self.conv2 = nn.Conv2d(32, 32, 3, padding=1) self.conv3 = nn.Conv2d(32, 32, 3, padding=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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
cmsflash/ocean-text
NanoNet
false
9,972
[ "MIT" ]
0
d2f98077cb5e6949aec87f88a369ba4c2e99d178
https://github.com/cmsflash/ocean-text/tree/d2f98077cb5e6949aec87f88a369ba4c2e99d178
import torch from torch import nn from torch.nn import functional as f class Model(nn.Module): def __init__(self, dimension): super().__init__() self.conv1 = nn.Conv2d(1, 32, 3, padding=1) self.conv2 = nn.Conv2d(32, 32, 3, padding=1) self.conv3 = nn.Conv2d(32, 32, 3, padding=1) ...
VGGSiameseNet
# 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 VGGSiameseNet(nn.Module): def __init__(self): super(VGGSiameseNet, self).__init__() self.conv11 = nn.Conv2d(1, 64, 3) self.conv12 = nn.Conv2d(64, 64, 3) self.conv21 = nn.Conv2d(64, 128, 3) self.conv22...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
christnp/comse6998-project
VGGSiameseNet
false
9,973
[ "MIT" ]
0
7deffaceb945ae0bd4851ff9478a7efe6e486d39
https://github.com/christnp/comse6998-project/tree/7deffaceb945ae0bd4851ff9478a7efe6e486d39
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv11 = nn.Conv2d(1, 64, 3) self.conv12 = nn.Conv2d(64, 64, 3) self.conv21 = nn.Conv2d(64, 128, 3) self.conv22 = nn.Conv2d(128, 128, 3) ...
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.utils.data class IrisClassifier(nn.Module): def __init__(self): super(IrisClassifier, self).__init__() self.fc1 = nn.Linear(4, 100) self.fc2 = nn.Linear(100, 100) self.fc3 = nn.Linear(100, 3) s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
dbinoy/pytorch-iris-sagemaker
IrisClassifier
false
9,974
[ "MIT-0" ]
0
afc5bd95f6dd0431338708bc179029fa08724a2f
https://github.com/dbinoy/pytorch-iris-sagemaker/tree/afc5bd95f6dd0431338708bc179029fa08724a2f
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(4, 100) self.fc2 = nn.Linear(100, 100) self.fc3 = nn.Linear(100, 3) self.softmax = nn.Softmax(dim=...
Gated_Recurrent_Unit
# 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 Gated_Recurrent_Unit(nn.Module): def __init__(self, fea_size, dropout): super(Gated_Recurrent_Unit, self).__init__() self.wih = nn.Linear(fea_size, fe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
champon1020/scene_graph_benchmark
Gated_Recurrent_Unit
false
9,975
[ "MIT" ]
0
970a7499f8fa2854810bd650f6c991bcad5748db
https://github.com/champon1020/scene_graph_benchmark/tree/970a7499f8fa2854810bd650f6c991bcad5748db
import torch from torchvision.transforms import functional as F import torch.utils.data from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, fea_size, dropout): super().__init__() self.wih = nn.Linear(fea_size, fea_size, bias=True) self.whh = nn....
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 class SimpleNet(nn.Module): def __init__(self, width, input_size, output_size, pool='max'): super(SimpleNet, self).__init__() self.pool = nn.MaxPool2d(width, stride=width ) if pool == 'max' else nn.AvgPool2d(width, stride=width) self.fc1 = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
daniel-zeng/SegSort
SimpleNet
false
9,976
[ "MIT" ]
0
7a50e6253df23a7719f962b34acff2626c916354
https://github.com/daniel-zeng/SegSort/tree/7a50e6253df23a7719f962b34acff2626c916354
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, width, input_size, output_size, pool='max'): super().__init__() self.pool = nn.MaxPool2d(width, stride=width ) if pool == 'max' else nn.AvgPool2d(width, stride=width) self.fc1 = nn.Linear(input_size,...
Message_Passing_Unit_v2
# 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 Message_Passing_Unit_v2(nn.Module): def __init__(self, fea_size, filter_size=128): super(Message_Passing_Unit_v2, self).__init__() self.w = nn.Linear(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
champon1020/scene_graph_benchmark
Message_Passing_Unit_v2
false
9,977
[ "MIT" ]
0
970a7499f8fa2854810bd650f6c991bcad5748db
https://github.com/champon1020/scene_graph_benchmark/tree/970a7499f8fa2854810bd650f6c991bcad5748db
import torch from torchvision.transforms import functional as F import torch.utils.data from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, fea_size, filter_size=128): super().__init__() self.w = nn.Linear(fea_size, filter_size, bias=True) self....
QNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn class QNetwork(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, seed, fc1_units=37, fc2_units=64): """Initialize parameters and build model. Params ====== state_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
deeplearningrobotics/p1nav
QNetwork
false
9,978
[ "Apache-2.0" ]
0
433ff8d8b5fec6c8bb3c346e5b8dfff2865f4a55
https://github.com/deeplearningrobotics/p1nav/tree/433ff8d8b5fec6c8bb3c346e5b8dfff2865f4a55
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, seed, fc1_units=37, fc2_units=64): """Initialize parameters and build model. Params ====== state_size ...
ScModel
# 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 as t import torch.nn as nn from torch.nn.parameter import Parameter class ScModel(nn.Module): """ Model for singel cell data """ def __init__(self, n_genes: 'int', n_celltypes: 'int', device: 't.device' ) ->None: super().__init__() self.K = n_celltypes ...
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...
denizcangi/stereoscope
ScModel
false
9,979
[ "MIT" ]
0
cfe70e5d1e174dedd2d1a0c4a86ae0131e8e4218
https://github.com/denizcangi/stereoscope/tree/cfe70e5d1e174dedd2d1a0c4a86ae0131e8e4218
import torch import torch as t import torch.nn as nn from torch.nn.parameter import Parameter class Model(nn.Module): """ Model for singel cell data """ def __init__(self, n_genes: 'int', n_celltypes: 'int', device: 't.device' ) ->None: super().__init__() self.K = n_celltypes ...
BertSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super(BertSelfAttention, self).__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Ago3/VLP
BertSelfAttention
false
9,980
[ "Apache-2.0" ]
0
4dec0e04b8592f4a74fe66c253dbb92574e7e2ba
https://github.com/Ago3/VLP/tree/4dec0e04b8592f4a74fe66c253dbb92574e7e2ba
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() if config.hidden_size % config.num_attention_heads != 0: raise ValueError( 'The hidden size (%d) is not a...
TianzigeCNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import functional as f class TianzigeCNN(nn.Module): def __init__(self, dimension): super().__init__() self.conv1 = nn.Conv2d(3, 1024, 5) self.relu = nn.ReLU(inplace=True) self.max_pool = nn.MaxPool2d(4) self.conv2 = nn.Conv2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
cmsflash/ocean-text
TianzigeCNN
false
9,981
[ "MIT" ]
0
d2f98077cb5e6949aec87f88a369ba4c2e99d178
https://github.com/cmsflash/ocean-text/tree/d2f98077cb5e6949aec87f88a369ba4c2e99d178
import torch from torch import nn from torch.nn import functional as f class Model(nn.Module): def __init__(self, dimension): super().__init__() self.conv1 = nn.Conv2d(3, 1024, 5) self.relu = nn.ReLU(inplace=True) self.max_pool = nn.MaxPool2d(4) self.conv2 = nn.Conv2d(1024...
MaskedCrossEntropyCriterion
# 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.modules.loss import _WeightedLoss class MaskedCrossEntropyCriterion(_WeightedLoss): def __init__(self, ignore_index=[-100], reduce=None): super(MaskedCrossEntropyCriterion, self).__init__() self.padding_idx = ignore_index self.reduce = redu...
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.nn.modules....
dataJSA/batch7_tomorrow_datascience
MaskedCrossEntropyCriterion
false
9,982
[ "MIT" ]
0
e2dc6bc59c456fa927e0a1f6d12024ba410f520c
https://github.com/dataJSA/batch7_tomorrow_datascience/tree/e2dc6bc59c456fa927e0a1f6d12024ba410f520c
import torch import torch.nn as nn from torch.nn.modules.loss import _WeightedLoss class Model(_WeightedLoss): def __init__(self, ignore_index=[-100], reduce=None): super().__init__() self.padding_idx = ignore_index self.reduce = reduce def forward(self, outputs, targets): lp...
InstanceLayerNorm2d
# 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 InstanceLayerNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.9, using_moving_average=True, using_bn=False): super(InstanceLayerNorm2d, self).__init__() self.eps = eps self.momentum = momentum self.using_mov...
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...
belphegor2211/khoa_luan
InstanceLayerNorm2d
false
9,983
[ "MIT" ]
0
c9c163ebf3aff3005639ce7e4020e510295d1c75
https://github.com/belphegor2211/khoa_luan/tree/c9c163ebf3aff3005639ce7e4020e510295d1c75
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.9, using_moving_average=True, using_bn=False): super().__init__() self.eps = eps self.momentum = momentum self.using_moving_average = using_moving_average ...
Message_Passing_Unit_v1
# 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 Message_Passing_Unit_v1(nn.Module): def __init__(self, fea_size, filter_size=128): super(Message_Passing_Unit_v1, self).__init__() self.w = nn.Linear(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
champon1020/scene_graph_benchmark
Message_Passing_Unit_v1
false
9,984
[ "MIT" ]
0
970a7499f8fa2854810bd650f6c991bcad5748db
https://github.com/champon1020/scene_graph_benchmark/tree/970a7499f8fa2854810bd650f6c991bcad5748db
import torch from torchvision.transforms import functional as F import torch.utils.data from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, fea_size, filter_size=128): super().__init__() self.w = nn.Linear(fea_size * 2, filter_size, bias=True) s...
CosMargin
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F class CosMargin(nn.Module): def __init__(self, in_size, out_size, s=None, m=0.0): super(CosMargin, self).__init__() self.in_size = in_size self.out_size = out_size self.W = nn.Parameter(torch.randn(out_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
belphegor2211/khoa_luan
CosMargin
false
9,985
[ "MIT" ]
0
c9c163ebf3aff3005639ce7e4020e510295d1c75
https://github.com/belphegor2211/khoa_luan/tree/c9c163ebf3aff3005639ce7e4020e510295d1c75
import math import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_size, out_size, s=None, m=0.0): super().__init__() self.in_size = in_size self.out_size = out_size self.W = nn.Parameter(torch.randn(out_size, in_size), req...
MultiheadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import Parameter import torch.nn.functional as F def fill_with_neg_inf(t): """FP16-compatible function that fills a tensor with -inf.""" return t.float().fill_(float('-inf')).type_as(t) def _get_full_incremental_state_key(module_instance, key): module_nam...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
dataJSA/batch7_tomorrow_datascience
MultiheadAttention
false
9,986
[ "MIT" ]
0
e2dc6bc59c456fa927e0a1f6d12024ba410f520c
https://github.com/dataJSA/batch7_tomorrow_datascience/tree/e2dc6bc59c456fa927e0a1f6d12024ba410f520c
import torch import torch.nn as nn from torch.nn import Parameter import torch.nn.functional as F def fill_with_neg_inf(t): """FP16-compatible function that fills a tensor with -inf.""" return t.float().fill_(float('-inf')).type_as(t) def _get_full_incremental_state_key(module_instance, key): module_nam...
Model
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch._C import torch.serialization class Model(nn.Module): def __init__(self): super().__init__() self.conv = nn.Conv2d(2, 2, 1) def forward(self, x): return self.conv(x) def get_inputs(): return [torch.rand([4, 2, 64, 64])] def get_...
import torch from torch._inductor.select_algorithm import extern_kernels import 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._C import torch.serialization assert_size_str...
devolfnn/mmsegmentation
Model
false
9,987
[ "Apache-2.0" ]
0
c0dccc1725b80b643419cc008cb93e8dcb4209c8
https://github.com/devolfnn/mmsegmentation/tree/c0dccc1725b80b643419cc008cb93e8dcb4209c8
import torch import torch.nn as nn import torch._C import torch.serialization class Model(nn.Module): def __init__(self): super().__init__() self.conv = nn.Conv2d(2, 2, 1) def forward(self, x): return self.conv(x) def get_inputs(): return [torch.rand([4, 2, 64, 64])] def get_...
DiceBCELoss
# 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 DiceBCELoss(nn.Module): def __init__(self): super(DiceBCELoss, self).__init__() def forward(self, predicted, target): batch = predicted.size()[0] batch_loss = 0 smooth = 1 for index in range(batc...
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...
daoducanhc/Tumor_Segmentation
DiceBCELoss
false
9,988
[ "MIT" ]
0
485a70492f7efb65a0f88f61a0eeffd6f0c92cc9
https://github.com/daoducanhc/Tumor_Segmentation/tree/485a70492f7efb65a0f88f61a0eeffd6f0c92cc9
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, predicted, target): batch = predicted.size()[0] batch_loss = 0 smooth = 1 for index in range(batch): pre = p...
_ASPP
# 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 _ASPP(nn.Module): """ Atrous spatial pyramid pooling (ASPP) """ def __init__(self, in_ch, out_ch, rates): super(_ASPP, self).__init__() self.aspp_num = len(rates) for i, rate in enumerate(rates): self.add_module('c{}'.format...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
developfeng/BCM
_ASPP
false
9,989
[ "BSD-3-Clause-Attribution" ]
0
8eb5ac950a2d67d10fc707519bb66cd9ea4f14f2
https://github.com/developfeng/BCM/tree/8eb5ac950a2d67d10fc707519bb66cd9ea4f14f2
import torch import torch.nn as nn class Model(nn.Module): """ Atrous spatial pyramid pooling (ASPP) """ def __init__(self, in_ch, out_ch, rates): super().__init__() self.aspp_num = len(rates) for i, rate in enumerate(rates): self.add_module('c{}'.format(i), nn.Con...