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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
SimpleArgSortModule | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleArgSortModule(torch.nn.Module):
def __init__(self, descending=True):
super(SimpleArgSortModule, self).__init__()
self.descending = descending
def forward(self, inputs):
return torch.argsort(inputs, dim=-1, de... | 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.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | mciprian13/glow | SimpleArgSortModule | false | 3,994 | [
"Apache-2.0"
] | 0 | 90f88205d9bf8baff8df5bbda51c9d138e3e668b | https://github.com/mciprian13/glow/tree/90f88205d9bf8baff8df5bbda51c9d138e3e668b | import torch
import torch.jit
import torch.onnx
import torch.nn
class Model(torch.nn.Module):
def __init__(self, descending=True):
super().__init__()
self.descending = descending
def forward(self, inputs):
return torch.argsort(inputs, dim=-1, descending=self.descending)
def get_inp... |
CriticNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 as optim
from torch import nn
from torch.nn import functional as F
class CriticNN(nn.Module):
def __init__(self, in_channels=3):
super(CriticNN, self).__init__()
self.fc1 = nn.Linear(4, 64)
self.fc2 = nn.Linear(64, 1)
self.optimizer = optim.Adam(sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | maxmax1992/Q_learning | CriticNN | false | 3,995 | [
"MIT"
] | 0 | 8b2b8491d6f94b94b2fce608b93cdc31b418c5b0 | https://github.com/maxmax1992/Q_learning/tree/8b2b8491d6f94b94b2fce608b93cdc31b418c5b0 | import torch
import torch.optim as optim
from torch import nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, in_channels=3):
super().__init__()
self.fc1 = nn.Linear(4, 64)
self.fc2 = nn.Linear(64, 1)
self.optimizer = optim.Adam(self.parameters(), l... |
scSE | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class cSE(nn.Module):
def __init__(self, in_channels):
super().__init__()
reduced_filters = 1 if in_channels // 2 == 0 else in_channels // 2
self.global_avg_pool = nn.AdaptiveAvgPool2d(output_size=(1, 1))
self.pointwise_1 = nn.Conv2d(in_channels=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | mattroz/yatopi | scSE | false | 3,996 | [
"MIT"
] | 0 | 278bac6f3d2f13916ae9d43309b9f38b608426bd | https://github.com/mattroz/yatopi/tree/278bac6f3d2f13916ae9d43309b9f38b608426bd | import torch
import torch.nn as nn
class cSE(nn.Module):
def __init__(self, in_channels):
super().__init__()
reduced_filters = 1 if in_channels // 2 == 0 else in_channels // 2
self.global_avg_pool = nn.AdaptiveAvgPool2d(output_size=(1, 1))
self.pointwise_1 = nn.Conv2d(in_channels=... |
SimpleAvgPool2dModule | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.jit
import torch.nn.functional as F
import torch.onnx
import torch.nn
class SimpleAvgPool2dModule(torch.nn.Module):
def __init__(self, kernel_size, stride=None, padding=0):
super(SimpleAvgPool2dModule, self).__init__()
self.kernel_size = kernel_size
self.padding ... | 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.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | mciprian13/glow | SimpleAvgPool2dModule | false | 3,997 | [
"Apache-2.0"
] | 0 | 90f88205d9bf8baff8df5bbda51c9d138e3e668b | https://github.com/mciprian13/glow/tree/90f88205d9bf8baff8df5bbda51c9d138e3e668b | import torch
import torch.jit
import torch.nn.functional as F
import torch.onnx
import torch.nn
class Model(torch.nn.Module):
def __init__(self, kernel_size, stride=None, padding=0):
super().__init__()
self.kernel_size = kernel_size
self.padding = padding
self.stride = stride
... |
SimpleFmodModule | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleFmodModule(torch.nn.Module):
def __init__(self):
super(SimpleFmodModule, self).__init__()
def forward(self, a, b):
if b.size() == torch.Size([]):
c = a.fmod(b.item())
else:
c = a.fmod(... | 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.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | mciprian13/glow | SimpleFmodModule | false | 3,998 | [
"Apache-2.0"
] | 0 | 90f88205d9bf8baff8df5bbda51c9d138e3e668b | https://github.com/mciprian13/glow/tree/90f88205d9bf8baff8df5bbda51c9d138e3e668b | import torch
import torch.jit
import torch.onnx
import torch.nn
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, a, b):
if b.size() == torch.Size([]):
c = a.fmod(b.item())
else:
c = a.fmod(b)
return c.fmod(torch.te... |
UnaryMaxModule | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.jit
import torch.onnx
import torch.nn
class UnaryMaxModule(torch.nn.Module):
def __init__(self):
super(UnaryMaxModule, self).__init__()
def forward(self, a):
return torch.max(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_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 import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | mciprian13/glow | UnaryMaxModule | false | 3,999 | [
"Apache-2.0"
] | 0 | 90f88205d9bf8baff8df5bbda51c9d138e3e668b | https://github.com/mciprian13/glow/tree/90f88205d9bf8baff8df5bbda51c9d138e3e668b | import torch
import torch.jit
import torch.onnx
import torch.nn
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, a):
return torch.max(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
UnaryMinModule | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.jit
import torch.onnx
import torch.nn
class UnaryMinModule(torch.nn.Module):
def __init__(self):
super(UnaryMinModule, self).__init__()
def forward(self, a):
return torch.min(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_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 import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | mciprian13/glow | UnaryMinModule | false | 4,000 | [
"Apache-2.0"
] | 0 | 90f88205d9bf8baff8df5bbda51c9d138e3e668b | https://github.com/mciprian13/glow/tree/90f88205d9bf8baff8df5bbda51c9d138e3e668b | import torch
import torch.jit
import torch.onnx
import torch.nn
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, a):
return torch.min(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
SqueezeEmbedding | # 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 SqueezeEmbedding(nn.Module):
"""
Squeeze sequence embedding length to the longest one in the batch
"""
def __init__(self, batch_first=True):
super(SqueezeEmbedding, self).__init__()
self.batch_first = batch_first
def forward(self, x, x_len... | 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... | minionssso/PyABSA | SqueezeEmbedding | false | 4,001 | [
"MIT"
] | 0 | fd9a9a6fd55552a60329fd04b6830e1bb144d50f | https://github.com/minionssso/PyABSA/tree/fd9a9a6fd55552a60329fd04b6830e1bb144d50f | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Squeeze sequence embedding length to the longest one in the batch
"""
def __init__(self, batch_first=True):
super().__init__()
self.batch_first = batch_first
def forward(self, x, x_len):
"""
sequence -... |
BiDAFAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 masked_softmax(logits, mask, dim=-1, log_softmax=False):
"""Take the softmax of `logits` over given dimension, and set
entries to 0 wherever `mask` is 0.
Args:
logits (torch.Tensor): Inputs to the softmax function.
mas... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mayankiitg/cs224n | BiDAFAttention | false | 4,002 | [
"MIT"
] | 0 | c67b7904101c8f19a5a231e4fe521e764470d41b | https://github.com/mayankiitg/cs224n/tree/c67b7904101c8f19a5a231e4fe521e764470d41b | import torch
import torch.nn as nn
import torch.nn.functional as F
def masked_softmax(logits, mask, dim=-1, log_softmax=False):
"""Take the softmax of `logits` over given dimension, and set
entries to 0 wherever `mask` is 0.
Args:
logits (torch.Tensor): Inputs to the softmax function.
mas... |
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, dim_seq, input_size, eps=1e-06):
super().__init__()
self.size = input_size
self.seq = dim_seq
self.alpha = nn.Parameter(torch.ones((self.size, self.seq)))
self.bias = nn.Parameter(torch.zeros((sel... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | mingweima/hintplaygame | Norm | false | 4,003 | [
"MIT"
] | 0 | 31f35a22111a2e5e7e5d8e90f92326bc784c5fe7 | https://github.com/mingweima/hintplaygame/tree/31f35a22111a2e5e7e5d8e90f92326bc784c5fe7 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, dim_seq, input_size, eps=1e-06):
super().__init__()
self.size = input_size
self.seq = dim_seq
self.alpha = nn.Parameter(torch.ones((self.size, self.seq)))
self.bias = nn.Parameter(torch.zeros((se... |
LinearExcitability | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import nn
from torch.nn.parameter import Parameter
def linearExcitability(input, weight, excitability=None, bias=None):
"""Applies a linear transformation to the incoming data: :math:`y = c(xA^T) + b`.
Shape:
- input: :math:`(N, *, in_features)`
- we... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
from torch import nn
from torch.nn.parameter import Parameter
assert... | mhmorta/continual-learning-1 | LinearExcitability | false | 4,004 | [
"MIT"
] | 0 | 959d5238d4dd015245592993b5d044572ab58c90 | https://github.com/mhmorta/continual-learning-1/tree/959d5238d4dd015245592993b5d044572ab58c90 | import math
import torch
from torch import nn
from torch.nn.parameter import Parameter
def linearExcitability(input, weight, excitability=None, bias=None):
"""Applies a linear transformation to the incoming data: :math:`y = c(xA^T) + b`.
Shape:
- input: :math:`(N, *, in_features)`
- we... |
HighwayMaxoutNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 masked_softmax(logits, mask, dim=-1, log_softmax=False):
"""Take the softmax of `logits` over given dimension, and set
entries to 0 wherever `mask` is 0.
Args:
logits (torch.Tensor): Inputs to the softmax function.
mas... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mayankiitg/cs224n | HighwayMaxoutNetwork | false | 4,005 | [
"MIT"
] | 0 | c67b7904101c8f19a5a231e4fe521e764470d41b | https://github.com/mayankiitg/cs224n/tree/c67b7904101c8f19a5a231e4fe521e764470d41b | import torch
import torch.nn as nn
import torch.nn.functional as F
def masked_softmax(logits, mask, dim=-1, log_softmax=False):
"""Take the softmax of `logits` over given dimension, and set
entries to 0 wherever `mask` is 0.
Args:
logits (torch.Tensor): Inputs to the softmax function.
mas... |
CoAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 masked_softmax(logits, mask, dim=-1, log_softmax=False):
"""Take the softmax of `logits` over given dimension, and set
entries to 0 wherever `mask` is 0.
Args:
logits (torch.Tensor): Inputs to the softmax function.
mas... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mayankiitg/cs224n | CoAttention | false | 4,006 | [
"MIT"
] | 0 | c67b7904101c8f19a5a231e4fe521e764470d41b | https://github.com/mayankiitg/cs224n/tree/c67b7904101c8f19a5a231e4fe521e764470d41b | import torch
import torch.nn as nn
import torch.nn.functional as F
def masked_softmax(logits, mask, dim=-1, log_softmax=False):
"""Take the softmax of `logits` over given dimension, and set
entries to 0 wherever `mask` is 0.
Args:
logits (torch.Tensor): Inputs to the softmax function.
mas... |
MySmallModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 MySmallModel(nn.Module):
def __init__(self, nodes):
super().__init__()
hidden_nodes = nodes * 2
self.fc1 = nn.Linear(nodes, hidden_nodes)
self.fc2 = nn.Linear(hidden_nodes, nodes)
self.fc3 = nn.Linear(nodes, 1)
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._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | minister19/RL_pytorch_get_started | MySmallModel | false | 4,007 | [
"MIT"
] | 0 | e444f524a14d329f9a25c53f102bc96c4ea36ad8 | https://github.com/minister19/RL_pytorch_get_started/tree/e444f524a14d329f9a25c53f102bc96c4ea36ad8 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, nodes):
super().__init__()
hidden_nodes = nodes * 2
self.fc1 = nn.Linear(nodes, hidden_nodes)
self.fc2 = nn.Linear(hidden_nodes, nodes)
self.fc3 = nn.Linear(nodes, 1)
def forward(self, x):
... |
AttentionLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import *
class AttentionLayer(nn.Module):
def __init__(self, hidden_dim_en, hidden_dim_de, projected_size):
super(AttentionLayer, self).__init__()
self.linear1 = nn.Linear(hidden_dim_en, projected_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.... | minhdo3000/visual_storytelling | AttentionLayer | false | 4,008 | [
"MIT"
] | 0 | 451c5194564fb1bb02929f57eac8f026662637b1 | https://github.com/minhdo3000/visual_storytelling/tree/451c5194564fb1bb02929f57eac8f026662637b1 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import *
class Model(nn.Module):
def __init__(self, hidden_dim_en, hidden_dim_de, projected_size):
super().__init__()
self.linear1 = nn.Linear(hidden_dim_en, projected_size)
self.linear2 = nn.Linear(hid... |
ELBOLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
class ELBOLoss(nn.Module):
def __init__(self):
super(ELBOLoss, self).__init__()
self.recons_loss = nn.BCELoss(reduction='sum')
def forward(self, reconstruction, x, mu, log_var):
loss = -self.recons_loss(reconstruction, x)
KL_loss = 0.5 * torc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | mirmohammad/IFT6135-TP3 | ELBOLoss | false | 4,009 | [
"MIT"
] | 0 | 70453b4ea695313837ab88243b0206552eb50632 | https://github.com/mirmohammad/IFT6135-TP3/tree/70453b4ea695313837ab88243b0206552eb50632 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.recons_loss = nn.BCELoss(reduction='sum')
def forward(self, reconstruction, x, mu, log_var):
loss = -self.recons_loss(reconstruction, x)
KL_loss = 0.5 * torch.sum(-1 - log_va... |
JSDLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
from torch import nn
class JSDLoss(nn.Module):
def __init__(self):
super(JSDLoss, self).__init__()
def forward(self, d_x, d_y):
return -(math.log(2.0) + 0.5 * (torch.mean(torch.log(d_x)) + torch.
mean(torch.log(1.0 - d_y))))
def get_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._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | mirmohammad/IFT6135-TP3 | JSDLoss | false | 4,010 | [
"MIT"
] | 0 | 70453b4ea695313837ab88243b0206552eb50632 | https://github.com/mirmohammad/IFT6135-TP3/tree/70453b4ea695313837ab88243b0206552eb50632 | import math
import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, d_x, d_y):
return -(math.log(2.0) + 0.5 * (torch.mean(torch.log(d_x)) + torch.
mean(torch.log(1.0 - d_y))))
def get_inputs():
return [torch.rand([4... |
Upsample | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Upsample(nn.Module):
def __init__(self, dim):
super().__init__()
self.conv = nn.ConvTranspose2d(dim, dim, 4, 2, 1)
def forward(self, x):
return self.conv(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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... | mishooax/denoising-diffusion-pytorch | Upsample | false | 4,011 | [
"MIT"
] | 0 | 54df92c06c5cb0dc3bb43232c24c492c6f5a35c7 | https://github.com/mishooax/denoising-diffusion-pytorch/tree/54df92c06c5cb0dc3bb43232c24c492c6f5a35c7 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim):
super().__init__()
self.conv = nn.ConvTranspose2d(dim, dim, 4, 2, 1)
def forward(self, x):
return self.conv(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
ret... |
Net | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv2 = nn.Conv2d(3, 64, 8, 2, 3)
self.conv3 = nn.Conv2d(64, 128, 6, 2, 2)
self.conv4 = nn.Conv2d(128, 256, 4, 2, 1)
self.conv5 = n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | leduchuy225/HairNet | Net | false | 4,012 | [
"MIT"
] | 0 | 2d3f0b82a686d2ccc7fee4429ef5925ffabd8982 | https://github.com/leduchuy225/HairNet/tree/2d3f0b82a686d2ccc7fee4429ef5925ffabd8982 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv2 = nn.Conv2d(3, 64, 8, 2, 3)
self.conv3 = nn.Conv2d(64, 128, 6, 2, 2)
self.conv4 = nn.Conv2d(128, 256, 4, 2, 1)
self.conv5 = nn.Conv2... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class Norm(nn.Module):
def __init__(self, dim_seq, input_size, eps=1e-06):
super().__init__()
self.size = input_size
self.seq = dim_seq
self.alpha = nn.Parameter(torch.ones((self.size, self.seq))... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mingweima/hintplaygame | Attention | false | 4,013 | [
"MIT"
] | 0 | 31f35a22111a2e5e7e5d8e90f92326bc784c5fe7 | https://github.com/mingweima/hintplaygame/tree/31f35a22111a2e5e7e5d8e90f92326bc784c5fe7 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class Norm(nn.Module):
def __init__(self, dim_seq, input_size, eps=1e-06):
super().__init__()
self.size = input_size
self.seq = dim_seq
self.alpha = nn.Parameter(torch.ones((self.size, self.seq))... |
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
from torch import Tensor
from torch.functional import Tensor
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, 60, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(60, 1... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | minister19/RL_pytorch_get_started | Net | false | 4,014 | [
"MIT"
] | 0 | e444f524a14d329f9a25c53f102bc96c4ea36ad8 | https://github.com/minister19/RL_pytorch_get_started/tree/e444f524a14d329f9a25c53f102bc96c4ea36ad8 | import torch
from torch import Tensor
from torch.functional import Tensor
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, 60, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(60,... |
SelfAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def masked_softmax(logits, mask, dim=-1, log_softmax=False):
"""Take the softmax of `logits` over given dimension, and set
entries to 0 wherever `mask` is 0.
Args:
logits (torch.Tensor): Inputs to the softmax fu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | mayankiitg/cs224n | SelfAttention | false | 4,015 | [
"MIT"
] | 0 | c67b7904101c8f19a5a231e4fe521e764470d41b | https://github.com/mayankiitg/cs224n/tree/c67b7904101c8f19a5a231e4fe521e764470d41b | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def masked_softmax(logits, mask, dim=-1, log_softmax=False):
"""Take the softmax of `logits` over given dimension, and set
entries to 0 wherever `mask` is 0.
Args:
logits (torch.Tensor): Inputs to the softmax fu... |
WDLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
class WDLoss(nn.Module):
def __init__(self, _lambda):
super(WDLoss, self).__init__()
self._lambda = _lambda
def forward(self, t_x, t_y, t_z):
return -(torch.mean(t_x) - torch.mean(t_y) - self._lambda * torch.
mean((torch.norm(t_z, 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 import nn
assert_... | mirmohammad/IFT6135-TP3 | WDLoss | false | 4,016 | [
"MIT"
] | 0 | 70453b4ea695313837ab88243b0206552eb50632 | https://github.com/mirmohammad/IFT6135-TP3/tree/70453b4ea695313837ab88243b0206552eb50632 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, _lambda):
super().__init__()
self._lambda = _lambda
def forward(self, t_x, t_y, t_z):
return -(torch.mean(t_x) - torch.mean(t_y) - self._lambda * torch.
mean((torch.norm(t_z, dim=1) - 1).pow(2)))... |
Linear_fil | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Linear_fil(nn.Module):
def __init__(self, input_dim, hidden_dim):
super(Linear_fil, self).__init__()
self.lin_1 = nn.Linear(input_dim, hidden_dim)
self.act = nn.ReLU()
self.lin_2 = nn.Linear(hidden_dim, 1)
self.sigmoid = nn.Sigmoid(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | mityanony404/TopGraph | Linear_fil | false | 4,017 | [
"MIT"
] | 0 | 23595ca5d3dfcd5bc5ebb771800e3fbe9a0d5eed | https://github.com/mityanony404/TopGraph/tree/23595ca5d3dfcd5bc5ebb771800e3fbe9a0d5eed | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, hidden_dim):
super().__init__()
self.lin_1 = nn.Linear(input_dim, hidden_dim)
self.act = nn.ReLU()
self.lin_2 = nn.Linear(hidden_dim, 1)
self.sigmoid = nn.Sigmoid()
def forward(se... |
SimpleStackModel | # 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.onnx
import torch.nn
class SimpleStackModel(torch.nn.Module):
def __init__(self):
super(SimpleStackModel, self).__init__()
def forward(self, a, b):
c = torch.stack((a, b), 0)
d = torch.stack((c, c), 1)
return torch.stack((d, d), 2)
def get_inputs()... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | mlupon/glow | SimpleStackModel | false | 4,018 | [
"Apache-2.0"
] | 0 | aedaa7b98617f1a2db651608e7f7c916a7d2c766 | https://github.com/mlupon/glow/tree/aedaa7b98617f1a2db651608e7f7c916a7d2c766 | import torch
import torch.onnx
import torch.nn
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, a, b):
c = torch.stack((a, b), 0)
d = torch.stack((c, c), 1)
return torch.stack((d, d), 2)
def get_inputs():
return [torch.rand([4, 4, 4... |
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
class Net(nn.Module):
def __init__(self, input_dim, output_dim, hidden_dim=None, barcode_dim=0):
super().__init__()
if hidden_dim is None:
hidden_dim = [250, 100]
self.fc1 = nn.Linear(input_dim, hidden_dim[0])
self.act = nn.ReLU()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | mityanony404/TopGraph | Net | false | 4,019 | [
"MIT"
] | 0 | 23595ca5d3dfcd5bc5ebb771800e3fbe9a0d5eed | https://github.com/mityanony404/TopGraph/tree/23595ca5d3dfcd5bc5ebb771800e3fbe9a0d5eed | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, output_dim, hidden_dim=None, barcode_dim=0):
super().__init__()
if hidden_dim is None:
hidden_dim = [250, 100]
self.fc1 = nn.Linear(input_dim, hidden_dim[0])
self.act = nn.ReLU()
... |
SimpleSliceModel | # 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.onnx
import torch.nn
class SimpleSliceModel(torch.nn.Module):
def __init__(self):
super(SimpleSliceModel, self).__init__()
def forward(self, tensor):
other = (tensor + tensor)[1:]
return other[0][1:]
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
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | mlupon/glow | SimpleSliceModel | false | 4,020 | [
"Apache-2.0"
] | 0 | aedaa7b98617f1a2db651608e7f7c916a7d2c766 | https://github.com/mlupon/glow/tree/aedaa7b98617f1a2db651608e7f7c916a7d2c766 | import torch
import torch.onnx
import torch.nn
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, tensor):
other = (tensor + tensor)[1:]
return other[0][1:]
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
retu... |
CAM_Module | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
import torch.utils.data
import torch
from torch.nn import Parameter
from torch.nn import Softmax
class CAM_Module(Module):
""" Channel attention module"""
def __init__(self, in_dim):
super(CAM_Module, self).__init__()
self.chanel_in = in_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.... | mlcb-jlu/wsMedSeg | CAM_Module | false | 4,021 | [
"MIT"
] | 0 | 63bd1fd28583f11444f292f4b961870ea1b12635 | https://github.com/mlcb-jlu/wsMedSeg/tree/63bd1fd28583f11444f292f4b961870ea1b12635 | from torch.nn import Module
import torch
import torch.utils.data
import torch
from torch.nn import Parameter
from torch.nn import Softmax
class Model(Module):
""" Channel attention module"""
def __init__(self, in_dim):
super().__init__()
self.chanel_in = in_dim
self.gamma = Parameter(... |
Homoscedastic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
class Homoscedastic(torch.nn.Module):
"""https://arxiv.homoscedasticorg/abs/1705.07115"""
def __init__(self, n_tasks, reduction='sum'):
super(Homoscedastic, self).__init__()
self.n_tasks = n_tasks
self.log_vars = torch.nn.Parameter(torch.zeros(self.n_tasks))
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, math as tl_math
assert_size... | moelmahdy/JRS-MTL | Homoscedastic | false | 4,022 | [
"BSD-3-Clause"
] | 0 | 5abec9e06dad2721929738b1734350ed847e9d5a | https://github.com/moelmahdy/JRS-MTL/tree/5abec9e06dad2721929738b1734350ed847e9d5a | import torch
class Model(torch.nn.Module):
"""https://arxiv.homoscedasticorg/abs/1705.07115"""
def __init__(self, n_tasks, reduction='sum'):
super().__init__()
self.n_tasks = n_tasks
self.log_vars = torch.nn.Parameter(torch.zeros(self.n_tasks))
self.reduction = reduction
... |
Model | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim):
super(Model, self).__init__()
self.layer1 = nn.Linear(input_dim, 50)
self.layer2 = nn.Linear(50, 20)
self.layer3 = nn.Linear(20, 1)
def forward(self, x):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | mlsquare/kitchen | Model | false | 4,023 | [
"MIT"
] | 0 | 3664fd289f7ea5c20cdd55e96ebe29b77effa062 | https://github.com/mlsquare/kitchen/tree/3664fd289f7ea5c20cdd55e96ebe29b77effa062 | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim):
super(Model, self).__init__()
self.layer1 = nn.Linear(input_dim, 50)
self.layer2 = nn.Linear(50, 20)
self.layer3 = nn.Linear(20, 1)
def forward(self, x):
... |
CDAE | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.autograd import Variable
def add_gaussian_noise(x, std):
return x + Variable(x.data.new(x.size()).normal_(0, std))
class CDAE(nn.Module):
"""
Convolutional denoising autoencoder layer for stacked autoencoders.
Args:
in_channels: the number of cha... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | mmcenta/eye-disease-recognition | CDAE | false | 4,025 | [
"MIT"
] | 0 | 52e1dedbce27514b605b9f8ad976d6042b7e2f14 | https://github.com/mmcenta/eye-disease-recognition/tree/52e1dedbce27514b605b9f8ad976d6042b7e2f14 | import torch
from torch import nn
from torch.autograd import Variable
def add_gaussian_noise(x, std):
return x + Variable(x.data.new(x.size()).normal_(0, std))
class Model(nn.Module):
"""
Convolutional denoising autoencoder layer for stacked autoencoders.
Args:
in_channels: the number of ch... |
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch.nn import Linear
from torch.nn import Sigmoid
from torch.nn import ReLU
from torch.nn.init import kaiming_normal
from torch.nn.init import xavier_normal
class MLP(Module):
def __init__(self, n_inputs):
super(MLP, self).__init__()
self.hidden1 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
f... | mmg63/Pytorch-Code-for-Binary-classification | MLP | false | 4,026 | [
"MIT"
] | 0 | 773e909fcba41cdaba48c96e35da68acaf64c513 | https://github.com/mmg63/Pytorch-Code-for-Binary-classification/tree/773e909fcba41cdaba48c96e35da68acaf64c513 | from torch.nn import Module
import torch
from torch.nn import Linear
from torch.nn import Sigmoid
from torch.nn import ReLU
from torch.nn.init import kaiming_normal
from torch.nn.init import xavier_normal
class Model(Module):
def __init__(self, n_inputs):
super().__init__()
self.hidden1 = Linear(... |
ConvNeuralNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ConvNeuralNetwork(nn.Module):
def __init__(self, num_classes=3):
super(ConvNeuralNetwork, self).__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=12, kernel_size=
3, stride=1, padding=1)
self.conv2 = nn.Conv2d(in_channels=12... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | mngaonkar/pytorch-image-classifier | ConvNeuralNetwork | false | 4,027 | [
"MIT"
] | 0 | f10b4363dc62c2fbbb5fbfbc56a3849da623fc80 | https://github.com/mngaonkar/pytorch-image-classifier/tree/f10b4363dc62c2fbbb5fbfbc56a3849da623fc80 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_classes=3):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=12, kernel_size=
3, stride=1, padding=1)
self.conv2 = nn.Conv2d(in_channels=12, out_channels=12, kernel_size
... |
AffineTransform | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 FC(nn.Module):
def __init__(self, n_dim_in, n_dim_out, equal_lr=True):
super().__init__()
norm_const = n_dim_in ** -0.5
scale_init = 1 if equal_lr else norm_const
self.scale_forward = norm_const if equal_lr else 1
self.weight = nn.Pa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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... | moritztng/stylegan2-pytorch | AffineTransform | false | 4,028 | [
"MIT"
] | 0 | 8827eae2e76c54b7406b34b2d49563ae53b04001 | https://github.com/moritztng/stylegan2-pytorch/tree/8827eae2e76c54b7406b34b2d49563ae53b04001 | import torch
from torch import nn
class FC(nn.Module):
def __init__(self, n_dim_in, n_dim_out, equal_lr=True):
super().__init__()
norm_const = n_dim_in ** -0.5
scale_init = 1 if equal_lr else norm_const
self.scale_forward = norm_const if equal_lr else 1
self.weight = nn.Pa... |
NeuralNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class NeuralNetwork(nn.Module):
def __init__(self, num_classes=3):
super(NeuralNetwork, self).__init__()
self.fc1 = nn.Linear(64 * 64 * 3, 84)
self.fc2 = nn.Linear(84, 50)
self.fc3 = nn.Linear(50, num_classes)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | mngaonkar/pytorch-image-classifier | NeuralNetwork | false | 4,029 | [
"MIT"
] | 0 | f10b4363dc62c2fbbb5fbfbc56a3849da623fc80 | https://github.com/mngaonkar/pytorch-image-classifier/tree/f10b4363dc62c2fbbb5fbfbc56a3849da623fc80 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_classes=3):
super().__init__()
self.fc1 = nn.Linear(64 * 64 * 3, 84)
self.fc2 = nn.Linear(84, 50)
self.fc3 = nn.Linear(50, num_classes)
def forward(self, x):
... |
Conv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Conv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, equal_lr=True):
super().__init__()
self.stride = stride
self.padding = padding
self.dilation = dilation
norm_const =... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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... | moritztng/stylegan2-pytorch | Conv | false | 4,030 | [
"MIT"
] | 0 | 8827eae2e76c54b7406b34b2d49563ae53b04001 | https://github.com/moritztng/stylegan2-pytorch/tree/8827eae2e76c54b7406b34b2d49563ae53b04001 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, equal_lr=True):
super().__init__()
self.stride = stride
self.padding = padding
self.dilation = dilation
norm_const ... |
_Classifier | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class _Classifier(nn.Module):
def __init__(self, z_c_dim):
super(_Classifier, self).__init__()
self.fc1 = nn.Linear(z_c_dim, 50)
self.fc2 = nn.Linear(50, 10)
def forward(self, z_c):
h =... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | mori97/revae | _Classifier | false | 4,031 | [
"MIT"
] | 0 | 465009076a9be78e8ddb9021a0699b32fc695f30 | https://github.com/mori97/revae/tree/465009076a9be78e8ddb9021a0699b32fc695f30 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Model(nn.Module):
def __init__(self, z_c_dim):
super().__init__()
self.fc1 = nn.Linear(z_c_dim, 50)
self.fc2 = nn.Linear(50, 10)
def forward(self, z_c):
h = F.relu(self.fc1(z_c))
... |
Distance | # 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 Distance(nn.Module):
def __init__(self):
super(Distance, self).__init__()
def forward(self, s, t):
n, q = s.shape[0], t.shape[0]
dist = (t.unsqueeze(0).expand(n, q, -1) - s.unsqueeze(1).expand(n,
q, -1)).pow(2).sum(dim=2).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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | msc5/ml-tools | Distance | false | 4,032 | [
"Apache-2.0"
] | 0 | 75ca504bdc0495e8a929ad73501b7de692b3089a | https://github.com/msc5/ml-tools/tree/75ca504bdc0495e8a929ad73501b7de692b3089a | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, s, t):
n, q = s.shape[0], t.shape[0]
dist = (t.unsqueeze(0).expand(n, q, -1) - s.unsqueeze(1).expand(n,
q, -1)).pow(2).sum(dim=2).T
return dist
de... |
SimpleConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SimpleConv(nn.Module):
def __init__(self, in_size):
super(SimpleConv, self).__init__()
self.conv = nn.Conv2d(in_size, 6, 3, padding='same')
self.relu = nn.ReLU()
def forward(self, x):
x = self.conv(x)
x = self.relu(x)
r... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | msc5/ml-tools | SimpleConv | false | 4,033 | [
"Apache-2.0"
] | 0 | 75ca504bdc0495e8a929ad73501b7de692b3089a | https://github.com/msc5/ml-tools/tree/75ca504bdc0495e8a929ad73501b7de692b3089a | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_size):
super().__init__()
self.conv = nn.Conv2d(in_size, 6, 3, padding='same')
self.relu = nn.ReLU()
def forward(self, x):
x = self.conv(x)
x = self.relu(x)
return x
def get_inp... |
_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.nn as nn
import torch.nn.functional as F
import torch.utils.data
class _Decoder(nn.Module):
def __init__(self, z_dim):
super(_Decoder, self).__init__()
self.fc1 = nn.Linear(z_dim, 600)
self.fc2 = nn.Linear(600, 600)
self.fc3 = nn.Linear(600, 784)
def... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | mori97/revae | _Decoder | false | 4,034 | [
"MIT"
] | 0 | 465009076a9be78e8ddb9021a0699b32fc695f30 | https://github.com/mori97/revae/tree/465009076a9be78e8ddb9021a0699b32fc695f30 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Model(nn.Module):
def __init__(self, z_dim):
super().__init__()
self.fc1 = nn.Linear(z_dim, 600)
self.fc2 = nn.Linear(600, 600)
self.fc3 = nn.Linear(600, 784)
def forward(self, z)... |
AGELU | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.utils.data
import torch.cuda
import torch.utils.checkpoint
def agelu(x):
SQRT_M2_PI = math.sqrt(2 / math.pi)
COEFF = 0.044715
return 0.5 * x * (1.0 + torch.tanh(SQRT_M2_PI * (x + COEFF * torch.pow(
x, 3))))
class AGELU(torch.nn.Module):
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 math
import torch.utils.data
import torch.cuda
import torch.utils.checkp... | mullovc/NMTGMinor | AGELU | false | 4,035 | [
"MIT"
] | 0 | b1b7b1e018eaa0d99a43449655937cc050a29987 | https://github.com/mullovc/NMTGMinor/tree/b1b7b1e018eaa0d99a43449655937cc050a29987 | import math
import torch
import torch.utils.data
import torch.cuda
import torch.utils.checkpoint
def agelu(x):
SQRT_M2_PI = math.sqrt(2 / math.pi)
COEFF = 0.044715
return 0.5 * x * (1.0 + torch.tanh(SQRT_M2_PI * (x + COEFF * torch.pow(
x, 3))))
class Model(torch.nn.Module):
def forward(self... |
LinReLU | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 torch.nn.parameter import Parameter
class LinReLU(torch.nn.Module):
__constants__ = ['bias']
def __init__(self, in_features: 'int', out_features: 'int') ->None:
super(LinReLU, self).__init__()
self.in_features = in_feature... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | mrahman93/nam | LinReLU | false | 4,036 | [
"MIT"
] | 0 | 1a2f286a87ffa024040e3330088b4a375700c1c6 | https://github.com/mrahman93/nam/tree/1a2f286a87ffa024040e3330088b4a375700c1c6 | import torch
from torch import nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
class Model(torch.nn.Module):
__constants__ = ['bias']
def __init__(self, in_features: 'int', out_features: 'int') ->None:
super().__init__()
self.in_features = in_features
self.... |
ExU | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
from torch.nn.parameter import Parameter
class ExU(torch.nn.Module):
def __init__(self, in_features: 'int', out_features: 'int') ->None:
super(ExU, self).__init__()
self.in_features = in_features
self.out_features = out_features
self.we... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mrahman93/nam | ExU | false | 4,037 | [
"MIT"
] | 0 | 1a2f286a87ffa024040e3330088b4a375700c1c6 | https://github.com/mrahman93/nam/tree/1a2f286a87ffa024040e3330088b4a375700c1c6 | import torch
import torch.nn.functional as F
from torch.nn.parameter import Parameter
class Model(torch.nn.Module):
def __init__(self, in_features: 'int', out_features: 'int') ->None:
super().__init__()
self.in_features = in_features
self.out_features = out_features
self.weights =... |
ReLUDropout | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torch.cuda
import torch.utils.checkpoint
def relu_dropout(x, p=0, training=False, variational=False, batch_first=False):
if not training or p == 0:
return x.clamp_(min=0)
p1m = 1 - p
if variational:
if batch_first:
mask = torch.rand_l... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
import torch.cuda
import torch.utils.checkpoint
assert_size_strid... | mullovc/NMTGMinor | ReLUDropout | false | 4,038 | [
"MIT"
] | 0 | b1b7b1e018eaa0d99a43449655937cc050a29987 | https://github.com/mullovc/NMTGMinor/tree/b1b7b1e018eaa0d99a43449655937cc050a29987 | import torch
import torch.utils.data
import torch.cuda
import torch.utils.checkpoint
def relu_dropout(x, p=0, training=False, variational=False, batch_first=False):
if not training or p == 0:
return x.clamp_(min=0)
p1m = 1 - p
if variational:
if batch_first:
mask = torch.rand_l... |
MLMTaskHead | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Linear
from torch.nn import LayerNorm
class MLMTaskHead(nn.Module):
def __init__(self, ntoken, ninp):
super().__init__()
self.mlm_span = Linear(ninp, ninp)
self.activation = F.gelu
self.norm_la... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | mrshenli/pipeline_experiments | MLMTaskHead | false | 4,039 | [
"MIT"
] | 0 | 09386ab70386a1f4b49ae078c132f4037a887f9b | https://github.com/mrshenli/pipeline_experiments/tree/09386ab70386a1f4b49ae078c132f4037a887f9b | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Linear
from torch.nn import LayerNorm
class Model(nn.Module):
def __init__(self, ntoken, ninp):
super().__init__()
self.mlm_span = Linear(ninp, ninp)
self.activation = F.gelu
self.norm_layer = ... |
SimpleTextClassifier | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SimpleTextClassifier(nn.Module):
"""Text Classifier with 1 hidden layer
"""
def __init__(self, num_labels, vocab_size):
super(SimpleTextClassifier, self).__init__()
self.linear1 = nn.Linear(vocab_size, 128)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mtfelix/pytorch_active_learning | SimpleTextClassifier | false | 4,040 | [
"MIT"
] | 0 | 495f20c9cf5100cf2a100f4a4c6103e05fb62ca2 | https://github.com/mtfelix/pytorch_active_learning/tree/495f20c9cf5100cf2a100f4a4c6103e05fb62ca2 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""Text Classifier with 1 hidden layer
"""
def __init__(self, num_labels, vocab_size):
super().__init__()
self.linear1 = nn.Linear(vocab_size, 128)
self.linear2 = nn.Linear(128, num_labels... |
ScaledDotProductAttention | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropout)
def forward(self, q, k, v, mask=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | muberraozmen/MrMP | ScaledDotProductAttention | false | 4,041 | [
"MIT"
] | 0 | da6bcccbad85a682c848ff4aa1121c773d779e57 | https://github.com/muberraozmen/MrMP/tree/da6bcccbad85a682c848ff4aa1121c773d779e57 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropout)
def forward(self, q, k, v, mask=None):
attn ... |
Gaussian | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import Tensor
import torch.utils.tensorboard
import torch.utils.data
class Gaussian(torch.nn.Module):
"""Gaussian activation"""
def forward(self, x: 'Tensor') ->Tensor:
return torch.exp(-x * x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_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 math as tl_math
import torch.utils.tensorboard
import torch.utils.data
assert_size_stride... | cdever01/torchani | Gaussian | false | 4,042 | [
"MIT"
] | 0 | 3f7e1347a06422f50010c04a65219e22f2179bfa | https://github.com/cdever01/torchani/tree/3f7e1347a06422f50010c04a65219e22f2179bfa | import torch
from torch import Tensor
import torch.utils.tensorboard
import torch.utils.data
class Model(torch.nn.Module):
"""Gaussian activation"""
def forward(self, x: 'Tensor') ->Tensor:
return torch.exp(-x * x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
... |
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(1, 32, 5)
self.conv2 = nn.Conv2d(32, 64, 5)
self.conv3 = nn.Conv2d(64, 128, 5)
self.fc1 = nn.Linear(512, 512)
self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | mmayers88/learn_pytorch | Net | false | 4,043 | [
"MIT"
] | 0 | 0dbc1aed24d869109feb23bfa6e970686cf485e3 | https://github.com/mmayers88/learn_pytorch/tree/0dbc1aed24d869109feb23bfa6e970686cf485e3 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 32, 5)
self.conv2 = nn.Conv2d(32, 64, 5)
self.conv3 = nn.Conv2d(64, 128, 5)
self.fc1 = nn.Linear(512, 512)
se... |
AttNLocalNew | # 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 AttNLocalNew(nn.Module):
"""
自动限制矩阵
实现斜对角线保留权重,其他的设为-inf
"""
def __init__(self, maxlen=128, limit=20):
super(AttNLocalNew, self).__init__()
self.limit = limit
self.maxlen = maxlen
pass
def forward(self, x):
m... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_index_put_lift_fres... | napoler/tkit-attnlocal-pytorch | AttNLocalNew | false | 4,044 | [
"Apache-2.0"
] | 0 | ec1c32cb49635824f978b3ec19b4c80505ea735b | https://github.com/napoler/tkit-attnlocal-pytorch/tree/ec1c32cb49635824f978b3ec19b4c80505ea735b | import torch
import torch.nn as nn
class Model(nn.Module):
"""
自动限制矩阵
实现斜对角线保留权重,其他的设为-inf
"""
def __init__(self, maxlen=128, limit=20):
super().__init__()
self.limit = limit
self.maxlen = maxlen
pass
def forward(self, x):
mask = torch.ones_like(x).... |
my_MLP2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 my_MLP2(nn.Module):
def __init__(self, input_dim, output_dim, softmax_type='vanilla'):
super().__init__()
self.input = nn.Linear(input_dim, 128)
self.hidden1 = nn.Linear(128, 128)
self.hidden2 = nn.Linear(128... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mtcarilli/CME_approximations | my_MLP2 | false | 4,045 | [
"MIT"
] | 0 | 1ffd1cc0bd17679116964ee33634c0d76c50064e | https://github.com/mtcarilli/CME_approximations/tree/1ffd1cc0bd17679116964ee33634c0d76c50064e | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim, output_dim, softmax_type='vanilla'):
super().__init__()
self.input = nn.Linear(input_dim, 128)
self.hidden1 = nn.Linear(128, 128)
self.hidden2 = nn.Linear(128, ... |
my_MLP1 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 my_MLP1(nn.Module):
def __init__(self, input_dim, npdf, h1_dim, h2_dim, norm_type='softmax'):
super().__init__()
self.input = nn.Linear(input_dim, h1_dim)
self.hidden = nn.Linear(h1_dim, h2_dim)
self.output = nn.Linear(h2_dim, npdf)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | mtcarilli/CME_approximations | my_MLP1 | false | 4,046 | [
"MIT"
] | 0 | 1ffd1cc0bd17679116964ee33634c0d76c50064e | https://github.com/mtcarilli/CME_approximations/tree/1ffd1cc0bd17679116964ee33634c0d76c50064e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, npdf, h1_dim, h2_dim, norm_type='softmax'):
super().__init__()
self.input = nn.Linear(input_dim, h1_dim)
self.hidden = nn.Linear(h1_dim, h2_dim)
self.output = nn.Linear(h2_dim, npdf)
s... |
R2CNNattetion | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils.data
class R2CNNattetion(nn.Module):
def __init__(self):
super(R2CNNattetion, self).__init__()
self.pool1 = nn.MaxPool2d(kernel_size=1)
self.pool2 = nn.MaxPool2d(kernel_size=2)
self.pool3 = nn.MaxPool2d(kernel_size=4)
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
import ... | leobean/CenterNet_simple | R2CNNattetion | false | 4,047 | [
"MIT"
] | 0 | 13e2eab2c049563afde5defdf90434a310a32d02 | https://github.com/leobean/CenterNet_simple/tree/13e2eab2c049563afde5defdf90434a310a32d02 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self):
super().__init__()
self.pool1 = nn.MaxPool2d(kernel_size=1)
self.pool2 = nn.MaxPool2d(kernel_size=2)
self.pool3 = nn.MaxPool2d(kernel_size=4)
self.deconv2 = nn.ConvTransp... |
CustomInverse | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class CustomInverse(torch.nn.Module):
def forward(self, x, y):
ress = torch.inverse(x) + x
return ress, torch.all(y)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | natke/onnxruntime-extensions | CustomInverse | false | 4,048 | [
"MIT"
] | 0 | e7b7eb596016242a7e913044e889c4a0d7dc1000 | https://github.com/natke/onnxruntime-extensions/tree/e7b7eb596016242a7e913044e889c4a0d7dc1000 | import torch
class Model(torch.nn.Module):
def forward(self, x, y):
ress = torch.inverse(x) + x
return ress, torch.all(y)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
Out | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
class Out(nn.Module):
def forward(self, out):
out_std = torch.sqrt(out.var(0, unbiased=False) + 1e-08)
mean_std = out_std.mean()
mean_std = mean_std.expand(out.size(0), 1, 4, 4)
out = torch.cat((out, mean_std), 1)
return out
def get_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._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | nazarblch/style-based-gan-pytorch | Out | false | 4,049 | [
"MIT"
] | 0 | 5ed7fa114904501d77b414921cd9f439773ba24c | https://github.com/nazarblch/style-based-gan-pytorch/tree/5ed7fa114904501d77b414921cd9f439773ba24c | import torch
from torch import nn
class Model(nn.Module):
def forward(self, out):
out_std = torch.sqrt(out.var(0, unbiased=False) + 1e-08)
mean_std = out_std.mean()
mean_std = mean_std.expand(out.size(0), 1, 4, 4)
out = torch.cat((out, mean_std), 1)
return out
def get_in... |
TwoArgNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 TwoArgNet(nn.Module):
def __init__(self, inc, outc):
super().__init__()
self.layer = nn.Linear(inc, outc)
def forward(self, t1, t2):
return self.layer(torch.cat((t1, t2), dim=1)).sigmoid()
def get_inputs():
return [torch.rand([4, 4, 4, 4]... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | nazarblch/style-based-gan-pytorch | TwoArgNet | false | 4,050 | [
"MIT"
] | 0 | 5ed7fa114904501d77b414921cd9f439773ba24c | https://github.com/nazarblch/style-based-gan-pytorch/tree/5ed7fa114904501d77b414921cd9f439773ba24c | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, inc, outc):
super().__init__()
self.layer = nn.Linear(inc, outc)
def forward(self, t1, t2):
return self.layer(torch.cat((t1, t2), dim=1)).sigmoid()
def get_inputs():
return [torch.rand([4, 4, 4, 4]), t... |
FusedUpsample | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from torch.nn import functional as F
from math import sqrt
class FusedUpsample(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, padding=0):
super().__init__()
weight = torch.randn(in_channel, out_channel, kernel_size, kernel_size)
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 import nn
from math import sqrt
assert_size_stride = torch._C._dynamo... | nazarblch/style-based-gan-pytorch | FusedUpsample | false | 4,051 | [
"MIT"
] | 0 | 5ed7fa114904501d77b414921cd9f439773ba24c | https://github.com/nazarblch/style-based-gan-pytorch/tree/5ed7fa114904501d77b414921cd9f439773ba24c | import torch
from torch import nn
from torch.nn import functional as F
from math import sqrt
class Model(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, padding=0):
super().__init__()
weight = torch.randn(in_channel, out_channel, kernel_size, kernel_size)
bias = torch... |
MultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class XavierLinear(nn.Module):
def __init__(self, d_in, d_out, bias=True):
super().__init__()
self.linear = nn.Linear(d_in, d_out, bias=bias)
nn.init.xavier_normal_(self.linear.weight)
def forward(self, x):
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._inductor.runtime.... | muberraozmen/MrMP | MultiHeadAttention | false | 4,052 | [
"MIT"
] | 0 | da6bcccbad85a682c848ff4aa1121c773d779e57 | https://github.com/muberraozmen/MrMP/tree/da6bcccbad85a682c848ff4aa1121c773d779e57 | import torch
import torch.nn as nn
import torch.nn.functional as F
class XavierLinear(nn.Module):
def __init__(self, d_in, d_out, bias=True):
super().__init__()
self.linear = nn.Linear(d_in, d_out, bias=bias)
nn.init.xavier_normal_(self.linear.weight)
def forward(self, x):
re... |
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 torch
import torch.nn as nn
import torch.nn.functional as F
class XavierLinear(nn.Module):
def __init__(self, d_in, d_out, bias=True):
super().__init__()
self.linear = nn.Linear(d_in, d_out, bias=bias)
nn.init.xavier_normal_(self.linear.weight)
def forward(self, x):
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._inductor.runtime.... | muberraozmen/MrMP | DecoderLayer | false | 4,053 | [
"MIT"
] | 0 | da6bcccbad85a682c848ff4aa1121c773d779e57 | https://github.com/muberraozmen/MrMP/tree/da6bcccbad85a682c848ff4aa1121c773d779e57 | import torch
import torch.nn as nn
import torch.nn.functional as F
class XavierLinear(nn.Module):
def __init__(self, d_in, d_out, bias=True):
super().__init__()
self.linear = nn.Linear(d_in, d_out, bias=bias)
nn.init.xavier_normal_(self.linear.weight)
def forward(self, x):
re... |
BiAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class BiAttention(nn.Module):
def __init__(self, input_size, dropout):
super().__init__()
self.dropout = nn.Dropout(p=dropout)
self.input_linear = nn.Linear(input_size, 1, bias=False)
self.m... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | mwakaba2/KOBE | BiAttention | false | 4,054 | [
"MIT"
] | 0 | e225e78fb18b5fc9785d521a3cd611fff3eaaf87 | https://github.com/mwakaba2/KOBE/tree/e225e78fb18b5fc9785d521a3cd611fff3eaaf87 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Model(nn.Module):
def __init__(self, input_size, dropout):
super().__init__()
self.dropout = nn.Dropout(p=dropout)
self.input_linear = nn.Linear(input_size, 1, bias=False)
self.memory_... |
FusedDownsample | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from torch.nn import functional as F
from math import sqrt
class FusedDownsample(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, padding=0):
super().__init__()
weight = torch.randn(out_channel, in_channel, kernel_size, kernel_size)
bi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from math import sqrt
assert_size_stride = torch._C._dynamo... | nazarblch/style-based-gan-pytorch | FusedDownsample | false | 4,055 | [
"MIT"
] | 0 | 5ed7fa114904501d77b414921cd9f439773ba24c | https://github.com/nazarblch/style-based-gan-pytorch/tree/5ed7fa114904501d77b414921cd9f439773ba24c | import torch
from torch import nn
from torch.nn import functional as F
from math import sqrt
class Model(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, padding=0):
super().__init__()
weight = torch.randn(out_channel, in_channel, kernel_size, kernel_size)
bias = torch... |
DeiTOutput | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.checkpoint
class DeiTOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.intermediate_size, config.hidden_size)
self.dropout = nn.Dropout(config.h... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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.checkpoint
assert_size_stride = torch._C... | ncoop57/transformers | DeiTOutput | false | 4,056 | [
"Apache-2.0"
] | 0 | d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | https://github.com/ncoop57/transformers/tree/d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.checkpoint
class Model(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.intermediate_size, config.hidden_size)
self.dropout = nn.Dropout(config.hidden... |
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 torch
import torch.nn as nn
import torch.nn.functional as F
class XavierLinear(nn.Module):
def __init__(self, d_in, d_out, bias=True):
super().__init__()
self.linear = nn.Linear(d_in, d_out, bias=bias)
nn.init.xavier_normal_(self.linear.weight)
def forward(self, x):
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._inductor.runtime.... | muberraozmen/MrMP | EncoderLayer | false | 4,057 | [
"MIT"
] | 0 | da6bcccbad85a682c848ff4aa1121c773d779e57 | https://github.com/muberraozmen/MrMP/tree/da6bcccbad85a682c848ff4aa1121c773d779e57 | import torch
import torch.nn as nn
import torch.nn.functional as F
class XavierLinear(nn.Module):
def __init__(self, d_in, d_out, bias=True):
super().__init__()
self.linear = nn.Linear(d_in, d_out, bias=bias)
nn.init.xavier_normal_(self.linear.weight)
def forward(self, x):
re... |
ConvDropoutLayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.checkpoint
class SqueezeBertLayerNorm(nn.LayerNorm):
"""
This is a nn.LayerNorm subclass that accepts NCW data layout and performs normalization in the C dimension.
N = batch C = channels W = sequence length
"""
def __init__(self, hidden_size,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | ncoop57/transformers | ConvDropoutLayerNorm | false | 4,058 | [
"Apache-2.0"
] | 0 | d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | https://github.com/ncoop57/transformers/tree/d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | import torch
from torch import nn
import torch.utils.checkpoint
class SqueezeBertLayerNorm(nn.LayerNorm):
"""
This is a nn.LayerNorm subclass that accepts NCW data layout and performs normalization in the C dimension.
N = batch C = channels W = sequence length
"""
def __init__(self, hidden_size,... |
DeiTEmbeddings | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 collections
import torch
from torch import nn
import torch.utils.checkpoint
import collections.abc
def to_2tuple(x):
if isinstance(x, collections.abc.Iterable):
return x
return x, x
class PatchEmbeddings(nn.Module):
"""
Image to Patch Embe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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 collections
from torch import nn
import torch.utils.checkpoint
import col... | ncoop57/transformers | DeiTEmbeddings | false | 4,059 | [
"Apache-2.0"
] | 0 | d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | https://github.com/ncoop57/transformers/tree/d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | from _paritybench_helpers import _mock_config
import collections
import torch
from torch import nn
import torch.utils.checkpoint
import collections.abc
def to_2tuple(x):
if isinstance(x, collections.abc.Iterable):
return x
return x, x
class PatchEmbeddings(nn.Module):
"""
Image to Patch Embe... |
PerceptronTanh | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 PerceptronTanh(nn.Module):
"""Implements a 1-layer perceptron with Tanh activaton."""
def __init__(self, input_dimension, hidden_dimension, output_dimension):
super(PerceptronTanh, self).__init__()
self._layer1 = nn.Line... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | negotiatorvivian/PDP-SP | PerceptronTanh | false | 4,060 | [
"MIT"
] | 0 | 0fa4c1145c2b881c1fde4ed8d9f0845b7967f857 | https://github.com/negotiatorvivian/PDP-SP/tree/0fa4c1145c2b881c1fde4ed8d9f0845b7967f857 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""Implements a 1-layer perceptron with Tanh activaton."""
def __init__(self, input_dimension, hidden_dimension, output_dimension):
super().__init__()
self._layer1 = nn.Linear(input_dimension, hidden_di... |
CanineSelfAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
import torch.utils.checkpoint
class CanineSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if (config.hidden_size % config.num_attention_heads != 0 and not
hasattr(confi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | ncoop57/transformers | CanineSelfAttention | false | 4,061 | [
"Apache-2.0"
] | 0 | d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | https://github.com/ncoop57/transformers/tree/d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
import torch.utils.checkpoint
class Model(nn.Module):
def __init__(self, config):
super().__init__()
if (config.hidden_size % config.num_attention_heads != 0 and not
hasattr(config, 'embedding_... |
Model | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
keep_rate = 0.5
self.conv1 = nn.Conv2d(in_channels=1, out_channels=16, kernel_size=
3, stride=1, padding='same', bias=True)
self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | mntalha/U-NET_Iplementation | Model | false | 4,062 | [
"MIT"
] | 0 | 7fc2a34352f02a4989659053a6dd8717134913a0 | https://github.com/mntalha/U-NET_Iplementation/tree/7fc2a34352f02a4989659053a6dd8717134913a0 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
keep_rate = 0.5
self.conv1 = nn.Conv2d(in_channels=1, out_channels=16, kernel_size=
3, stride=1, padding='same', bias=True)
self... |
DeconvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 DeconvBlock(nn.Module):
def __init__(self, in_channels, out_channels):
super(DeconvBlock, self).__init__()
self.conv = nn.ConvTranspose2d(in_channels, out_channels,
kernel_size=3, stride=2, padding=1, output_padding=0)
self.pad = nn.Ref... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | maxuanquang/FeatDepth | DeconvBlock | false | 4,063 | [
"MIT"
] | 0 | cc68d9f1f49b65ace8f2918af5b9d552ecd80ba4 | https://github.com/maxuanquang/FeatDepth/tree/cc68d9f1f49b65ace8f2918af5b9d552ecd80ba4 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.conv = nn.ConvTranspose2d(in_channels, out_channels,
kernel_size=3, stride=2, padding=1, output_padding=0)
self.pad = nn.ReflectionPad2d((0, 1, 0, ... |
BasicModel | # 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 BasicModel(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input):
input = 1 - F.relu(1 - input)
return input
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_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 import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | ngduduong/captum | BasicModel | false | 4,064 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input):
input = 1 - F.relu(1 - input)
return input
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
... |
Perceptron | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Perceptron(nn.Module):
"""Implements a 1-layer perceptron."""
def __init__(self, input_dimension, hidden_dimension, output_dimension):
super(Perceptron, self).__init__()
self._layer1 = nn.Linear(input_dimension, hidden_d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | negotiatorvivian/PDP-SP | Perceptron | false | 4,065 | [
"MIT"
] | 0 | 0fa4c1145c2b881c1fde4ed8d9f0845b7967f857 | https://github.com/negotiatorvivian/PDP-SP/tree/0fa4c1145c2b881c1fde4ed8d9f0845b7967f857 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""Implements a 1-layer perceptron."""
def __init__(self, input_dimension, hidden_dimension, output_dimension):
super().__init__()
self._layer1 = nn.Linear(input_dimension, hidden_dimension)
sel... |
Conv5x5 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Conv5x5(nn.Module):
def __init__(self, in_channels, out_channels, use_refl=True):
super(Conv5x5, self).__init__()
if use_refl:
self.pad = nn.ReflectionPad2d(2)
else:
self.pad = nn.ZeroPad2d(2)
self.conv = nn.Conv2d(i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | maxuanquang/FeatDepth | Conv5x5 | false | 4,066 | [
"MIT"
] | 0 | cc68d9f1f49b65ace8f2918af5b9d552ecd80ba4 | https://github.com/maxuanquang/FeatDepth/tree/cc68d9f1f49b65ace8f2918af5b9d552ecd80ba4 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, use_refl=True):
super().__init__()
if use_refl:
self.pad = nn.ReflectionPad2d(2)
else:
self.pad = nn.ZeroPad2d(2)
self.conv = nn.Conv2d(int(in_channels)... |
BasicModel4_MultiArgs | # 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 BasicModel4_MultiArgs(nn.Module):
"""
Slightly modified example model from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1 - 1) - ReLU(x2) / x3)
"""
def __init__(self):
super()... | 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... | ngduduong/captum | BasicModel4_MultiArgs | false | 4,067 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Slightly modified example model from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1 - 1) - ReLU(x2) / x3)
"""
def __init__(self):
super().__init__()
... |
MultiRelu | # 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 MultiRelu(nn.Module):
def __init__(self, inplace=False):
super().__init__()
self.relu1 = nn.ReLU(inplace=inplace)
self.relu2 = nn.ReLU(inplace=inplace)
def forward(self, arg1, arg2):
return self.relu1(arg1), self.relu2(arg2)
def get_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | ngduduong/captum | MultiRelu | false | 4,068 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, inplace=False):
super().__init__()
self.relu1 = nn.ReLU(inplace=inplace)
self.relu2 = nn.ReLU(inplace=inplace)
def forward(self, arg1, arg2):
return self.relu1(arg1), self.relu2(arg2)
def get_inpu... |
AlbertAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ncoop57/transformers | AlbertAttention | false | 4,069 | [
"Apache-2.0"
] | 0 | d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | https://github.com/ncoop57/transformers/tree/d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | from _paritybench_helpers import _mock_config
import math
import torch
from typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... |
BasicModel3 | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicModel3(nn.Module):
"""
Example model two from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1 - 1) - ReLU(x2))
"""
def __init__(self):
super().__init__()
def forward... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | ngduduong/captum | BasicModel3 | false | 4,070 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Example model two from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1 - 1) - ReLU(x2))
"""
def __init__(self):
super().__init__()
def forward(self,... |
BasicModel5_MultiArgs | # 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 BasicModel5_MultiArgs(nn.Module):
"""
Slightly modified example model from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1 - 1) * x3[0] - ReLU(x2) * x3[1])
"""
def __init__(self):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | ngduduong/captum | BasicModel5_MultiArgs | false | 4,071 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Slightly modified example model from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1 - 1) * x3[0] - ReLU(x2) * x3[1])
"""
def __init__(self):
super().__in... |
BasicModel6_MultiTensor | # 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 BasicModel6_MultiTensor(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input1, input2):
input = input1 + input2
return 1 - F.relu(1 - input)[:, 1]
def get_inputs():
return [torch.rand... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | ngduduong/captum | BasicModel6_MultiTensor | false | 4,072 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input1, input2):
input = input1 + input2
return 1 - F.relu(1 - input)[:, 1]
def get_inputs():
return [torch.rand([4, 4, 4, 4]), to... |
T5DenseReluDense | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint
class T5DenseReluDense(nn.Module):
def __init__(self, config):
super().__init__()
self.wi = nn.Linear(config.d_model, config.d_ff, bias=False)
sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | Hzfinfdu/Black-Box-Tuning | T5DenseReluDense | false | 4,073 | [
"MIT"
] | 0 | 64eb5505875dc1b242c6f0a2a2f07e4000c24cb4 | https://github.com/Hzfinfdu/Black-Box-Tuning/tree/64eb5505875dc1b242c6f0a2a2f07e4000c24cb4 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint
class Model(nn.Module):
def __init__(self, config):
super().__init__()
self.wi = nn.Linear(config.d_model, config.d_ff, bias=False)
self.wo = nn.L... |
STFullyConnected | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import time
import torch
import numpy as np
from torch import nn
from torch import optim
from torch.nn import functional as F
class Base(nn.Module):
""" This class is the base structure for all of classification/regression DNN models.
Mainly, it provides the general methods for training, evaluating model and ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | naisuu/DrugEx | STFullyConnected | false | 4,074 | [
"MIT"
] | 0 | 8708c98a137473f11990d70e43a46018806b6f39 | https://github.com/naisuu/DrugEx/tree/8708c98a137473f11990d70e43a46018806b6f39 | import time
import torch
import numpy as np
from torch import nn
from torch import optim
from torch.nn import functional as F
class Base(nn.Module):
""" This class is the base structure for all of classification/regression DNN models.
Mainly, it provides the general methods for training, evaluating model and ... |
BasicModel2 | # 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 BasicModel2(nn.Module):
"""
Example model one from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1) - 1 - ReLU(x2))
"""
def __init__(self):
super().__init__()
def forward... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | ngduduong/captum | BasicModel2 | false | 4,075 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Example model one from the paper
https://arxiv.org/pdf/1703.01365.pdf
f(x1, x2) = RELU(ReLU(x1) - 1 - ReLU(x2))
"""
def __init__(self):
super().__init__()
def forward(self,... |
ReLUDeepLiftModel | # 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 ReLUDeepLiftModel(nn.Module):
"""
https://www.youtube.com/watch?v=f_iAM0NPwnM
"""
def __init__(self):
super().__init__()
self.relu1 = nn.ReLU()
self.relu2 = nn.ReLU()
def forward(self, x1, x2):
return 2 * self.relu1(x1)... | 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... | ngduduong/captum | ReLUDeepLiftModel | false | 4,076 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
https://www.youtube.com/watch?v=f_iAM0NPwnM
"""
def __init__(self):
super().__init__()
self.relu1 = nn.ReLU()
self.relu2 = nn.ReLU()
def forward(self, x1, x2):
return 2 * self.relu1(x1) + 2 * self.... |
FeatureModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 FeatureModel(nn.Module):
def __init__(self, num_features_in, num_anchors=9, feature_size_out=64,
prior=0.01, feature_size=256):
super(FeatureModel, self).__init__()
self.feature_size_out = feature_size_out
self.num_anchors = num_anchors
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | nassarofficial/pytorch-retina | FeatureModel | false | 4,077 | [
"Apache-2.0"
] | 0 | b2f10ffa7617797280c1f44d562c455b996254af | https://github.com/nassarofficial/pytorch-retina/tree/b2f10ffa7617797280c1f44d562c455b996254af | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_features_in, num_anchors=9, feature_size_out=64,
prior=0.01, feature_size=256):
super().__init__()
self.feature_size_out = feature_size_out
self.num_anchors = num_anchors
self.conv1 = nn.Conv... |
TanhDeepLiftModel | # 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 TanhDeepLiftModel(nn.Module):
"""
Same as the ReLUDeepLiftModel, but with activations
that can have negative outputs
"""
def __init__(self):
super().__init__()
self.tanh1 = nn.Tanh()
self.tanh2 = nn.Tanh()
def forward(s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | ngduduong/captum | TanhDeepLiftModel | false | 4,078 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Same as the ReLUDeepLiftModel, but with activations
that can have negative outputs
"""
def __init__(self):
super().__init__()
self.tanh1 = nn.Tanh()
self.tanh2 = nn.Tanh()
def forward(self, x1, x2)... |
SigmoidDeepLiftModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SigmoidDeepLiftModel(nn.Module):
"""
Model architecture from:
https://medium.com/coinmonks/create-a-neural-network-in
-pytorch-and-make-your-life-simpler-ec5367895199
"""
def __init__(self, num_in, num_hidden, num_out):
super().... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | ngduduong/captum | SigmoidDeepLiftModel | false | 4,079 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Model architecture from:
https://medium.com/coinmonks/create-a-neural-network-in
-pytorch-and-make-your-life-simpler-ec5367895199
"""
def __init__(self, num_in, num_hidden, num_out):
super().__init__()
... |
BasicModel_ConvNet_One_Conv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 BasicModel_ConvNet_One_Conv(nn.Module):
def __init__(self, inplace=False):
super().__init__()
self.conv1 = nn.Conv2d(1, 2, 3, 1)
self.relu1 = nn.ReLU(inplace=inplace)
self.fc1 = nn.Linear(8, 4)
self.conv1.weight = nn.Parameter(torch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | ngduduong/captum | BasicModel_ConvNet_One_Conv | false | 4,080 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, inplace=False):
super().__init__()
self.conv1 = nn.Conv2d(1, 2, 3, 1)
self.relu1 = nn.ReLU(inplace=inplace)
self.fc1 = nn.Linear(8, 4)
self.conv1.weight = nn.Parameter(torch.ones(2, 1, 3, 3))
... |
Binarizer | # 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 abc import ABC
from sklearn.preprocessing import Binarizer
class BaseOperator(ABC):
"""
Abstract class defining the basic structure for operator implementations in Hummingbird.
"""
def __init__(self, regression=False, classification=False, transformer=
False, anomaly_detecti... | 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 abc import ABC
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_stri... | kvenkman/hummingbird | Binarizer | false | 4,081 | [
"MIT"
] | 0 | dac08f4ff4a4103df4a8e83329a02f2d804bf34d | https://github.com/kvenkman/hummingbird/tree/dac08f4ff4a4103df4a8e83329a02f2d804bf34d | import torch
from abc import ABC
from sklearn.preprocessing import Binarizer
class BaseOperator(ABC):
"""
Abstract class defining the basic structure for operator implementations in Hummingbird.
"""
def __init__(self, regression=False, classification=False, transformer=
False, anomaly_detecti... |
DeiTAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ncoop57/transformers | DeiTAttention | false | 4,082 | [
"Apache-2.0"
] | 0 | d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | https://github.com/ncoop57/transformers/tree/d7e156bd1ae2467e9ea1dbc44f31da0ed2296aee | from _paritybench_helpers import _mock_config
import math
import torch
from typing import List
from typing import Tuple
from torch import nn
from typing import Set
import torch.utils.checkpoint
def find_pruneable_heads_and_indices(heads: 'List[int]', n_heads: 'int',
head_size: 'int', already_pruned_heads: 'Set[in... |
SoftmaxModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SoftmaxModel(nn.Module):
"""
Model architecture from:
https://adventuresinmachinelearning.com/pytorch-tutorial-deep-learning/
"""
def __init__(self, num_in, num_hidden, num_out, inplace=False):
super().__init__()
self.num_in = num_i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ngduduong/captum | SoftmaxModel | false | 4,083 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Model architecture from:
https://adventuresinmachinelearning.com/pytorch-tutorial-deep-learning/
"""
def __init__(self, num_in, num_hidden, num_out, inplace=False):
super().__init__()
self.num_in = num_in
... |
TinyCnn | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 TinyCnn(nn.Module):
def __init__(self, feature_extraction=False):
super().__init__()
self.feature_extraction = feature_extraction
self.conv1 = nn.Conv2d(3, 3, 5)
self.relu1 = nn.ReLU()
self.pool1 = nn.MaxPool2d(2, 2)
if not ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | ngduduong/captum | TinyCnn | false | 4,084 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, feature_extraction=False):
super().__init__()
self.feature_extraction = feature_extraction
self.conv1 = nn.Conv2d(3, 3, 5)
self.relu1 = nn.ReLU()
self.pool1 = nn.MaxPool2d(2, 2)
if not se... |
MLPNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 MLPNet(nn.Module):
def __init__(self):
super(MLPNet, self).__init__()
self.fc1 = nn.Linear(28 * 28, 500)
self.fc2 = nn.Linear(500, 256)
self.fc3 = nn.Linear(256, 10)
def forward(self, x):
x = x.v... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | ngtrunghuan/50.021-ArtificialIntelligence | MLPNet | false | 4,085 | [
"MIT"
] | 0 | b0c3d9f8cc70312ea1298818482a4b25d4ddbded | https://github.com/ngtrunghuan/50.021-ArtificialIntelligence/tree/b0c3d9f8cc70312ea1298818482a4b25d4ddbded | 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(28 * 28, 500)
self.fc2 = nn.Linear(500, 256)
self.fc3 = nn.Linear(256, 10)
def forward(self, x):
x = x.view(-1, 28 * ... |
ResNNFlow | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class ResNNFlow(torch.nn.Sequential):
def __init__(self, *args, **kwargs):
super(ResNNFlow, self).__init__(*args, **kwargs)
self.gate = torch.nn.Parameter(torch.nn.init.normal_(torch.Tensor(1)))
def forward(self, inputs):
or_inputs = inputs
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_... | nicola-decao/M-NAF-experiments-VAE | ResNNFlow | false | 4,086 | [
"MIT"
] | 0 | b8e127205e84d94ae50618e95734f20d259f7934 | https://github.com/nicola-decao/M-NAF-experiments-VAE/tree/b8e127205e84d94ae50618e95734f20d259f7934 | import torch
import torch.utils.data
class Model(torch.nn.Sequential):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.gate = torch.nn.Parameter(torch.nn.init.normal_(torch.Tensor(1)))
def forward(self, inputs):
or_inputs = inputs
for module in sel... |
GatedConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch.nn as nn
class GatedConv2d(nn.Module):
def __init__(self, input_channels, output_channels, kernel_size, stride,
padding, dilation=1, activation=None):
super(GatedConv2d, self).__init__()
self.activation = activation
self.sigmoid = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dyn... | nicola-decao/M-NAF-experiments-VAE | GatedConv2d | false | 4,087 | [
"MIT"
] | 0 | b8e127205e84d94ae50618e95734f20d259f7934 | https://github.com/nicola-decao/M-NAF-experiments-VAE/tree/b8e127205e84d94ae50618e95734f20d259f7934 | import torch
import torch.utils.data
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_channels, output_channels, kernel_size, stride,
padding, dilation=1, activation=None):
super().__init__()
self.activation = activation
self.sigmoid = nn.Sigmoid()
se... |
NPIArg | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NPIArg(nn.Module):
def __init__(self, input_dim: 'int', arg_dim: 'int'):
super(NPIArg, self).__init__()
self.f_arg = nn.Linear(input_dim, arg_dim)
def forward(self, x):
x = self.f_arg(x)
x = F.log_softma... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | nienjiuntai/pytorch-npi | NPIArg | false | 4,088 | [
"MIT"
] | 0 | 16b413c152dfb7f1506a85997adc10ddc2d9af35 | https://github.com/nienjiuntai/pytorch-npi/tree/16b413c152dfb7f1506a85997adc10ddc2d9af35 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim: 'int', arg_dim: 'int'):
super().__init__()
self.f_arg = nn.Linear(input_dim, arg_dim)
def forward(self, x):
x = self.f_arg(x)
x = F.log_softmax(x.view(1, -... |
NPIProg | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NPIProg(nn.Module):
def __init__(self, input_dim: 'int', prog_key_dim: 'int', prog_num: 'int'):
super(NPIProg, self).__init__()
self._fcn1 = nn.Linear(in_features=input_dim, out_features=prog_key_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.... | nienjiuntai/pytorch-npi | NPIProg | false | 4,089 | [
"MIT"
] | 0 | 16b413c152dfb7f1506a85997adc10ddc2d9af35 | https://github.com/nienjiuntai/pytorch-npi/tree/16b413c152dfb7f1506a85997adc10ddc2d9af35 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim: 'int', prog_key_dim: 'int', prog_num: 'int'):
super().__init__()
self._fcn1 = nn.Linear(in_features=input_dim, out_features=prog_key_dim
)
self._fcn2 = nn.L... |
BasicModel_ConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class BasicModel_ConvNet(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 2, 3, 1)
self.relu1 = nn.ReLU()
self.pool1 = nn.MaxPool2d(2)
self.conv2 = nn.Conv2d(2, 4, 3, 1)
self.relu2 = nn.ReLU()
s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ngduduong/captum | BasicModel_ConvNet | false | 4,090 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 2, 3, 1)
self.relu1 = nn.ReLU()
self.pool1 = nn.MaxPool2d(2)
self.conv2 = nn.Conv2d(2, 4, 3, 1)
self.relu2 = nn.ReLU()
self.pool2 = n... |
GammaLoss | # 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
class GammaLoss(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, y, y_hat):
p = 2
loss = -y * torch.pow(y_hat, 1 - p) / (1 - p) + torch.pow(y_hat, 2 - p
) / (2 - p)
return torch.mean(loss)
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 import triton_helpers
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_str... | nizamphoenix/kaggle | GammaLoss | false | 4,091 | [
"MIT"
] | 0 | a9c993d0441a6d9260d605a630f95d938e6329db | https://github.com/nizamphoenix/kaggle/tree/a9c993d0441a6d9260d605a630f95d938e6329db | import torch
import torch.nn
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, y, y_hat):
p = 2
loss = -y * torch.pow(y_hat, 1 - p) / (1 - p) + torch.pow(y_hat, 2 - p
) / (2 - p)
return torch.mean(loss)
def get_inputs():
... |
BasicModel_ConvNet_MaxPool1d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class BasicModel_ConvNet_MaxPool1d(nn.Module):
"""Same as above, but with the MaxPool2d replaced
with a MaxPool1d. This is useful because the MaxPool modules
behave differently to other modules from the perspective
of the DeepLift Attributions
"""
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 import triton_helpers
from torch._inductor.runtime.... | ngduduong/captum | BasicModel_ConvNet_MaxPool1d | false | 4,092 | [
"BSD-3-Clause"
] | 0 | 6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | https://github.com/ngduduong/captum/tree/6fe5f0f23ea975e73e0c0dee79bdc01b4223d283 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Same as above, but with the MaxPool2d replaced
with a MaxPool1d. This is useful because the MaxPool modules
behave differently to other modules from the perspective
of the DeepLift Attributions
"""
def __init__(self):
super... |
LogCoshLoss | # 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
class LogCoshLoss(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, y_t, y_prime_t):
ey_t = torch.abs(y_t - y_prime_t)
return torch.mean(torch.log(torch.cosh(ey_t + 1e-16)))
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._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | nizamphoenix/kaggle | LogCoshLoss | false | 4,093 | [
"MIT"
] | 0 | a9c993d0441a6d9260d605a630f95d938e6329db | https://github.com/nizamphoenix/kaggle/tree/a9c993d0441a6d9260d605a630f95d938e6329db | import torch
import torch.nn
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, y_t, y_prime_t):
ey_t = torch.abs(y_t - y_prime_t)
return torch.mean(torch.log(torch.cosh(ey_t + 1e-16)))
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torc... |
AbsModel | # 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.nn import Module
import torch
from torch import Tensor
from torch.nn import Identity
from torch.nn.modules import Module
import torch.optim.lr_scheduler
class AbsLayer(Module):
def forward(self, x: 'Tensor') ->Tensor:
return torch.abs(x).reshape((-1, 1))
class AbsModel(Module):
"""Fake 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 math as tl_math
from torch.nn import Module
from torch import Tensor
from torch.nn import... | nuwangunasekara/avalanche | AbsModel | false | 4,094 | [
"MIT"
] | 0 | 1f4d5b3e559552394cce573a85b1c9af26a544fb | https://github.com/nuwangunasekara/avalanche/tree/1f4d5b3e559552394cce573a85b1c9af26a544fb | from torch.nn import Module
import torch
from torch import Tensor
from torch.nn import Identity
from torch.nn.modules import Module
import torch.optim.lr_scheduler
class AbsLayer(Module):
def forward(self, x: 'Tensor') ->Tensor:
return torch.abs(x).reshape((-1, 1))
class Model(Module):
"""Fake mode... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.