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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
ConvElement | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 ConvElement(nn.Module):
"""
Residual Core element used inside the NN. Control the number of filters
and batch normalization.
"""
def __init__(self, input_size, num_filters, use_leaky=True, stride=1,
leaky_p=0.2):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | tensormedical/PARIETAL | ConvElement | false | 13,030 | [
"Apache-2.0"
] | 0 | 25bf1cf7828b24d60ccff42efbd0537989aaf160 | https://github.com/tensormedical/PARIETAL/tree/25bf1cf7828b24d60ccff42efbd0537989aaf160 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Residual Core element used inside the NN. Control the number of filters
and batch normalization.
"""
def __init__(self, input_size, num_filters, use_leaky=True, stride=1,
leaky_p=0.2):
s... |
Hill | # 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 Hill(nn.Module):
def forward(self, p):
n = 2
return 1 / (1 + p ** n)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | tianyu-lu/latent_ode | Hill | false | 13,031 | [
"MIT"
] | 0 | 1a9e9415eda1837ed78e50009752b90eda3ca0db | https://github.com/tianyu-lu/latent_ode/tree/1a9e9415eda1837ed78e50009752b90eda3ca0db | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, p):
n = 2
return 1 / (1 + p ** n)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
Net | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 12, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(12, 16, 5)
self.fc1 = nn.Linear(16 * 5 * 5, 120)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | tassotirap/data-science | Net | false | 13,032 | [
"Apache-2.0"
] | 0 | 644bc351740cda90c0d8c907132d9da9630266c9 | https://github.com/tassotirap/data-science/tree/644bc351740cda90c0d8c907132d9da9630266c9 | 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, 12, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(12, 16, 5)
self.fc1 = nn.Linear(16 * 5 * 5, 120)
... |
MaxPoolStride1 | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.functional as F
import torch._utils
class MaxPoolStride1(nn.Module):
def __init__(self, kernel_size):
super(MaxPoolStride1, self).__init__()
self.kernel_size = kernel_size
self.p... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import ... | tiahflorens/AlphaPose | MaxPoolStride1 | false | 13,033 | [
"Apache-2.0"
] | 0 | 84b844eff543eaa619d994ea0b15cb6caf69950d | https://github.com/tiahflorens/AlphaPose/tree/84b844eff543eaa619d994ea0b15cb6caf69950d | import torch
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.functional as F
import torch._utils
class Model(nn.Module):
def __init__(self, kernel_size):
super().__init__()
self.kernel_size = kernel_size
self.pad = kernel_size - 1
def... |
ConcatBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
class ConcatBlock(nn.Module):
def __init__(self, in_channels, out_channels):
super(ConcatBlock, self).__init__()
self.in_chns = in_channels
self.out_chns = out_channels
self.conv1 = nn.Conv2d(self.in_chns, self.in_chns,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional
assert_size_stride = torch._C._... | timothytancy/SSL4MIS | ConcatBlock | false | 13,034 | [
"MIT"
] | 0 | 7879ad3483223e31a2785f5112eac1d4fa36b66e | https://github.com/timothytancy/SSL4MIS/tree/7879ad3483223e31a2785f5112eac1d4fa36b66e | import torch
import torch.nn as nn
import torch.nn.functional
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.in_chns = in_channels
self.out_chns = out_channels
self.conv1 = nn.Conv2d(self.in_chns, self.in_chns, kernel_size=1,
... |
RingLoss | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 warnings
import torch.nn as nn
from torchvision.transforms import *
class RingLoss(nn.Module):
"""Ring loss.
Reference:
Zheng et al. Ring loss: Convex Feature Normalization for Face Recognition. CVPR 2018.
"""
def __init__(self):
super(RingLoss, self).__init__()
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import warnings
import torch.nn as nn
from torchvision.transforms import *
asse... | theodorhusefest/ABD-Net | RingLoss | false | 13,035 | [
"MIT"
] | 0 | 4ad71205954726b88d081ca079c28378f74e3007 | https://github.com/theodorhusefest/ABD-Net/tree/4ad71205954726b88d081ca079c28378f74e3007 | import torch
import warnings
import torch.nn as nn
from torchvision.transforms import *
class Model(nn.Module):
"""Ring loss.
Reference:
Zheng et al. Ring loss: Convex Feature Normalization for Face Recognition. CVPR 2018.
"""
def __init__(self):
super().__init__()
warnings.w... |
OutPutBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
class OutPutBlock(nn.Module):
def __init__(self, in_channels, out_channels):
super(OutPutBlock, self).__init__()
self.in_chns = in_channels
self.out_chns = out_channels
self.conv1 = nn.Conv2d(self.in_chns, self.in_chns ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional
assert_size_stride = torch._C._... | timothytancy/SSL4MIS | OutPutBlock | false | 13,036 | [
"MIT"
] | 0 | 7879ad3483223e31a2785f5112eac1d4fa36b66e | https://github.com/timothytancy/SSL4MIS/tree/7879ad3483223e31a2785f5112eac1d4fa36b66e | import torch
import torch.nn as nn
import torch.nn.functional
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.in_chns = in_channels
self.out_chns = out_channels
self.conv1 = nn.Conv2d(self.in_chns, self.in_chns // 2, kernel_size
... |
ConvolutionModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import Tensor
from torch import nn
class Swish(torch.nn.Module):
"""Construct an Swish object."""
def forward(self, x: 'Tensor') ->Tensor:
"""Return Swich activation function."""
return x * torch.sigmoid(x)
class ConvolutionModule(nn.Module):
"""ConvolutionModule... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import T... | thangdepzai/icefall | ConvolutionModule | false | 13,037 | [
"Apache-2.0"
] | 0 | 8c7995d493c4309c3d09bdabfa1ab12b4eec2657 | https://github.com/thangdepzai/icefall/tree/8c7995d493c4309c3d09bdabfa1ab12b4eec2657 | import torch
from torch import Tensor
from torch import nn
class Swish(torch.nn.Module):
"""Construct an Swish object."""
def forward(self, x: 'Tensor') ->Tensor:
"""Return Swich activation function."""
return x * torch.sigmoid(x)
class Model(nn.Module):
"""ConvolutionModule in Conforme... |
PAMA | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 calc_mean_std(feat, eps=1e-05):
size = feat.size()
assert len(size) == 4
N, C = size[:2]
feat_var = feat.view(N, C, -1).var(dim=2) + eps
feat_std = feat_var.sqrt().view(N, C, 1, 1)
feat_mean = feat.view(N, C, -1).mean(dim=2).view(N, C, 1, 1)
return 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
from torch._inductor.runtime.... | sugi-san/PAMA | PAMA | false | 13,038 | [
"MIT"
] | 0 | 95141ebf0d3b61828a0e545f989f96b8ef569f34 | https://github.com/sugi-san/PAMA/tree/95141ebf0d3b61828a0e545f989f96b8ef569f34 | import torch
import torch.nn as nn
def calc_mean_std(feat, eps=1e-05):
size = feat.size()
assert len(size) == 4
N, C = size[:2]
feat_var = feat.view(N, C, -1).var(dim=2) + eps
feat_std = feat_var.sqrt().view(N, C, 1, 1)
feat_mean = feat.view(N, C, -1).mean(dim=2).view(N, C, 1, 1)
return fe... |
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 numpy as np
import torch.nn.functional as F
from torch import nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Actor(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | tjkemp/tennis-example | Actor | false | 13,039 | [
"MIT"
] | 0 | 3cb0c52a93c65f88872cf44e3782bf87d9d8cef3 | https://github.com/tjkemp/tennis-example/tree/3cb0c52a93c65f88872cf44e3782bf87d9d8cef3 | import torch
import numpy as np
import torch.nn.functional as F
from torch import nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Model(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc... |
CausalAttentionSortNet | # 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.nn import functional as F
from torch import nn
def bucket(buckets, t, dim=1):
shape = list(t.shape)
shape[dim:dim + 1] = [buckets, -1]
return t.reshape(*shape)
def differentiable_topk(x, k, temperature=1.0):
*_, n, dim = x.shape
topk_tensors = []
for i in range(k):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | tatp22/sinkhorn-transformer | CausalAttentionSortNet | false | 13,040 | [
"MIT"
] | 0 | 3eaa76e99efeee75cf8298defaaef51621c55ff4 | https://github.com/tatp22/sinkhorn-transformer/tree/3eaa76e99efeee75cf8298defaaef51621c55ff4 | import torch
from torch.nn import functional as F
from torch import nn
def bucket(buckets, t, dim=1):
shape = list(t.shape)
shape[dim:dim + 1] = [buckets, -1]
return t.reshape(*shape)
def differentiable_topk(x, k, temperature=1.0):
*_, n, dim = x.shape
topk_tensors = []
for i in range(k):
... |
Critic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn.functional as F
from torch import nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Critic(nn.Module):
"""Critic (Value) Model."""
def __init__(self, state_size, action_size, seed, f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import numpy as np
from torch... | tjkemp/tennis-example | Critic | false | 13,041 | [
"MIT"
] | 0 | 3cb0c52a93c65f88872cf44e3782bf87d9d8cef3 | https://github.com/tjkemp/tennis-example/tree/3cb0c52a93c65f88872cf44e3782bf87d9d8cef3 | import torch
import numpy as np
import torch.nn.functional as F
from torch import nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Model(nn.Module):
"""Critic (Value) Model."""
def __init__(self, state_size, action_size, seed, fc... |
DeepModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 DeepModel(nn.Module):
def __init__(self, in_size, out_size):
super().__init__()
self.linear1 = nn.Linear(in_size, 1024)
self.linear2 = nn.Linear(1024, 512)
self.linear3 = nn.Linear(512, 256)
self.line... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | tianyi-ge/eecs598-a1 | DeepModel | false | 13,042 | [
"MIT"
] | 0 | 540140c5c2a59931ee051a0064932a1e81f84806 | https://github.com/tianyi-ge/eecs598-a1/tree/540140c5c2a59931ee051a0064932a1e81f84806 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, in_size, out_size):
super().__init__()
self.linear1 = nn.Linear(in_size, 1024)
self.linear2 = nn.Linear(1024, 512)
self.linear3 = nn.Linear(512, 256)
self.linear4 ... |
GaussianNoiseSampler | # 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
import torch.nn as nn
class GaussianNoiseSampler(nn.Module):
def __init__(self, scale=0.01, inplace=False):
super(GaussianNoiseSampler, self).__init__()
if scale < 0:
raise ValueError(
'noise scale has to be greather than 0, but got {}'.... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_... | tritas/mixdat | GaussianNoiseSampler | false | 13,043 | [
"BSD-3-Clause"
] | 0 | 38fb10df76df55cc1eddba5375c7699c23771fb3 | https://github.com/tritas/mixdat/tree/38fb10df76df55cc1eddba5375c7699c23771fb3 | import torch
import torch as th
import torch.nn as nn
class Model(nn.Module):
def __init__(self, scale=0.01, inplace=False):
super().__init__()
if scale < 0:
raise ValueError(
'noise scale has to be greather than 0, but got {}'.format(
scale))
s... |
Projection | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 TimeDistributed(nn.Module):
def __init__(self, layer, activation='relu'):
super().__init__()
self.layer = layer
self.activation = self.select_activation(activation)
def forward(self, x):
x_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | tndls9304/chatspace | Projection | false | 13,044 | [
"Apache-2.0"
] | 0 | 42cb4bd9bd3b553706d9ac227150329103d681aa | https://github.com/tndls9304/chatspace/tree/42cb4bd9bd3b553706d9ac227150329103d681aa | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class TimeDistributed(nn.Module):
def __init__(self, layer, activation='relu'):
super().__init__()
self.layer = layer
self.activation = self.select_activation(activation)
def forward(self, x):
x_... |
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
class Model(nn.Module):
def __init__(self, input_dim, output_class_num, **kwargs):
super(Model, self).__init__()
self.linear = nn.Linear(input_dim, output_class_num)
def forward(self, features):
pooled = features.mean(dim=1)
predicted = self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | triper1022/s3prl | Model | false | 13,045 | [
"MIT"
] | 0 | d48e9e1d062d6cb14b66048eb56193fb50c60c24 | https://github.com/triper1022/s3prl/tree/d48e9e1d062d6cb14b66048eb56193fb50c60c24 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, output_class_num, **kwargs):
super(Model, self).__init__()
self.linear = nn.Linear(input_dim, output_class_num)
def forward(self, features):
pooled = features.mean(dim=1)
predicted = self... |
resnet_block | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class resnet_block(nn.Module):
def __init__(self, dim_in, dim_out):
super(resnet_block, self).__init__()
self.dim_in = dim_in
self.dim_out = dim_out
if self.dim_in == self.dim_out:
self.conv_1 = nn.Conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | trisct/BSP-NET-pytorch | resnet_block | false | 13,046 | [
"MIT"
] | 0 | 31f148aa3d7321bac854bc3de6c88f676236b7e4 | https://github.com/trisct/BSP-NET-pytorch/tree/31f148aa3d7321bac854bc3de6c88f676236b7e4 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, dim_in, dim_out):
super().__init__()
self.dim_in = dim_in
self.dim_out = dim_out
if self.dim_in == self.dim_out:
self.conv_1 = nn.Conv2d(self.dim_in, self.dim_... |
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class MLP(nn.Module):
def __init__(self):
super(MLP, self).__init__()
self.fc1 = nn.Linear(in_features=28 * 28, out_features=500)
self.fc2 = nn.Linear(in_features=500, out_features=200)
self.fc3 = nn.Linear(in_feat... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | trGiang99/ml-glossary-vn | MLP | false | 13,047 | [
"MIT"
] | 0 | 1160300cee6ccb02712c790b76bbc11c06c2ca55 | https://github.com/trGiang99/ml-glossary-vn/tree/1160300cee6ccb02712c790b76bbc11c06c2ca55 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(in_features=28 * 28, out_features=500)
self.fc2 = nn.Linear(in_features=500, out_features=200)
self.fc3 = nn.Linear(in_features=20... |
generator | # 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 generator(nn.Module):
def __init__(self, p_dim, c_dim):
super(generator, self).__init__()
self.p_dim = p_dim
self.c_dim = c_dim
convex_layer_weights = torch.zeros((self.p_dim, self.c_dim))
self.convex_layer_weights = nn.Parameter(co... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | trisct/BSP-NET-pytorch | generator | false | 13,048 | [
"MIT"
] | 0 | 31f148aa3d7321bac854bc3de6c88f676236b7e4 | https://github.com/trisct/BSP-NET-pytorch/tree/31f148aa3d7321bac854bc3de6c88f676236b7e4 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, p_dim, c_dim):
super().__init__()
self.p_dim = p_dim
self.c_dim = c_dim
convex_layer_weights = torch.zeros((self.p_dim, self.c_dim))
self.convex_layer_weights = nn.Parameter(convex_layer_weights)... |
FocalLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
class FocalLoss(nn.Module):
def __init__(self, gamma=0, eps=1e-07):
super(FocalLoss, self).__init__()
self.gamma = gamma
self.eps = eps
self.ce = torch.nn.CrossEntropyLoss(reduction='none')
def forward(self, input, target):
logp = sel... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | tropicbird/kaggle-landmark-recognition-2020-1st-place | FocalLoss | false | 13,049 | [
"MIT"
] | 0 | 79a9d1b05c326a77b4859d4d41d30e52e6be710e | https://github.com/tropicbird/kaggle-landmark-recognition-2020-1st-place/tree/79a9d1b05c326a77b4859d4d41d30e52e6be710e | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, gamma=0, eps=1e-07):
super().__init__()
self.gamma = gamma
self.eps = eps
self.ce = torch.nn.CrossEntropyLoss(reduction='none')
def forward(self, input, target):
logp = self.ce(input, target)... |
Conv2dStaticSamePadding | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import nn
from torch.nn import functional as F
class Conv2dStaticSamePadding(nn.Module):
"""
created by Zylo117
The real keras/tensorflow conv2d with same padding
"""
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
bias=False, group... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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... | tujikuangmo/FishNet | Conv2dStaticSamePadding | false | 13,050 | [
"MIT"
] | 0 | 1c2f7112639416bd12a02585a9e04e1d05960520 | https://github.com/tujikuangmo/FishNet/tree/1c2f7112639416bd12a02585a9e04e1d05960520 | import math
import torch
from torch import nn
from torch.nn import functional as F
class Model(nn.Module):
"""
created by Zylo117
The real keras/tensorflow conv2d with same padding
"""
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
bias=False, groups=1, dilation=1, *... |
GAT | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class GraphAttentionLayer(nn.Module):
"""
Simple GAT layer, similar to https://arxiv.org/abs/1710.10903
"""
def __init__(self, in_features, out_features, dropout, alpha, concat=True):
super(GraphAttentionLayer, self).__init__(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | thilinicooray/pyGAT | GAT | false | 13,051 | [
"MIT"
] | 0 | 0c8fd0fdae20e42a41116cc9691e1223fd9d0a93 | https://github.com/thilinicooray/pyGAT/tree/0c8fd0fdae20e42a41116cc9691e1223fd9d0a93 | import torch
import torch.nn as nn
import torch.nn.functional as F
class GraphAttentionLayer(nn.Module):
"""
Simple GAT layer, similar to https://arxiv.org/abs/1710.10903
"""
def __init__(self, in_features, out_features, dropout, alpha, concat=True):
super().__init__()
self.dropout = ... |
BinaryFocalLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class BinaryFocalLoss(torch.nn.Module):
""" from https://github.com/qubvel/segmentation_models"""
def __init__(self, gamma=2.0, alpha=0.25, eps=1e-07):
super().__init__()
self.gamma = gamma
self.alpha = alpha
self.eps = eps
def forward(self, pr, gt):
... | 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
assert_size_stride = t... | uncharted-distil/d3m-primitives | BinaryFocalLoss | false | 13,054 | [
"Apache-2.0"
] | 0 | e8d37dbe302c0f2bae4e7f7fa241a46faebc9b79 | https://github.com/uncharted-distil/d3m-primitives/tree/e8d37dbe302c0f2bae4e7f7fa241a46faebc9b79 | import torch
class Model(torch.nn.Module):
""" from https://github.com/qubvel/segmentation_models"""
def __init__(self, gamma=2.0, alpha=0.25, eps=1e-07):
super().__init__()
self.gamma = gamma
self.alpha = alpha
self.eps = eps
def forward(self, pr, gt):
pr = torch... |
GeM | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
from torchvision.transforms import *
class GeM(nn.Module):
def __init__(self, dim=2048, p=3, eps=1e-06):
super(GeM, self).__init__()
self.p = nn.Parameter(torch.ones(dim) * p, requires_grad=True)
self.eps = eps
... | 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 ... | uestcwcw/University1652-Baseline | GeM | false | 13,056 | [
"MIT"
] | 0 | fda1e4773fc911cbb43a9b96901d436298dc1284 | https://github.com/uestcwcw/University1652-Baseline/tree/fda1e4773fc911cbb43a9b96901d436298dc1284 | import torch
from torch import nn
from torch.nn import functional as F
from torchvision.transforms import *
class Model(nn.Module):
def __init__(self, dim=2048, p=3, eps=1e-06):
super().__init__()
self.p = nn.Parameter(torch.ones(dim) * p, requires_grad=True)
self.eps = eps
self.d... |
CrossEntropy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.nn.functional as F
def cross_entropy(y, target, mask=None):
if target.ndim == 1:
loss = F.cross_entropy(y, target, reduction='none')
else:
loss = -(target * F.log_softmax(y, 1)).sum(1)
if mask is not None:
loss = mask * loss
return... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
i... | uncharted-distil/d3m-primitives | CrossEntropy | false | 13,057 | [
"Apache-2.0"
] | 0 | e8d37dbe302c0f2bae4e7f7fa241a46faebc9b79 | https://github.com/uncharted-distil/d3m-primitives/tree/e8d37dbe302c0f2bae4e7f7fa241a46faebc9b79 | import torch
from torch import nn
import torch.nn.functional as F
def cross_entropy(y, target, mask=None):
if target.ndim == 1:
loss = F.cross_entropy(y, target, reduction='none')
else:
loss = -(target * F.log_softmax(y, 1)).sum(1)
if mask is not None:
loss = mask * loss
return... |
CircleLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import Tensor
from torch import nn
from torchvision.transforms import *
class CircleLoss(nn.Module):
def __init__(self, m: 'float', gamma: 'float') ->None:
super(CircleLoss, self).__init__()
self.m = m
self.gamma = gamma
self.soft_plus = nn.Softplus()
... | 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 ... | uestcwcw/University1652-Baseline | CircleLoss | false | 13,058 | [
"MIT"
] | 0 | fda1e4773fc911cbb43a9b96901d436298dc1284 | https://github.com/uestcwcw/University1652-Baseline/tree/fda1e4773fc911cbb43a9b96901d436298dc1284 | import torch
from torch import Tensor
from torch import nn
from torchvision.transforms import *
class Model(nn.Module):
def __init__(self, m: 'float', gamma: 'float') ->None:
super().__init__()
self.m = m
self.gamma = gamma
self.soft_plus = nn.Softplus()
def forward(self, sp:... |
Image2Patch | # 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 Image2Patch(nn.Module):
"""Some Information about Image2Patch"""
def __init__(self, channels, image_size, patch_size):
super(Image2Patch, self).__init__()
if type(patch_size) == int:
patch_size = [patch_size,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | uthree/ReMixer | Image2Patch | false | 13,059 | [
"MIT"
] | 0 | 587e1b6a01850df649eccf043689f84a7dd5e2dc | https://github.com/uthree/ReMixer/tree/587e1b6a01850df649eccf043689f84a7dd5e2dc | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""Some Information about Image2Patch"""
def __init__(self, channels, image_size, patch_size):
super().__init__()
if type(patch_size) == int:
patch_size = [patch_size, patch_size]
se... |
CEFL | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class CEFL(nn.Module):
def __init__(self, gamma=1):
super(CEFL, self).__init__()
self.gamma = gamma
def get_prob(self, input, target):
prob = F.softmax(input, dim=-1)
prob = prob[range(target... | 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
... | umairjavaid/staff-employee-classification | CEFL | false | 13,060 | [
"MIT"
] | 0 | fc5fe32acfbde2b188094df90d888eeb0f4f4acd | https://github.com/umairjavaid/staff-employee-classification/tree/fc5fe32acfbde2b188094df90d888eeb0f4f4acd | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Model(nn.Module):
def __init__(self, gamma=1):
super().__init__()
self.gamma = gamma
def get_prob(self, input, target):
prob = F.softmax(input, dim=-1)
prob = prob[range(target.shape[0]... |
FocalLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class FocalLoss(nn.Module):
def __init__(self, alpha=1, gamma=0):
super(FocalLoss, self).__init__()
self.gamma = gamma
self.alpha = alpha
def get_attention(self, input, target):
prob = F.soft... | 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
... | umairjavaid/staff-employee-classification | FocalLoss | false | 13,061 | [
"MIT"
] | 0 | fc5fe32acfbde2b188094df90d888eeb0f4f4acd | https://github.com/umairjavaid/staff-employee-classification/tree/fc5fe32acfbde2b188094df90d888eeb0f4f4acd | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Model(nn.Module):
def __init__(self, alpha=1, gamma=0):
super().__init__()
self.gamma = gamma
self.alpha = alpha
def get_attention(self, input, target):
prob = F.softmax(input, dim=-1)
... |
encoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class encoder(nn.Module):
def __init__(self, ef_dim):
super(encoder, self).__init__()
self.ef_dim = ef_dim
self.conv_1 = nn.Conv3d(1, self.ef_dim, 4, stride=2, padding=1,
bias=True)
self.conv_2 = nn.Con... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | trisct/BSP-NET-pytorch | encoder | false | 13,062 | [
"MIT"
] | 0 | 31f148aa3d7321bac854bc3de6c88f676236b7e4 | https://github.com/trisct/BSP-NET-pytorch/tree/31f148aa3d7321bac854bc3de6c88f676236b7e4 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, ef_dim):
super().__init__()
self.ef_dim = ef_dim
self.conv_1 = nn.Conv3d(1, self.ef_dim, 4, stride=2, padding=1,
bias=True)
self.conv_2 = nn.Conv3d(self.ef_dim... |
CustomInverse | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class CustomTorchOp(torch.autograd.Function):
@staticmethod
def symbolic(g, input):
return g.op('torchcustom::Add10', input)
@staticmethod
def forward(ctx, x):
return x + 10
class CustomInverse(torch.nn.Module):
def forward(self, x, y):
ress = CustomTorchO... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | shaahji/onnxruntime-extensions | CustomInverse | false | 13,063 | [
"MIT"
] | 0 | c30df08aee69db761b97185be9f87160a4efa6bc | https://github.com/shaahji/onnxruntime-extensions/tree/c30df08aee69db761b97185be9f87160a4efa6bc | import torch
class CustomTorchOp(torch.autograd.Function):
@staticmethod
def symbolic(g, input):
return g.op('torchcustom::Add10', input)
@staticmethod
def forward(ctx, x):
return x + 10
class Model(torch.nn.Module):
def forward(self, x, y):
ress = CustomTorchOp.apply(... |
MixerMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 MixerMLP(nn.Module):
"""Some Information about MixerMLP"""
def __init__(self, dim, activation='gelu'):
super(MixerMLP, self).__init__()
if activation == 'gelu':
self.activation = nn.GELU()
elif activation == 'relu':
self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | uthree/ReMixer | MixerMLP | false | 13,064 | [
"MIT"
] | 0 | 587e1b6a01850df649eccf043689f84a7dd5e2dc | https://github.com/uthree/ReMixer/tree/587e1b6a01850df649eccf043689f84a7dd5e2dc | import torch
import torch.nn as nn
class Model(nn.Module):
"""Some Information about MixerMLP"""
def __init__(self, dim, activation='gelu'):
super().__init__()
if activation == 'gelu':
self.activation = nn.GELU()
elif activation == 'relu':
self.activation = nn.... |
SpatialShift2d | # 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 SpatialShift2d(nn.Module):
def __init__(self, channels, padding_mode='replicate'):
super(SpatialShift2d, self).__init__()
qc = channels // 4
self.num_shift_left = qc
self.num_shift_right = qc
self.num... | 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... | uthree/ReMixer | SpatialShift2d | false | 13,065 | [
"MIT"
] | 0 | 587e1b6a01850df649eccf043689f84a7dd5e2dc | https://github.com/uthree/ReMixer/tree/587e1b6a01850df649eccf043689f84a7dd5e2dc | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, channels, padding_mode='replicate'):
super().__init__()
qc = channels // 4
self.num_shift_left = qc
self.num_shift_right = qc
self.num_shift_up = qc
self.n... |
ElementWiseMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 ElementWiseMLP(nn.Module):
"""Some Information about ElementWiseMLP"""
def __init__(self, dim, activation='gelu'):
super(ElementWiseMLP, self).__init__()
if activation == 'gelu':
self.activation = nn.GELU()
elif activation == '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.triton_helpers import libdevice
import torch.nn as ... | uthree/ReMixer | ElementWiseMLP | false | 13,066 | [
"MIT"
] | 0 | 587e1b6a01850df649eccf043689f84a7dd5e2dc | https://github.com/uthree/ReMixer/tree/587e1b6a01850df649eccf043689f84a7dd5e2dc | import torch
import torch.nn as nn
class Model(nn.Module):
"""Some Information about ElementWiseMLP"""
def __init__(self, dim, activation='gelu'):
super().__init__()
if activation == 'gelu':
self.activation = nn.GELU()
elif activation == 'relu':
self.activation... |
DQN_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 torch
import torch.nn as nn
import torch.nn.functional as F
class DQN_Linear(nn.Module):
def __init__(self, input_size, output_size):
super(DQN_Linear, self).__init__()
self.l1 = nn.Linear(input_size, 32)
self.l2 = nn.Linear(32, 64)
self.head = nn.Linear(64, output_size)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | vashineyu/dqn_cartpole | DQN_Linear | false | 13,067 | [
"MIT"
] | 0 | 7d3d2c26e29d40fce7710dbd56c59045514f2e84 | https://github.com/vashineyu/dqn_cartpole/tree/7d3d2c26e29d40fce7710dbd56c59045514f2e84 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_size, output_size):
super().__init__()
self.l1 = nn.Linear(input_size, 32)
self.l2 = nn.Linear(32, 64)
self.head = nn.Linear(64, output_size)
def forward(self, ... |
EnvModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
def layer_init(layer, w_scale=1.0):
nn.init.orthogonal_(layer.weight.data)
layer.weight.data.mul_(w_scale)
nn.init.constant_(layer.bias.data, 0)
return layer
class EnvModel(nn.Module):
def __init__(self, phi_dim, action_dim):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | spacegoing/oc_hrl_pytorch | EnvModel | false | 13,068 | [
"MIT"
] | 0 | 3e6c3b32b41d7dad40a9ee35f436f8cbcde8633b | https://github.com/spacegoing/oc_hrl_pytorch/tree/3e6c3b32b41d7dad40a9ee35f436f8cbcde8633b | import torch
import torch.nn as nn
import torch.nn.functional as F
def layer_init(layer, w_scale=1.0):
nn.init.orthogonal_(layer.weight.data)
layer.weight.data.mul_(w_scale)
nn.init.constant_(layer.bias.data, 0)
return layer
class Model(nn.Module):
def __init__(self, phi_dim, action_dim):
... |
Scale | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.nn as nn
class Scale(nn.Module):
def __init__(self, d_model):
super(Scale, self).__init__()
self.d_model = d_model
def forward(self, x):
return x * math.sqrt(self.d_model)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | voidism/End-to-end-ASR-Pytorch | Scale | false | 13,069 | [
"MIT"
] | 0 | 509c389fa6ab98c30e227c6f4c8f7474adbc1bb2 | https://github.com/voidism/End-to-end-ASR-Pytorch/tree/509c389fa6ab98c30e227c6f4c8f7474adbc1bb2 | import math
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, d_model):
super().__init__()
self.d_model = d_model
def forward(self, x):
return x * math.sqrt(self.d_model)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
... |
GeneratorBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 leaky_relu(p=0.2):
return nn.LeakyReLU(p)
class GeneratorBlock(nn.Module):
def __init__(self, input_channels, latent_channels, output_channels,
upsample=True):
super(GeneratorBlock, self).__init__()
if upsample:
self.upsample = nn.U... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | uthree/pg-gan | GeneratorBlock | false | 13,070 | [
"MIT"
] | 0 | 7a72a9f3487a66ddc6c8c51a774e3d8128369b2a | https://github.com/uthree/pg-gan/tree/7a72a9f3487a66ddc6c8c51a774e3d8128369b2a | import torch
import torch.nn as nn
def leaky_relu(p=0.2):
return nn.LeakyReLU(p)
class Model(nn.Module):
def __init__(self, input_channels, latent_channels, output_channels,
upsample=True):
super().__init__()
if upsample:
self.upsample = nn.Upsample(scale_factor=2)
... |
Res | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.distributions
class Res(nn.Module):
def __init__(self, H):
super().__init__()
self.u1 = nn.Linear(H, H)
self.u2 = nn.Linear(H, H)
self.v1 = nn.Linear(H, H)
self.v2 = nn.Linear(H, H)
self.w = nn.Linear(H, H)
def fo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | w-cheng/pytorch-struct | Res | false | 13,071 | [
"MIT"
] | 0 | e51fecc1473925e4c44de135c4a3240fcb20fa40 | https://github.com/w-cheng/pytorch-struct/tree/e51fecc1473925e4c44de135c4a3240fcb20fa40 | import torch
from torch import nn
import torch.distributions
class Model(nn.Module):
def __init__(self, H):
super().__init__()
self.u1 = nn.Linear(H, H)
self.u2 = nn.Linear(H, H)
self.v1 = nn.Linear(H, H)
self.v2 = nn.Linear(H, H)
self.w = nn.Linear(H, H)
def ... |
DAInsHead | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
from torchvision.transforms import functional as F
from torch import nn
import torch.nn.functional as F
class DAInsHead(nn.Module):
"""
Adds a simple Instance-level Domain Classifier head
"""
def __init__(self, in_channels):
"""
Arguments:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | thesuperorange/Domain-Adaptive-Faster-RCNN-PyTorch | DAInsHead | false | 13,072 | [
"MIT"
] | 0 | bcde744a486b25ec1d6e4b023da3ce0c8e5d72a7 | https://github.com/thesuperorange/Domain-Adaptive-Faster-RCNN-PyTorch/tree/bcde744a486b25ec1d6e4b023da3ce0c8e5d72a7 | import torch
import torch.utils.data
from torchvision.transforms import functional as F
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Adds a simple Instance-level Domain Classifier head
"""
def __init__(self, in_channels):
"""
Arguments:
... |
Net | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1, 32, 3, 1)
self.conv2 = nn.Conv2d(32, 64, 3, 1)
self.dropout1 = nn.Dropout2d(0.25)
self.dropout2 = nn.Dropout2d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | v01dXYZ/petastorm | Net | false | 13,073 | [
"Apache-2.0"
] | 0 | d6f4e82eb2c3a6c2b4c16c060c7350331b60a51a | https://github.com/v01dXYZ/petastorm/tree/d6f4e82eb2c3a6c2b4c16c060c7350331b60a51a | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 32, 3, 1)
self.conv2 = nn.Conv2d(32, 64, 3, 1)
self.dropout1 = nn.Dropout2d(0.25)
self.dropout2 = nn.Dropout2d(0.5)
... |
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 torch
import torch.nn as nn
import torch.cuda
def aeq(*args):
"""
Assert all arguments have the same value
"""
arguments = (arg for arg in args)
first = next(arguments)
assert all(arg == first for arg in arguments
), 'Not all arguments have the same value: ' + str(args)
def se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | vvjn/MultimodalNMT | GlobalAttention | false | 13,074 | [
"MIT"
] | 0 | 2d69588a5b640290602b4f6d7e4120ae9742c1c2 | https://github.com/vvjn/MultimodalNMT/tree/2d69588a5b640290602b4f6d7e4120ae9742c1c2 | import torch
import torch.nn as nn
import torch.cuda
def aeq(*args):
"""
Assert all arguments have the same value
"""
arguments = (arg for arg in args)
first = next(arguments)
assert all(arg == first for arg in arguments
), 'Not all arguments have the same value: ' + str(args)
def se... |
BertAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
class BertLayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(BertLayerNorm, self).__init__... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | vincentlux/TextBrewer | BertAttention | false | 13,075 | [
"Apache-2.0"
] | 0 | 51ffbf390a0b69ee51b6ad6f5045be63e21c98e3 | https://github.com/vincentlux/TextBrewer/tree/51ffbf390a0b69ee51b6ad6f5045be63e21c98e3 | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
class BertLayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super().__init__()
self.wei... |
ConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class ConvNet(nn.Module):
"""
A network with a single convolution layer. This is used for testing flop
count for convolution layers.
"""
def __init__(self, conv_dim: 'int', input_dim: 'int', output_dim: 'int',
kernel_size: 'int', spatial_dim: 'int', stri... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | wangg12/fvcore | ConvNet | false | 13,076 | [
"Apache-2.0"
] | 0 | aca6e95b3319144ec3c66385ff348c1557a2147f | https://github.com/wangg12/fvcore/tree/aca6e95b3319144ec3c66385ff348c1557a2147f | import torch
import torch.nn as nn
class Model(nn.Module):
"""
A network with a single convolution layer. This is used for testing flop
count for convolution layers.
"""
def __init__(self, conv_dim: 'int', input_dim: 'int', output_dim: 'int',
kernel_size: 'int', spatial_dim: 'int', stride... |
AEC | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn.functional as F
from torch import nn
class AEC(nn.Module):
def __init__(self, hidden_nodes, conv_width, pixel_patchsize,
lambda_activation):
super(AEC, self).__init__()
self.hidden_nodes = hidden_nodes
self.conv_width = conv_width
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | vdutell/biophys_encoder | AEC | false | 13,077 | [
"Apache-2.0"
] | 0 | 2ca8011338c4f1eb6b50e7cb74e07d105d1e9669 | https://github.com/vdutell/biophys_encoder/tree/2ca8011338c4f1eb6b50e7cb74e07d105d1e9669 | import torch
import numpy as np
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
def __init__(self, hidden_nodes, conv_width, pixel_patchsize,
lambda_activation):
super().__init__()
self.hidden_nodes = hidden_nodes
self.conv_width = conv_width
s... |
UpConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 UpConv(nn.Module):
def __init__(self, in_channels):
super().__init__()
self.up_conv = nn.Sequential(OrderedDict([('up', nn.Upsample(
scale_factor=2)), ('conv', nn.Conv2d(in_channels, in_channels //
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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 collections import OrderedDict
assert_size_stride = t... | wan2000/ssdf-perception | UpConv | false | 13,078 | [
"MIT"
] | 0 | df91bfb60f0d1b324fecada3d99d3498ca5794b0 | https://github.com/wan2000/ssdf-perception/tree/df91bfb60f0d1b324fecada3d99d3498ca5794b0 | import torch
import torch.nn as nn
from collections import OrderedDict
class Model(nn.Module):
def __init__(self, in_channels):
super().__init__()
self.up_conv = nn.Sequential(OrderedDict([('up', nn.Upsample(
scale_factor=2)), ('conv', nn.Conv2d(in_channels, in_channels //
... |
ThreeNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 ThreeNet(nn.Module):
"""
A network with three layers. This is used for testing a network with more
than one operation. The network has a convolution layer followed by two
fully connected layers.
"""
def __init__(self, input_dim: 'int', conv_dim: 'int',... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | wangg12/fvcore | ThreeNet | false | 13,079 | [
"Apache-2.0"
] | 0 | aca6e95b3319144ec3c66385ff348c1557a2147f | https://github.com/wangg12/fvcore/tree/aca6e95b3319144ec3c66385ff348c1557a2147f | import torch
import torch.nn as nn
class Model(nn.Module):
"""
A network with three layers. This is used for testing a network with more
than one operation. The network has a convolution layer followed by two
fully connected layers.
"""
def __init__(self, input_dim: 'int', conv_dim: 'int', li... |
Attention_layer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class Attention_layer(nn.Module):
def __init__(self, sequence_length):
super(Attention_layer, self).__init__()
self.input_size = sequence_length
self.output_size = sequence_length
self.dense = nn.Linear(sequence_length, sequence_length)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | w6688j/ChatBot-PyTorch | Attention_layer | false | 13,080 | [
"Apache-2.0"
] | 0 | 84f5a3267d16c650b90727ce80e4952901faa902 | https://github.com/w6688j/ChatBot-PyTorch/tree/84f5a3267d16c650b90727ce80e4952901faa902 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, sequence_length):
super().__init__()
self.input_size = sequence_length
self.output_size = sequence_length
self.dense = nn.Linear(sequence_length, sequence_length)
self.softmax = nn.Softmax(dim=-1)... |
SPPNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
def spatial_pyramid_pool(previous_conv, num_sample, previous_conv_size,
out_pool_size):
"""
previous_conv: a tensor vector of previous convolution layer
num_sample: an int number of image in the batch
previous_conv_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.... | maj34/Deep-Learning-Papers | SPPNet | false | 13,081 | [
"MIT"
] | 0 | 2672d3426b3f4342f7d81cd5ae029f2485594b4c | https://github.com/maj34/Deep-Learning-Papers/tree/2672d3426b3f4342f7d81cd5ae029f2485594b4c | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
def spatial_pyramid_pool(previous_conv, num_sample, previous_conv_size,
out_pool_size):
"""
previous_conv: a tensor vector of previous convolution layer
num_sample: an int number of image in the batch
previous_conv_size... |
CmapPafHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
import torch.optim
class UpsampleCBR(torch.nn.Sequential):
def __init__(self, input_channels, output_channels, count=1, num_flat=0):
layers = []
for i in range(count):
if i == 0:
inch = input_channels
els... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn
import torch.optim
assert_size_stride = ... | tucachmo2202/trt_pose | CmapPafHeadAttention | false | 13,082 | [
"MIT"
] | 0 | b847fc197c32219dc2d719c2b42906603da0988a | https://github.com/tucachmo2202/trt_pose/tree/b847fc197c32219dc2d719c2b42906603da0988a | import torch
import torch.utils.data
import torch.nn
import torch.optim
class UpsampleCBR(torch.nn.Sequential):
def __init__(self, input_channels, output_channels, count=1, num_flat=0):
layers = []
for i in range(count):
if i == 0:
inch = input_channels
els... |
ParsingRelationLoss | # 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.modules
import torch.nn as nn
class ParsingRelationLoss(nn.Module):
def __init__(self):
super(ParsingRelationLoss, self).__init__()
def forward(self, logits):
_n, _c, h, _w = logits.shape
loss_all = []
for i in range(0, h - 1):
loss_al... | 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.modules
import torch.nn as nn
assert_size_stride = torch.... | wangping984/Ultra-Fast-Lane-Detection | ParsingRelationLoss | false | 13,083 | [
"MIT"
] | 0 | b7559c1469d832bf5afe5d158dd3ad63b4df9d9c | https://github.com/wangping984/Ultra-Fast-Lane-Detection/tree/b7559c1469d832bf5afe5d158dd3ad63b4df9d9c | import torch
import torch.nn.modules
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, logits):
_n, _c, h, _w = logits.shape
loss_all = []
for i in range(0, h - 1):
loss_all.append(logits[:, :, i, :] - logits[:,... |
FSP | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class FSP(nn.Module):
"""
A Gift from Knowledge Distillation: Fast Optimization, Network Minimization and Transfer Learning
http://openaccess.thecvf... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from i... | wangxianliang/FaceX-Zoo | FSP | false | 13,084 | [
"Apache-2.0"
] | 0 | b0555c88a0350fa7b59c317f3a171f551fef4e6e | https://github.com/wangxianliang/FaceX-Zoo/tree/b0555c88a0350fa7b59c317f3a171f551fef4e6e | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class Model(nn.Module):
"""
A Gift from Knowledge Distillation: Fast Optimization, Network Minimization and Transfer Learning
http://openaccess.thec... |
FT | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class FT(nn.Module):
"""
araphrasing Complex Network: Network Compression via Factor Transfer
http://papers.nips.cc/paper/7541-paraphrasing-complex-... | 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... | wangxianliang/FaceX-Zoo | FT | false | 13,085 | [
"Apache-2.0"
] | 0 | b0555c88a0350fa7b59c317f3a171f551fef4e6e | https://github.com/wangxianliang/FaceX-Zoo/tree/b0555c88a0350fa7b59c317f3a171f551fef4e6e | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class Model(nn.Module):
"""
araphrasing Complex Network: Network Compression via Factor Transfer
http://papers.nips.cc/paper/7541-paraphrasing-compl... |
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... | from _paritybench_helpers import _mock_config
import torch
import torch.nn.functional as F
from torch import nn
from torch.autograd import *
class Attention(nn.Module):
def __init__(self, opt):
super(Attention, self).__init__()
self.rnn_size = opt.rnn_size
self.att_hid_size = opt.att_hid_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | GeorgeKostenkov/ImageCaptioning.pytorch | Attention | false | 13,086 | [
"MIT"
] | 0 | 8f17433fdaba2f89774e45ad5a3a88b880932ee6 | https://github.com/GeorgeKostenkov/ImageCaptioning.pytorch/tree/8f17433fdaba2f89774e45ad5a3a88b880932ee6 | from _paritybench_helpers import _mock_config
import torch
import torch.nn.functional as F
from torch import nn
from torch.autograd import *
class Model(nn.Module):
def __init__(self, opt):
super().__init__()
self.rnn_size = opt.rnn_size
self.att_hid_size = opt.att_hid_size
self.h... |
Visual_Q_Network | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 Visual_Q_Network(nn.Module):
"""
The input of this network should have shape (num_frame, 80, 80)
"""
def __init__(self, num_frame, num_action):
super(Visual_Q_Network, self).__init__()
self.conv1 = nn.Conv2d(in_c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | wanghaodi/DQN_with_DDQN | Visual_Q_Network | false | 13,087 | [
"MIT"
] | 0 | 970ebf429c863debfd009b48e3bc4169fcbb05d4 | https://github.com/wanghaodi/DQN_with_DDQN/tree/970ebf429c863debfd009b48e3bc4169fcbb05d4 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
The input of this network should have shape (num_frame, 80, 80)
"""
def __init__(self, num_frame, num_action):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=num_frame, out_channels=1... |
SoftTarget | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class SoftTarget(nn.Module):
"""
Distilling the Knowledge in a Neural Network
https://arxiv.org/pdf/1503.02531.pdf
"""
def __init__(self, T):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | wangxianliang/FaceX-Zoo | SoftTarget | false | 13,088 | [
"Apache-2.0"
] | 0 | b0555c88a0350fa7b59c317f3a171f551fef4e6e | https://github.com/wangxianliang/FaceX-Zoo/tree/b0555c88a0350fa7b59c317f3a171f551fef4e6e | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class Model(nn.Module):
"""
Distilling the Knowledge in a Neural Network
https://arxiv.org/pdf/1503.02531.pdf
"""
def __init__(self, T):
... |
GCN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
import torch.nn as nn
from torch.nn.modules.module import Module
import torch.nn.functional as F
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __init__(self, in_features, out_features, bias=True):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
i... | wangzefan666/pygcn | GCN | false | 13,089 | [
"MIT"
] | 0 | 2a5e4f299e3c9d3eafe3014622e8ec3742ba365c | https://github.com/wangzefan666/pygcn/tree/2a5e4f299e3c9d3eafe3014622e8ec3742ba365c | from torch.nn import Module
import torch
import torch.nn as nn
from torch.nn.modules.module import Module
import torch.nn.functional as F
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __init__(self, in_features, out_features, bias=True):
... |
GraphConvolution | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
import torch.nn as nn
from torch.nn.modules.module import Module
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __init__(self, in_features, out_features, bias=True):
super(GraphConvolution, 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.nn import Module
import torch.nn as nn
from torch.nn.modules.module i... | wangzefan666/pygcn | GraphConvolution | false | 13,090 | [
"MIT"
] | 0 | 2a5e4f299e3c9d3eafe3014622e8ec3742ba365c | https://github.com/wangzefan666/pygcn/tree/2a5e4f299e3c9d3eafe3014622e8ec3742ba365c | from torch.nn import Module
import torch
import torch.nn as nn
from torch.nn.modules.module import Module
class Model(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __init__(self, in_features, out_features, bias=True):
super().__init__()
self.in_fea... |
SqueezeExcite | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
def _make_divisible(v, divisor, min_value=None):
"""
This function is taken from the original tf repo.
It ensures that all layers have a chann... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.functional as... | wangxianliang/FaceX-Zoo | SqueezeExcite | false | 13,091 | [
"Apache-2.0"
] | 0 | b0555c88a0350fa7b59c317f3a171f551fef4e6e | https://github.com/wangxianliang/FaceX-Zoo/tree/b0555c88a0350fa7b59c317f3a171f551fef4e6e | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
def _make_divisible(v, divisor, min_value=None):
"""
This function is taken from the original tf repo.
It ensures that all layers have a chann... |
ArcFace | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import math
import torch
from torch.nn import Parameter
import torch.nn.functional as F
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class ArcFace(Module):
"""Implementation for "ArcFace: Additive Angular Margin Loss for Deep Face Rec... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | wangxianliang/FaceX-Zoo | ArcFace | false | 13,092 | [
"Apache-2.0"
] | 0 | b0555c88a0350fa7b59c317f3a171f551fef4e6e | https://github.com/wangxianliang/FaceX-Zoo/tree/b0555c88a0350fa7b59c317f3a171f551fef4e6e | from torch.nn import Module
import math
import torch
from torch.nn import Parameter
import torch.nn.functional as F
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class Model(Module):
"""Implementation for "ArcFace: Additive Angular Margin Loss for Deep Face Recog... |
GELU | # 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 GELU(nn.Module):
def forward(self, x):
return torch.sigmoid(1.702 * x) * x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | simonlevine/enformer-pytorch | GELU | false | 13,093 | [
"MIT"
] | 0 | 342915c3f9385f5f24ee4d1d9965d126d49ca279 | https://github.com/simonlevine/enformer-pytorch/tree/342915c3f9385f5f24ee4d1d9965d126d49ca279 | import torch
from torch import nn
class Model(nn.Module):
def forward(self, x):
return torch.sigmoid(1.702 * x) * x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class MLP(nn.Module):
"""
Create a multilayer perceptron model with variable hidden layers.
The network will have the specified number of layers and neurons,
with each layer using the leaky ReLU activation function.
Parameters
----------
input_dim : int... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | wfondrie/wefpy | MLP | false | 13,094 | [
"Apache-2.0"
] | 0 | 00691d453048203e1e3b1daea53879067ee4a395 | https://github.com/wfondrie/wefpy/tree/00691d453048203e1e3b1daea53879067ee4a395 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Create a multilayer perceptron model with variable hidden layers.
The network will have the specified number of layers and neurons,
with each layer using the leaky ReLU activation function.
Parameters
----------
input_dim : i... |
PKTCosSim | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class PKTCosSim(nn.Module):
"""
Learning Deep Representations with Probabilistic Knowledge Transfer
http://openaccess.thecvf.com/content_ECCV_2018/papers/Nikolaos_Passalis_Learning... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | wangxianliang/FaceX-Zoo | PKTCosSim | false | 13,095 | [
"Apache-2.0"
] | 0 | b0555c88a0350fa7b59c317f3a171f551fef4e6e | https://github.com/wangxianliang/FaceX-Zoo/tree/b0555c88a0350fa7b59c317f3a171f551fef4e6e | import torch
import torch.nn as nn
import torch._utils
from itertools import product as product
import torch.utils.data.distributed
class Model(nn.Module):
"""
Learning Deep Representations with Probabilistic Knowledge Transfer
http://openaccess.thecvf.com/content_ECCV_2018/papers/Nikolaos_Passalis_Learning_Dee... |
PDF | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
def compute_negative_ln_prob(Y, mu, ln_var, pdf):
var = ln_var.exp()
if pdf == 'gauss':
negative_ln_prob = 0.5 * ((Y - mu) ** 2 / var).sum(1).mean(
) + 0.5 * Y.size(1) * math.log(2 * math.pi) + 0.5 * ln_var.sum(1
).mean()
elif ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | wangxuuu/Demo | PDF | false | 13,096 | [
"MIT"
] | 0 | f1d85a55525a4199d63ee7dfe0ae2f21d3066c7c | https://github.com/wangxuuu/Demo/tree/f1d85a55525a4199d63ee7dfe0ae2f21d3066c7c | import math
import torch
import torch.nn as nn
def compute_negative_ln_prob(Y, mu, ln_var, pdf):
var = ln_var.exp()
if pdf == 'gauss':
negative_ln_prob = 0.5 * ((Y - mu) ** 2 / var).sum(1).mean(
) + 0.5 * Y.size(1) * math.log(2 * math.pi) + 0.5 * ln_var.sum(1
).mean()
elif ... |
JointsMSELoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class JointsMSELoss(nn.Module):
def __init__(self, use_target_weight):
super(JointsMSELoss, self).__init__()
self.criterion = nn.MSELoss(reduction='sum')
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
assert_size_st... | wszsycn/DarkPose-for-VIP2021 | JointsMSELoss | false | 13,097 | [
"Apache-2.0"
] | 0 | 3658c74ed8bc76c497cb0269dbe10ed6898e07fb | https://github.com/wszsycn/DarkPose-for-VIP2021/tree/3658c74ed8bc76c497cb0269dbe10ed6898e07fb | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, use_target_weight):
super().__init__()
self.criterion = nn.MSELoss(reduction='sum')
self.use_target_weight ... |
Offset | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 Offset(nn.Module):
def __init__(self, init_value=0.0):
super(Offset, self).__init__()
self.bias = nn.Parameter(torch.FloatTensor([init_value]))
def forward(self, input):
return input + self.bias
def get_inputs():
return [torch.rand([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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | xaviolo99/dd3d | Offset | false | 13,098 | [
"MIT"
] | 0 | e83cbbc14986fe5c9e0d65c58085b4d0bc9330ff | https://github.com/xaviolo99/dd3d/tree/e83cbbc14986fe5c9e0d65c58085b4d0bc9330ff | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, init_value=0.0):
super().__init__()
self.bias = nn.Parameter(torch.FloatTensor([init_value]))
def forward(self, input):
return input + self.bias
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
de... |
CompositePrior | # 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 numpy as np
from torch import nn
from torch.nn import functional as F
def swish(x):
return x.mul(torch.sigmoid(x))
def log_norm_pdf(x, mu, logvar):
return -0.5 * (logvar + np.log(2 * np.pi) + (x - mu).pow(2) / logvar.exp())
class Encoder(nn.Module):
def __init__(self, hidden_dim, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | verachtertr/RecVAE | CompositePrior | false | 13,099 | [
"Apache-2.0"
] | 0 | 915bed7f537cac6fc918aac8c622112561d15f03 | https://github.com/verachtertr/RecVAE/tree/915bed7f537cac6fc918aac8c622112561d15f03 | import torch
import numpy as np
from torch import nn
from torch.nn import functional as F
def swish(x):
return x.mul(torch.sigmoid(x))
def log_norm_pdf(x, mu, logvar):
return -0.5 * (logvar + np.log(2 * np.pi) + (x - mu).pow(2) / logvar.exp())
class Encoder(nn.Module):
def __init__(self, hidden_dim, ... |
CBAM_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
from torch import nn
from torchvision.transforms import *
class CBAM_Module(nn.Module):
def __init__(self, channels, reduction):
super(CBAM_Module, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.max_pool = nn.AdaptiveMaxPool2d(1)
self.fc1 = nn.Conv2d(ch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from tor... | wangxing001/project-for-ReID | CBAM_Module | false | 13,100 | [
"MIT"
] | 0 | 68a216dbbc7f7036fa72e49e1a806edc9b8e152d | https://github.com/wangxing001/project-for-ReID/tree/68a216dbbc7f7036fa72e49e1a806edc9b8e152d | import torch
from torch import nn
from torchvision.transforms import *
class Model(nn.Module):
def __init__(self, channels, reduction):
super().__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.max_pool = nn.AdaptiveMaxPool2d(1)
self.fc1 = nn.Conv2d(channels, channels // red... |
PolicyNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
class PolicyNetwork(nn.Module):
def __init__(self, num_inputs, num_actions, hidden_size, init_w=0.003,
log_std_min=-20, log_std_max=2):
super(PolicyNetwork, self).__init__()
self.log_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from to... | watermeleon/spot_mini_mini | PolicyNetwork | false | 13,101 | [
"MIT"
] | 0 | 8622d3b0e0a95f7c548cacb6722a94f61a7e2b4b | https://github.com/watermeleon/spot_mini_mini/tree/8622d3b0e0a95f7c548cacb6722a94f61a7e2b4b | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
class Model(nn.Module):
def __init__(self, num_inputs, num_actions, hidden_size, init_w=0.003,
log_std_min=-20, log_std_max=2):
super().__init__()
self.log_std_min = log_std_min
... |
MLP_G | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | tasfia/BMCoGAN | MLP_G | false | 13,102 | [
"MIT"
] | 0 | 0d400c2c71dbfb69af422afc487f65afb98de8af | https://github.com/tasfia/BMCoGAN/tree/0d400c2c71dbfb69af422afc487f65afb98de8af | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
"""
Applies an attention mechanism on the output features from the decoder.
.. math::
\\begin{array}{ll}
x = context*output \\\\
attn = exp(x_i) / sum_j exp(x_j) \\\\
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | woaksths/set2regex-baseline | Attention | false | 13,103 | [
"Apache-2.0"
] | 0 | be377593526ad664a727dd7152fcb186118adaa5 | https://github.com/woaksths/set2regex-baseline/tree/be377593526ad664a727dd7152fcb186118adaa5 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Applies an attention mechanism on the output features from the decoder.
.. math::
\\begin{array}{ll}
x = context*output \\\\
attn = exp(x_i) / sum_j exp(x_j) \\\\
... |
ConditionalEntropyLoss | # 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
class ConditionalEntropyLoss(torch.nn.Module):
def __init__(self, model):
super(ConditionalEntropyLoss, self).__init__()
def forward(self, x, weight):
loss = F.softmax(x, dim=1) * F.log_softmax(x, dim=1) * weight
loss = loss.sum(dim=1)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_stride = t... | tasfia/BMCoGAN | ConditionalEntropyLoss | false | 13,104 | [
"MIT"
] | 0 | 0d400c2c71dbfb69af422afc487f65afb98de8af | https://github.com/tasfia/BMCoGAN/tree/0d400c2c71dbfb69af422afc487f65afb98de8af | import torch
import torch.nn.functional as F
class Model(torch.nn.Module):
def __init__(self, model):
super().__init__()
def forward(self, x, weight):
loss = F.softmax(x, dim=1) * F.log_softmax(x, dim=1) * weight
loss = loss.sum(dim=1)
return -1.0 * loss.mean(dim=0)
def get... |
SelfAttentionGPT2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
def mask_(matrices, maskval=0.0, mask_diagonal=True):
"""
Masks out all values in the given batch of matrices where i <= j holds,
i < j if mask_diagonal is false
In place operation
:param tns:
:return:
"""
h, w = matrices.size(-2), matrices.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
from torch._inductor.runtime.... | wjeliot/former | SelfAttentionGPT2 | false | 13,105 | [
"MIT"
] | 0 | 38bd29b68b110e1e3eddae3106f7db2ffc0e5ce8 | https://github.com/wjeliot/former/tree/38bd29b68b110e1e3eddae3106f7db2ffc0e5ce8 | import torch
from torch import nn
def mask_(matrices, maskval=0.0, mask_diagonal=True):
"""
Masks out all values in the given batch of matrices where i <= j holds,
i < j if mask_diagonal is false
In place operation
:param tns:
:return:
"""
h, w = matrices.size(-2), matrices.size(-1)
... |
SelfAttentionWide | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.nn.functional as F
def mask_(matrices, maskval=0.0, mask_diagonal=True):
"""
Masks out all values in the given batch of matrices where i <= j holds,
i < j if mask_diagonal is false
In place operation
:param tns:
:return:
"""
h, w = matri... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | wjeliot/former | SelfAttentionWide | false | 13,106 | [
"MIT"
] | 0 | 38bd29b68b110e1e3eddae3106f7db2ffc0e5ce8 | https://github.com/wjeliot/former/tree/38bd29b68b110e1e3eddae3106f7db2ffc0e5ce8 | import torch
from torch import nn
import torch.nn.functional as F
def mask_(matrices, maskval=0.0, mask_diagonal=True):
"""
Masks out all values in the given batch of matrices where i <= j holds,
i < j if mask_diagonal is false
In place operation
:param tns:
:return:
"""
h, w = matri... |
Discriminator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | tasfia/BMCoGAN | Discriminator | false | 13,107 | [
"MIT"
] | 0 | 0d400c2c71dbfb69af422afc487f65afb98de8af | https://github.com/tasfia/BMCoGAN/tree/0d400c2c71dbfb69af422afc487f65afb98de8af | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... |
Mapping | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | tasfia/BMCoGAN | Mapping | false | 13,108 | [
"MIT"
] | 0 | 0d400c2c71dbfb69af422afc487f65afb98de8af | https://github.com/tasfia/BMCoGAN/tree/0d400c2c71dbfb69af422afc487f65afb98de8af | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... |
LinearEmbedder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 LinearEmbedder(torch.nn.Module):
def __init__(self, in_features, out_features):
super(LinearEmbedder, self).__init__()
self.fc = nn.Linear(in_features, out_features)
def forward(self, x):
o = self.fc(x)
o = self.l2_norm(o)
retu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | xiaonanzzz/ProxyAnchorLossSimple | LinearEmbedder | false | 13,109 | [
"MIT"
] | 0 | a501578142fd00bf001c840e8051c67dee873f67 | https://github.com/xiaonanzzz/ProxyAnchorLossSimple/tree/a501578142fd00bf001c840e8051c67dee873f67 | import torch
import torch.nn as nn
class Model(torch.nn.Module):
def __init__(self, in_features, out_features):
super().__init__()
self.fc = nn.Linear(in_features, out_features)
def forward(self, x):
o = self.fc(x)
o = self.l2_norm(o)
return o
def l2_norm(self, i... |
ValueNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 ValueNet(nn.Module):
def __init__(self, actions):
super(ValueNet, self).__init__()
self.conv1 = nn.Conv2d(4, 32, 8, stride=4, padding=2)
self.conv2 = nn.Conv2d(32, 64, 4, stride=2, padding=1)
self.conv3 = 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_... | wondervictor/DeepQLearning | ValueNet | false | 13,110 | [
"MIT"
] | 0 | 48d1a5c9e3dff38845366a31830d9114e9eefedc | https://github.com/wondervictor/DeepQLearning/tree/48d1a5c9e3dff38845366a31830d9114e9eefedc | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, actions):
super().__init__()
self.conv1 = nn.Conv2d(4, 32, 8, stride=4, padding=2)
self.conv2 = nn.Conv2d(32, 64, 4, stride=2, padding=1)
self.conv3 = nn.Conv2d(64, 64, 3,... |
DecoderBias | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 DecoderBias(nn.Module):
def __init__(self, dim1_batch, latent_dim, bias=False):
super().__init__()
self.dim1_latent_decoder = nn.Parameter(torch.randn(latent_dim,
latent_dim))
self.dim2_latent_decoder = nn.Parameter(torch.randn(latent_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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | xiaoyanLi629/single_cell_data_analysis | DecoderBias | false | 13,111 | [
"MIT"
] | 0 | 39d6bbd64249385d2005a775ea1d05e210f41fbe | https://github.com/xiaoyanLi629/single_cell_data_analysis/tree/39d6bbd64249385d2005a775ea1d05e210f41fbe | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, dim1_batch, latent_dim, bias=False):
super().__init__()
self.dim1_latent_decoder = nn.Parameter(torch.randn(latent_dim,
latent_dim))
self.dim2_latent_decoder = nn.Parameter(torch.randn(latent_dim,
... |
ContextualCell | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def conv_bn_relu(C_in, C_out, kernel_size, stride, padding, affine=True):
return nn.Sequential(nn.Conv2d(C_in, C_out, kernel_size, stride=stride,
padding=padding, bias=False), nn.BatchNorm2d(C_out, affine=affine),
nn.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | xkp793003821/nas-segm-pytorch | ContextualCell | false | 13,112 | [
"BSD-2-Clause"
] | 0 | c4b59ab56bd539bf08493c6d85072849213a3d62 | https://github.com/xkp793003821/nas-segm-pytorch/tree/c4b59ab56bd539bf08493c6d85072849213a3d62 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def conv_bn_relu(C_in, C_out, kernel_size, stride, padding, affine=True):
return nn.Sequential(nn.Conv2d(C_in, C_out, kernel_size, stride=stride,
padding=padding, bias=False), nn.BatchNorm2d(C_out, affine=affine),
nn.... |
MLP_g | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | tasfia/BMCoGAN | MLP_g | false | 13,113 | [
"MIT"
] | 0 | 0d400c2c71dbfb69af422afc487f65afb98de8af | https://github.com/tasfia/BMCoGAN/tree/0d400c2c71dbfb69af422afc487f65afb98de8af | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.norm... |
EncoderBias | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 EncoderBias(nn.Module):
def __init__(self, input_dim1, input_dim2, batch_feature, latent_dim,
bias=False):
"""[summary]
Args:
input_dim1 ([type]): [mod1 dimemsion]
input_dim2 ([type]): [mod2 dimemsion]
batch_feat... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | xiaoyanLi629/single_cell_data_analysis | EncoderBias | false | 13,114 | [
"MIT"
] | 0 | 39d6bbd64249385d2005a775ea1d05e210f41fbe | https://github.com/xiaoyanLi629/single_cell_data_analysis/tree/39d6bbd64249385d2005a775ea1d05e210f41fbe | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim1, input_dim2, batch_feature, latent_dim,
bias=False):
"""[summary]
Args:
input_dim1 ([type]): [mod1 dimemsion]
input_dim2 ([type]): [mod2 dimemsion]
batch_feature ([... |
CIFAR10ConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 random import *
import torch.nn.functional as F
import torch.nn as nn
class CIFAR10ConvNet(torch.nn.Module):
def __init__(self, num_conv_layers, num_filters_1, num_filters_2,
num_filters_3, dropout_rate, num_fc_units, kernel_size):
super().__init__()
self.conv1 = nn.Conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | xinranzhu/GPTune-1 | CIFAR10ConvNet | false | 13,115 | [
"BSD-3-Clause-LBNL"
] | 0 | 1e502295e790ab68990f657492243fd4fb3dfc0a | https://github.com/xinranzhu/GPTune-1/tree/1e502295e790ab68990f657492243fd4fb3dfc0a | import torch
from random import *
import torch.nn.functional as F
import torch.nn as nn
class Model(torch.nn.Module):
def __init__(self, num_conv_layers, num_filters_1, num_filters_2,
num_filters_3, dropout_rate, num_fc_units, kernel_size):
super().__init__()
self.conv1 = nn.Conv2d(3, num... |
maxout | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils.data
class maxout(nn.Module):
def __init__(self, in_feature, out_feature, pool_size):
super(maxout, self).__init__()
self.in_feature = in_feature
self.out_feature = out_feature
self.pool_size = pool_size
self.linear = n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | xuehuiping/Global-Encoding | maxout | false | 13,116 | [
"MIT"
] | 0 | 1cba2746162ac569b430aa1ba5bca58183416ee7 | https://github.com/xuehuiping/Global-Encoding/tree/1cba2746162ac569b430aa1ba5bca58183416ee7 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, in_feature, out_feature, pool_size):
super().__init__()
self.in_feature = in_feature
self.out_feature = out_feature
self.pool_size = pool_size
self.linear = nn.Linear(in_f... |
Conv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
import torch.backends.cudnn
class Conv2d(torch.nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
dilation=1, groups=1, bias=False):
super().__init__(in_channels, out_channels, kernel_size, stride, 0,
di... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional
import torch.backends.cudnn
assert_size_stride = torc... | xolbynz/EfficientNetV2-PyTorch- | Conv2d | false | 13,117 | [
"Apache-2.0"
] | 0 | 4b5039755adbd0e5f8ee0611e3d6b5be8c13ecd2 | https://github.com/xolbynz/EfficientNetV2-PyTorch-/tree/4b5039755adbd0e5f8ee0611e3d6b5be8c13ecd2 | import math
import torch
import torch.nn.functional
import torch.backends.cudnn
class Model(torch.nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
dilation=1, groups=1, bias=False):
super().__init__(in_channels, out_channels, kernel_size, stride, 0,
dil... |
MNISTConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 random import *
import torch.nn.functional as F
import torch.nn as nn
class MNISTConvNet(torch.nn.Module):
def __init__(self, num_conv_layers, num_filters_1, num_filters_2,
num_filters_3, dropout_rate, num_fc_units, kernel_size):
super().__init__()
self.conv1 = nn.Conv2d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | xinranzhu/GPTune-1 | MNISTConvNet | false | 13,118 | [
"BSD-3-Clause-LBNL"
] | 0 | 1e502295e790ab68990f657492243fd4fb3dfc0a | https://github.com/xinranzhu/GPTune-1/tree/1e502295e790ab68990f657492243fd4fb3dfc0a | import torch
from random import *
import torch.nn.functional as F
import torch.nn as nn
class Model(torch.nn.Module):
def __init__(self, num_conv_layers, num_filters_1, num_filters_2,
num_filters_3, dropout_rate, num_fc_units, kernel_size):
super().__init__()
self.conv1 = nn.Conv2d(1, num... |
ConvBlockD | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 ConvBlockD(nn.Module):
def __init__(self, in_channels, out_channels, groups=3, ker_size=2):
super(ConvBlockD, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.groups = groups
def wn(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.triton_helpers import libdevice
import torch.nn as ... | wwjfsfs/wwjyyds | ConvBlockD | false | 13,119 | [
"MIT"
] | 0 | 80cd6267fde7cd98838078a0d5178a557ceb7414 | https://github.com/wwjfsfs/wwjyyds/tree/80cd6267fde7cd98838078a0d5178a557ceb7414 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, groups=3, ker_size=2):
super().__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.groups = groups
def wn(x):
return torch.nn.u... |
EmbedNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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.utils.data
import torch
from torchvision.transforms import functional as F
from torch import nn
import torch.nn.functional as F
class EmbedNet(nn.Module):
def __init__(self, cfg):
super(EmbedNet, self).__init__()
self.embed_c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | ron5569/mega.pytorch | EmbedNet | false | 13,120 | [
"BSD-2-Clause"
] | 0 | b845b7050da307576cd98ab73eb7be4e9a9088bc | https://github.com/ron5569/mega.pytorch/tree/b845b7050da307576cd98ab73eb7be4e9a9088bc | from _paritybench_helpers import _mock_config
import torch
import torch.utils.data
import torch
from torchvision.transforms import functional as F
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, cfg):
super().__init__()
self.embed_conv1 = nn.Conv2d(... |
ESA | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 ESA(nn.Module):
def __init__(self, channel=64, reduction=4, bias=True):
super(ESA, self).__init__()
self.r_nc = channel // reduction
self.conv1 = nn.Conv2d(channel, self.r_nc, kernel_size=1)
self.conv21 = 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_... | wwjfsfs/wwjyyds | ESA | false | 13,121 | [
"MIT"
] | 0 | 80cd6267fde7cd98838078a0d5178a557ceb7414 | https://github.com/wwjfsfs/wwjyyds/tree/80cd6267fde7cd98838078a0d5178a557ceb7414 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, channel=64, reduction=4, bias=True):
super().__init__()
self.r_nc = channel // reduction
self.conv1 = nn.Conv2d(channel, self.r_nc, kernel_size=1)
self.conv21 = nn.Conv2d(... |
PolicyNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
class PolicyNetwork(nn.Module):
def __init__(self, num_inputs, num_actions, hidden_size, learning_rate=
0.0003):
super(PolicyNetwork, self).__init_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | xuzhiyuan1528/tf2basic | PolicyNetwork | false | 13,122 | [
"Apache-2.0"
] | 0 | 52ed7d8bcc72f16e198754f5f92a583fe16d544e | https://github.com/xuzhiyuan1528/tf2basic/tree/52ed7d8bcc72f16e198754f5f92a583fe16d544e | import torch
import numpy as np
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
class Model(nn.Module):
def __init__(self, num_inputs, num_actions, hidden_size, learning_rate=
0.0003):
super().__init__()
self.num_action... |
FCUDown | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
class FCUDown(nn.Module):
""" CNN feature maps -> Transformer patch embeddings
"""
def __init__(self, inplanes, outplanes, dw_stride, act_layer=nn.GELU,
norm_layer=partial(nn.LayerNorm, eps=1e-06)):
super(FCUDown, self).__in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | xuewengeophysics/Conformer | FCUDown | false | 13,123 | [
"Apache-2.0"
] | 0 | e769a1ac9ab110dae2a356a4de1e06ccd0e95041 | https://github.com/xuewengeophysics/Conformer/tree/e769a1ac9ab110dae2a356a4de1e06ccd0e95041 | import torch
import torch.nn as nn
from functools import partial
class Model(nn.Module):
""" CNN feature maps -> Transformer patch embeddings
"""
def __init__(self, inplanes, outplanes, dw_stride, act_layer=nn.GELU,
norm_layer=partial(nn.LayerNorm, eps=1e-06)):
super().__init__()
... |
ConvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, groups=3):
super(ConvBlock, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.groups = groups
def wn(x):
return tor... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | wwjfsfs/wwjyyds | ConvBlock | false | 13,124 | [
"MIT"
] | 0 | 80cd6267fde7cd98838078a0d5178a557ceb7414 | https://github.com/wwjfsfs/wwjyyds/tree/80cd6267fde7cd98838078a0d5178a557ceb7414 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, groups=3):
super().__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.groups = groups
def wn(x):
return torch.nn.utils.weight_... |
TVLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torch
import torch.nn as nn
class TVLoss(nn.Module):
def __init__(self, TVLoss_weight=1.0):
super(TVLoss, self).__init__()
self.TVLoss_weight = TVLoss_weight
def forward(self, x):
batch_size = x.size()[0]
h_x = x.size()[2]
w... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cud... | xyp8023/pytorch-CycleGAN-and-pix2pix | TVLoss | false | 13,125 | [
"BSD-3-Clause"
] | 0 | dce720d985a951a3cfed470ef4c2ef206c0e0817 | https://github.com/xyp8023/pytorch-CycleGAN-and-pix2pix/tree/dce720d985a951a3cfed470ef4c2ef206c0e0817 | import torch
import torch.utils.data
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, TVLoss_weight=1.0):
super().__init__()
self.TVLoss_weight = TVLoss_weight
def forward(self, x):
batch_size = x.size()[0]
h_x = x.size()[2]
w_x = x.size()... |
C1 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 C1(nn.Module):
def __init__(self):
super(C1, self).__init__()
self.c1 = nn.Sequential(OrderedDict([('c1', nn.Conv2d(1, 6,
kernel_size=(5, 5))), ('relu1', nn.ReLU()), ('s1', nn.MaxPool2d
(kernel_si... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from co... | xxchenxx/otdd | C1 | false | 13,126 | [
"MIT"
] | 0 | e63d1d170fed36957052b7bb0a0af1553b980381 | https://github.com/xxchenxx/otdd/tree/e63d1d170fed36957052b7bb0a0af1553b980381 | import torch
import torch.nn as nn
from collections import OrderedDict
class Model(nn.Module):
def __init__(self):
super().__init__()
self.c1 = nn.Sequential(OrderedDict([('c1', nn.Conv2d(1, 6,
kernel_size=(5, 5))), ('relu1', nn.ReLU()), ('s1', nn.MaxPool2d
(kernel_size=(2... |
BoF_Pooling | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 BoF_Pooling(nn.Module):
def __init__(self, n_codewords, features, spatial_level=0, **kwargs):
super(BoF_Pooling, self).__init__()
"""
Initializes a BoF Pooling layer
:param n_codewords: the number of the code... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | xujli/cbof_torch | BoF_Pooling | false | 13,127 | [
"MIT"
] | 0 | ed8d67dd7a41b6345305d970d0f8fa0892f8ccee | https://github.com/xujli/cbof_torch/tree/ed8d67dd7a41b6345305d970d0f8fa0892f8ccee | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, n_codewords, features, spatial_level=0, **kwargs):
super().__init__()
"""
Initializes a BoF Pooling layer
:param n_codewords: the number of the codewords to be used
... |
C2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 C2(nn.Module):
def __init__(self):
super(C2, self).__init__()
self.c2 = nn.Sequential(OrderedDict([('c2', nn.Conv2d(6, 16,
kernel_size=(5, 5))), ('relu2', nn.ReLU()), ('s2', nn.MaxPool2d
(kernel_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
from co... | xxchenxx/otdd | C2 | false | 13,128 | [
"MIT"
] | 0 | e63d1d170fed36957052b7bb0a0af1553b980381 | https://github.com/xxchenxx/otdd/tree/e63d1d170fed36957052b7bb0a0af1553b980381 | import torch
import torch.nn as nn
from collections import OrderedDict
class Model(nn.Module):
def __init__(self):
super().__init__()
self.c2 = nn.Sequential(OrderedDict([('c2', nn.Conv2d(6, 16,
kernel_size=(5, 5))), ('relu2', nn.ReLU()), ('s2', nn.MaxPool2d
(kernel_size=(... |
FirstBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
class BatchNormLayer(nn.Module):
"""Implements batch normalization layer."""
def __init__(self, channels, gamma=False, beta=True, decay=0.9, epsilon
=1e-05):
"""Initializes with basic settings.
Args:
channels: Number of channels... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | thunguyenphuoc/idinvert_pytorch | FirstBlock | false | 13,129 | [
"MIT"
] | 0 | bf8a81e75d193c22a05d9c4457907dc468389766 | https://github.com/thunguyenphuoc/idinvert_pytorch/tree/bf8a81e75d193c22a05d9c4457907dc468389766 | import torch
import numpy as np
import torch.nn as nn
class BatchNormLayer(nn.Module):
"""Implements batch normalization layer."""
def __init__(self, channels, gamma=False, beta=True, decay=0.9, epsilon
=1e-05):
"""Initializes with basic settings.
Args:
channels: Number of channels... |
ConvCompress | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 ConvCompress(nn.Module):
def __init__(self, dim, ratio=4):
super().__init__()
self.conv = nn.Conv1d(dim, dim, ratio, stride=ratio)
def forward(self, mem):
mem = mem.transpose(1, 2)
compressed_mem = self.conv(mem)
return compress... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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... | yhgon/cmtf | ConvCompress | false | 13,130 | [
"MIT"
] | 0 | 7a3ffc3a59a7c546a00d3b73be58f7d1c2f1f0cf | https://github.com/yhgon/cmtf/tree/7a3ffc3a59a7c546a00d3b73be58f7d1c2f1f0cf | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim, ratio=4):
super().__init__()
self.conv = nn.Conv1d(dim, dim, ratio, stride=ratio)
def forward(self, mem):
mem = mem.transpose(1, 2)
compressed_mem = self.conv(mem)
return compressed_mem.... |
_FakeMegatronMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 _FakeMegatronMLP(nn.Module):
"""
A fake mlp without model parallelism for correctness testing
"""
def __init__(self, args, _):
super().__init__()
self.fc1 = 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.triton_helpers import libdevice
import torch.nn as ... | xxchenxx/fastmoe | _FakeMegatronMLP | false | 13,131 | [
"Apache-2.0"
] | 0 | f60dd0e1f9f0447e56ff265c9ede304b88d0556b | https://github.com/xxchenxx/fastmoe/tree/f60dd0e1f9f0447e56ff265c9ede304b88d0556b | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
A fake mlp without model parallelism for correctness testing
"""
def __init__(self, args, _):
super().__init__()
self.fc1 = nn.Linear(args.hidde... |
C3 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 C3(nn.Module):
def __init__(self):
super(C3, self).__init__()
self.c3 = nn.Sequential(OrderedDict([('c3', nn.Conv2d(16, 120,
kernel_size=(5, 5))), ('relu3', nn.ReLU())]))
def forward(self, img):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from co... | xxchenxx/otdd | C3 | false | 13,132 | [
"MIT"
] | 0 | e63d1d170fed36957052b7bb0a0af1553b980381 | https://github.com/xxchenxx/otdd/tree/e63d1d170fed36957052b7bb0a0af1553b980381 | import torch
import torch.nn as nn
from collections import OrderedDict
class Model(nn.Module):
def __init__(self):
super().__init__()
self.c3 = nn.Sequential(OrderedDict([('c3', nn.Conv2d(16, 120,
kernel_size=(5, 5))), ('relu3', nn.ReLU())]))
def forward(self, img):
outpu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.