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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Mul | # 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 ch
class Mul(ch.nn.Module):
def __init__(self, weight):
super(Mul, self).__init__()
self.weight = weight
def forward(self, x):
return x * self.weight
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {'weig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch as ch
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strid... | njwfish/ffcv | Mul | false | 10,598 | [
"Apache-2.0"
] | 0 | 3c219787da2fb8dbdaab24e75f34b3398ad7b7d1 | https://github.com/njwfish/ffcv/tree/3c219787da2fb8dbdaab24e75f34b3398ad7b7d1 | import torch
import torch as ch
class Model(ch.nn.Module):
def __init__(self, weight):
super().__init__()
self.weight = weight
def forward(self, x):
return x * self.weight
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [4]
|
MPJPE | # 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
class BaseMetric(nn.Module):
def forward(self, y_pr, points_gt, gt_mask=None):
"""
Base forward method for metric evaluation
Args:
y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3)
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.triton_helpers import libdevice
import torch.nn as nn
import torch.nn.functional
assert_size_stride = torch._C.... | miracleyoo/lifting_events_to_3d_hpe | MPJPE | false | 10,599 | [
"Apache-2.0"
] | 0 | dfe734ee055900d6ab90c064bf82db7672830ac7 | https://github.com/miracleyoo/lifting_events_to_3d_hpe/tree/dfe734ee055900d6ab90c064bf82db7672830ac7 | import torch
import torch.nn as nn
import torch.nn.functional
class BaseMetric(nn.Module):
def forward(self, y_pr, points_gt, gt_mask=None):
"""
Base forward method for metric evaluation
Args:
y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3)
p... |
PCK | # 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
class BaseMetric(nn.Module):
def forward(self, y_pr, points_gt, gt_mask=None):
"""
Base forward method for metric evaluation
Args:
y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3)
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.triton_helpers import libdevice
import torch.nn as nn
import torch.nn.functional
assert_size_stride = torch._C.... | miracleyoo/lifting_events_to_3d_hpe | PCK | false | 10,600 | [
"Apache-2.0"
] | 0 | dfe734ee055900d6ab90c064bf82db7672830ac7 | https://github.com/miracleyoo/lifting_events_to_3d_hpe/tree/dfe734ee055900d6ab90c064bf82db7672830ac7 | import torch
import torch.nn as nn
import torch.nn.functional
class BaseMetric(nn.Module):
def forward(self, y_pr, points_gt, gt_mask=None):
"""
Base forward method for metric evaluation
Args:
y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3)
p... |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.nn.functional as F
import torch._utils
class BinaryDiceLoss(nn.Module):
"""Dice loss of binary class
Args:
smooth: A float number to smooth loss, and avoid NaN error, default: 1
p: Denominator value: \\sum{x^p} + \\sum{y^p}, default: 2
pre... | 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... | ilcessadecalcular/segmentation | DiceLoss | false | 10,601 | [
"MIT"
] | 0 | 24ba499a399efdba212ec5e2235b72ed8270cc24 | https://github.com/ilcessadecalcular/segmentation/tree/24ba499a399efdba212ec5e2235b72ed8270cc24 | import torch
from torch import nn
import torch.nn.functional as F
import torch._utils
class BinaryDiceLoss(nn.Module):
"""Dice loss of binary class
Args:
smooth: A float number to smooth loss, and avoid NaN error, default: 1
p: Denominator value: \\sum{x^p} + \\sum{y^p}, default: 2
pre... |
CompositeActivation | # 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 CompositeActivation(torch.nn.Module):
def forward(self, x):
x = torch.atan(x)
return torch.cat([x / 0.67, x * x / 0.6], 1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | ndey96/lucent | CompositeActivation | false | 10,602 | [
"Apache-2.0"
] | 0 | d868d8ca52520bd245c1e5fcf3b026782f77e561 | https://github.com/ndey96/lucent/tree/d868d8ca52520bd245c1e5fcf3b026782f77e561 | import torch
class Model(torch.nn.Module):
def forward(self, x):
x = torch.atan(x)
return torch.cat([x / 0.67, x * x / 0.6], 1)
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().__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)
s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | neal2018/torch_learn | Net | false | 10,603 | [
"MIT"
] | 0 | 80bda3a44952aca6fce7156fe4aecb48ddd602ee | https://github.com/neal2018/torch_learn/tree/80bda3a44952aca6fce7156fe4aecb48ddd602ee | 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)
... |
DeepCoxMixturesTorch | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 create_representation(inputdim, layers, activation):
"""Helper function to generate the representation function for DSM.
Deep Survival Machines learns a representation (\\ Phi(X) \\) for the input
data. This representation is parameterized using a Non Linear Multilayer
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mononitogoswami/auton-survival | DeepCoxMixturesTorch | false | 10,604 | [
"MIT"
] | 0 | 04739adac55e47d3d2c61101d92784a9fbb2dd86 | https://github.com/mononitogoswami/auton-survival/tree/04739adac55e47d3d2c61101d92784a9fbb2dd86 | import torch
import torch.nn as nn
def create_representation(inputdim, layers, activation):
"""Helper function to generate the representation function for DSM.
Deep Survival Machines learns a representation (\\ Phi(X) \\) for the input
data. This representation is parameterized using a Non Linear Multilayer
... |
ReluSquared | # 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
class ReluSquared(nn.Module):
def forward(self, x):
return F.relu(x) ** 2
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | ncoop57/x-transformers | ReluSquared | false | 10,605 | [
"MIT"
] | 0 | b65f25384349abfc101001b42482b05745c861fa | https://github.com/ncoop57/x-transformers/tree/b65f25384349abfc101001b42482b05745c861fa | import torch
from torch.nn import functional as F
from torch import nn
class Model(nn.Module):
def forward(self, x):
return F.relu(x) ** 2
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
SpatialAttentionGate | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class SpatialAttentionGate(nn.Module):
def __init__(self, channel, reduction=16):
super(SpatialAttentionGate, self).__init__()
self.fc1 = nn.Conv2d(channel, reduction, kernel_size=1, padding=0)
self.fc2 = nn.Conv2d(reducti... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | lawwu/nni | SpatialAttentionGate | false | 10,606 | [
"MIT"
] | 0 | b869dd48dfe36392e7b78c70ea35eb6d4b4779dc | https://github.com/lawwu/nni/tree/b869dd48dfe36392e7b78c70ea35eb6d4b4779dc | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, channel, reduction=16):
super().__init__()
self.fc1 = nn.Conv2d(channel, reduction, kernel_size=1, padding=0)
self.fc2 = nn.Conv2d(reduction, 1, kernel_size=1, padding=0)
def... |
RMSNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 RMSNorm(nn.Module):
def __init__(self, dim, eps=1e-08):
super().__init__()
self.scale = dim ** -0.5
self.eps = eps
self.g = nn.Parameter(torch.ones(dim))
def forward(self, x):
norm = torch.norm(x, dim=-1, keepdim=True) * self.sc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_... | ncoop57/x-transformers | RMSNorm | false | 10,607 | [
"MIT"
] | 0 | b65f25384349abfc101001b42482b05745c861fa | https://github.com/ncoop57/x-transformers/tree/b65f25384349abfc101001b42482b05745c861fa | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim, eps=1e-08):
super().__init__()
self.scale = dim ** -0.5
self.eps = eps
self.g = nn.Parameter(torch.ones(dim))
def forward(self, x):
norm = torch.norm(x, dim=-1, keepdim=True) * self.scal... |
LanguageModelCriterion | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class LanguageModelCriterion(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, target, mask):
x = x.contiguous().view(-1, x.size(2))
target = target.contiguous().view(-1, 1)
mask = mask.contiguous().view(-1, 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | neal2018/torch_learn | LanguageModelCriterion | false | 10,608 | [
"MIT"
] | 0 | 80bda3a44952aca6fce7156fe4aecb48ddd602ee | https://github.com/neal2018/torch_learn/tree/80bda3a44952aca6fce7156fe4aecb48ddd602ee | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, target, mask):
x = x.contiguous().view(-1, x.size(2))
target = target.contiguous().view(-1, 1)
mask = mask.contiguous().view(-1, 1)
output = -x.gathe... |
ScaleNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class ScaleNorm(nn.Module):
def __init__(self, dim, eps=1e-05):
super().__init__()
self.scale = dim ** -0.5
self.eps = eps
self.g = nn.Parameter(torch.ones(1))
def forward(self, x):
norm = torch.norm(x, dim=-1, keepdim=True) * self.sc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_... | ncoop57/x-transformers | ScaleNorm | false | 10,609 | [
"MIT"
] | 0 | b65f25384349abfc101001b42482b05745c861fa | https://github.com/ncoop57/x-transformers/tree/b65f25384349abfc101001b42482b05745c861fa | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim, eps=1e-05):
super().__init__()
self.scale = dim ** -0.5
self.eps = eps
self.g = nn.Parameter(torch.ones(1))
def forward(self, x):
norm = torch.norm(x, dim=-1, keepdim=True) * self.scale
... |
DuelingQNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from collections import OrderedDict
class DuelingQNetwork(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, hidden_advantage=[512,
512], hidden_state_value=[512, 512]):
"""Initialize parameters and build model.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | nullbyte91/udacity-drl-navigation | DuelingQNetwork | false | 10,610 | [
"MIT"
] | 0 | d981ab906fd3dfc9939d639b2083d004cde0b961 | https://github.com/nullbyte91/udacity-drl-navigation/tree/d981ab906fd3dfc9939d639b2083d004cde0b961 | import torch
import torch.nn as nn
from collections import OrderedDict
class Model(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, hidden_advantage=[512,
512], hidden_state_value=[512, 512]):
"""Initialize parameters and build model.
Params
... |
L2 | # 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 L2(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
out = (s - t) ** 2
return (out.view(out.size(0), -1).sum(dim=1) + 1e-14) ** 0.5
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | mrernst/rl_robotics_research | L2 | false | 10,611 | [
"MIT"
] | 0 | 0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | https://github.com/mrernst/rl_robotics_research/tree/0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
out = (s - t) ** 2
return (out.view(out.size(0), -1).sum(dim=1) + 1e-14) ** 0.5
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4,... |
DotProd | # 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
import torch.nn as nn
class DotProd(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
if isinstance(s, np.ndarray):
s = torch.from_numpy(s).float()
if isinstance(t, np.ndarray):
t = torch.from_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... | mrernst/rl_robotics_research | DotProd | false | 10,612 | [
"MIT"
] | 0 | 0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | https://github.com/mrernst/rl_robotics_research/tree/0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | import torch
import numpy as np
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
if isinstance(s, np.ndarray):
s = torch.from_numpy(s).float()
if isinstance(t, np.ndarray):
t = torch.from_numpy... |
L1 | # 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
import torch.nn as nn
class L1(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
if isinstance(s, np.ndarray):
s = torch.from_numpy(s).float()
if isinstance(t, np.ndarray):
t = torch.from_numpy(t)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | mrernst/rl_robotics_research | L1 | false | 10,613 | [
"MIT"
] | 0 | 0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | https://github.com/mrernst/rl_robotics_research/tree/0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | import torch
import numpy as np
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
if isinstance(s, np.ndarray):
s = torch.from_numpy(s).float()
if isinstance(t, np.ndarray):
t = torch.from_numpy... |
SingleDeconv3DBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch._utils
class SingleDeconv3DBlock(nn.Module):
def __init__(self, in_planes, out_planes):
super().__init__()
self.block = nn.ConvTranspose3d(in_planes, out_planes, kernel_size=
2, stride=2, padding=0, output_padding=0)
def forward(self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch._utils
assert_size_stride = torch._C._dynamo.g... | ilcessadecalcular/segmentation | SingleDeconv3DBlock | false | 10,614 | [
"MIT"
] | 0 | 24ba499a399efdba212ec5e2235b72ed8270cc24 | https://github.com/ilcessadecalcular/segmentation/tree/24ba499a399efdba212ec5e2235b72ed8270cc24 | import torch
from torch import nn
import torch._utils
class Model(nn.Module):
def __init__(self, in_planes, out_planes):
super().__init__()
self.block = nn.ConvTranspose3d(in_planes, out_planes, kernel_size=
2, stride=2, padding=0, output_padding=0)
def forward(self, x):
... |
QNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class QNetwork(nn.Module):
def __init__(self, state_size, action_size, hidden_layer1=64,
hidden_layer2=64):
super(QNetwork, self).__init__()
self.fc1 = nn.Linear(state_size, hidden_layer1)
self.fc2 = nn.Linear(hidd... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | pardi/DRL_navigation | QNetwork | false | 10,615 | [
"Apache-2.0"
] | 0 | 4b66edf696c34a53686c02ff91264f5d6b32dc02 | https://github.com/pardi/DRL_navigation/tree/4b66edf696c34a53686c02ff91264f5d6b32dc02 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, state_size, action_size, hidden_layer1=64,
hidden_layer2=64):
super().__init__()
self.fc1 = nn.Linear(state_size, hidden_layer1)
self.fc2 = nn.Linear(hidden_layer1, hidden... |
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):
"""
A convolutional block including conv, BN, nonliear activiation, residual connection
"""
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1, bias=True, batchnorm=False, residual=False, nonlinear=nn... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | norveclibalikci/easyreg-mirror | convBlock | false | 10,616 | [
"Apache-2.0"
] | 0 | a16254733fe957cc4024923f8dce91412966a189 | https://github.com/norveclibalikci/easyreg-mirror/tree/a16254733fe957cc4024923f8dce91412966a189 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
A convolutional block including conv, BN, nonliear activiation, residual connection
"""
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1, bias=True, batchnorm=False, residual=False, nonlinear=nn
... |
NCCLoss | # 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 NCCLoss(nn.Module):
"""
A implementation of the normalized cross correlation (NCC)
"""
def forward(self, input, target):
input = input.view(input.shape[0], -1)
target = target.view(target.shape[0], -1)
input_minus_mean = input - torch.m... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | norveclibalikci/easyreg-mirror | NCCLoss | false | 10,617 | [
"Apache-2.0"
] | 0 | a16254733fe957cc4024923f8dce91412966a189 | https://github.com/norveclibalikci/easyreg-mirror/tree/a16254733fe957cc4024923f8dce91412966a189 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
A implementation of the normalized cross correlation (NCC)
"""
def forward(self, input, target):
input = input.view(input.shape[0], -1)
target = target.view(target.shape[0], -1)
input_minus_mean = input - torch.mea... |
LocalResponseNormLayer | # 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 LocalResponseNormLayer(nn.Module):
def forward(self, tensor, size=5, alpha=9.999999747378752e-05, beta=
0.75, k=1.0):
return F.local_response_norm(tensor, size=size, alpha=alpha, beta=
beta, k=k)
def get_inputs... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | ndey96/lucent | LocalResponseNormLayer | false | 10,618 | [
"Apache-2.0"
] | 0 | d868d8ca52520bd245c1e5fcf3b026782f77e561 | https://github.com/ndey96/lucent/tree/d868d8ca52520bd245c1e5fcf3b026782f77e561 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def forward(self, tensor, size=5, alpha=9.999999747378752e-05, beta=
0.75, k=1.0):
return F.local_response_norm(tensor, size=size, alpha=alpha, beta=
beta, k=k)
def get_inputs():
return [t... |
JointsCELoss | # 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.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
class JointsCELoss(nn.Module):
def __init__(self):
super(JointsCELoss, self).__init__()
self.criterion = nn.MSELoss(reduction='mean')
def forward(self, o... | 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.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
assert_size_st... | nuguziii/deep-high-resolution-net.pytorch | JointsCELoss | false | 10,619 | [
"MIT"
] | 0 | 3c053e97201fbeb35ff48cbc567ffb37b5e0b436 | https://github.com/nuguziii/deep-high-resolution-net.pytorch/tree/3c053e97201fbeb35ff48cbc567ffb37b5e0b436 | import torch
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.criterion = nn.MSELoss(reduction='mean')
def forward(self, output, target):
b... |
JointsDistLoss | # 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.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
class JointsDistLoss(nn.Module):
def __init__(self):
super(JointsDistLoss, self).__init__()
self.criterion = nn.MSELoss(reduction='mean')
def forward(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
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
assert_size_st... | nuguziii/deep-high-resolution-net.pytorch | JointsDistLoss | false | 10,620 | [
"MIT"
] | 0 | 3c053e97201fbeb35ff48cbc567ffb37b5e0b436 | https://github.com/nuguziii/deep-high-resolution-net.pytorch/tree/3c053e97201fbeb35ff48cbc567ffb37b5e0b436 | import torch
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.criterion = nn.MSELoss(reduction='mean')
def forward(self, output, target):
b... |
Bottleneck | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from collections import OrderedDict
class Bottleneck(nn.Module):
def __init__(self, in_channels, out_channels):
super(Bottleneck, self).__init__()
m = OrderedDict()
m['conv1'] = nn.Conv2d(in_channels, out_channels, kernel_size=1,
bias=False)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from col... | nivedk/SPANet | Bottleneck | false | 10,621 | [
"BSD-3-Clause"
] | 0 | 1bd84ae67732f9885af65dcbd286075008d46e91 | https://github.com/nivedk/SPANet/tree/1bd84ae67732f9885af65dcbd286075008d46e91 | import torch
from torch import nn
from collections import OrderedDict
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
m = OrderedDict()
m['conv1'] = nn.Conv2d(in_channels, out_channels, kernel_size=1,
bias=False)
m['relu1'] = n... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class Attention(nn.Module):
def __init__(self, in_channels):
super(Attention, self).__init__()
self.out_channels = int(in_channels / 2)
self.conv1 = nn.Conv2d(in_channels, self.out_channels, kernel_size=
3, padding=1, stride=1)
self.re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | nivedk/SPANet | Attention | false | 10,623 | [
"BSD-3-Clause"
] | 0 | 1bd84ae67732f9885af65dcbd286075008d46e91 | https://github.com/nivedk/SPANet/tree/1bd84ae67732f9885af65dcbd286075008d46e91 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, in_channels):
super().__init__()
self.out_channels = int(in_channels / 2)
self.conv1 = nn.Conv2d(in_channels, self.out_channels, kernel_size=
3, padding=1, stride=1)
self.relu1 = nn.ReLU()
... |
Sparsemax | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.autograd import Function
import torch
import torch.nn as nn
def _make_ix_like(X, dim):
d = X.size(dim)
rho = torch.arange(1, d + 1, device=X.device, dtype=X.dtype)
view = [1] * X.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def _roll_last(X, dim):
if 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.autograd import Function
import torch.nn as nn
assert_size_stride = torch._C._... | mtreviso/entmax | Sparsemax | false | 10,624 | [
"MIT"
] | 0 | 5b029d07fe00d7aacc77c8e684a5796d29287575 | https://github.com/mtreviso/entmax/tree/5b029d07fe00d7aacc77c8e684a5796d29287575 | from torch.autograd import Function
import torch
import torch.nn as nn
def _make_ix_like(X, dim):
d = X.size(dim)
rho = torch.arange(1, d + 1, device=X.device, dtype=X.dtype)
view = [1] * X.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def _roll_last(X, dim):
if dim == -1:
... |
Standardize | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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.utils.data
from torch.nn import init
from torch.nn.parameter import Parameter
class Standardize(Module):
"""
Applies (element-wise) standardization with trainable translation parameter μ and scale parameter σ, i.e. computes
(x - μ) / σ where '/' is app... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import torch.utils.data
from torch.nn import init
from torch.nn.parameter import Parameter
assert_size_stride = ... | kevinwss/Deep-SAD-Baseline | Standardize | false | 10,625 | [
"MIT"
] | 0 | b704725cc44ab5e7aa9bb09503a4c5f244fa907b | https://github.com/kevinwss/Deep-SAD-Baseline/tree/b704725cc44ab5e7aa9bb09503a4c5f244fa907b | from torch.nn import Module
import torch
import torch.utils.data
from torch.nn import init
from torch.nn.parameter import Parameter
class Model(Module):
"""
Applies (element-wise) standardization with trainable translation parameter μ and scale parameter σ, i.e. computes
(x - μ) / σ where '/' is applied e... |
ResizeConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.nn.functional as F
class ResizeConv2d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, scale_factor,
mode='nearest'):
super().__init__()
self.scale_factor = scale_factor
self.mode = mode
self.conv = nn.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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | neuronphysics/FEAIML | ResizeConv2d | false | 10,626 | [
"MIT"
] | 0 | a31ae0d9f526f489fca1ca4b01dd8f06115de450 | https://github.com/neuronphysics/FEAIML/tree/a31ae0d9f526f489fca1ca4b01dd8f06115de450 | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, scale_factor,
mode='nearest'):
super().__init__()
self.scale_factor = scale_factor
self.mode = mode
self.conv = nn.Conv2d(in... |
CrossLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.optim
class CrossLayer(nn.Module):
def __init__(self, d, dropout):
super().__init__()
self.linear = nn.Linear(d, d)
self.dropout = nn.Dropout(dropout)
def forward(self, x0, x):
return self.dropout(x0 * self.linear(x)) + x
def ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.optim
assert_size_stride = torch._C._dynamo.g... | piers-hinds/rtdl | CrossLayer | false | 10,627 | [
"Apache-2.0"
] | 0 | 66cf9b90d2269395152dabf32653bdd599ddb12e | https://github.com/piers-hinds/rtdl/tree/66cf9b90d2269395152dabf32653bdd599ddb12e | import torch
import torch.nn as nn
import torch.optim
class Model(nn.Module):
def __init__(self, d, dropout):
super().__init__()
self.linear = nn.Linear(d, d)
self.dropout = nn.Dropout(dropout)
def forward(self, x0, x):
return self.dropout(x0 * self.linear(x)) + x
def get_i... |
LayerShift | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class LayerShift(nn.Module):
def __init__(self, init=1.0):
super().__init__()
self.bias = torch.nn.Parameter(torch.zeros(1))
def forward(self, x):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
assert_size_st... | ptillet/Fixup | LayerShift | false | 10,628 | [
"BSD-3-Clause"
] | 0 | c36dbe7f2cce71c4308afc43ab6e8551e567be30 | https://github.com/ptillet/Fixup/tree/c36dbe7f2cce71c4308afc43ab6e8551e567be30 | 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, init=1.0):
super().__init__()
self.bias = torch.nn.Parameter(torch.zeros(1))
def forward(self, x):
ret... |
Decoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
""" VAE decoder """
def __init__(self, img_channels, latent_size):
super(Decoder, self).__init__()
self.latent_size = latent_size
self.img_channels = img_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
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | parthjaggi/world-models | Decoder | false | 10,629 | [
"MIT"
] | 0 | 534b3a3474761e83da6c251bce97bea527e7435f | https://github.com/parthjaggi/world-models/tree/534b3a3474761e83da6c251bce97bea527e7435f | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
""" VAE decoder """
def __init__(self, img_channels, latent_size):
super().__init__()
self.latent_size = latent_size
self.img_channels = img_channels
self.fc1 = n... |
NgramCombined | # 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.cuda
import torch.distributed
class NgramCombined(nn.Module):
def __init__(self, n_gram):
super(NgramCombined, self).__init__()
self.n_gram = n_gram
def forward(self, x):
out = x
if self.n_gram > ... | 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.cuda
import torch.distributed
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strid... | phuongnm-bkhn/OpenNMT-py | NgramCombined | false | 10,630 | [
"MIT"
] | 0 | 554a826139f1bfc55f4ea6a3e7491858c2afec4c | https://github.com/phuongnm-bkhn/OpenNMT-py/tree/554a826139f1bfc55f4ea6a3e7491858c2afec4c | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.cuda
import torch.distributed
class Model(nn.Module):
def __init__(self, n_gram):
super().__init__()
self.n_gram = n_gram
def forward(self, x):
out = x
if self.n_gram > 1:
for i_gram i... |
SoftDiceLoss | # 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 SoftDiceLoss(nn.Module):
"""
Soft Dice Loss
"""
def __init__(self, weight=None, size_average=True):
super(SoftDiceLoss, self).__init__()
def forward(self, logits, targets):
smooth = 1.0
logits = torch.sigmoid(logits)
iflat ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | prateekstark/unet.pytorch | SoftDiceLoss | false | 10,631 | [
"MIT"
] | 0 | b6ef6302f35ca93c6c818215c915e05b7f3055dc | https://github.com/prateekstark/unet.pytorch/tree/b6ef6302f35ca93c6c818215c915e05b7f3055dc | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Soft Dice Loss
"""
def __init__(self, weight=None, size_average=True):
super().__init__()
def forward(self, logits, targets):
smooth = 1.0
logits = torch.sigmoid(logits)
iflat = logits.view(-1)
... |
HSwish | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
from torch import nn
class HSwish(nn.Module):
"""Hard Swish activation function.
See: https://arxiv.org/abs/1905.02244
"""
def forward(self, x):
return x * nn.functional.relu6(x + 3).div_(6)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def g... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
from torch import nn
assert_size_stride = torch._C._dynamo.guards... | prabhum456/determined | HSwish | false | 10,632 | [
"Apache-2.0"
] | 0 | 7e8017df0f62d80d21f5483578e2d5abd0e30935 | https://github.com/prabhum456/determined/tree/7e8017df0f62d80d21f5483578e2d5abd0e30935 | import torch
import torch.utils.data
from torch import nn
class Model(nn.Module):
"""Hard Swish activation function.
See: https://arxiv.org/abs/1905.02244
"""
def forward(self, x):
return x * nn.functional.relu6(x + 3).div_(6)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def ge... |
RewardEstimator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def reset_parameters_util_x(model):
for module in model.modules():
if isinstance(module, nn.Linear):
nn.init.xavier_normal_(module.weight.data, 1)
if module.bias is not None:
module.bias.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import math
import torch.nn a... | olipinski/MultimodalGame | RewardEstimator | false | 10,633 | [
"BSD-3-Clause"
] | 0 | cfacc66baebfadb6ed6a8b44b3dd71a298285d68 | https://github.com/olipinski/MultimodalGame/tree/cfacc66baebfadb6ed6a8b44b3dd71a298285d68 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def reset_parameters_util_x(model):
for module in model.modules():
if isinstance(module, nn.Linear):
nn.init.xavier_normal_(module.weight.data, 1)
if module.bias is not None:
module.bias.... |
TextProcessor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
def reset_parameters_util_x(model):
for module in model.modules():
if isinstance(module, nn.Linear):
nn.init.xavier_normal_(module.weight.data, 1)
if module.bias is not None:
module.bias.data.zero_()... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | olipinski/MultimodalGame | TextProcessor | false | 10,634 | [
"BSD-3-Clause"
] | 0 | cfacc66baebfadb6ed6a8b44b3dd71a298285d68 | https://github.com/olipinski/MultimodalGame/tree/cfacc66baebfadb6ed6a8b44b3dd71a298285d68 | import torch
import torch.nn as nn
import torch.nn.functional as F
def reset_parameters_util_x(model):
for module in model.modules():
if isinstance(module, nn.Linear):
nn.init.xavier_normal_(module.weight.data, 1)
if module.bias is not None:
module.bias.data.zero_()... |
BinLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
class BinQuant(torch.autograd.Function):
"""BinaryConnect quantization.
Refer:
https://pytorch.org/tutorials/beginner/examples_autograd/two_layer_net_cu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from itertools import product as product
from torch import nn
import torch.optim... | ninfueng/a-PyTorch-Tutorial-to-Object-Detection | BinLinear | false | 10,635 | [
"MIT"
] | 0 | fc7544720a7e939f5a56f4f7214e4965b7775f77 | https://github.com/ninfueng/a-PyTorch-Tutorial-to-Object-Detection/tree/fc7544720a7e939f5a56f4f7214e4965b7775f77 | import torch
from itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
class BinQuant(torch.autograd.Function):
"""BinaryConnect quantization.
Refer:
https://pytorch.org/tutorials/beginner/examples_autograd/two_layer_net_cu... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, max_action):
super(Actor, self).__init__()
self.l1 = nn.Linear(state_dim, 4)
self.l2 = nn.Linear(4, 4)
self.l3 = nn.Linear(4, action_dim)
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.... | pkj415/CityLearn | Actor | false | 10,636 | [
"MIT"
] | 0 | 912d1e28270fba2d11a713dc7f0445d59d620511 | https://github.com/pkj415/CityLearn/tree/912d1e28270fba2d11a713dc7f0445d59d620511 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, state_dim, action_dim, max_action):
super().__init__()
self.l1 = nn.Linear(state_dim, 4)
self.l2 = nn.Linear(4, 4)
self.l3 = nn.Linear(4, action_dim)
self.max_acti... |
TerConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
from itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
def ternary_threshold(delta: 'float'=0.7, *ws):
"""Ternary threshold find in ws."""
assert isinstance(delta, float)
num_params = sum_w = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | ninfueng/a-PyTorch-Tutorial-to-Object-Detection | TerConv2d | false | 10,637 | [
"MIT"
] | 0 | fc7544720a7e939f5a56f4f7214e4965b7775f77 | https://github.com/ninfueng/a-PyTorch-Tutorial-to-Object-Detection/tree/fc7544720a7e939f5a56f4f7214e4965b7775f77 | import torch
import numpy as np
from itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
def ternary_threshold(delta: 'float'=0.7, *ws):
"""Ternary threshold find in ws."""
assert isinstance(delta, float)
num_params = sum_w = ... |
BinConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
class BinQuant(torch.autograd.Function):
"""BinaryConnect quantization.
Refer:
https://pytorch.org/tutorials/beginner/examples_autograd/two_layer_net_cu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from itertools import product as product
from torch import nn
import torch.optim... | ninfueng/a-PyTorch-Tutorial-to-Object-Detection | BinConv2d | false | 10,638 | [
"MIT"
] | 0 | fc7544720a7e939f5a56f4f7214e4965b7775f77 | https://github.com/ninfueng/a-PyTorch-Tutorial-to-Object-Detection/tree/fc7544720a7e939f5a56f4f7214e4965b7775f77 | import torch
from itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
class BinQuant(torch.autograd.Function):
"""BinaryConnect quantization.
Refer:
https://pytorch.org/tutorials/beginner/examples_autograd/two_layer_net_cu... |
TerLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
from itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
def ternary_threshold(delta: 'float'=0.7, *ws):
"""Ternary threshold find in ws."""
assert isinstance(delta, float)
num_params = sum_w = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 numpy ... | ninfueng/a-PyTorch-Tutorial-to-Object-Detection | TerLinear | false | 10,639 | [
"MIT"
] | 0 | fc7544720a7e939f5a56f4f7214e4965b7775f77 | https://github.com/ninfueng/a-PyTorch-Tutorial-to-Object-Detection/tree/fc7544720a7e939f5a56f4f7214e4965b7775f77 | import torch
import numpy as np
from itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
def ternary_threshold(delta: 'float'=0.7, *ws):
"""Ternary threshold find in ws."""
assert isinstance(delta, float)
num_params = sum_w = ... |
pixelwise_norm_layer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class pixelwise_norm_layer(nn.Module):
def __init__(self):
super(pixelwise_norm_layer, self).__init__()
self.eps = 1e-08
def forward(self, x):
return x / (torch.mean(x ** 2, dim=1, keepdim=True) + self.eps) ** 0.5
def get_inputs():
return [tor... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | mikanCan/PG-GAN | pixelwise_norm_layer | false | 10,640 | [
"MIT"
] | 0 | bc4a1bd2101f836c22a164174381f80b3f5c73c1 | https://github.com/mikanCan/PG-GAN/tree/bc4a1bd2101f836c22a164174381f80b3f5c73c1 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.eps = 1e-08
def forward(self, x):
return x / (torch.mean(x ** 2, dim=1, keepdim=True) + self.eps) ** 0.5
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inp... |
Norm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Norm(nn.Module):
def __init__(self, d_model, eps=1e-06):
super().__init__()
self.size = d_model
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.zeros(self.size))
self.eps = eps
def forward(self, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | nlakshmanan/Transformer | Norm | false | 10,641 | [
"Apache-2.0"
] | 0 | 4562f8e9b282d0a70f26903a7b4410cb6132364b | https://github.com/nlakshmanan/Transformer/tree/4562f8e9b282d0a70f26903a7b4410cb6132364b | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, d_model, eps=1e-06):
super().__init__()
self.size = d_model
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.zeros(self.size))
self.eps = eps
def forward(self,... |
ConcatModel | # 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
class ConcatModel(torch.nn.Module):
def __init__(self):
super(ConcatModel, self).__init__()
def forward(self, x):
return torch.concat([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
import torch.nn.functional
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._emp... | elad-c/model_optimization | ConcatModel | false | 10,642 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return torch.concat([x, x])
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
CatModel | # 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
class CatModel(torch.nn.Module):
def __init__(self):
super(CatModel, self).__init__()
def forward(self, x):
return torch.cat([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
import torch.nn.functional
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._emp... | elad-c/model_optimization | CatModel | false | 10,643 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return torch.cat([x, x])
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
Qnet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import random
import torch
import torch.nn as nn
import torch.nn.functional as F
class Qnet(nn.Module):
def __init__(self):
super(Qnet, self).__init__()
self.fc1 = nn.Linear(4, 256)
self.fc2 = nn.Linear(256, 2)
def forward(self, x):
x = F.relu(self.fc1(x))
x = self.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
import random
import torch.nn... | rainwangphy/minimalRL | Qnet | false | 10,644 | [
"MIT"
] | 0 | 646cc771107f1b15098d7f52f0e7c4444862fb90 | https://github.com/rainwangphy/minimalRL/tree/646cc771107f1b15098d7f52f0e7c4444862fb90 | import random
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(4, 256)
self.fc2 = nn.Linear(256, 2)
def forward(self, x):
x = F.relu(self.fc1(x))
x = self.fc2(x)
... |
SparsemaxBisect | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.autograd import Function
import torch
import torch.nn as nn
def sparsemax_bisect(X, dim=-1, n_iter=50, ensure_sum_one=True):
"""sparsemax: normalizing sparse transform (a la softmax), via bisection.
Solves the projection:
min_p ||x - p||_2 s.t. p >= 0, sum(p) == 1.
Parameters
... | 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.autograd import Function
import torch.nn as nn
assert_size_stride = torch._C._... | mtreviso/entmax | SparsemaxBisect | false | 10,645 | [
"MIT"
] | 0 | 5b029d07fe00d7aacc77c8e684a5796d29287575 | https://github.com/mtreviso/entmax/tree/5b029d07fe00d7aacc77c8e684a5796d29287575 | from torch.autograd import Function
import torch
import torch.nn as nn
def sparsemax_bisect(X, dim=-1, n_iter=50, ensure_sum_one=True):
"""sparsemax: normalizing sparse transform (a la softmax), via bisection.
Solves the projection:
min_p ||x - p||_2 s.t. p >= 0, sum(p) == 1.
Parameters
... |
AddNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class AddNet(torch.nn.Module):
def __init__(self):
super(AddNet, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 4, kernel_size=1, stride=1)
self.conv2 = torch.nn.Conv2d(3, 4, kernel_size=1, stride=1)
def forward(self, x, y):
x = 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.functional
assert_size_stride = torch._C._dynamo.guards.assert_s... | elad-c/model_optimization | AddNet | false | 10,646 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv1 = torch.nn.Conv2d(3, 4, kernel_size=1, stride=1)
self.conv2 = torch.nn.Conv2d(3, 4, kernel_size=1, stride=1)
def forward(self, x, y):
x = self.conv1(x)
... |
UNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
from torchvision import models
class UNet(nn.Module):
"""
The U-Net Convolutional Neural Network for semantic segmentation
Source material for the algorithm:
https://link.springer.com/chapter/10.1007%2F978-3-319-24574-4_28
"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from tor... | mattesko/torch-toolkit | UNet | false | 10,647 | [
"MIT"
] | 0 | 1b4526640232843bdd4022c86cf1856e2e3248b0 | https://github.com/mattesko/torch-toolkit/tree/1b4526640232843bdd4022c86cf1856e2e3248b0 | import torch
from torch import nn
import torch.nn.functional as F
from torchvision import models
class Model(nn.Module):
"""
The U-Net Convolutional Neural Network for semantic segmentation
Source material for the algorithm:
https://link.springer.com/chapter/10.1007%2F978-3-319-24574-4_28
"""
... |
minibatch_std_concat_layer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import copy
import torch
import torch.nn as nn
class minibatch_std_concat_layer(nn.Module):
def __init__(self, averaging='all'):
super(minibatch_std_concat_layer, self).__init__()
self.averaging = averaging.lower()
if 'group' in self.averaging:
self.n = int(self.averaging[5:])... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | mikanCan/PG-GAN | minibatch_std_concat_layer | false | 10,648 | [
"MIT"
] | 0 | bc4a1bd2101f836c22a164174381f80b3f5c73c1 | https://github.com/mikanCan/PG-GAN/tree/bc4a1bd2101f836c22a164174381f80b3f5c73c1 | import copy
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, averaging='all'):
super().__init__()
self.averaging = averaging.lower()
if 'group' in self.averaging:
self.n = int(self.averaging[5:])
else:
assert self.averaging in [... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class Actor(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc1_units=200,
fc2_units=150):
"""Initialize parameters and build model.
Params
======
state_siz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | rafapi/PMTG | Actor | false | 10,649 | [
"Apache-2.0"
] | 0 | 8a89a3dd9620e2fdf747d20781b46daebd41569c | https://github.com/rafapi/PMTG/tree/8a89a3dd9620e2fdf747d20781b46daebd41569c | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc1_units=200,
fc2_units=150):
"""Initialize parameters and build model.
Params
======
state_siz... |
Entmax15 | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.autograd import Function
import torch
import torch.nn as nn
def _make_ix_like(X, dim):
d = X.size(dim)
rho = torch.arange(1, d + 1, device=X.device, dtype=X.dtype)
view = [1] * X.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def _roll_last(X, dim):
if 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 libdevice
from torch.autograd import F... | mtreviso/entmax | Entmax15 | false | 10,650 | [
"MIT"
] | 0 | 5b029d07fe00d7aacc77c8e684a5796d29287575 | https://github.com/mtreviso/entmax/tree/5b029d07fe00d7aacc77c8e684a5796d29287575 | from torch.autograd import Function
import torch
import torch.nn as nn
def _make_ix_like(X, dim):
d = X.size(dim)
rho = torch.arange(1, d + 1, device=X.device, dtype=X.dtype)
view = [1] * X.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def _roll_last(X, dim):
if dim == -1:
... |
fadein_layer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class fadein_layer(nn.Module):
def __init__(self, config):
super(fadein_layer, self).__init__()
self.alpha = 0.0
def update_alpha(self, delta):
self.alpha = self.alpha + delta
self.alpha = max(0,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | mikanCan/PG-GAN | fadein_layer | false | 10,651 | [
"MIT"
] | 0 | bc4a1bd2101f836c22a164174381f80b3f5c73c1 | https://github.com/mikanCan/PG-GAN/tree/bc4a1bd2101f836c22a164174381f80b3f5c73c1 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, config):
super().__init__()
self.alpha = 0.0
def update_alpha(self, delta):
self.alpha = self.alpha + delta
self.alpha = max(0, min(self.alpha, 1.0))
... |
BertPreTrainingHeads | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
def gelu(x):
"""Gaussian Error Linear Unitという活性化関数です。
LeLUが0でカクっと不連続なので、そこを連続になるように滑らかにした形のLeLUです。
"""
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
class BertLayerNorm(nn.Module):
def __init__(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
from to... | Cyndi-Tokyotech/Fin_Text_Analysis_ML | BertPreTrainingHeads | false | 10,652 | [
"MIT"
] | 0 | 7f9b6c1ea78f8e6f32c003b2de32809722df88d4 | https://github.com/Cyndi-Tokyotech/Fin_Text_Analysis_ML/tree/7f9b6c1ea78f8e6f32c003b2de32809722df88d4 | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
def gelu(x):
"""Gaussian Error Linear Unitという活性化関数です。
LeLUが0でカクっと不連続なので、そこを連続になるように滑らかにした形のLeLUです。
"""
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
class BertLayerNorm(nn.Module):
def __init__(... |
ReshapeNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class ReshapeNet(torch.nn.Module):
def __init__(self):
super(ReshapeNet, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 4, kernel_size=1, stride=1)
def forward(self, x):
x = self.conv1(x)
batch, channels, height, width = x.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
import torch.nn.functional
assert_size_stride = torch._C._dynamo.guards.assert_s... | elad-c/model_optimization | ReshapeNet | false | 10,653 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv1 = torch.nn.Conv2d(3, 4, kernel_size=1, stride=1)
def forward(self, x):
x = self.conv1(x)
batch, channels, height, width = x.size()
x = x * height
... |
MultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
class MultiHeadAttention(nn.Module):
def __init__(self, heads, d_model, dropout=0.1):
super().__init__()
self.d_model = d_model
self.d_k = d_model // heads
self.h = heads
self.q_linear1 = nn.Par... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | nlakshmanan/Transformer | MultiHeadAttention | false | 10,654 | [
"Apache-2.0"
] | 0 | 4562f8e9b282d0a70f26903a7b4410cb6132364b | https://github.com/nlakshmanan/Transformer/tree/4562f8e9b282d0a70f26903a7b4410cb6132364b | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, heads, d_model, dropout=0.1):
super().__init__()
self.d_model = d_model
self.d_k = d_model // heads
self.h = heads
self.q_linear1 = nn.Parameter(torch.... |
ReuseLayerNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class ReuseLayerNet(torch.nn.Module):
def __init__(self):
super(ReuseLayerNet, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 3, kernel_size=1, stride=1)
self.conv2 = torch.nn.Conv2d(3, 3, kernel_size=1, stride=1)
self.identity = torch.nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional
assert_size_stride = torch._C._dynamo.guards.assert_s... | elad-c/model_optimization | ReuseLayerNet | false | 10,655 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv1 = torch.nn.Conv2d(3, 3, kernel_size=1, stride=1)
self.conv2 = torch.nn.Conv2d(3, 3, kernel_size=1, stride=1)
self.identity = torch.nn.Identity()
def forward... |
BinaryLoss | # 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 functools
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._C
import torch.serialization
def binary_ce_loss(pred, label, **kwargs):
loss = F.binary_cross_entropy(pred, label, reduction='none')
loss = torch.mean(loss, dim=(1, 2))
return loss
def reduce_loss(loss, red... | 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 func... | puzzledsky/mmsegmentation-lesion | BinaryLoss | false | 10,656 | [
"Apache-2.0"
] | 0 | 522efceab6735dfec13acf6f45dc6bfdb35cfd60 | https://github.com/puzzledsky/mmsegmentation-lesion/tree/522efceab6735dfec13acf6f45dc6bfdb35cfd60 | import functools
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch._C
import torch.serialization
def binary_ce_loss(pred, label, **kwargs):
loss = F.binary_cross_entropy(pred, label, reduction='none')
loss = torch.mean(loss, dim=(1, 2))
return loss
def reduce_loss(loss, red... |
SoftMaxAvgPoolModel | # 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.cuda
import torch.nn
import torch.utils.data
import torch.fx
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class SoftMaxAvgPoolModel(torch.nn.Module):
def __init__(self):
super(SoftMaxAvgPoolModel, self).__init__()
self.sfmax = torch.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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.cuda
impo... | quic-araha/aimet | SoftMaxAvgPoolModel | false | 10,657 | [
"BSD-3-Clause"
] | 0 | 1afd5ce23f06bed74fec9812d5d2ea256ac4a650 | https://github.com/quic-araha/aimet/tree/1afd5ce23f06bed74fec9812d5d2ea256ac4a650 | import torch
import torch.cuda
import torch.nn
import torch.utils.data
import torch.fx
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.sfmax = torch.nn.Softmax(dim=1)
self.avgpool = t... |
HardtanhBoundToPOTNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch.nn.functional import relu
from torch.nn import Conv2d
from torch.nn import Hardtanh
from torch.nn.functional import hardtanh
import torch.nn.functional
class HardtanhBoundToPOTNet(torch.nn.Module):
def __init__(self):
super(HardtanhBoundToPOTNet, self).__init__()
self.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.nn import Conv2d
f... | elad-c/model_optimization | HardtanhBoundToPOTNet | false | 10,658 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
from torch.nn.functional import relu
from torch.nn import Conv2d
from torch.nn import Hardtanh
from torch.nn.functional import hardtanh
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv1 = Conv2d(3, 3, kernel_size=1, stride=1)
... |
TorchTensorAttrNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class TorchTensorAttrNet(torch.nn.Module):
def __init__(self):
super(TorchTensorAttrNet, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 4, kernel_size=1, stride=1)
def forward(self, x):
x = self.conv1(x)
x = x * x.size(1)
retu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional
assert_size_stride = torch._C._dynamo.guards.assert_s... | elad-c/model_optimization | TorchTensorAttrNet | false | 10,659 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv1 = torch.nn.Conv2d(3, 4, kernel_size=1, stride=1)
def forward(self, x):
x = self.conv1(x)
x = x * x.size(1)
return x.view(1, -1)
def get_inputs():
... |
ReLUBoundToPOTNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch.nn import ReLU
from torch.nn import ReLU6
from torch.nn.functional import relu
from torch.nn.functional import relu6
from torch.nn import Conv2d
import torch.nn.functional
class ReLUBoundToPOTNet(torch.nn.Module):
def __init__(self):
super(ReLUBoundToPOTNet, 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.nn import ReLU
fro... | elad-c/model_optimization | ReLUBoundToPOTNet | false | 10,660 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
from torch.nn import ReLU
from torch.nn import ReLU6
from torch.nn.functional import relu
from torch.nn.functional import relu6
from torch.nn import Conv2d
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv1 = Conv2d(3, 3, kernel... |
focal_loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
class focal_loss(torch.nn.Module):
"""
Loss function for classification tasks with
large data imbalance. Focal loss (FL) is define as:
FL(p_t) = -alpha*((1-p_t)^gamma))*log(p_t),
where p_t is a cross-entropy loss for binary classification.
For more... | 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
assert_size... | miguel-fc/atomai | focal_loss | false | 10,661 | [
"MIT"
] | 0 | f51699ef5e1bfc577781977d38f7414b1b51449d | https://github.com/miguel-fc/atomai/tree/f51699ef5e1bfc577781977d38f7414b1b51449d | import torch
import torch.nn.functional as F
class Model(torch.nn.Module):
"""
Loss function for classification tasks with
large data imbalance. Focal loss (FL) is define as:
FL(p_t) = -alpha*((1-p_t)^gamma))*log(p_t),
where p_t is a cross-entropy loss for binary classification.
For more deta... |
SplitConcatNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class SplitConcatNet(torch.nn.Module):
def __init__(self):
super(SplitConcatNet, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 3, kernel_size=1, stride=1)
self.conv2 = torch.nn.Conv2d(1, 3, kernel_size=1, stride=1)
self.conv3 = torch.nn.C... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional
assert_size_stride = torch._C._dynamo.guards.assert_s... | elad-c/model_optimization | SplitConcatNet | false | 10,662 | [
"Apache-2.0"
] | 0 | b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | https://github.com/elad-c/model_optimization/tree/b0ecf41c3f9434008d57d7fe724ff8585e19d4cc | import torch
import torch.nn.functional
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv1 = torch.nn.Conv2d(3, 3, kernel_size=1, stride=1)
self.conv2 = torch.nn.Conv2d(1, 3, kernel_size=1, stride=1)
self.conv3 = torch.nn.Conv2d(1, 3, kernel_size=1, st... |
SplitAndConcat | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.quantization.quantize_fx
import torch.utils.data
class SplitAndConcat(nn.Module):
"""Split the data from split_dim and concatenate in concat_dim.
@param split_dim from which axis the data will be chunk
@param concat_dim to which axis the data will be concat... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.quantization.quantize_fx
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size... | petoor/d2go | SplitAndConcat | false | 10,663 | [
"Apache-2.0"
] | 0 | d0a20d048738f447945d7c948a8d3019a110d2e8 | https://github.com/petoor/d2go/tree/d0a20d048738f447945d7c948a8d3019a110d2e8 | import torch
import torch.nn as nn
import torch.quantization.quantize_fx
import torch.utils.data
class Model(nn.Module):
"""Split the data from split_dim and concatenate in concat_dim.
@param split_dim from which axis the data will be chunk
@param concat_dim to which axis the data will be concatenated
... |
UNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 double_conv(nn.Module):
def __init__(self, input_channels, output_channels):
super(double_conv, self).__init__()
self.conv1 = nn.Conv2d(input_channels, output_channels, kernel_size
=3, padding='same')
self.conv2 = nn.Conv2d(output_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 as nn
assert_... | mhakyash/UNet-MNIST-denoising | UNet | false | 10,664 | [
"MIT"
] | 0 | 0e3c20cbb3f34af575e33209425ae4d7cb0bcd82 | https://github.com/mhakyash/UNet-MNIST-denoising/tree/0e3c20cbb3f34af575e33209425ae4d7cb0bcd82 | import torch
import torch.nn as nn
class double_conv(nn.Module):
def __init__(self, input_channels, output_channels):
super().__init__()
self.conv1 = nn.Conv2d(input_channels, output_channels, kernel_size
=3, padding='same')
self.conv2 = nn.Conv2d(output_channels, output_chann... |
UpsampleBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class UpsampleBlock(nn.Module):
"""
Defines upsampling block performed using bilinear
or nearest-neigbor interpolation followed by 1-by-1 convolution
(the latter can be used to reduce a number of feature channels)
Args:
nd... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | miguel-fc/atomai | UpsampleBlock | false | 10,665 | [
"MIT"
] | 0 | f51699ef5e1bfc577781977d38f7414b1b51449d | https://github.com/miguel-fc/atomai/tree/f51699ef5e1bfc577781977d38f7414b1b51449d | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
"""
Defines upsampling block performed using bilinear
or nearest-neigbor interpolation followed by 1-by-1 convolution
(the latter can be used to reduce a number of feature channels)
Args:
ndim:
... |
KeypointRCNNPredictorNoUpscale | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.quantization.quantize_fx
import torch.utils.data
class KeypointRCNNPredictorNoUpscale(nn.Module):
def __init__(self, in_channels, num_keypoints):
super(KeypointRCNNPredictorNoUpscale, self).__init__()
input_features = in_channels
deconv_kern... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.quantization.quantize_fx
import torch.utils.d... | petoor/d2go | KeypointRCNNPredictorNoUpscale | false | 10,666 | [
"Apache-2.0"
] | 0 | d0a20d048738f447945d7c948a8d3019a110d2e8 | https://github.com/petoor/d2go/tree/d0a20d048738f447945d7c948a8d3019a110d2e8 | import torch
import torch.nn as nn
import torch.quantization.quantize_fx
import torch.utils.data
class Model(nn.Module):
def __init__(self, in_channels, num_keypoints):
super().__init__()
input_features = in_channels
deconv_kernel = 4
self.kps_score_lowres = nn.ConvTranspose2d(inp... |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class DiceLoss(nn.Module):
def __init__(self):
super(DiceLoss, self).__init__()
def forward(self, input, target):
N = target.size(0)
smooth = 1
input_flat = input.view(N, -1)
target_flat = target.view(N, -1)
intersection = in... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | phenixcxz/DeepGlobe-Road-Extraction-Challenge | DiceLoss | false | 10,667 | [
"MIT"
] | 0 | 4dee0f0866ff6f06b888afd28a60940b75a8eadd | https://github.com/phenixcxz/DeepGlobe-Road-Extraction-Challenge/tree/4dee0f0866ff6f06b888afd28a60940b75a8eadd | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input, target):
N = target.size(0)
smooth = 1
input_flat = input.view(N, -1)
target_flat = target.view(N, -1)
intersection = input_flat * target... |
Critic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
def __init__(self, state_dim, action_dim):
super(Critic, self).__init__()
self.l1 = nn.Linear(state_dim + action_dim, 6)
self.l2 = nn.Linear(6, 4)
self.l3 = nn.Linear(4, 1)
self.l4 ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | pkj415/CityLearn-2 | Critic | false | 10,668 | [
"MIT"
] | 0 | 003012ddeb52868d42d85b835a9a5f2c28008927 | https://github.com/pkj415/CityLearn-2/tree/003012ddeb52868d42d85b835a9a5f2c28008927 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, state_dim, action_dim):
super().__init__()
self.l1 = nn.Linear(state_dim + action_dim, 6)
self.l2 = nn.Linear(6, 4)
self.l3 = nn.Linear(4, 1)
self.l4 = nn.Linear(s... |
MulticlassDiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class DiceLoss(nn.Module):
def __init__(self):
super(DiceLoss, self).__init__()
def forward(self, input, target):
N = target.size(0)
smooth = 1
input_flat = input.view(N, -1)
target_flat = target.view(N, -1)
intersection = in... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | phenixcxz/DeepGlobe-Road-Extraction-Challenge | MulticlassDiceLoss | false | 10,669 | [
"MIT"
] | 0 | 4dee0f0866ff6f06b888afd28a60940b75a8eadd | https://github.com/phenixcxz/DeepGlobe-Road-Extraction-Challenge/tree/4dee0f0866ff6f06b888afd28a60940b75a8eadd | import torch
import torch.nn as nn
class DiceLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input, target):
N = target.size(0)
smooth = 1
input_flat = input.view(N, -1)
target_flat = target.view(N, -1)
intersection = input_flat * tar... |
BertSelfAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = int(config.hidden_size / config.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | priyamtejaswin/minbert-assignment | BertSelfAttention | false | 10,670 | [
"Apache-2.0"
] | 0 | fd41a54441916a6d421640bbee910f64786b303d | https://github.com/priyamtejaswin/minbert-assignment/tree/fd41a54441916a6d421640bbee910f64786b303d | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = int(config.hidden_size / config.
... |
VariableBoxMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class VariableBoxMLP(nn.Module):
def __init__(self, num_in_features: 'int', num_out_features: 'int',
neurons_per_layer: 'int', hidden_layers: 'int'):
super(VariableBoxMLP, self).__init__()
self.hidden_layers = hidden_l... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.optim
... | plaveczlambert/nonlinearbubbledynamics | VariableBoxMLP | false | 10,671 | [
"MIT"
] | 0 | 190c5170f7ff6068badeee818c01226c55aaec97 | https://github.com/plaveczlambert/nonlinearbubbledynamics/tree/190c5170f7ff6068badeee818c01226c55aaec97 | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_in_features: 'int', num_out_features: 'int',
neurons_per_layer: 'int', hidden_layers: 'int'):
super().__init__()
self.hidden_layers = hidden_layers
self.act = nn.E... |
TilePad2d | # 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 TilePad2d(nn.Module):
def __init__(self, left, right, top, bottom):
super().__init__()
self.left = left
self.right = right
self.top = top
self.bottom = bottom
def forward(self, x):
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... | mkarmann/conway-reversed | TilePad2d | false | 10,672 | [
"MIT"
] | 0 | a3ae10dd5768affb9caf193a246395ee0fb2bc6f | https://github.com/mkarmann/conway-reversed/tree/a3ae10dd5768affb9caf193a246395ee0fb2bc6f | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, left, right, top, bottom):
super().__init__()
self.left = left
self.right = right
self.top = top
self.bottom = bottom
def forward(self, x):
return F.p... |
SimpleMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class SimpleMLP(nn.Module):
def __init__(self, num_in_features: 'int', num_out_features: 'int',
neurons_per_layer: 'int'):
super(SimpleMLP, self).__init__()
self.act = nn.ELU()
self.l_in = nn.Linear(in_features... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.optim
... | plaveczlambert/nonlinearbubbledynamics | SimpleMLP | false | 10,673 | [
"MIT"
] | 0 | 190c5170f7ff6068badeee818c01226c55aaec97 | https://github.com/plaveczlambert/nonlinearbubbledynamics/tree/190c5170f7ff6068badeee818c01226c55aaec97 | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_in_features: 'int', num_out_features: 'int',
neurons_per_layer: 'int'):
super().__init__()
self.act = nn.ELU()
self.l_in = nn.Linear(in_features=num_in_features, o... |
EncoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
class FeedForward(nn.Module):
def __init__(self, d_model, d_ff=2048, dropout=0.1):
super().__init__()
self.linear_1 = nn.Linear(d_model, d_ff)
self.dropout = nn.Dropout(dropout)
self.linear_2 = nn.Linea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | nlakshmanan/Transformer | EncoderLayer | false | 10,674 | [
"Apache-2.0"
] | 0 | 4562f8e9b282d0a70f26903a7b4410cb6132364b | https://github.com/nlakshmanan/Transformer/tree/4562f8e9b282d0a70f26903a7b4410cb6132364b | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
class FeedForward(nn.Module):
def __init__(self, d_model, d_ff=2048, dropout=0.1):
super().__init__()
self.linear_1 = nn.Linear(d_model, d_ff)
self.dropout = nn.Dropout(dropout)
self.linear_2 = nn.Linea... |
HighwayCNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 HighwayCNN(nn.Module):
def __init__(self, input_size, gate_bias=-1, activation_function=nn.
functional.relu, gate_activation=nn.functional.softmax):
super(HighwayCNN, self).__init__()
self.activation_function = activation_function
self.gate... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | okcd00/glyce | HighwayCNN | false | 10,675 | [
"Apache-2.0"
] | 0 | 010d88ac5cff4969308d2f8d105831ddcb352a02 | https://github.com/okcd00/glyce/tree/010d88ac5cff4969308d2f8d105831ddcb352a02 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_size, gate_bias=-1, activation_function=nn.
functional.relu, gate_activation=nn.functional.softmax):
super().__init__()
self.activation_function = activation_function
self.gate_activation = gate_ac... |
HighwayMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 HighwayMLP(nn.Module):
def __init__(self, input_size, gate_bias=-2, activation_function=nn.
functional.relu, gate_activation=nn.functional.softmax):
super(HighwayMLP, self).__init__()
self.activation_function = activation_function
self.gate... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | okcd00/glyce | HighwayMLP | false | 10,676 | [
"Apache-2.0"
] | 0 | 010d88ac5cff4969308d2f8d105831ddcb352a02 | https://github.com/okcd00/glyce/tree/010d88ac5cff4969308d2f8d105831ddcb352a02 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_size, gate_bias=-2, activation_function=nn.
functional.relu, gate_activation=nn.functional.softmax):
super().__init__()
self.activation_function = activation_function
self.gate_activation = gate_ac... |
DecoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
class FeedForward(nn.Module):
def __init__(self, d_model, d_ff=2048, dropout=0.1):
super().__init__()
self.linear_1 = nn.Linear(d_model, d_ff)
self.dropout = nn.Dropout(dropout)
self.linear_2 = nn.Linea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | nlakshmanan/Transformer | DecoderLayer | false | 10,677 | [
"Apache-2.0"
] | 0 | 4562f8e9b282d0a70f26903a7b4410cb6132364b | https://github.com/nlakshmanan/Transformer/tree/4562f8e9b282d0a70f26903a7b4410cb6132364b | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
class FeedForward(nn.Module):
def __init__(self, d_model, d_ff=2048, dropout=0.1):
super().__init__()
self.linear_1 = nn.Linear(d_model, d_ff)
self.dropout = nn.Dropout(dropout)
self.linear_2 = nn.Linea... |
TiledConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 TiledConv2d(nn.Module):
def __init__(self, in_features, out_features):
super().__init__()
self.conv = nn.Conv2d(in_features, out_features, kernel_size=3,
bias=False)
def forward(self, x):
return 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... | mkarmann/conway-reversed | TiledConv2d | false | 10,678 | [
"MIT"
] | 0 | a3ae10dd5768affb9caf193a246395ee0fb2bc6f | https://github.com/mkarmann/conway-reversed/tree/a3ae10dd5768affb9caf193a246395ee0fb2bc6f | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, in_features, out_features):
super().__init__()
self.conv = nn.Conv2d(in_features, out_features, kernel_size=3,
bias=False)
def forward(self, x):
return self.conv(... |
PositionWiseFFN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.functional import relu
class PositionWiseFFN(nn.Module):
def __init__(self, model_dim, dropout=0.0):
super().__init__()
dff = model_dim * 4
self.l = nn.Linear(model_dim, dff)
self.o = nn.Linear(dff, model_dim)
self.dropout = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | richardzhangy26/NLP-Tutorials | PositionWiseFFN | false | 10,679 | [
"MIT"
] | 0 | ddf123853c53cef1142207c3a4fb9aa6ac87febd | https://github.com/richardzhangy26/NLP-Tutorials/tree/ddf123853c53cef1142207c3a4fb9aa6ac87febd | import torch
from torch import nn
from torch.nn.functional import relu
class Model(nn.Module):
def __init__(self, model_dim, dropout=0.0):
super().__init__()
dff = model_dim * 4
self.l = nn.Linear(model_dim, dff)
self.o = nn.Linear(dff, model_dim)
self.dropout = nn.Dropout... |
PoseRegHead | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 _get_fc_layer(in_cn, out_cn):
x = nn.Linear(in_cn, out_cn)
x.bias.data.zero_()
nn.init.normal_(x.weight, 0.0, 0.001)
return x
class PoseRegHead(nn.Module):
def __init__(self, dim_in, dim_out, num_units=4096):
super(P... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mrlooi/PoseCNN | PoseRegHead | false | 10,680 | [
"MIT"
] | 0 | c103bd7dc743edbc9c7cc8a4687b035e3d1150f6 | https://github.com/mrlooi/PoseCNN/tree/c103bd7dc743edbc9c7cc8a4687b035e3d1150f6 | import torch
import torch.nn as nn
import torch.nn.functional as F
def _get_fc_layer(in_cn, out_cn):
x = nn.Linear(in_cn, out_cn)
x.bias.data.zero_()
nn.init.normal_(x.weight, 0.0, 0.001)
return x
class Model(nn.Module):
def __init__(self, dim_in, dim_out, num_units=4096):
super().__ini... |
FCNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
class FCNet(nn.Module):
def __init__(self):
super(FCNet, self).__init__()
self.fc1 = nn.Linear(3 * 28 * 28, 128)
self.fc2 = nn.Linear(128, 5)
def forward(self, x):
x = x.vie... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.u... | rilu0361/mytorch | FCNet | false | 10,681 | [
"MIT"
] | 0 | 9f00b830b3ce8fdf942cd19704dedfe6ffd359a5 | https://github.com/rilu0361/mytorch/tree/9f00b830b3ce8fdf942cd19704dedfe6ffd359a5 | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
class Model(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(3 * 28 * 28, 128)
self.fc2 = nn.Linear(128, 5)
def forward(self, x):
x = x.view(-1, 3 * 2... |
MultiHeadSelfAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch.nn import Dropout
from torch.nn import Linear
from torch.nn.modules import Dropout
def masked_softmax(vector: 'torch.Tensor', mask: 'torch.Tensor', dim: 'int'=-1
) ->torch.Tensor:
"""
``torch.nn.functional.softmax(vector)`` does not work if some elements... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | okcd00/glyce | MultiHeadSelfAttention | false | 10,682 | [
"Apache-2.0"
] | 0 | 010d88ac5cff4969308d2f8d105831ddcb352a02 | https://github.com/okcd00/glyce/tree/010d88ac5cff4969308d2f8d105831ddcb352a02 | from torch.nn import Module
import torch
from torch.nn import Dropout
from torch.nn import Linear
from torch.nn.modules import Dropout
def masked_softmax(vector: 'torch.Tensor', mask: 'torch.Tensor', dim: 'int'=-1
) ->torch.Tensor:
"""
``torch.nn.functional.softmax(vector)`` does not work if some elements... |
StatsPool | # 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 StatsPool(nn.Module):
def __init__(self, floor=1e-10, bessel=False):
super(StatsPool, self).__init__()
self.floor = floor
self.bessel = bessel
def forward(self, x):
means = torch.mean(x, dim=1)
_, t, _ = x.shape
if self... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert... | penguinwang96825/Umigame | StatsPool | false | 10,683 | [
"Apache-2.0"
] | 0 | 98d647ab6f40df08fe31d6b3bc444afe229a914e | https://github.com/penguinwang96825/Umigame/tree/98d647ab6f40df08fe31d6b3bc444afe229a914e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, floor=1e-10, bessel=False):
super().__init__()
self.floor = floor
self.bessel = bessel
def forward(self, x):
means = torch.mean(x, dim=1)
_, t, _ = x.shape
if self.bessel:
... |
LayerNorm | # 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 LayerNorm(nn.Module):
def __init__(self, *args):
super().__init__()
def forward(self, activation):
if len(activation.size()) == 3:
ori_size = activation.size()
activation = activation.view(-1, activation.size(-1))
else:... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | mansoorcheema/segan_pytorch | LayerNorm | false | 10,684 | [
"MIT"
] | 0 | 8f3b401e42cadfd1f8ad57a8ba0e89c16cc7ee65 | https://github.com/mansoorcheema/segan_pytorch/tree/8f3b401e42cadfd1f8ad57a8ba0e89c16cc7ee65 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, *args):
super().__init__()
def forward(self, activation):
if len(activation.size()) == 3:
ori_size = activation.size()
activation = activation.view(-1, activation.size(-1))
else:
... |
convTranspose23DUnit | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.nn.init as init
import torch.nn.init
class convTranspose23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, output_padding=0, groups=1, bias=True, dilation=1, nd=2):
super(convTransp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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
import torch.nn.init as init
import tor... | navid0308/medSynthesisV1 | convTranspose23DUnit | false | 10,685 | [
"MIT"
] | 0 | 6731a67d0eb9bb3e0c1646f01feb24229aa4fe30 | https://github.com/navid0308/medSynthesisV1/tree/6731a67d0eb9bb3e0c1646f01feb24229aa4fe30 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.init as init
import torch.nn.init
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, output_padding=0, groups=1, bias=True, dilation=1, nd=2):
super().__init__()
asse... |
residualUnit | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import torch.nn.init
class conv23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=True, dilation=1, nd=2):
super(conv2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | navid0308/medSynthesisV1 | residualUnit | false | 10,686 | [
"MIT"
] | 0 | 6731a67d0eb9bb3e0c1646f01feb24229aa4fe30 | https://github.com/navid0308/medSynthesisV1/tree/6731a67d0eb9bb3e0c1646f01feb24229aa4fe30 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import torch.nn.init
class conv23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=True, dilation=1, nd=2):
super().__i... |
CombFilter | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 CombFilter(nn.Module):
def __init__(self, ninputs, fmaps, L):
super().__init__()
self.L = L
self.filt = nn.Conv1d(ninputs, fmaps, 2, dilation=L, bias=False)
r_init_weight = torch.ones(ninputs * fmaps, 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... | mansoorcheema/segan_pytorch | CombFilter | false | 10,687 | [
"MIT"
] | 0 | 8f3b401e42cadfd1f8ad57a8ba0e89c16cc7ee65 | https://github.com/mansoorcheema/segan_pytorch/tree/8f3b401e42cadfd1f8ad57a8ba0e89c16cc7ee65 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, ninputs, fmaps, L):
super().__init__()
self.L = L
self.filt = nn.Conv1d(ninputs, fmaps, 2, dilation=L, bias=False)
r_init_weight = torch.ones(ninputs * fmaps, 2)
r... |
quadexp | # 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 tr
import torch.nn as nn
class quadexp(nn.Module):
def __init__(self, sigma=2.0):
super(quadexp, self).__init__()
self.sigma = sigma
def forward(self, x: 'tr.Tensor'):
return tr.exp(-x ** 2 / self.sigma ** 2)
def get_inputs():
return [torch.rand([4,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | pierreglaser/MMD-gradient-flow | quadexp | false | 10,688 | [
"BSD-3-Clause"
] | 0 | 43591137e1d04bed5153887a364fae72621b01ae | https://github.com/pierreglaser/MMD-gradient-flow/tree/43591137e1d04bed5153887a364fae72621b01ae | import torch
import torch as tr
import torch.nn as nn
class Model(nn.Module):
def __init__(self, sigma=2.0):
super().__init__()
self.sigma = sigma
def forward(self, x: 'tr.Tensor'):
return tr.exp(-x ** 2 / self.sigma ** 2)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
d... |
power | # 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 tr
import torch.nn as nn
class power(nn.Module):
def __init__(self):
super(power, self).__init__()
def forward(self, x: 'tr.Tensor'):
return x.pow(2)
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... | pierreglaser/MMD-gradient-flow | power | false | 10,689 | [
"BSD-3-Clause"
] | 0 | 43591137e1d04bed5153887a364fae72621b01ae | https://github.com/pierreglaser/MMD-gradient-flow/tree/43591137e1d04bed5153887a364fae72621b01ae | import torch
import torch as tr
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x: 'tr.Tensor'):
return x.pow(2)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
MultiNonLinearClassifier | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 MultiNonLinearClassifier(nn.Module):
def __init__(self, hidden_size, num_label):
super(MultiNonLinearClassifier, self).__init__()
self.num_label = num_label
self.classifier1 = nn.Linear(hidden_size, int(hidden_size / 2))
self.classifier2 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | okcd00/glyce | MultiNonLinearClassifier | false | 10,690 | [
"Apache-2.0"
] | 0 | 010d88ac5cff4969308d2f8d105831ddcb352a02 | https://github.com/okcd00/glyce/tree/010d88ac5cff4969308d2f8d105831ddcb352a02 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, hidden_size, num_label):
super().__init__()
self.num_label = num_label
self.classifier1 = nn.Linear(hidden_size, int(hidden_size / 2))
self.classifier2 = nn.Linear(int(hidden_size / 2), num_label)
d... |
Conv2dWithConstraint | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Conv2dWithConstraint(nn.Conv2d):
def __init__(self, *args, max_norm=1, **kwargs):
self.max_norm = max_norm
super(Conv2dWithConstraint, self).__init__(*args, **kwargs)
def forward(self, x):
self.weight.data = torch.renorm(self.weight.data, p=2,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | rmpeng/TIE-EEGNet | Conv2dWithConstraint | false | 10,691 | [
"MIT"
] | 0 | 69817fce3edb67f68bf4e85b53596f122dbc78fb | https://github.com/rmpeng/TIE-EEGNet/tree/69817fce3edb67f68bf4e85b53596f122dbc78fb | import torch
import torch.nn as nn
class Model(nn.Conv2d):
def __init__(self, *args, max_norm=1, **kwargs):
self.max_norm = max_norm
super().__init__(*args, **kwargs)
def forward(self, x):
self.weight.data = torch.renorm(self.weight.data, p=2, dim=0,
maxnorm=self.max_norm... |
laplace | # 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 tr
import torch.nn as nn
class laplace(nn.Module):
def __init__(self, lambda_=2.0):
super(laplace, self).__init__()
self.lambda_ = lambda_
def forward(self, x: 'tr.Tensor'):
return tr.exp(-self.lambda_ * tr.abs(x))
def get_inputs():
return [torch.ra... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | pierreglaser/MMD-gradient-flow | laplace | false | 10,692 | [
"BSD-3-Clause"
] | 0 | 43591137e1d04bed5153887a364fae72621b01ae | https://github.com/pierreglaser/MMD-gradient-flow/tree/43591137e1d04bed5153887a364fae72621b01ae | import torch
import torch as tr
import torch.nn as nn
class Model(nn.Module):
def __init__(self, lambda_=2.0):
super().__init__()
self.lambda_ = lambda_
def forward(self, x: 'tr.Tensor'):
return tr.exp(-self.lambda_ * tr.abs(x))
def get_inputs():
return [torch.rand([4, 4, 4, 4]... |
BertLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | priyamtejaswin/minbert-assignment | BertLayer | false | 10,693 | [
"Apache-2.0"
] | 0 | fd41a54441916a6d421640bbee910f64786b303d | https://github.com/priyamtejaswin/minbert-assignment/tree/fd41a54441916a6d421640bbee910f64786b303d | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = ... |
cosine | # 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 tr
import torch.nn as nn
class cosine(nn.Module):
def __init__(self):
super(cosine, self).__init__()
def forward(self, x: 'tr.Tensor'):
return tr.cos(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._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | pierreglaser/MMD-gradient-flow | cosine | false | 10,694 | [
"BSD-3-Clause"
] | 0 | 43591137e1d04bed5153887a364fae72621b01ae | https://github.com/pierreglaser/MMD-gradient-flow/tree/43591137e1d04bed5153887a364fae72621b01ae | import torch
import torch as tr
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x: 'tr.Tensor'):
return tr.cos(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
OptimizedMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class OptimizedMLP(nn.Module):
def __init__(self, num_in_features: 'int', num_out_features: 'int'):
super(OptimizedMLP, self).__init__()
self.act = nn.ELU()
self.l_in = nn.Linear(in_features=num_in_features, out_featur... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.optim
... | plaveczlambert/nonlinearbubbledynamics | OptimizedMLP | false | 10,695 | [
"MIT"
] | 0 | 190c5170f7ff6068badeee818c01226c55aaec97 | https://github.com/plaveczlambert/nonlinearbubbledynamics/tree/190c5170f7ff6068badeee818c01226c55aaec97 | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_in_features: 'int', num_out_features: 'int'):
super().__init__()
self.act = nn.ELU()
self.l_in = nn.Linear(in_features=num_in_features, out_features=107)
self.l1 =... |
ScoreCap | # 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
import torch.optim
class ScoreCap(nn.Module):
def __init__(self, cap: 'float'):
super().__init__()
self.cap = cap
def forward(self, input):
return torch.clip(input, max=self.cap)
def get_inputs():
return [torch.rand([4, 4, 4, 4]... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import torch.nn
import torch.optim
assert_size_stride = torch._C._dy... | mikaylagawarecki/ReAgent | ScoreCap | false | 10,696 | [
"BSD-3-Clause"
] | 0 | b1a306a9d3641c8adeb03ac272e5774a0009fa88 | https://github.com/mikaylagawarecki/ReAgent/tree/b1a306a9d3641c8adeb03ac272e5774a0009fa88 | import torch
from torch import nn
import torch.nn
import torch.optim
class Model(nn.Module):
def __init__(self, cap: 'float'):
super().__init__()
self.cap = cap
def forward(self, input):
return torch.clip(input, max=self.cap)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
... |
Concat | # 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
import torch.optim
class Concat(nn.Module):
def forward(self, state: 'torch.Tensor', action: 'torch.Tensor'):
return torch.cat((state, action), dim=-1)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inpu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.nn
import torch.optim
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda =... | mikaylagawarecki/ReAgent | Concat | false | 10,697 | [
"BSD-3-Clause"
] | 0 | b1a306a9d3641c8adeb03ac272e5774a0009fa88 | https://github.com/mikaylagawarecki/ReAgent/tree/b1a306a9d3641c8adeb03ac272e5774a0009fa88 | import torch
from torch import nn
import torch.nn
import torch.optim
class Model(nn.Module):
def forward(self, state: 'torch.Tensor', action: 'torch.Tensor'):
return torch.cat((state, action), dim=-1)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_input... |
imq | # 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 tr
import torch.nn as nn
class imq(nn.Module):
def __init__(self, c=1.0):
super(imq, self).__init__()
self.c = c
def forward(self, x: 'tr.Tensor'):
return 1 / (self.c ** 2 + x ** 2)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | pierreglaser/MMD-gradient-flow | imq | false | 10,698 | [
"BSD-3-Clause"
] | 0 | 43591137e1d04bed5153887a364fae72621b01ae | https://github.com/pierreglaser/MMD-gradient-flow/tree/43591137e1d04bed5153887a364fae72621b01ae | import torch
import torch as tr
import torch.nn as nn
class Model(nn.Module):
def __init__(self, c=1.0):
super().__init__()
self.c = c
def forward(self, x: 'tr.Tensor'):
return 1 / (self.c ** 2 + x ** 2)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.