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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils.data
class MLP(nn.Module):
def __init__(self, input_size, output_size, hidden_size=500,
weight_decay=0.0):
super(MLP, self).__init__()
self.i2h = nn.Linear(in_features=input_size, out_features=hidden_size)
self.Dropout = nn.Dro... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | gchrupala/platalea | MLP | false | 6,728 | [
"Apache-2.0"
] | 1 | 65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | https://github.com/gchrupala/platalea/tree/65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, input_size, output_size, hidden_size=500,
weight_decay=0.0):
super().__init__()
self.i2h = nn.Linear(in_features=input_size, out_features=hidden_size)
self.Dropout = nn.Dropout(p=... |
MeanPool | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.utils.data
class MeanPool(nn.Module):
def __init__(self):
super(MeanPool, self).__init__()
def forward(self, input):
x = input.mean(dim=1)
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
r... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | gchrupala/platalea | MeanPool | false | 6,729 | [
"Apache-2.0"
] | 1 | 65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | https://github.com/gchrupala/platalea/tree/65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input):
x = input.mean(dim=1)
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
NNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NNet(nn.Module):
def __init__(self, input_dim, output_dim):
super(NNet, self).__init__()
self.linear1 = nn.Linear(input_dim, 64)
self.linear2 = nn.Linear(64, 256)
self.linear3 = nn.Linear(256, output_dim)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | gautam-sharma1/openRL | NNet | false | 6,730 | [
"MIT"
] | 1 | 14310a97a328fe5682a01ee85d83a6b5e1ae29ca | https://github.com/gautam-sharma1/openRL/tree/14310a97a328fe5682a01ee85d83a6b5e1ae29ca | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim, output_dim):
super().__init__()
self.linear1 = nn.Linear(input_dim, 64)
self.linear2 = nn.Linear(64, 256)
self.linear3 = nn.Linear(256, output_dim)
def for... |
ELBO | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional
import torch.nn as nn
class ELBO(nn.Module):
def __init__(self, train_size, loss_function=nn.MSELoss()):
"""
Quantify the Evidence Lower Bound (ELBO) and provide the total loss.
"""
super(ELBO, self).__init__()
self.train_size = trai... | 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.functional
import torch.nn as nn
assert_size_stride = torch._C._dynamo.gu... | geek-yang/NEmo | ELBO | false | 6,731 | [
"Apache-2.0"
] | 1 | 4f310535c4865f3816155b99b4a2bbb891672cc9 | https://github.com/geek-yang/NEmo/tree/4f310535c4865f3816155b99b4a2bbb891672cc9 | import torch
import torch.nn.functional
import torch.nn as nn
class Model(nn.Module):
def __init__(self, train_size, loss_function=nn.MSELoss()):
"""
Quantify the Evidence Lower Bound (ELBO) and provide the total loss.
"""
super().__init__()
self.train_size = train_size
... |
SCNLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
def chebyshev(L, X, k=3):
if k == 1:
return torch.sparse.mm(L, X)
dp = [X, torch.sparse.mm(L, X)]
for i in range(2, k):
nxt = 2 * torch.sparse.mm(L, dp[i - 1])
dp.append(torch.sparse.FloatTensor.add(nxt, -dp[i - 2]))
return torch.cat(dp, dim=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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | ggoh29/Simplicial-neural-network-benchmark | SCNLayer | false | 6,733 | [
"MIT"
] | 1 | 9a12bcd054251790d85e3971f5473dcffaa5664b | https://github.com/ggoh29/Simplicial-neural-network-benchmark/tree/9a12bcd054251790d85e3971f5473dcffaa5664b | import torch
import torch.nn as nn
def chebyshev(L, X, k=3):
if k == 1:
return torch.sparse.mm(L, X)
dp = [X, torch.sparse.mm(L, X)]
for i in range(2, k):
nxt = 2 * torch.sparse.mm(L, dp[i - 1])
dp.append(torch.sparse.FloatTensor.add(nxt, -dp[i - 2]))
return torch.cat(dp, dim=1... |
Temp | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Temp(nn.Module):
def __init__(self, input_dim, output_dim):
super(Temp, self).__init__()
self.linear1 = nn.Linear(input_dim, 256)
self.linear2 = nn.Linear(256, 256)
self.linear3 = nn.Linear(256, 256)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | gautam-sharma1/openRL | Temp | false | 6,734 | [
"MIT"
] | 1 | 14310a97a328fe5682a01ee85d83a6b5e1ae29ca | https://github.com/gautam-sharma1/openRL/tree/14310a97a328fe5682a01ee85d83a6b5e1ae29ca | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim, output_dim):
super().__init__()
self.linear1 = nn.Linear(input_dim, 256)
self.linear2 = nn.Linear(256, 256)
self.linear3 = nn.Linear(256, 256)
self.line... |
GroupNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 GroupNorm(nn.Module):
def __init__(self, c_num, group_num=16, eps=1e-10):
"""
The groupnorm layer from https://arxiv.org/abs/1803.08494
Args:
c_num (int): Number of input channels
group_num (int): Number of group by which to... | 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_... | generall/Torchlite | GroupNorm | false | 6,735 | [
"MIT"
] | 1 | 2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a | https://github.com/generall/Torchlite/tree/2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, c_num, group_num=16, eps=1e-10):
"""
The groupnorm layer from https://arxiv.org/abs/1803.08494
Args:
c_num (int): Number of input channels
group_num (int): Number of group by which to div... |
LinearAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 LinearAttention(nn.Module):
def __init__(self, in_size):
super(LinearAttention, self).__init__()
self.out = nn.Linear(in_size, 1)
nn.init.orthogonal_(self.out.weight.data)
self.softmax = nn.Softmax(dim=1)
def fo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | gchrupala/platalea | LinearAttention | false | 6,736 | [
"Apache-2.0"
] | 1 | 65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | https://github.com/gchrupala/platalea/tree/65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, in_size):
super().__init__()
self.out = nn.Linear(in_size, 1)
nn.init.orthogonal_(self.out.weight.data)
self.softmax = nn.Softmax(dim=1)
def forward(self, input):
sel... |
GreedyCTCDecoder | # 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 GreedyCTCDecoder(nn.Module):
""" Greedy CTC Decoder
"""
def __init__(self, **kwargs):
nn.Module.__init__(self)
def forward(self, log_probs):
with torch.no_grad():
argmx = log_probs.argmax(dim=-1, keepdim=False).int()
re... | 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... | ghdrl95/Naver-Speech-Hackathon | GreedyCTCDecoder | false | 6,737 | [
"Apache-2.0"
] | 1 | 10b4526d98ce535415cb91d24338790d9c175b63 | https://github.com/ghdrl95/Naver-Speech-Hackathon/tree/10b4526d98ce535415cb91d24338790d9c175b63 | import torch
import torch.nn as nn
class Model(nn.Module):
""" Greedy CTC Decoder
"""
def __init__(self, **kwargs):
nn.Module.__init__(self)
def forward(self, log_probs):
with torch.no_grad():
argmx = log_probs.argmax(dim=-1, keepdim=False).int()
return argmx
... |
RegionPenaltyLoss | # 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 RegionPenaltyLoss(nn.Module):
def __init__(self, scale=1.0):
"""
Multiplicative penalty.
Penalizes "forbidden" regions instead of exact distribution matches.
Optionally used in tandem with MTCrossEntropyRegionAwareLoss.
`scale` para... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | geoffreyangus/pet-ct | RegionPenaltyLoss | false | 6,738 | [
"Apache-2.0"
] | 1 | fa96a07734afade475f6a1e1587ec14965fe2de3 | https://github.com/geoffreyangus/pet-ct/tree/fa96a07734afade475f6a1e1587ec14965fe2de3 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, scale=1.0):
"""
Multiplicative penalty.
Penalizes "forbidden" regions instead of exact distribution matches.
Optionally used in tandem with MTCrossEntropyRegionAwareLoss.
`scale` param allows cal... |
Network | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
class Network(torch.nn.Module):
def __init__(self, input_dimension, output_dimension):
super(Network, self).__init__()
self.layer_1 = torch.nn.Linear(in_features=input_dimension,
out_features=100)
self.layer_2 = torch.nn.Linear(in_features=100, out_features=200)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | georgeyiasemis/Deep-Reinforcement-Learning-on-a-Grid-World- | Network | false | 6,739 | [
"MIT"
] | 1 | f32ceac5f4e29cba212d6fd1b8a25c08ac733666 | https://github.com/georgeyiasemis/Deep-Reinforcement-Learning-on-a-Grid-World-/tree/f32ceac5f4e29cba212d6fd1b8a25c08ac733666 | import torch
class Model(torch.nn.Module):
def __init__(self, input_dimension, output_dimension):
super().__init__()
self.layer_1 = torch.nn.Linear(in_features=input_dimension,
out_features=100)
self.layer_2 = torch.nn.Linear(in_features=100, out_features=200)
self.out... |
ScalarAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ScalarAttention(nn.Module):
def __init__(self, in_size, hidden_size):
super(ScalarAttention, self).__init__()
self.hidden = nn.Linear(in_size, hidden_size)
nn.init.orthogonal_(self.hidden.weight.data)
self.out = nn.L... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | gchrupala/platalea | ScalarAttention | false | 6,740 | [
"Apache-2.0"
] | 1 | 65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | https://github.com/gchrupala/platalea/tree/65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, in_size, hidden_size):
super().__init__()
self.hidden = nn.Linear(in_size, hidden_size)
nn.init.orthogonal_(self.hidden.weight.data)
self.out = nn.Linear(hidden_size, 1)
n... |
ODEfunc | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
def norm(dim):
return nn.GroupNorm(min(32, dim), dim)
class ConcatConv2d(nn.Module):
def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0,
dilation=1, groups=1, bias=True, transpose=False):
super(ConcatConv2d, self).__init__()
module = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | gaozhihan/torchdiffeq | ODEfunc | false | 6,741 | [
"MIT"
] | 1 | 414781617d595ba01cc3f23382e25ab890f4ca66 | https://github.com/gaozhihan/torchdiffeq/tree/414781617d595ba01cc3f23382e25ab890f4ca66 | import torch
import torch.nn as nn
def norm(dim):
return nn.GroupNorm(min(32, dim), dim)
class ConcatConv2d(nn.Module):
def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0,
dilation=1, groups=1, bias=True, transpose=False):
super().__init__()
module = nn.ConvTranspose2d... |
MSELoss2d | # 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 MSELoss2d(nn.Module):
def __init__(self, size_average=None, reduce=None, reduction='mean',
ignore_index=255):
super(MSELoss2d, self).__init__()
self.MSE = nn.MSELoss(size_average=size_average, reduce=reduce,
reduction=reduction)
def... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | giannifranchi/deeplabv3-superpixelmix | MSELoss2d | false | 6,742 | [
"MIT"
] | 1 | db52bf83b3b242af05bde5e39ee3de896e44c264 | https://github.com/giannifranchi/deeplabv3-superpixelmix/tree/db52bf83b3b242af05bde5e39ee3de896e44c264 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, size_average=None, reduce=None, reduction='mean',
ignore_index=255):
super().__init__()
self.MSE = nn.MSELoss(size_average=size_average, reduce=reduce,
reduction=reduction)
def forward(self, outp... |
ResidualBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ResidualBlock(nn.Module):
def __init__(self, channels):
super(ResidualBlock, self).__init__()
self.conv1 = nn.Conv2d(channels, channels, kernel_size=3, padding=1)
self.in1 = nn.InstanceNorm2d(channels)
self.prelu = nn.PReLU()
self.c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | generall/Torchlite | ResidualBlock | false | 6,743 | [
"MIT"
] | 1 | 2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a | https://github.com/generall/Torchlite/tree/2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, channels):
super().__init__()
self.conv1 = nn.Conv2d(channels, channels, kernel_size=3, padding=1)
self.in1 = nn.InstanceNorm2d(channels)
self.prelu = nn.PReLU()
self.conv2 = nn.Conv2d(channels, ... |
ConvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size,
stride, padding=1)
self.lr = nn.LeakyReLU()
d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | gle-bellier/DuelingNetwork | ConvBlock | false | 6,744 | [
"MIT"
] | 1 | 8909fe1ba6aee08b6249cb6ca3287752039c6410 | https://github.com/gle-bellier/DuelingNetwork/tree/8909fe1ba6aee08b6249cb6ca3287752039c6410 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride):
super().__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size,
stride, padding=1)
self.lr = nn.LeakyReLU()
def forward(self, x)... |
WordPredictor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.onnx.operators
class WordPredictor(nn.Module):
def __init__(self, encoder_output_dim, hidden_dim, output_dim):
super().__init__()
self.encoder_output_dim = encoder_output_dim
self.hidden_dim = hidden_dim
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | gardenia22/translate | WordPredictor | false | 6,745 | [
"BSD-3-Clause"
] | 1 | 0be57c8f55b52fc9d39197efa02e05d1c1cda024 | https://github.com/gardenia22/translate/tree/0be57c8f55b52fc9d39197efa02e05d1c1cda024 | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.onnx.operators
class Model(nn.Module):
def __init__(self, encoder_output_dim, hidden_dim, output_dim):
super().__init__()
self.encoder_output_dim = encoder_output_dim
self.hidden_dim = hidden_dim
self.... |
VideoNormalizer | # 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 VideoNormalizer(nn.Module):
def __init__(self):
super(VideoNormalizer, self).__init__()
self.scale = nn.Parameter(torch.Tensor([255.0]), requires_grad=False)
self.mean = nn.Parameter(torch.Tensor([0.485, 0.456, 0.406]),
requires_grad=Fa... | 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... | glee1228/segment_temporal_context_aggregation | VideoNormalizer | false | 6,746 | [
"Apache-2.0"
] | 1 | e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | https://github.com/glee1228/segment_temporal_context_aggregation/tree/e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.scale = nn.Parameter(torch.Tensor([255.0]), requires_grad=False)
self.mean = nn.Parameter(torch.Tensor([0.485, 0.456, 0.406]),
requires_grad=False)
self.std = nn.Para... |
LogSparsemax | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.autograd import Function
import torch
import torch.nn.init
import torch.nn as nn
def _make_ix_like(input, dim=0):
d = input.size(dim)
rho = torch.arange(1, d + 1, device=input.device, dtype=input.dtype)
view = [1] * input.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch.autograd im... | gililior/qasrl-modeling | LogSparsemax | false | 6,747 | [
"MIT"
] | 1 | 2f9684536f6d5f0283b0e4b90a911ea12fa72f72 | https://github.com/gililior/qasrl-modeling/tree/2f9684536f6d5f0283b0e4b90a911ea12fa72f72 | from torch.autograd import Function
import torch
import torch.nn.init
import torch.nn as nn
def _make_ix_like(input, dim=0):
d = input.size(dim)
rho = torch.arange(1, d + 1, device=input.device, dtype=input.dtype)
view = [1] * input.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def ... |
RegressionSubNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 RegressionSubNet(nn.Module):
def __init__(self, in_channels, num_anchors=9):
super().__init__()
self.conv2d_1 = nn.Conv2d(in_channels, 256, 3, padding=1)
nn.init.normal_(self.conv2d_1.weight.data, std=0.01)
nn.init.zeros_(self.conv2d_1.bias... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | geez0219/ARC | RegressionSubNet | false | 6,748 | [
"Apache-2.0"
] | 1 | f2176f0d442d4a2d6028f0770b1efc1a9ae982b8 | https://github.com/geez0219/ARC/tree/f2176f0d442d4a2d6028f0770b1efc1a9ae982b8 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, num_anchors=9):
super().__init__()
self.conv2d_1 = nn.Conv2d(in_channels, 256, 3, padding=1)
nn.init.normal_(self.conv2d_1.weight.data, std=0.01)
nn.init.zeros_(self.conv2d_1.bias.data)
... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Attention(nn.Module):
def __init__(self, dims, norm=False):
super(Attention, self).__init__()
self.norm = norm
if self.norm:
self.constrain = L2Constrain()
else:
self.transform = nn.Linear(dims, dims)
self.co... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | glee1228/segment_temporal_context_aggregation | Attention | false | 6,749 | [
"Apache-2.0"
] | 1 | e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | https://github.com/glee1228/segment_temporal_context_aggregation/tree/e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, dims, norm=False):
super().__init__()
self.norm = norm
if self.norm:
self.constrain = L2Constrain()
else:
self.transform = nn.Linear(dims, dims)
self.context_vector = nn.L... |
Sparsemax | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.autograd import Function
import torch
import torch.nn.init
import torch.nn as nn
def _make_ix_like(input, dim=0):
d = input.size(dim)
rho = torch.arange(1, d + 1, device=input.device, dtype=input.dtype)
view = [1] * input.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.autograd import Function
import torch.nn.init
import torch.nn as nn
assert_siz... | gililior/qasrl-modeling | Sparsemax | false | 6,750 | [
"MIT"
] | 1 | 2f9684536f6d5f0283b0e4b90a911ea12fa72f72 | https://github.com/gililior/qasrl-modeling/tree/2f9684536f6d5f0283b0e4b90a911ea12fa72f72 | from torch.autograd import Function
import torch
import torch.nn.init
import torch.nn as nn
def _make_ix_like(input, dim=0):
d = input.size(dim)
rho = torch.arange(1, d + 1, device=input.device, dtype=input.dtype)
view = [1] * input.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def ... |
ActorNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ActorNetwork(nn.Module):
def __init__(self, state_size, action_size, hidden_size, init_w=0.003,
log_std_min=-20, log_std_max=2):
super(ActorNetwork, self).__init__()
self.log_std_min = log_std... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | godnpeter/DMC_Clustering_PICA | ActorNetwork | false | 6,751 | [
"BSD-2-Clause"
] | 1 | 1b3e14dd4034f3941af1caa06c1d4b6f9d606408 | https://github.com/godnpeter/DMC_Clustering_PICA/tree/1b3e14dd4034f3941af1caa06c1d4b6f9d606408 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Model(nn.Module):
def __init__(self, state_size, action_size, hidden_size, init_w=0.003,
log_std_min=-20, log_std_max=2):
super().__init__()
self.log_std_min = log_std_min
self.log_std... |
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.functional as F
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
self.conv2_drop = nn.Dropout2d()
self.fc1 = 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.... | generall/Torchlite | Net | false | 6,752 | [
"MIT"
] | 1 | 2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a | https://github.com/generall/Torchlite/tree/2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
self.conv2_drop = nn.Dropout2d()
self.fc1 = nn.Linea... |
ClassificationSubNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
class ClassificationSubNet(nn.Module):
def __init__(self, in_channels, num_classes, num_anchors=9):
super().__init__()
self.num_classes = num_classes
self.conv2d_1 = nn.Conv2d(in_channels, 256, 3, padding=1)
nn.init.normal_(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 numpy as np
import tor... | geez0219/ARC | ClassificationSubNet | false | 6,753 | [
"Apache-2.0"
] | 1 | f2176f0d442d4a2d6028f0770b1efc1a9ae982b8 | https://github.com/geez0219/ARC/tree/f2176f0d442d4a2d6028f0770b1efc1a9ae982b8 | import torch
import numpy as np
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, num_classes, num_anchors=9):
super().__init__()
self.num_classes = num_classes
self.conv2d_1 = nn.Conv2d(in_channels, 256, 3, padding=1)
nn.init.normal_(self.conv2d_1.weig... |
ZeroConv1d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ZeroConv1d(nn.Module):
def __init__(self, in_channel, out_channel):
super().__init__()
self.conv = nn.Conv1d(in_channel, out_channel, 1, padding=0)
self.conv.weight.data.zero_()
self.conv.bias.data.zero_()
self.scale = nn.Parameter(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | gorinars/VQ-VAE-Speech | ZeroConv1d | false | 6,754 | [
"MIT"
] | 1 | 60398f03eb129195bce402a423ace8cca8995f3c | https://github.com/gorinars/VQ-VAE-Speech/tree/60398f03eb129195bce402a423ace8cca8995f3c | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channel, out_channel):
super().__init__()
self.conv = nn.Conv1d(in_channel, out_channel, 1, padding=0)
self.conv.weight.data.zero_()
self.conv.bias.data.zero_()
self.scale = nn.Parameter(torch... |
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 Conv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, dilation=1,
causal=True):
super(Conv, self).__init__()
self.causal = causal
if self.causal:
self.padding = dilation * (kernel_size - 1)
else:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | gorinars/VQ-VAE-Speech | Conv | false | 6,755 | [
"MIT"
] | 1 | 60398f03eb129195bce402a423ace8cca8995f3c | https://github.com/gorinars/VQ-VAE-Speech/tree/60398f03eb129195bce402a423ace8cca8995f3c | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, dilation=1,
causal=True):
super().__init__()
self.causal = causal
if self.causal:
self.padding = dilation * (kernel_size - 1)
else:
... |
HingeLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
from torch import nn
import torch
import torch.nn.parallel
import torch.optim
class HingeLoss(nn.Module):
def __init__(self):
super(HingeLoss, self).__init__()
self.margin = 1.0
def hinge_loss(self, input, target):
output = self.margin - input.mul... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
from torch import nn
import torch
import torch.nn.parallel
import... | graphbuilder/BNN | HingeLoss | false | 6,756 | [
"MIT"
] | 1 | d99eb5c7ef19f8b0c14a135d40a489f154a3c894 | https://github.com/graphbuilder/BNN/tree/d99eb5c7ef19f8b0c14a135d40a489f154a3c894 | import torch
import torch.utils.data
from torch import nn
import torch
import torch.nn.parallel
import torch.optim
class Model(nn.Module):
def __init__(self):
super().__init__()
self.margin = 1.0
def hinge_loss(self, input, target):
output = self.margin - input.mul(target)
ou... |
ContrastiveLoss | # 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
class ContrastiveLoss(torch.nn.Module):
"""
Contrastive loss function.
"""
def __init__(self, margin=1.0):
super(ContrastiveLoss, self).__init__()
self.margin = margin
def forward(self, x0, x1, y):
diff = x0 - x1
dist_sq = 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
import torch.utils.data
asse... | guruprasaad123/all_dl_projects | ContrastiveLoss | false | 6,757 | [
"Apache-2.0"
] | 1 | 04c869f7f001ef94c467740260663d91a34815e0 | https://github.com/guruprasaad123/all_dl_projects/tree/04c869f7f001ef94c467740260663d91a34815e0 | import torch
import torch.utils.data
class Model(torch.nn.Module):
"""
Contrastive loss function.
"""
def __init__(self, margin=1.0):
super().__init__()
self.margin = margin
def forward(self, x0, x1, y):
diff = x0 - x1
dist_sq = torch.sum(torch.pow(diff, 2), 1)
... |
AlignQuestionEmbedding | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
from torch import nn
class AlignQuestionEmbedding(nn.Module):
def __init__(self, input_dim):
super().__init__()
self.linear = nn.Linear(input_dim, input_dim)
self.relu = nn.ReLU()
def forward(self, context, question, question_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.... | gustavhartz/legal-contract-elements | AlignQuestionEmbedding | false | 6,758 | [
"MIT"
] | 1 | 7a1e1f0024f9d336c7166f51b4325acf03db86a2 | https://github.com/gustavhartz/legal-contract-elements/tree/7a1e1f0024f9d336c7166f51b4325acf03db86a2 | import torch
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
def __init__(self, input_dim):
super().__init__()
self.linear = nn.Linear(input_dim, input_dim)
self.relu = nn.ReLU()
def forward(self, context, question, question_mask):
ctx_ = self.lin... |
BasicBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
from torch import nn
import torch
import torch.nn.parallel
import torch.optim
def Binarize(tensor, quant_mode='det'):
if quant_mode == 'det':
tensor = tensor.sign()
zero = torch.zeros_like(tensor)
one = torch.ones_like(tensor)
zero - one
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | graphbuilder/BNN | BasicBlock | false | 6,759 | [
"MIT"
] | 1 | d99eb5c7ef19f8b0c14a135d40a489f154a3c894 | https://github.com/graphbuilder/BNN/tree/d99eb5c7ef19f8b0c14a135d40a489f154a3c894 | import torch
import torch.utils.data
from torch import nn
import torch
import torch.nn.parallel
import torch.optim
def Binarize(tensor, quant_mode='det'):
if quant_mode == 'det':
tensor = tensor.sign()
zero = torch.zeros_like(tensor)
one = torch.ones_like(tensor)
zero - one
... |
NetVLAD | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class NetVLAD(nn.Module):
def __init__(self, dims, num_clusters, outdims=None):
super(NetVLAD, self).__init__()
self.num_clusters = num_clusters
self.dims = dims
self.centroids = nn.Parameter(torch.rand... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | glee1228/segment_temporal_context_aggregation | NetVLAD | false | 6,760 | [
"Apache-2.0"
] | 1 | e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | https://github.com/glee1228/segment_temporal_context_aggregation/tree/e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, dims, num_clusters, outdims=None):
super().__init__()
self.num_clusters = num_clusters
self.dims = dims
self.centroids = nn.Parameter(torch.randn(num_clusters,... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils.data
class Attention(nn.Module):
def __init__(self, in_size, hidden_size):
super(Attention, self).__init__()
self.hidden = nn.Linear(in_size, hidden_size)
nn.init.orthogonal_(self.hidden.weight.data)
self.out = nn.Linear(hidden... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | gchrupala/platalea | Attention | false | 6,761 | [
"Apache-2.0"
] | 1 | 65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | https://github.com/gchrupala/platalea/tree/65833307bb6c5ad6cbdd6b17ad8ca59cf51fcd81 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, in_size, hidden_size):
super().__init__()
self.hidden = nn.Linear(in_size, hidden_size)
nn.init.orthogonal_(self.hidden.weight.data)
self.out = nn.Linear(hidden_size, in_size)
... |
Auxiliary | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Auxiliary(nn.Module):
def __init__(self, input_channels, n_classes):
super(Auxiliary, self).__init__()
self.Conv2 = nn.Conv2d(input_channels, 128, kernel_size=1)
self.FC1 = nn.Linear(2048, 1024)
self.FC2 = nn... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | gogo5911/PyTorch_Network | Auxiliary | false | 6,762 | [
"MIT"
] | 1 | 396e2ebfe2c7e23143e72972e2fd55613c0098a3 | https://github.com/gogo5911/PyTorch_Network/tree/396e2ebfe2c7e23143e72972e2fd55613c0098a3 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_channels, n_classes):
super().__init__()
self.Conv2 = nn.Conv2d(input_channels, 128, kernel_size=1)
self.FC1 = nn.Linear(2048, 1024)
self.FC2 = nn.Linear(1024, n_cla... |
Conv2dBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
from torch import nn
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-05, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
self.affine = affine
self.eps = eps
if self.affin... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | guyii54/Contrastive-I2I | Conv2dBlock | false | 6,763 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 | import torch
import torch.utils.data
import torch
from torch import nn
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-05, affine=True):
super().__init__()
self.num_features = num_features
self.affine = affine
self.eps = eps
if self.affine:
... |
GRU | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch as tc
import torch.nn as nn
class Layer_Norm(nn.Module):
def __init__(self, d_hid, eps=0.001):
super(Layer_Norm, self).__init__()
self.eps = eps
self.g = nn.Parameter(tc.ones(d_hid), requires_grad=True)
self.b = nn.Parameter(tc.zeros(d_hid), requires_grad... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch as tc
... | gushu333/DA4NMT | GRU | false | 6,764 | [
"Apache-2.0"
] | 1 | dba52a3d3784cd795b6f9aaf655b63475a848798 | https://github.com/gushu333/DA4NMT/tree/dba52a3d3784cd795b6f9aaf655b63475a848798 | import torch
import torch as tc
import torch.nn as nn
class Layer_Norm(nn.Module):
def __init__(self, d_hid, eps=0.001):
super().__init__()
self.eps = eps
self.g = nn.Parameter(tc.ones(d_hid), requires_grad=True)
self.b = nn.Parameter(tc.zeros(d_hid), requires_grad=True)
def ... |
Normalize | # 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
from torch import nn
class Normalize(nn.Module):
def __init__(self, power=2):
super(Normalize, self).__init__()
self.power = power
def forward(self, x):
norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power)
out =... | 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.utils.data
import torch
from torch import nn
assert_size_stride = ... | guyii54/Contrastive-I2I | Normalize | false | 6,765 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 | import torch
import torch.utils.data
import torch
from torch import nn
class Model(nn.Module):
def __init__(self, power=2):
super().__init__()
self.power = power
def forward(self, x):
norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power)
out = x.div(norm + 1e-07... |
GroupedChannelNorm | # 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
from torch import nn
class GroupedChannelNorm(nn.Module):
def __init__(self, num_groups):
super().__init__()
self.num_groups = num_groups
def forward(self, x):
shape = list(x.shape)
new_shape = [shape[0], self.num_groups, shap... | 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.utils.data
import torch
from torch import nn
assert_size_stride = ... | guyii54/Contrastive-I2I | GroupedChannelNorm | false | 6,766 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 | import torch
import torch.utils.data
import torch
from torch import nn
class Model(nn.Module):
def __init__(self, num_groups):
super().__init__()
self.num_groups = num_groups
def forward(self, x):
shape = list(x.shape)
new_shape = [shape[0], self.num_groups, shape[1] // self.... |
ReshapeF | # 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
from torch import nn
class Normalize(nn.Module):
def __init__(self, power=2):
super(Normalize, self).__init__()
self.power = power
def forward(self, x):
norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power)
out =... | 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.utils.data
import torch
from torch import nn
assert_size_stride = ... | guyii54/Contrastive-I2I | ReshapeF | false | 6,767 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 | import torch
import torch.utils.data
import torch
from torch import nn
class Normalize(nn.Module):
def __init__(self, power=2):
super().__init__()
self.power = power
def forward(self, x):
norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power)
out = x.div(norm + 1... |
SCConv_Layer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class SCConv_Layer(nn.Module):
def __init__(self, num_node_feats, num_edge_feats, num_triangle_feats,
output_size, bias=True, f=F.relu):
super().__init__()
self.n2n_weights = nn.Linear(num_node_feats, output_size, bias=bia... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | ggoh29/Simplicial-neural-network-benchmark | SCConv_Layer | false | 6,768 | [
"MIT"
] | 1 | 9a12bcd054251790d85e3971f5473dcffaa5664b | https://github.com/ggoh29/Simplicial-neural-network-benchmark/tree/9a12bcd054251790d85e3971f5473dcffaa5664b | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_node_feats, num_edge_feats, num_triangle_feats,
output_size, bias=True, f=F.relu):
super().__init__()
self.n2n_weights = nn.Linear(num_node_feats, output_size, bias=bias)
... |
FusedLeakyReLU | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
from torch import nn
import torch.nn.functional as F
def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5):
return F.leaky_relu(input + bias, negative_slope) * scale
class FusedLeakyReLU(nn.Module):
def __init__(self, channel, negative_slope... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
assert_size_stride = torch._C._dynamo.guards.asser... | guyii54/Contrastive-I2I | FusedLeakyReLU | false | 6,769 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 | import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5):
return F.leaky_relu(input + bias, negative_slope) * scale
class Model(nn.Module):
def __init__(self, channel, negative_slope=0.2, sca... |
DCRBranch | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
import torch.optim
import torch.utils.data.distributed
class DCRBranch(nn.Module):
"""Branch Network for DCR"""
def __init__(self, num_classes, in_channels, mid_channels,
normalized_embeddings=False):
super().__init__()
self.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
import torch.nn as nn
import torch.utils.data
import torch.optim
import torch.ut... | gyfastas/CS7319E1G16 | DCRBranch | false | 6,770 | [
"MIT"
] | 1 | 03126af04766abcb269d0c8db481c96c856d21ef | https://github.com/gyfastas/CS7319E1G16/tree/03126af04766abcb269d0c8db481c96c856d21ef | import torch
import torch.nn as nn
import torch.utils.data
import torch.optim
import torch.utils.data.distributed
class Model(nn.Module):
"""Branch Network for DCR"""
def __init__(self, num_classes, in_channels, mid_channels,
normalized_embeddings=False):
super().__init__()
self.norma... |
LinearAttentionLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
from torch import nn
class LinearAttentionLayer(nn.Module):
def __init__(self, input_dim):
super().__init__()
self.linear = nn.Linear(input_dim, 1)
def forward(self, question, question_mask):
qtn = question.view(-1, question.shape[-1])
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | gustavhartz/legal-contract-elements | LinearAttentionLayer | false | 6,771 | [
"MIT"
] | 1 | 7a1e1f0024f9d336c7166f51b4325acf03db86a2 | https://github.com/gustavhartz/legal-contract-elements/tree/7a1e1f0024f9d336c7166f51b4325acf03db86a2 | import torch
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
def __init__(self, input_dim):
super().__init__()
self.linear = nn.Linear(input_dim, 1)
def forward(self, question, question_mask):
qtn = question.view(-1, question.shape[-1])
attn_score... |
DownsampleA | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class DownsampleA(nn.Module):
def __init__(self, nIn, nOut, stride):
super(DownsampleA, self).__init__()
assert stride == 2
self.avg = nn.AvgPool2d(kernel_size=1, stride=stride)
def forward(self, x):
x = self.avg(x)
return torch.cat(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | hamedomidvar/associativeconv | DownsampleA | false | 6,772 | [
"MIT"
] | 1 | 9930915abd3625871354df676865fc44eb92abf3 | https://github.com/hamedomidvar/associativeconv/tree/9930915abd3625871354df676865fc44eb92abf3 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, nIn, nOut, stride):
super().__init__()
assert stride == 2
self.avg = nn.AvgPool2d(kernel_size=1, stride=stride)
def forward(self, x):
x = self.avg(x)
return torch.cat((x, x.mul(0)), 1)
def... |
Reverse | # 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 Reverse(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, audio):
return torch.flip(audio, dims=[1])
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | h0ngwen/torchaudio-augmentations | Reverse | false | 6,773 | [
"MIT"
] | 1 | d044f9d020e12032ab9280acf5f34a337e72d212 | https://github.com/h0ngwen/torchaudio-augmentations/tree/d044f9d020e12032ab9280acf5f34a337e72d212 | import torch
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, audio):
return torch.flip(audio, dims=[1])
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
PolarityInversion | # 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 PolarityInversion(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, audio):
audio = torch.neg(audio)
return audio
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | h0ngwen/torchaudio-augmentations | PolarityInversion | false | 6,774 | [
"MIT"
] | 1 | d044f9d020e12032ab9280acf5f34a337e72d212 | https://github.com/h0ngwen/torchaudio-augmentations/tree/d044f9d020e12032ab9280acf5f34a337e72d212 | import torch
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, audio):
audio = torch.neg(audio)
return audio
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
ToRGB | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
def make_kernel(k):
k = torch.tensor(k, dtype=torch.float32)
if len(k.shape) == 1:
k = k[None, :] * k[:, None]
k /= k.sum()
return k
def upfirdn2d_native(input, kernel, up_x, up... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.utils.data
import torch
from torch import nn
import tor... | guyii54/Contrastive-I2I | ToRGB | false | 6,775 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 | import math
import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
def make_kernel(k):
k = torch.tensor(k, dtype=torch.float32)
if len(k.shape) == 1:
k = k[None, :] * k[:, None]
k /= k.sum()
return k
def upfirdn2d_native(input, kernel, up_x, up... |
ResidualMLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ResidualMLP(nn.Module):
def __init__(self, input_dim, target_dim, hidden_dim=64):
super(ResidualMLP, self).__init__()
self.linear1 = nn.Linear(input_dim, hidden_dim)
self.linear2 = nn.Linear(hidden_dim, hidden_dim)
self.linear3 = nn.Linear(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | greydanus/piecewise_node | ResidualMLP | false | 6,776 | [
"Apache-2.0"
] | 1 | 9d218d4ec1bab486ae954ad2e84732a5f952770f | https://github.com/greydanus/piecewise_node/tree/9d218d4ec1bab486ae954ad2e84732a5f952770f | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, target_dim, hidden_dim=64):
super().__init__()
self.linear1 = nn.Linear(input_dim, hidden_dim)
self.linear2 = nn.Linear(hidden_dim, hidden_dim)
self.linear3 = nn.Linear(hidden_dim, hidden_dim)... |
ModulatedConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
def make_kernel(k):
k = torch.tensor(k, dtype=torch.float32)
if len(k.shape) == 1:
k = k[None, :] * k[:, None]
k /= k.sum()
return k
def upfirdn2d_native(input, kernel, up_x, up... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | guyii54/Contrastive-I2I | ModulatedConv2d | false | 6,777 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 | import math
import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
def make_kernel(k):
k = torch.tensor(k, dtype=torch.float32)
if len(k.shape) == 1:
k = k[None, :] * k[:, None]
k /= k.sum()
return k
def upfirdn2d_native(input, kernel, up_x, up... |
Multiply | # 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
class BaseOperator(ABC):
"""
Abstract class defining the basic structure for operator implementations in Hummingbird.
"""
def __init__(self, regression=False, classification=False, transformer=
False, anomaly_detection=False, **kwargs):
"""
Arg... | 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... | hannahaih/hummingbird | Multiply | false | 6,778 | [
"MIT"
] | 1 | b8ec670b3c90ec7e87d3ae4a2b268075bd5eae65 | https://github.com/hannahaih/hummingbird/tree/b8ec670b3c90ec7e87d3ae4a2b268075bd5eae65 | import torch
from abc import ABC
class BaseOperator(ABC):
"""
Abstract class defining the basic structure for operator implementations in Hummingbird.
"""
def __init__(self, regression=False, classification=False, transformer=
False, anomaly_detection=False, **kwargs):
"""
Arg... |
PoolingF | # 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
from torch import nn
class Normalize(nn.Module):
def __init__(self, power=2):
super(Normalize, self).__init__()
self.power = power
def forward(self, x):
norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power)
out =... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.data
impo... | guyii54/Contrastive-I2I | PoolingF | false | 6,779 | [
"BSD-3-Clause"
] | 1 | e73daa0f9d3770c2280a304c39678d5b22440647 | https://github.com/guyii54/Contrastive-I2I/tree/e73daa0f9d3770c2280a304c39678d5b22440647 | import torch
import torch.utils.data
import torch
from torch import nn
class Normalize(nn.Module):
def __init__(self, power=2):
super().__init__()
self.power = power
def forward(self, x):
norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power)
out = x.div(norm + 1... |
HierarchicalPolicy | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as f
class HierarchicalPolicy(nn.Module):
def __init__(self, args):
super(HierarchicalPolicy, self).__init__()
self.fc_1 = nn.Linear(args.state_shape, 128)
self.fc_2 = 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.... | hanhanAnderson/LSF-SAC | HierarchicalPolicy | false | 6,780 | [
"MIT"
] | 1 | 3e2daf0da23b0ea08e92948c87f7e583f3fb1ed9 | https://github.com/hanhanAnderson/LSF-SAC/tree/3e2daf0da23b0ea08e92948c87f7e583f3fb1ed9 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.nn.functional as f
class Model(nn.Module):
def __init__(self, args):
super().__init__()
self.fc_1 = nn.Linear(args.state_shape, 128)
self.fc_2 = nn.Linear(128, args.noise_dim)
def forward(se... |
NumericLabelEncoder | # 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
class BaseOperator(ABC):
"""
Abstract class defining the basic structure for operator implementations in Hummingbird.
"""
def __init__(self, regression=False, classification=False, transformer=
False, anomaly_detection=False, **kwargs):
"""
Arg... | 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... | hannahaih/hummingbird | NumericLabelEncoder | false | 6,781 | [
"MIT"
] | 1 | b8ec670b3c90ec7e87d3ae4a2b268075bd5eae65 | https://github.com/hannahaih/hummingbird/tree/b8ec670b3c90ec7e87d3ae4a2b268075bd5eae65 | import torch
from abc import ABC
class BaseOperator(ABC):
"""
Abstract class defining the basic structure for operator implementations in Hummingbird.
"""
def __init__(self, regression=False, classification=False, transformer=
False, anomaly_detection=False, **kwargs):
"""
Arg... |
PositionalEncoding | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 PositionalEncoding(nn.Module):
def __init__(self, patch_num, d_model, dropout=0.1):
super(PositionalEncoding, self).__init__()
self.pe = nn.Parameter(torch.rand(patch_num + 1, d_model))
self.add_positional_encoding = lambda x: x + self.pe[:x.size(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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | hankyul2/ImageClassification | PositionalEncoding | false | 6,782 | [
"Apache-2.0"
] | 1 | c4df6bf3dc1ee804f9885d586aa581ebb4d7ca05 | https://github.com/hankyul2/ImageClassification/tree/c4df6bf3dc1ee804f9885d586aa581ebb4d7ca05 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, patch_num, d_model, dropout=0.1):
super().__init__()
self.pe = nn.Parameter(torch.rand(patch_num + 1, d_model))
self.add_positional_encoding = lambda x: x + self.pe[:x.size(1)
].unsqueeze(0)
s... |
StdConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 StdConv(nn.Conv2d):
def forward(self, x):
return self._conv_forward(x, self.standarize(self.weight), self.bias)
def standarize(self, x):
return (x - x.mean(dim=(1, 2, 3), keepdim=True)) / (x.std(dim=(1, 2,
3), keepdim=True) + 1e-06)
def g... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | hankyul2/ImageClassification | StdConv | false | 6,783 | [
"Apache-2.0"
] | 1 | c4df6bf3dc1ee804f9885d586aa581ebb4d7ca05 | https://github.com/hankyul2/ImageClassification/tree/c4df6bf3dc1ee804f9885d586aa581ebb4d7ca05 | import torch
from torch import nn
class Model(nn.Conv2d):
def forward(self, x):
return self._conv_forward(x, self.standarize(self.weight), self.bias)
def standarize(self, x):
return (x - x.mean(dim=(1, 2, 3), keepdim=True)) / (x.std(dim=(1, 2,
3), keepdim=True) + 1e-06)
def get... |
rec_attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.utils.data
import torch.nn as nn
def batch_product(iput, mat2):
result = None
for i in range(iput.size()[0]):
op = torch.mm(iput[i], mat2)
op = op.unsqueeze(0)
if result is None:
result = op
els... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | gzerveas/TransformChrome | rec_attention | false | 6,784 | [
"MIT"
] | 1 | ab1046009aff2ec863aa65223dcfcd750d41ab86 | https://github.com/gzerveas/TransformChrome/tree/ab1046009aff2ec863aa65223dcfcd750d41ab86 | from _paritybench_helpers import _mock_config
import torch
import torch.utils.data
import torch.nn as nn
def batch_product(iput, mat2):
result = None
for i in range(iput.size()[0]):
op = torch.mm(iput[i], mat2)
op = op.unsqueeze(0)
if result is None:
result = op
els... |
ConvertPointsToHomogeneous | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def convert_points_to_homogeneous(points):
"""Function that converts points from Euclidean to homogeneous space.
See :class:`~torchgeometry.ConvertPointsToHomogeneous` for details.
Examples::
>>> input = torch.rand(2, 4, 3) # BxNx3
>>> output = tgm.co... | 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... | hassony2/frankmocap | ConvertPointsToHomogeneous | false | 6,785 | [
"BSD-3-Clause"
] | 1 | 50aae41d9b41d2f344ae1709bbf1b25974209fa9 | https://github.com/hassony2/frankmocap/tree/50aae41d9b41d2f344ae1709bbf1b25974209fa9 | import torch
import torch.nn as nn
def convert_points_to_homogeneous(points):
"""Function that converts points from Euclidean to homogeneous space.
See :class:`~torchgeometry.ConvertPointsToHomogeneous` for details.
Examples::
>>> input = torch.rand(2, 4, 3) # BxNx3
>>> output = tgm.co... |
Hidden2Discrete | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init
class Hidden2Discrete(nn.Module):
def __init__(self, input_size, y_size, k_size, is_lstm=False, has_bias=True
):
super(Hidden2Discrete, self).__init__()
self.y_size = y_size
self.k_size = k_siz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | haojiepan1/CrossWOZ | Hidden2Discrete | false | 6,786 | [
"Apache-2.0"
] | 1 | 6d7b4c4cfb73a528b76074764687906abecc90b6 | https://github.com/haojiepan1/CrossWOZ/tree/6d7b4c4cfb73a528b76074764687906abecc90b6 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init
class Model(nn.Module):
def __init__(self, input_size, y_size, k_size, is_lstm=False, has_bias=True
):
super().__init__()
self.y_size = y_size
self.k_size = k_size
latent_size = self.k_... |
ConvertPointsFromHomogeneous | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def convert_points_from_homogeneous(points):
"""Function that converts points from homogeneous to Euclidean space.
See :class:`~torchgeometry.ConvertPointsFromHomogeneous` for details.
Examples::
>>> input = torch.rand(2, 4, 3) # BxNx3
>>> output = tg... | 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... | hassony2/frankmocap | ConvertPointsFromHomogeneous | false | 6,787 | [
"BSD-3-Clause"
] | 1 | 50aae41d9b41d2f344ae1709bbf1b25974209fa9 | https://github.com/hassony2/frankmocap/tree/50aae41d9b41d2f344ae1709bbf1b25974209fa9 | import torch
import torch.nn as nn
def convert_points_from_homogeneous(points):
"""Function that converts points from homogeneous to Euclidean space.
See :class:`~torchgeometry.ConvertPointsFromHomogeneous` for details.
Examples::
>>> input = torch.rand(2, 4, 3) # BxNx3
>>> output = tg... |
GCN_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 math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
class GCN_conv(nn.Module):
def __init__(self, in_ft, out_ft, bias=False, dropout=0.0, activation=F
.relu):
super(GCN_conv, self).__init__()
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 math
import torch.util... | haoyfan/Dual-SVDAE | GCN_conv | false | 6,788 | [
"MIT"
] | 1 | 1fcb61960606d743438f33b740cb434dbfcfd727 | https://github.com/haoyfan/Dual-SVDAE/tree/1fcb61960606d743438f33b740cb434dbfcfd727 | import math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
class Model(nn.Module):
def __init__(self, in_ft, out_ft, bias=False, dropout=0.0, activation=F
.relu):
super().__init__()
self.weight = Paramete... |
SelfAttn | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init
import torch as th
class SelfAttn(nn.Module):
def __init__(self, hidden_size):
super(SelfAttn, self).__init__()
self.query = nn.Linear(hidden_size, 1)
def forward(self, keys, values, attn_mask=None):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | haojiepan1/CrossWOZ | SelfAttn | false | 6,789 | [
"Apache-2.0"
] | 1 | 6d7b4c4cfb73a528b76074764687906abecc90b6 | https://github.com/haojiepan1/CrossWOZ/tree/6d7b4c4cfb73a528b76074764687906abecc90b6 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init
import torch as th
class Model(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.query = nn.Linear(hidden_size, 1)
def forward(self, keys, values, attn_mask=None):
"""
:... |
NormKLLoss | # 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.init
import torch as th
from torch.nn.modules.loss import _Loss
class NormKLLoss(_Loss):
def __init__(self, unit_average=False):
super(NormKLLoss, self).__init__()
self.unit_average = unit_average
def forward(self, recog_mu, recog_logvar, prior_mu, prior_logvar):... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn.init
from torch.nn.modules.loss import _Loss
assert_size_... | haojiepan1/CrossWOZ | NormKLLoss | false | 6,790 | [
"Apache-2.0"
] | 1 | 6d7b4c4cfb73a528b76074764687906abecc90b6 | https://github.com/haojiepan1/CrossWOZ/tree/6d7b4c4cfb73a528b76074764687906abecc90b6 | import torch
import torch.nn.init
import torch as th
from torch.nn.modules.loss import _Loss
class Model(_Loss):
def __init__(self, unit_average=False):
super().__init__()
self.unit_average = unit_average
def forward(self, recog_mu, recog_logvar, prior_mu, prior_logvar):
loss = 1.0 +... |
Zeronet | # 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 Zeronet(nn.Module):
def forward(self, x):
"""
Return a zero-out copy of x
:param x: torch.Tensor
:return: x*0, type torch.Tensor
"""
return torch.zeros_like(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | hedixia/xhd_source | Zeronet | false | 6,791 | [
"MIT"
] | 1 | cb176bceb5f5349d68206aaf60014e251de36300 | https://github.com/hedixia/xhd_source/tree/cb176bceb5f5349d68206aaf60014e251de36300 | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x):
"""
Return a zero-out copy of x
:param x: torch.Tensor
:return: x*0, type torch.Tensor
"""
return torch.zeros_like(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def ge... |
BinaryDiceLoss | # 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 BinaryDiceLoss(nn.Module):
"""二分类版本的Dice Loss"""
def __init__(self, smooth: 'int'=1, exponent: 'int'=1, reduction: 'str'
='mean', loss_weight: 'float'=1.0, balance_weight: 'float'=1.0,
activation: 'bool'=False) ->None:
super(BinaryDiceLoss, sel... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | hehaoming/RSI-ChangeDetection | BinaryDiceLoss | false | 6,792 | [
"MIT"
] | 1 | f24a1d79c03fb9fefc49bc91bc94b3c120992496 | https://github.com/hehaoming/RSI-ChangeDetection/tree/f24a1d79c03fb9fefc49bc91bc94b3c120992496 | import torch
import torch.nn as nn
class Model(nn.Module):
"""二分类版本的Dice Loss"""
def __init__(self, smooth: 'int'=1, exponent: 'int'=1, reduction: 'str'
='mean', loss_weight: 'float'=1.0, balance_weight: 'float'=1.0,
activation: 'bool'=False) ->None:
super().__init__()
self.sm... |
EqualizedLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 EqualizedLinear(nn.Module):
def __init__(self, input_size, output_size, gain=2 ** 0.5, lrmul=0.01):
super().__init__()
he_std = gain * input_size ** -0.5
init_std = 1.0 / lrmul
self.w_mul = he_std * lrmul
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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... | hejj16/Landscape-StyleGAN | EqualizedLinear | false | 6,793 | [
"MIT"
] | 1 | a93cd32b588ab21da9d7589e705ca6f09db18408 | https://github.com/hejj16/Landscape-StyleGAN/tree/a93cd32b588ab21da9d7589e705ca6f09db18408 | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_size, output_size, gain=2 ** 0.5, lrmul=0.01):
super().__init__()
he_std = gain * input_size ** -0.5
init_std = 1.0 / lrmul
self.w_mul = he_std * lrmul
self.w... |
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
class Classifier(nn.Module):
def __init__(self):
super(Classifier, self).__init__()
self.fc1 = nn.Linear(900, 3)
def forward(self, x):
x = F.avg_pool2d(x, 8)
x = x.view(-1, 900)
x = self.fc1(x)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | helinwang/pytorch-semseg | Classifier | false | 6,794 | [
"MIT"
] | 1 | 117e5fb8afbad87d6968de1683867854ddec5885 | https://github.com/helinwang/pytorch-semseg/tree/117e5fb8afbad87d6968de1683867854ddec5885 | 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(900, 3)
def forward(self, x):
x = F.avg_pool2d(x, 8)
x = x.view(-1, 900)
x = self.fc1(x)
return F.log_softmax... |
ClassificationLogSoftmax | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ClassificationLogSoftmax(nn.Module):
"""
Classifier on top of the hidden representation of the first token, which
is usually [CLS] token in BERT-like architectures.
"""
def __init__(self, hidden_size, num_classes):
super().__init__()
self.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
from torch._inductor.runtime.... | harisankarh/NeMo | ClassificationLogSoftmax | false | 6,795 | [
"Apache-2.0"
] | 1 | 27bfb1aed24a786626e1c27c37417ebcd226ca8a | https://github.com/harisankarh/NeMo/tree/27bfb1aed24a786626e1c27c37417ebcd226ca8a | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Classifier on top of the hidden representation of the first token, which
is usually [CLS] token in BERT-like architectures.
"""
def __init__(self, hidden_size, num_classes):
super().__init__()
self.dense1 = nn.Linear(h... |
BalancedBinaryCrossEntropy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from typing import Any
import torch.nn.functional as F
class BalancedBinaryCrossEntropy(nn.Module):
"""二分类加权交叉熵"""
def __init__(self, reduction: 'str'='mean', class_weight: 'Any'=None,
loss_weight: 'float'=1.0, activation: 'bool'=False) ->None:
super(Balance... | 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... | hehaoming/RSI-ChangeDetection | BalancedBinaryCrossEntropy | false | 6,796 | [
"MIT"
] | 1 | f24a1d79c03fb9fefc49bc91bc94b3c120992496 | https://github.com/hehaoming/RSI-ChangeDetection/tree/f24a1d79c03fb9fefc49bc91bc94b3c120992496 | import torch
import torch.nn as nn
from typing import Any
import torch.nn.functional as F
class Model(nn.Module):
"""二分类加权交叉熵"""
def __init__(self, reduction: 'str'='mean', class_weight: 'Any'=None,
loss_weight: 'float'=1.0, activation: 'bool'=False) ->None:
super().__init__()
self.re... |
SeperableConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
def _get_padding(kernel_size, stride, dilation):
padding = (stride - 1 + dilation * (kernel_size - 1)) // 2
return padding
class SeperableConv(nn.Module):
def __init__(self, inp, outp, k=3, stride=1, dilation=1):
super(Seperable... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | henningpohl/body-based-ar | SeperableConv | false | 6,797 | [
"MIT"
] | 1 | dc7d5d6eaf8dd4427de0f2b1cfdcc415cbfffdfb | https://github.com/henningpohl/body-based-ar/tree/dc7d5d6eaf8dd4427de0f2b1cfdcc415cbfffdfb | import torch
import torch.nn as nn
import torch.nn.functional as F
def _get_padding(kernel_size, stride, dilation):
padding = (stride - 1 + dilation * (kernel_size - 1)) // 2
return padding
class Model(nn.Module):
def __init__(self, inp, outp, k=3, stride=1, dilation=1):
super().__init__()
... |
HybridLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from typing import Any
import torch.nn.functional as F
class BalancedBinaryCrossEntropy(nn.Module):
"""二分类加权交叉熵"""
def __init__(self, reduction: 'str'='mean', class_weight: 'Any'=None,
loss_weight: 'float'=1.0, activation: 'bool'=False) ->None:
super(Balance... | 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... | hehaoming/RSI-ChangeDetection | HybridLoss | false | 6,798 | [
"MIT"
] | 1 | f24a1d79c03fb9fefc49bc91bc94b3c120992496 | https://github.com/hehaoming/RSI-ChangeDetection/tree/f24a1d79c03fb9fefc49bc91bc94b3c120992496 | import torch
import torch.nn as nn
from typing import Any
import torch.nn.functional as F
class BalancedBinaryCrossEntropy(nn.Module):
"""二分类加权交叉熵"""
def __init__(self, reduction: 'str'='mean', class_weight: 'Any'=None,
loss_weight: 'float'=1.0, activation: 'bool'=False) ->None:
super().__ini... |
BalancedBinaryCrossEntropyWithLogits | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from typing import Any
class BalancedBinaryCrossEntropyWithLogits(nn.Module):
"""二分类加权交叉熵"""
def __init__(self, reduction: 'str'='mean', class_weight: 'Any'=None,
loss_weight: 'float'=1.0, activation: 'bool'=False, eposion:
'float'=1e-10) ->None:
sup... | 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... | hehaoming/RSI-ChangeDetection | BalancedBinaryCrossEntropyWithLogits | false | 6,799 | [
"MIT"
] | 1 | f24a1d79c03fb9fefc49bc91bc94b3c120992496 | https://github.com/hehaoming/RSI-ChangeDetection/tree/f24a1d79c03fb9fefc49bc91bc94b3c120992496 | import torch
import torch.nn as nn
from typing import Any
class Model(nn.Module):
"""二分类加权交叉熵"""
def __init__(self, reduction: 'str'='mean', class_weight: 'Any'=None,
loss_weight: 'float'=1.0, activation: 'bool'=False, eposion:
'float'=1e-10) ->None:
super().__init__()
self.re... |
InputConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
def _get_padding(kernel_size, stride, dilation):
padding = (stride - 1 + dilation * (kernel_size - 1)) // 2
return padding
class InputConv(nn.Module):
def __init__(self, inp, outp, k=3, stride=1, dilation=1):
super(InputConv, se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | henningpohl/body-based-ar | InputConv | false | 6,800 | [
"MIT"
] | 1 | dc7d5d6eaf8dd4427de0f2b1cfdcc415cbfffdfb | https://github.com/henningpohl/body-based-ar/tree/dc7d5d6eaf8dd4427de0f2b1cfdcc415cbfffdfb | import torch
import torch.nn as nn
import torch.nn.functional as F
def _get_padding(kernel_size, stride, dilation):
padding = (stride - 1 + dilation * (kernel_size - 1)) // 2
return padding
class Model(nn.Module):
def __init__(self, inp, outp, k=3, stride=1, dilation=1):
super().__init__()
... |
ActQuant_PACT | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
def uniform_quantize(k):
class qfn(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
if k == 32:
out = input
elif k == 1:
out = torch.sign(input)
else:
n = float... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | heymesut/SJTU_microe | ActQuant_PACT | false | 6,801 | [
"BSD-3-Clause"
] | 1 | 7a862d03b4d8fe4c8608173a16082f44001f3f13 | https://github.com/heymesut/SJTU_microe/tree/7a862d03b4d8fe4c8608173a16082f44001f3f13 | import torch
import torch.nn as nn
def uniform_quantize(k):
class qfn(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
if k == 32:
out = input
elif k == 1:
out = torch.sign(input)
else:
n = float... |
Mish | # 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 Mish(nn.Module):
def forward(self, x):
return x.mul_(F.softplus(x).tanh())
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.gu... | heymesut/SJTU_microe | Mish | false | 6,802 | [
"BSD-3-Clause"
] | 1 | 7a862d03b4d8fe4c8608173a16082f44001f3f13 | https://github.com/heymesut/SJTU_microe/tree/7a862d03b4d8fe4c8608173a16082f44001f3f13 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def forward(self, x):
return x.mul_(F.softplus(x).tanh())
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
activation_quantize_fn | # AOT ID: ['1_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def uniform_quantize(k):
class qfn(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
if k == 32:
out = input
elif k == 1:
out = torch.sign(input)
else:
n = float... | 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_... | heymesut/SJTU_microe | activation_quantize_fn | false | 6,803 | [
"BSD-3-Clause"
] | 1 | 7a862d03b4d8fe4c8608173a16082f44001f3f13 | https://github.com/heymesut/SJTU_microe/tree/7a862d03b4d8fe4c8608173a16082f44001f3f13 | import torch
import torch.nn as nn
def uniform_quantize(k):
class qfn(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
if k == 32:
out = input
elif k == 1:
out = torch.sign(input)
else:
n = float... |
weightedFeatureFusion | # 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 weightedFeatureFusion(nn.Module):
def __init__(self, layers, weight=False):
super(weightedFeatureFusion, self).__init__()
self.layers = layers
self.weight = weight
self.n = len(layers) + 1
if weight:
self.w = torch.nn.Pa... | 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... | heymesut/SJTU_microe | weightedFeatureFusion | false | 6,804 | [
"BSD-3-Clause"
] | 1 | 7a862d03b4d8fe4c8608173a16082f44001f3f13 | https://github.com/heymesut/SJTU_microe/tree/7a862d03b4d8fe4c8608173a16082f44001f3f13 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, layers, weight=False):
super().__init__()
self.layers = layers
self.weight = weight
self.n = len(layers) + 1
if weight:
self.w = torch.nn.Parameter(torch.zeros(self.n))
def forwa... |
ClipGlobalAvgPool2d | # 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 FastGlobalAvgPool2d(nn.Module):
def __init__(self, flatten=False):
super(FastGlobalAvgPool2d, self).__init__()
self.flatten = flatten
def forward(self, x):
if self.flatten:
in_size = x.size()
return x.view((in_size[0], i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | hfyer/NAIC2020_ReID_R1 | ClipGlobalAvgPool2d | false | 6,805 | [
"Apache-2.0"
] | 1 | 240f0c9f65e482e6b0090f01d9f9e3373a337033 | https://github.com/hfyer/NAIC2020_ReID_R1/tree/240f0c9f65e482e6b0090f01d9f9e3373a337033 | import torch
from torch import nn
class FastGlobalAvgPool2d(nn.Module):
def __init__(self, flatten=False):
super().__init__()
self.flatten = flatten
def forward(self, x):
if self.flatten:
in_size = x.size()
return x.view((in_size[0], in_size[1], -1)).mean(dim=... |
GeneralizedMeanPooling | # 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 GeneralizedMeanPooling(nn.Module):
"""Applies a 2D power-average adaptive pooling over an input signal composed of several input planes.
The function computed is: :math:`f(X) = pow(sum(pow(X, p)), 1/p)`
- At p = infinity, one gets Max Pooling
- At p = 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_... | hfyer/NAIC2020_ReID_R1 | GeneralizedMeanPooling | false | 6,806 | [
"Apache-2.0"
] | 1 | 240f0c9f65e482e6b0090f01d9f9e3373a337033 | https://github.com/hfyer/NAIC2020_ReID_R1/tree/240f0c9f65e482e6b0090f01d9f9e3373a337033 | import torch
from torch import nn
class Model(nn.Module):
"""Applies a 2D power-average adaptive pooling over an input signal composed of several input planes.
The function computed is: :math:`f(X) = pow(sum(pow(X, p)), 1/p)`
- At p = infinity, one gets Max Pooling
- At p = 1, one gets Average... |
weight_quantize_fn | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def uniform_quantize(k):
class qfn(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
if k == 32:
out = input
elif k == 1:
out = torch.sign(input)
else:
n = float... | 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... | heymesut/SJTU_microe | weight_quantize_fn | false | 6,807 | [
"BSD-3-Clause"
] | 1 | 7a862d03b4d8fe4c8608173a16082f44001f3f13 | https://github.com/heymesut/SJTU_microe/tree/7a862d03b4d8fe4c8608173a16082f44001f3f13 | import torch
import torch.nn as nn
def uniform_quantize(k):
class qfn(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
if k == 32:
out = input
elif k == 1:
out = torch.sign(input)
else:
n = float... |
TLU | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Parameter
from torch.nn.parameter import Parameter
class TLU(nn.Module):
def __init__(self, num_features):
"""max(y, tau) = max(y - tau, 0) + tau = ReLU(y - tau) + tau"""
super(TLU, self).__init__()
self.num_features = num_features
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from torch.nn import Parameter
from torch.nn.parameter import Parame... | hfyer/NAIC2020_ReID_R1 | TLU | false | 6,808 | [
"Apache-2.0"
] | 1 | 240f0c9f65e482e6b0090f01d9f9e3373a337033 | https://github.com/hfyer/NAIC2020_ReID_R1/tree/240f0c9f65e482e6b0090f01d9f9e3373a337033 | import torch
from torch import nn
from torch.nn import Parameter
from torch.nn.parameter import Parameter
class Model(nn.Module):
def __init__(self, num_features):
"""max(y, tau) = max(y - tau, 0) + tau = ReLU(y - tau) + tau"""
super().__init__()
self.num_features = num_features
s... |
YOLOLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
class YOLOLayer(nn.Module):
"""
Detection Layer
"""
def __init__(self, in_ch, n_anchors, n_classes):
super(YOLOLayer, self).__init__()
self.n_anchors = n_anchors
self.n_classes = n_classes
self.conv = nn.Conv2d(in_c... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | hiroki-kawauchi/SHAPObjectDetection | YOLOLayer | false | 6,809 | [
"MIT"
] | 1 | 3667d026949137cf710fc627672809c8564f5c6f | https://github.com/hiroki-kawauchi/SHAPObjectDetection/tree/3667d026949137cf710fc627672809c8564f5c6f | import torch
import numpy as np
import torch.nn as nn
class Model(nn.Module):
"""
Detection Layer
"""
def __init__(self, in_ch, n_anchors, n_classes):
super().__init__()
self.n_anchors = n_anchors
self.n_classes = n_classes
self.conv = nn.Conv2d(in_channels=in_ch, out_... |
AdaptiveAvgMaxPool2d | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
class FastGlobalAvgPool2d(nn.Module):
def __init__(self, flatten=False):
super(FastGlobalAvgPool2d, self).__init__()
self.flatten = flatten
def forward(self, x):
if self.flatten:
in_size = x.size()
return x.view((in_size[0], i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | hfyer/NAIC2020_ReID_R1 | AdaptiveAvgMaxPool2d | false | 6,810 | [
"Apache-2.0"
] | 1 | 240f0c9f65e482e6b0090f01d9f9e3373a337033 | https://github.com/hfyer/NAIC2020_ReID_R1/tree/240f0c9f65e482e6b0090f01d9f9e3373a337033 | import torch
from torch import nn
class FastGlobalAvgPool2d(nn.Module):
def __init__(self, flatten=False):
super().__init__()
self.flatten = flatten
def forward(self, x):
if self.flatten:
in_size = x.size()
return x.view((in_size[0], in_size[1], -1)).mean(dim=... |
KeyValueAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Variable
import torch.nn.init
class KeyValueAttention(nn.Module):
def __init__(self, query_size, key_size, value_size, hid_size, init_range):
super(KeyValueAttention, self).__init__()
self.key2hid = nn.L... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | haojiepan1/CrossWOZ | KeyValueAttention | false | 6,811 | [
"Apache-2.0"
] | 1 | 6d7b4c4cfb73a528b76074764687906abecc90b6 | https://github.com/haojiepan1/CrossWOZ/tree/6d7b4c4cfb73a528b76074764687906abecc90b6 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.nn.init
class Model(nn.Module):
def __init__(self, query_size, key_size, value_size, hid_size, init_range):
super().__init__()
self.key2hid = nn.Linear(key_size, hid_size)
s... |
LandmarksLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import numpy as np
import torch.nn as nn
import torch.utils.data
class WingLoss(nn.Module):
def __init__(self, w=10, e=2):
super(WingLoss, self).__init__()
self.w = w
self.e = e
self.C = self.w - self.w * np.log(1 + self.w / self.e)
def forward(self, x, t, sigma=... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strid... | homomorfism/wise-programming | LandmarksLoss | false | 6,812 | [
"MIT"
] | 1 | e0589e8900237ddc9c3abf54c85be532cacf2d33 | https://github.com/homomorfism/wise-programming/tree/e0589e8900237ddc9c3abf54c85be532cacf2d33 | import torch
import numpy as np
import torch.nn as nn
import torch.utils.data
class WingLoss(nn.Module):
def __init__(self, w=10, e=2):
super().__init__()
self.w = w
self.e = e
self.C = self.w - self.w * np.log(1 + self.w / self.e)
def forward(self, x, t, sigma=1):
we... |
Decoder1 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Decoder1(nn.Module):
def __init__(self):
super(Decoder1, self).__init__()
self.reflecPad2 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv3 = nn.Conv2d(64, 3, 3, 1, 0)
def forward(self, x):
out = self.reflecPad2(x)
out = self.conv3... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | hologerry/wct_experiment | Decoder1 | false | 6,814 | [
"MIT"
] | 1 | 890d885561dc8df8c4ae732aebd902aa838257e6 | https://github.com/hologerry/wct_experiment/tree/890d885561dc8df8c4ae732aebd902aa838257e6 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.reflecPad2 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv3 = nn.Conv2d(64, 3, 3, 1, 0)
def forward(self, x):
out = self.reflecPad2(x)
out = self.conv3(out)
ret... |
QuantMeasure | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
from torch.autograd.function import InplaceFunction
def quantize(x, num_bits=8, min_value=None, max_value=None, num_chunks=None,
stochastic=False, inplace=False, quantize=False, layer_num=-1, multi=
False, index=[], is_act=False):
return UniformQuantize().apply(x, num_bit... | 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
from to... | hoseung2/DNAS-Compression | QuantMeasure | false | 6,815 | [
"MIT"
] | 1 | 645407fc572045f33278c935091a07e0ccfce87f | https://github.com/hoseung2/DNAS-Compression/tree/645407fc572045f33278c935091a07e0ccfce87f | import torch
from torch import nn
from torch.autograd.function import InplaceFunction
def quantize(x, num_bits=8, min_value=None, max_value=None, num_chunks=None,
stochastic=False, inplace=False, quantize=False, layer_num=-1, multi=
False, index=[], is_act=False):
return UniformQuantize().apply(x, num_bit... |
SmooothLabelCELoss | # 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 SmooothLabelCELoss(nn.Module):
def __init__(self, smooth=0.1, use_uniform=False, reduction='mean'):
super(SmooothLabelCELoss, self).__init__()
self.smooth_coef = smooth
self.smooth_std = 0.5
self.reduction = reduction
self.use_unifo... | 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... | hekq/3DFingerPose | SmooothLabelCELoss | false | 6,816 | [
"MIT"
] | 1 | 385c672408e2fd29ed0373a842727c9fcfd0fc59 | https://github.com/hekq/3DFingerPose/tree/385c672408e2fd29ed0373a842727c9fcfd0fc59 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, smooth=0.1, use_uniform=False, reduction='mean'):
super().__init__()
self.smooth_coef = smooth
self.smooth_std = 0.5
self.reduction = reduction
self.use_uniform = use_uniform
self.interva... |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
class BinaryDiceLoss(nn.Module):
"""Dice loss of binary class
Args:
smooth: A float number to smooth loss, and avoid NaN error, default: 1
p: Denominator value: \\sum{x^p} + \\sum{y^p}, default: 2
predict: A tensor of 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 import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | hekq/3DFingerPose | DiceLoss | false | 6,817 | [
"MIT"
] | 1 | 385c672408e2fd29ed0373a842727c9fcfd0fc59 | https://github.com/hekq/3DFingerPose/tree/385c672408e2fd29ed0373a842727c9fcfd0fc59 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BinaryDiceLoss(nn.Module):
"""Dice loss of binary class
Args:
smooth: A float number to smooth loss, and avoid NaN error, default: 1
p: Denominator value: \\sum{x^p} + \\sum{y^p}, default: 2
predict: A tensor of s... |
StdConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 StdConv2d(nn.Conv2d):
def forward(self, x):
w = self.weight
v = torch.var(w, dim=[1, 2, 3], keepdim=True, unbiased=False)
m = torch.mean(w, dim=[1, 2, 3], keepdim=True)
w = (w - m) / torch.sqrt(v + 1e-10)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | hrlblab/Glo-In-One | StdConv2d | false | 6,818 | [
"Apache-2.0"
] | 1 | 7daef49c557bccd6f5c956b88603357346dc78a2 | https://github.com/hrlblab/Glo-In-One/tree/7daef49c557bccd6f5c956b88603357346dc78a2 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Conv2d):
def forward(self, x):
w = self.weight
v = torch.var(w, dim=[1, 2, 3], keepdim=True, unbiased=False)
m = torch.mean(w, dim=[1, 2, 3], keepdim=True)
w = (w - m) / torch.sqrt(v + 1e-10)
... |
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
from torch.autograd import Variable
import torch.nn as nn
import torch.optim
class Bottle(nn.Module):
""" Perform the reshape routine before and after an operation """
def forward(self, input):
if len(input.size()) <= 2:
return super(Bottle, self).forward(input)
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.... | howardchenhd/Transformer-pytorch | ScaledDotProductAttention | false | 6,819 | [
"MIT"
] | 1 | ae71ed5767272feb7e717be6d5bfce46f80ec57a | https://github.com/howardchenhd/Transformer-pytorch/tree/ae71ed5767272feb7e717be6d5bfce46f80ec57a | import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.optim
class Bottle(nn.Module):
""" Perform the reshape routine before and after an operation """
def forward(self, input):
if len(input.size()) <= 2:
return super(Bottle, self).forward(input)
size ... |
LeNet_300_100 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 LeNet_300_100(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(28 * 28, 300)
self.fc2 = nn.Linear(300, 100)
self.fc3 = nn.Linear(100, 10)
self.relu = nn.ReLU()
self.last... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | htt-trangtran/smg | LeNet_300_100 | false | 6,820 | [
"MIT"
] | 1 | b7a49055e7d48ec456bac67ab473db2183d2f597 | https://github.com/htt-trangtran/smg/tree/b7a49055e7d48ec456bac67ab473db2183d2f597 | 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, 300)
self.fc2 = nn.Linear(300, 100)
self.fc3 = nn.Linear(100, 10)
self.relu = nn.ReLU()
self.lastbias = '... |
IA_gate | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 IA_gate(nn.Module):
def __init__(self, in_dim, out_dim):
super(IA_gate, self).__init__()
self.IA = nn.Linear(in_dim, out_dim)
def forward(self, x, IA_head):
a = self.IA(IA_head)
a = 1.0 + torch.tanh(a)
a = a.unsqueeze(-1).unsqu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | huanglf714/COMatchNet | IA_gate | false | 6,821 | [
"Apache-2.0"
] | 1 | 79023f5be65d354eb9bdac026d7e0d73110bc4aa | https://github.com/huanglf714/COMatchNet/tree/79023f5be65d354eb9bdac026d7e0d73110bc4aa | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_dim, out_dim):
super().__init__()
self.IA = nn.Linear(in_dim, out_dim)
def forward(self, x, IA_head):
a = self.IA(IA_head)
a = 1.0 + torch.tanh(a)
a = a.unsqueeze(-1).unsqueeze(-1)
... |
ConvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
def conv3x3(in_planes, out_planes, strd=1, padding=1, bias=False):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=strd,
padding=padding, bias=bias)
class ConvBlock(nn.Module):
de... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | hhj1897/fan_training | ConvBlock | false | 6,822 | [
"MIT"
] | 1 | 5882f9edf2f1a07c80a6d1f3341a7cf1d348e217 | https://github.com/hhj1897/fan_training/tree/5882f9edf2f1a07c80a6d1f3341a7cf1d348e217 | import torch
import torch.nn as nn
import torch.nn.functional as F
def conv3x3(in_planes, out_planes, strd=1, padding=1, bias=False):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=strd,
padding=padding, bias=bias)
class Model(nn.Module):
def __... |
PositionwiseFeedForward | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.optim
class LayerNorm(nn.Module):
def __init__(self, features, eps=1e-06):
super(LayerNorm, self).__init__()
self.a_2 = nn.Parameter(torch.ones(features))
self.b_2 = nn.Parameter(torch.zeros(features))
self.eps = eps
def forward... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | howardchenhd/Transformer-pytorch | PositionwiseFeedForward | false | 6,823 | [
"MIT"
] | 1 | ae71ed5767272feb7e717be6d5bfce46f80ec57a | https://github.com/howardchenhd/Transformer-pytorch/tree/ae71ed5767272feb7e717be6d5bfce46f80ec57a | import torch
import torch.nn as nn
import torch.optim
class LayerNorm(nn.Module):
def __init__(self, features, eps=1e-06):
super().__init__()
self.a_2 = nn.Parameter(torch.ones(features))
self.b_2 = nn.Parameter(torch.zeros(features))
self.eps = eps
def forward(self, x):
... |
MultiHeadedAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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.autograd import Variable
import torch.nn as nn
import torch.optim
class MultiHeadedAttention(nn.Module):
"""
Multi-Head Attention module from
"Attention is All You Need"
:cite:`DBLP:journals/corr/VaswaniSPUJGKP17`.
Similar to standard `dot` attention but uses
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | howardchenhd/Transformer-pytorch | MultiHeadedAttention | false | 6,824 | [
"MIT"
] | 1 | ae71ed5767272feb7e717be6d5bfce46f80ec57a | https://github.com/howardchenhd/Transformer-pytorch/tree/ae71ed5767272feb7e717be6d5bfce46f80ec57a | import math
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.optim
class Model(nn.Module):
"""
Multi-Head Attention module from
"Attention is All You Need"
:cite:`DBLP:journals/corr/VaswaniSPUJGKP17`.
Similar to standard `dot` attention but uses
multiple att... |
Decoder2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Decoder2(nn.Module):
def __init__(self):
super(Decoder2, self).__init__()
self.reflecPad5 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv5 = nn.Conv2d(128, 64, 3, 1, 0)
self.relu5 = nn.ReLU(inplace=True)
self.unpool = nn.UpsamplingNear... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | hologerry/wct_experiment | Decoder2 | false | 6,825 | [
"MIT"
] | 1 | 890d885561dc8df8c4ae732aebd902aa838257e6 | https://github.com/hologerry/wct_experiment/tree/890d885561dc8df8c4ae732aebd902aa838257e6 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.reflecPad5 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv5 = nn.Conv2d(128, 64, 3, 1, 0)
self.relu5 = nn.ReLU(inplace=True)
self.unpool = nn.UpsamplingNearest2d(scale_facto... |
HirarchicalAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 typing import *
import torch.utils.data
import torch.nn as nn
import torch.onnx.operators
import torch.optim
class HirarchicalAttention(Module):
"""
ref: Hierarchical Attention Networks for Document Classification
"""
def __init__(self, hidden_size: 'int')... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | hrshy0629/naturalcc | HirarchicalAttention | false | 6,826 | [
"MIT"
] | 1 | 9c3329dd8387c8242deb52bf590ebe3ac795f8de | https://github.com/hrshy0629/naturalcc/tree/9c3329dd8387c8242deb52bf590ebe3ac795f8de | from torch.nn import Module
import torch
from typing import *
import torch.utils.data
import torch.nn as nn
import torch.onnx.operators
import torch.optim
class Model(Module):
"""
ref: Hierarchical Attention Networks for Document Classification
"""
def __init__(self, hidden_size: 'int'):
super... |
GCT | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 GCT(nn.Module):
def __init__(self, num_channels, epsilon=1e-05, mode='l2', after_relu=False
):
super(GCT, self).__init__()
self.alpha = nn.Parameter(torch.ones(1, num_channels, 1, 1))
self.gamma = nn.Parameter(torch.zeros(1, num_channels, 1... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | huanglf714/COMatchNet | GCT | false | 6,827 | [
"Apache-2.0"
] | 1 | 79023f5be65d354eb9bdac026d7e0d73110bc4aa | https://github.com/huanglf714/COMatchNet/tree/79023f5be65d354eb9bdac026d7e0d73110bc4aa | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_channels, epsilon=1e-05, mode='l2', after_relu=False
):
super().__init__()
self.alpha = nn.Parameter(torch.ones(1, num_channels, 1, 1))
self.gamma = nn.Parameter(torch.zeros(1, num_channels, 1, 1))
... |
BertAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if (config.hidden_size % config.num_attention_heads != 0 and not
hasattr(config, 'embedding_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.... | hongyuntw/Col-KBERT | BertAttention | false | 6,828 | [
"MIT"
] | 1 | e77ce2585d228a783bf83cc1de53583aff70f7b4 | https://github.com/hongyuntw/Col-KBERT/tree/e77ce2585d228a783bf83cc1de53583aff70f7b4 | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if (config.hidden_size % config.num_attention_heads != 0 and not
hasattr(config, 'embedding_size')):
... |
SimpleGFLLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
def simple_gfl(pred, target, beta):
"""Simply add a pow of abs difference in front of BCE"""
assert pred.size() == target.size(
), 'simple GFL assume pred and target to have the same shape'
loss = (pred.sigmoid() - target).abs().pow(beta)
loss = F.b... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | huimlight/OpenMMLab-IoUNet | SimpleGFLLoss | false | 6,829 | [
"Apache-2.0"
] | 1 | 00536bac99f4d3d7ad2682dad44f299f714565b6 | https://github.com/huimlight/OpenMMLab-IoUNet/tree/00536bac99f4d3d7ad2682dad44f299f714565b6 | import torch
import torch.nn.functional as F
def simple_gfl(pred, target, beta):
"""Simply add a pow of abs difference in front of BCE"""
assert pred.size() == target.size(
), 'simple GFL assume pred and target to have the same shape'
loss = (pred.sigmoid() - target).abs().pow(beta)
loss = F.b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.