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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Scale | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
from torch.nn import *
class Scale(nn.Module):
def __init__(self, scale):
super().__init__()
self.scale = scale
def forward(self, x):
return x * self.scale
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from torch.nn import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._d... | jlubars/autonomous-learning-library | Scale | false | 10,295 | [
"MIT"
] | 0 | 5d2d2e1ee9e0876614d7113e26f026f126a3899f | https://github.com/jlubars/autonomous-learning-library/tree/5d2d2e1ee9e0876614d7113e26f026f126a3899f | import torch
from torch import nn
from torch.nn import *
class Model(nn.Module):
def __init__(self, scale):
super().__init__()
self.scale = scale
def forward(self, x):
return x * self.scale
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return ... |
FullSort | # 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 FullSort(nn.Module):
def forward(self, x):
return torch.sort(x, 1)[0]
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | hologerry/residual-flows | FullSort | false | 10,296 | [
"MIT"
] | 0 | 33a3639150490279c2e13238dd6244b80c52adf7 | https://github.com/hologerry/residual-flows/tree/33a3639150490279c2e13238dd6244b80c52adf7 | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x):
return torch.sort(x, 1)[0]
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
Accuracy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
class Accuracy(nn.Module):
def __init__(self):
super().__init__()
def forward(self, prediction, target, mask=None, token_dim=-1,
sequence_dim=-2):
prediction = F.softmax(prediction, token_dim).argmax(sequence_dim)
... | 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
... | karadeli98/BBM406-Project | Accuracy | false | 10,297 | [
"MIT"
] | 0 | 6de0fa2cbebb93dec272dc7c54a25024880ed1e7 | https://github.com/karadeli98/BBM406-Project/tree/6de0fa2cbebb93dec272dc7c54a25024880ed1e7 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, prediction, target, mask=None, token_dim=-1,
sequence_dim=-2):
prediction = F.softmax(prediction, token_dim).argmax(sequence_dim)
... |
LipschitzCube | # 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 LipschitzCube(nn.Module):
def forward(self, x):
return (x >= 1) * (x - 2 / 3) + (x <= -1) * (x + 2 / 3) + (x > -1) * (x
< 1) * x ** 3 / 3
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | hologerry/residual-flows | LipschitzCube | false | 10,298 | [
"MIT"
] | 0 | 33a3639150490279c2e13238dd6244b80c52adf7 | https://github.com/hologerry/residual-flows/tree/33a3639150490279c2e13238dd6244b80c52adf7 | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x):
return (x >= 1) * (x - 2 / 3) + (x <= -1) * (x + 2 / 3) + (x > -1) * (x
< 1) * x ** 3 / 3
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
MSDConvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 MSDConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, dilation, std):
super(MSDConvBlock, self).__init__()
self.conv = nn.Conv2d(in_channels=in_channels, out_channels=
out_channels, kernel_size=(3, 3), padding=(dilation, dilati... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | jiayangshi/pcf | MSDConvBlock | false | 10,299 | [
"MIT"
] | 0 | 1e3c5847bdb4100f60b7251cefb9cfe7a76c3c64 | https://github.com/jiayangshi/pcf/tree/1e3c5847bdb4100f60b7251cefb9cfe7a76c3c64 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, dilation, std):
super().__init__()
self.conv = nn.Conv2d(in_channels=in_channels, out_channels=
out_channels, kernel_size=(3, 3), padding=(dilation, dilation),
padding_... |
Sparsify1D | # 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 SparsifyBase(nn.Module):
def __init__(self, sparse_ratio=0.5):
super(SparsifyBase, self).__init__()
self.sr = sparse_ratio
self.preact = None
self.act = None
def get_activation(self):
def hook(model, input, output):
... | 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... | jmhuer/TCN | Sparsify1D | false | 10,301 | [
"MIT"
] | 0 | 8233b2ff5686ef496b113a6984f5100709a503d3 | https://github.com/jmhuer/TCN/tree/8233b2ff5686ef496b113a6984f5100709a503d3 | import torch
import torch.nn as nn
class SparsifyBase(nn.Module):
def __init__(self, sparse_ratio=0.5):
super().__init__()
self.sr = sparse_ratio
self.preact = None
self.act = None
def get_activation(self):
def hook(model, input, output):
self.preact = in... |
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=90)
self.layer_2 = torch.nn.Linear(in_features=90, out_features=125)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | joshsia/random-maze-rl | Network | false | 10,302 | [
"MIT"
] | 0 | 016b67d23bfba63182cf06ca17bc9a75baca6ee5 | https://github.com/joshsia/random-maze-rl/tree/016b67d23bfba63182cf06ca17bc9a75baca6ee5 | 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=90)
self.layer_2 = torch.nn.Linear(in_features=90, out_features=125)
self.layer... |
Aggregation | # 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.nn import *
class Aggregation(nn.Module):
"""
Aggregation layer for the Dueling architecture.
https://arxiv.org/abs/1511.06581
This layer computes a Q function by combining
an estimate of V with an estimate of the advantage.
The advantage is normal... | 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
from torch.nn import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._d... | jlubars/autonomous-learning-library | Aggregation | false | 10,303 | [
"MIT"
] | 0 | 5d2d2e1ee9e0876614d7113e26f026f126a3899f | https://github.com/jlubars/autonomous-learning-library/tree/5d2d2e1ee9e0876614d7113e26f026f126a3899f | import torch
from torch import nn
from torch.nn import *
class Model(nn.Module):
"""
Aggregation layer for the Dueling architecture.
https://arxiv.org/abs/1511.06581
This layer computes a Q function by combining
an estimate of V with an estimate of the advantage.
The advantage is normalized b... |
LipNormLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 _max_except_dim(input, dim):
maxed = input
for axis in range(input.ndimension() - 1, dim, -1):
maxed, _ = maxed.max(axis, keepdim=True)
for axis in range(dim - 1, -1, -1):
maxed, _ = maxed.max(axis, keepdim=True)
re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | hologerry/residual-flows | LipNormLinear | false | 10,304 | [
"MIT"
] | 0 | 33a3639150490279c2e13238dd6244b80c52adf7 | https://github.com/hologerry/residual-flows/tree/33a3639150490279c2e13238dd6244b80c52adf7 | import torch
import torch.nn as nn
import torch.nn.functional as F
def _max_except_dim(input, dim):
maxed = input
for axis in range(input.ndimension() - 1, dim, -1):
maxed, _ = maxed.max(axis, keepdim=True)
for axis in range(dim - 1, -1, -1):
maxed, _ = maxed.max(axis, keepdim=True)
re... |
LipNormConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 _max_except_dim(input, dim):
maxed = input
for axis in range(input.ndimension() - 1, dim, -1):
maxed, _ = maxed.max(axis, keepdim=True)
for axis in range(dim - 1, -1, -1):
maxed, _ = maxed.max(axis, keepdim=True)
re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | hologerry/residual-flows | LipNormConv2d | false | 10,305 | [
"MIT"
] | 0 | 33a3639150490279c2e13238dd6244b80c52adf7 | https://github.com/hologerry/residual-flows/tree/33a3639150490279c2e13238dd6244b80c52adf7 | import torch
import torch.nn as nn
import torch.nn.functional as F
def _max_except_dim(input, dim):
maxed = input
for axis in range(input.ndimension() - 1, dim, -1):
maxed, _ = maxed.max(axis, keepdim=True)
for axis in range(dim - 1, -1, -1):
maxed, _ = maxed.max(axis, keepdim=True)
re... |
EALSTM | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 EALSTM(nn.Module):
"""Implementation of the Entity-Aware-LSTM (EA-LSTM)
TODO: Include paper ref and latex equations
Parameters
----------
input_size_dyn : int
Number of dynamic features, which are those, passed to the LSTM at... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | jdwillard19/lake_conus_surface_temp_2021 | EALSTM | false | 10,306 | [
"MIT"
] | 0 | 88334091dec71ae43fe4256603d65045141936b5 | https://github.com/jdwillard19/lake_conus_surface_temp_2021/tree/88334091dec71ae43fe4256603d65045141936b5 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""Implementation of the Entity-Aware-LSTM (EA-LSTM)
TODO: Include paper ref and latex equations
Parameters
----------
input_size_dyn : int
Number of dynamic features, which are those, passed to the LSTM at ... |
AttentionConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 as init
class AttentionConv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=False):
super(AttentionConv, self).__init__()
self.out_channels = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | jhvics1/pytorch-stand-alone-self-attention | AttentionConv | false | 10,307 | [
"MIT"
] | 0 | 77375d99250ab9d8089e73bd4803afae30843748 | https://github.com/jhvics1/pytorch-stand-alone-self-attention/tree/77375d99250ab9d8089e73bd4803afae30843748 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=False):
super().__init__()
self.out_channels = out_channels
self.k... |
ConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.optim
import torch.nn as nn
import torch.nn.functional as F
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.optim
import tor... | jwdink/PyTorch-LBFGS | ConvNet | false | 10,308 | [
"MIT"
] | 0 | 7e18ea3d9cb16a0af1a76f7c9c023c916b408a04 | https://github.com/jwdink/PyTorch-LBFGS/tree/7e18ea3d9cb16a0af1a76f7c9c023c916b408a04 | import torch
import torch.optim
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 5 ... |
AttentionLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class AttentionLayer(nn.Module):
def __init__(self, embed_dim, num_heads, dropout_rate=0.1,
feedforward_size=256):
"""The core module with both spatial attention module and
temporal attention model embedded within it.
"""
super(Attent... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | jhbed/fairmotion | AttentionLayer | false | 10,310 | [
"BSD-3-Clause"
] | 0 | 949683d628b389a1e4f241b21e88f5d57f3a488e | https://github.com/jhbed/fairmotion/tree/949683d628b389a1e4f241b21e88f5d57f3a488e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, embed_dim, num_heads, dropout_rate=0.1,
feedforward_size=256):
"""The core module with both spatial attention module and
temporal attention model embedded within it.
"""
super().__init__()
... |
AUGRUCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 sklearn.metrics import *
import torch.onnx
import torch as torch
class AUGRUCell(nn.Module):
""" Effect of GRU with attentional update gate (AUGRU)
Reference:
- Deep Interest Evolution Network for Click-Through Rate Predicti... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | dulvqingyunLT/DeepCTR-Torch | AUGRUCell | false | 10,311 | [
"Apache-2.0"
] | 0 | f40cf08f3469aa471f9ca69e44c5de51180341cc | https://github.com/dulvqingyunLT/DeepCTR-Torch/tree/f40cf08f3469aa471f9ca69e44c5de51180341cc | import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import *
import torch.onnx
import torch as torch
class Model(nn.Module):
""" Effect of GRU with attentional update gate (AUGRU)
Reference:
- Deep Interest Evolution Network for Click-Through Rate Prediction[J... |
Norm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Norm(nn.Module):
"""
Re-usable class for either batch-norm or layer-norm (by swapping dim)
"""
def __init__(self, n_hidden, eps=1e-08, dim=0):
super(Norm, self).__init__()
self.eps = eps
self.n_hidden = n_hidden
self.a = nn.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.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | jrbtaylor/recurrent_pytorch | Norm | false | 10,312 | [
"Apache-2.0"
] | 0 | 09ee203a86b70a32aec3e97d7daa646caf8fd182 | https://github.com/jrbtaylor/recurrent_pytorch/tree/09ee203a86b70a32aec3e97d7daa646caf8fd182 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Re-usable class for either batch-norm or layer-norm (by swapping dim)
"""
def __init__(self, n_hidden, eps=1e-08, dim=0):
super().__init__()
self.eps = eps
self.n_hidden = n_hidden
self.a = nn.Parameter(tor... |
Adjust_naive | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def get_conv2d_layer(in_c, out_c, k, s, p=0, dilation=1, groups=1):
return nn.Conv2d(in_channels=in_c, out_channels=out_c, kernel_size=k,
stride=s, padding=p, dilation=dilation, groups=groups)
class Adjust_naive(nn.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
import torch.nn as nn
assert_... | AndersonYong/URetinex-Net-Retinex-based-Deep-Unfolding-Network-for-Low-light-Image-Enhancem | Adjust_naive | false | 10,313 | [
"MIT"
] | 0 | 9d837b8df9c761defb1eca390b3a60aa4a6fbb1a | https://github.com/AndersonYong/URetinex-Net-Retinex-based-Deep-Unfolding-Network-for-Low-light-Image-Enhancem/tree/9d837b8df9c761defb1eca390b3a60aa4a6fbb1a | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
def get_conv2d_layer(in_c, out_c, k, s, p=0, dilation=1, groups=1):
return nn.Conv2d(in_channels=in_c, out_channels=out_c, kernel_size=k,
stride=s, padding=p, dilation=dilation, groups=groups)
class Model(nn.Module):
d... |
SpaceToDepth | # 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 torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class SpaceToDepth(nn.Module):
def __init__(self, block_size=4):
super().__init__()
assert block_size == 4
self.bs = block_size
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distr... | jasonnoy/COMP5329 | SpaceToDepth | false | 10,314 | [
"MIT"
] | 0 | fc17c80b1ac41d788cc0a92d3a033dbe2f9b8b81 | https://github.com/jasonnoy/COMP5329/tree/fc17c80b1ac41d788cc0a92d3a033dbe2f9b8b81 | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, block_size=4):
super().__init__()
assert block_size == 4
self.bs = block_size
def... |
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.nn.functional as F
class ContrastiveLoss(torch.nn.Module):
"""
Contrastive loss function.
Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
"""
def __init__(self, margin=2):
super(ContrastiveLoss, self).__init__()
self.margin = m... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._... | kevincao91/SiameseNet_Demo | ContrastiveLoss | false | 10,315 | [
"MIT"
] | 0 | 6ec4384159682a8ee93fb110d6fca33de85fa1ba | https://github.com/kevincao91/SiameseNet_Demo/tree/6ec4384159682a8ee93fb110d6fca33de85fa1ba | import torch
import torch.nn.functional as F
class Model(torch.nn.Module):
"""
Contrastive loss function.
Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
"""
def __init__(self, margin=2):
super().__init__()
self.margin = margin
def forward(self, ou... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, max_action):
super(Actor, self).__init__()
self.l1 = nn.Linear(state_dim, 256)
self.l2 = nn.Linear(256, 256)
self.l3 = nn.Linear(256, action_dim)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | karush17/gym-pybullet-drones | Actor | false | 10,316 | [
"MIT"
] | 0 | 7a7acd4f51dcb1cbea8eb9ef0cfcfc7dcf1c90ba | https://github.com/karush17/gym-pybullet-drones/tree/7a7acd4f51dcb1cbea8eb9ef0cfcfc7dcf1c90ba | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, state_dim, action_dim, max_action):
super().__init__()
self.l1 = nn.Linear(state_dim, 256)
self.l2 = nn.Linear(256, 256)
self.l3 = nn.Linear(256, action_dim)
self.... |
FM | # 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 sklearn.metrics import *
import torch.onnx
import torch as torch
class FM(nn.Module):
"""Factorization Machine models pairwise (order-2) feature interactions
without linear term and bias.
Input shape
- 3D tensor with shape: ``(batch_size,field_size,embedd... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
import torch.onnx
import torch as torch
assert_size_stride = torch._C._dynamo.guards.ass... | dulvqingyunLT/DeepCTR-Torch | FM | false | 10,317 | [
"Apache-2.0"
] | 0 | f40cf08f3469aa471f9ca69e44c5de51180341cc | https://github.com/dulvqingyunLT/DeepCTR-Torch/tree/f40cf08f3469aa471f9ca69e44c5de51180341cc | import torch
import torch.nn as nn
from sklearn.metrics import *
import torch.onnx
import torch as torch
class Model(nn.Module):
"""Factorization Machine models pairwise (order-2) feature interactions
without linear term and bias.
Input shape
- 3D tensor with shape: ``(batch_size,field_size,emb... |
CapsuleConvLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 CapsuleConvLayer(nn.Module):
def __init__(self, in_channels, out_channels):
super(CapsuleConvLayer, self).__init__()
self.conv0 = nn.Conv2d(in_channels=in_channels, out_channels=
out_channels, kernel_size=9, stride=1, bias=True)
self.re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | juingzhou/Base-on-PyTorch-implementation-CapsuleNet | CapsuleConvLayer | false | 10,318 | [
"MIT"
] | 0 | 6b030bf93b258d9d6496379bcbe4b94542366817 | https://github.com/juingzhou/Base-on-PyTorch-implementation-CapsuleNet/tree/6b030bf93b258d9d6496379bcbe4b94542366817 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.conv0 = nn.Conv2d(in_channels=in_channels, out_channels=
out_channels, kernel_size=9, stride=1, bias=True)
self.relu = nn.ReLU(inplace=True)
d... |
ConvUnit | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ConvUnit(nn.Module):
def __init__(self, in_channels):
super(ConvUnit, self).__init__()
self.conv0 = nn.Conv2d(in_channels=in_channels, out_channels=32,
kernel_size=9, stride=2, bias=True)
def forward(self, x):
return self.conv0(x)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | juingzhou/Base-on-PyTorch-implementation-CapsuleNet | ConvUnit | false | 10,319 | [
"MIT"
] | 0 | 6b030bf93b258d9d6496379bcbe4b94542366817 | https://github.com/juingzhou/Base-on-PyTorch-implementation-CapsuleNet/tree/6b030bf93b258d9d6496379bcbe4b94542366817 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels):
super().__init__()
self.conv0 = nn.Conv2d(in_channels=in_channels, out_channels=32,
kernel_size=9, stride=2, bias=True)
def forward(self, x):
return self.conv0(x)
def get_inputs(... |
KLLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils.checkpoint
class KLLoss(nn.Module):
"""Loss that uses a 'hinge' on the lower bound.
This means that for samples with a label value smaller than the threshold, the loss is zero if the prediction is
also smaller than that t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | jiazheng-xing/Swin_Multimodal | KLLoss | false | 10,320 | [
"MIT"
] | 0 | 7bc41977fe7d8d4f0091852c63a6a32a0fada0fb | https://github.com/jiazheng-xing/Swin_Multimodal/tree/7bc41977fe7d8d4f0091852c63a6a32a0fada0fb | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils.checkpoint
class Model(nn.Module):
"""Loss that uses a 'hinge' on the lower bound.
This means that for samples with a label value smaller than the threshold, the loss is zero if the prediction is
also smaller than that th... |
DeepHeadModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 math import sqrt as sqrt
class DeepHeadModule(nn.Module):
def __init__(self, input_channels, output_channels):
super(DeepHeadModule, self).__init__()
self._input_channels = input_channels
self._output_channels = outpu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from ma... | juanmed/FaceDetection-DSFD | DeepHeadModule | false | 10,321 | [
"Apache-2.0"
] | 0 | 23650ca492444f9f052ca9b8db8b068a9be5bc68 | https://github.com/juanmed/FaceDetection-DSFD/tree/23650ca492444f9f052ca9b8db8b068a9be5bc68 | import torch
import torch.nn as nn
import torch.nn.functional as F
from math import sqrt as sqrt
class Model(nn.Module):
def __init__(self, input_channels, output_channels):
super().__init__()
self._input_channels = input_channels
self._output_channels = output_channels
self._mid_... |
CNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 CNN(torch.nn.Module):
"""Basic CNN architecture."""
def __init__(self, in_channels=1):
super(CNN, self).__init__()
self.conv1 = nn.Conv2d(in_channels, 64, 8, 1)
self.conv2 = nn.Conv2d(64, 128, 6, 2)
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 import triton_helpers
from torch import nn
assert_s... | jubueche/cleverhans | CNN | false | 10,322 | [
"MIT"
] | 0 | 2e45b75ccc7b04ffec27fd9e6079f00451586266 | https://github.com/jubueche/cleverhans/tree/2e45b75ccc7b04ffec27fd9e6079f00451586266 | import torch
from torch import nn
import torch.nn.functional as F
class Model(torch.nn.Module):
"""Basic CNN architecture."""
def __init__(self, in_channels=1):
super().__init__()
self.conv1 = nn.Conv2d(in_channels, 64, 8, 1)
self.conv2 = nn.Conv2d(64, 128, 6, 2)
self.conv3 = ... |
AsymmetricLossOptimized | # 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 torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class AsymmetricLossOptimized(nn.Module):
""" Notice - optimized version, minimizes memory allocation and gpu uploading,
favors inplace operations"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torchv... | jasonnoy/COMP5329 | AsymmetricLossOptimized | false | 10,323 | [
"MIT"
] | 0 | fc17c80b1ac41d788cc0a92d3a033dbe2f9b8b81 | https://github.com/jasonnoy/COMP5329/tree/fc17c80b1ac41d788cc0a92d3a033dbe2f9b8b81 | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class Model(nn.Module):
""" Notice - optimized version, minimizes memory allocation and gpu uploading,
favors inplace operations"""
def __init__(... |
SEModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class FastAvgPool2d(nn.Module):
def __init__(self, flatten=False):
super(FastAvgPool2d, self).__init__()
self.flatten = flatten
def ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torchvision import datas... | jasonnoy/COMP5329 | SEModule | false | 10,324 | [
"MIT"
] | 0 | fc17c80b1ac41d788cc0a92d3a033dbe2f9b8b81 | https://github.com/jasonnoy/COMP5329/tree/fc17c80b1ac41d788cc0a92d3a033dbe2f9b8b81 | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class FastAvgPool2d(nn.Module):
def __init__(self, flatten=False):
super().__init__()
self.flatten = flatten
def forward(self, x):
... |
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, m = torch.var_mean(w, dim=[1, 2, 3], keepdim=True, unbiased=False)
w = (w - m) / torch.sqrt(v + 1e-10)
return F.conv2d(x, w, self.bias, self.stri... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | kayvane1/BiT-Tobacco-800 | StdConv2d | false | 10,325 | [
"Apache-2.0"
] | 0 | fd937cc3f8fc1d5e45744defd82d112c10281433 | https://github.com/kayvane1/BiT-Tobacco-800/tree/fd937cc3f8fc1d5e45744defd82d112c10281433 | 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, m = torch.var_mean(w, dim=[1, 2, 3], keepdim=True, unbiased=False)
w = (w - m) / torch.sqrt(v + 1e-10)
return F.conv2d(x, w, self.bias, self.stride, ... |
RNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Norm(nn.Module):
"""
Re-usable class for either batch-norm or layer-norm (by swapping dim)
"""
def __init__(self, n_hidden, eps=1e-08, dim=0):
super(Norm, self).__init__()
self.eps = eps
self.n_hidden = n_hidden
self.a = nn.Para... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | jrbtaylor/recurrent_pytorch | RNN | false | 10,326 | [
"Apache-2.0"
] | 0 | 09ee203a86b70a32aec3e97d7daa646caf8fd182 | https://github.com/jrbtaylor/recurrent_pytorch/tree/09ee203a86b70a32aec3e97d7daa646caf8fd182 | import torch
import torch.nn as nn
class Norm(nn.Module):
"""
Re-usable class for either batch-norm or layer-norm (by swapping dim)
"""
def __init__(self, n_hidden, eps=1e-08, dim=0):
super().__init__()
self.eps = eps
self.n_hidden = n_hidden
self.a = nn.Parameter(torc... |
BinaryLogisticRegressionLoss | # 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 binary_logistic_regression_loss(reg_score, label, threshold=0.5,
ratio_range=(1.05, 21), eps=1e-05):
"""Binary Logistic Regression Loss."""
label = label.view(-1)
reg_score = reg_score.contiguous().view(-1)
pmask = (label > threshold).float()
num_positive... | 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
... | giahaowjx/mmaction2 | BinaryLogisticRegressionLoss | false | 10,327 | [
"Apache-2.0"
] | 0 | 4f95e9b91354acdcae768ce94e01d3821bba0154 | https://github.com/giahaowjx/mmaction2/tree/4f95e9b91354acdcae768ce94e01d3821bba0154 | import torch
import torch.nn as nn
def binary_logistic_regression_loss(reg_score, label, threshold=0.5,
ratio_range=(1.05, 21), eps=1e-05):
"""Binary Logistic Regression Loss."""
label = label.view(-1)
reg_score = reg_score.contiguous().view(-1)
pmask = (label > threshold).float()
num_positive... |
FEM | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 math import sqrt as sqrt
class FEM(nn.Module):
def __init__(self, channel_size):
super(FEM, self).__init__()
self.cs = channel_size
self.cpm1 = nn.Conv2d(self.cs, 256, kernel_size=3, dilation=1,
stride=1, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from ma... | juanmed/FaceDetection-DSFD | FEM | false | 10,328 | [
"Apache-2.0"
] | 0 | 23650ca492444f9f052ca9b8db8b068a9be5bc68 | https://github.com/juanmed/FaceDetection-DSFD/tree/23650ca492444f9f052ca9b8db8b068a9be5bc68 | import torch
import torch.nn as nn
import torch.nn.functional as F
from math import sqrt as sqrt
class Model(nn.Module):
def __init__(self, channel_size):
super().__init__()
self.cs = channel_size
self.cpm1 = nn.Conv2d(self.cs, 256, kernel_size=3, dilation=1,
stride=1, padding... |
ExpandNetLoss | # 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 ExpandNetLoss(nn.Module):
def __init__(self, loss_lambda=5):
super(ExpandNetLoss, self).__init__()
self.similarity = torch.nn.CosineSimilarity(dim=1, eps=1e-20)
self.l1_loss = nn.L1Loss()
self.loss_lambda = loss_lambda
def forward(self,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | kacperkk2/temporalStableExpandNet | ExpandNetLoss | false | 10,329 | [
"BSD-3-Clause-Clear"
] | 0 | 87a4d6c8c1a47b721760c9daf2727e380b90c541 | https://github.com/kacperkk2/temporalStableExpandNet/tree/87a4d6c8c1a47b721760c9daf2727e380b90c541 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, loss_lambda=5):
super().__init__()
self.similarity = torch.nn.CosineSimilarity(dim=1, eps=1e-20)
self.l1_loss = nn.L1Loss()
self.loss_lambda = loss_lambda
def forward(self, x, y):
cosine_term... |
ScaledDotProductAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
from torch import nn
class ScaledDotProductAttention(nn.Module):
"""
Scaled dot-product attention
"""
def __init__(self, d_model, d_k, d_v, h):
"""
:param d_model: Output dimensionality of the model
:param d_k: Dimensionality of queries and keys... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | jmhessel/meshed-memory-transformer | ScaledDotProductAttention | false | 10,330 | [
"BSD-3-Clause"
] | 0 | b502da2522f2e25d602fba547ed6ebf7968857a9 | https://github.com/jmhessel/meshed-memory-transformer/tree/b502da2522f2e25d602fba547ed6ebf7968857a9 | import torch
import numpy as np
from torch import nn
class Model(nn.Module):
"""
Scaled dot-product attention
"""
def __init__(self, d_model, d_k, d_v, h):
"""
:param d_model: Output dimensionality of the model
:param d_k: Dimensionality of queries and keys
:param d_v:... |
Clamp | # 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 Clamp(nn.Module):
"""Clamp energy output"""
def forward(self, x):
x = torch.clamp(x, min=0, max=30)
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | kgreif24/mlhep-aka | Clamp | false | 10,331 | [
"Apache-2.0"
] | 0 | 41e120eb3e7049a01ffdb22c4e00b3aaca94b541 | https://github.com/kgreif24/mlhep-aka/tree/41e120eb3e7049a01ffdb22c4e00b3aaca94b541 | import torch
from torch import nn
class Model(nn.Module):
"""Clamp energy output"""
def forward(self, x):
x = torch.clamp(x, min=0, max=30)
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
AvgConsensus | # 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 AvgConsensus(nn.Module):
"""Average consensus module.
Args:
dim (int): Decide which dim consensus function to apply.
Default: 1.
"""
def __init__(self, dim=1):
super().__init__()
self.dim = dim
def forward(self, x):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | giahaowjx/mmaction2 | AvgConsensus | false | 10,332 | [
"Apache-2.0"
] | 0 | 4f95e9b91354acdcae768ce94e01d3821bba0154 | https://github.com/giahaowjx/mmaction2/tree/4f95e9b91354acdcae768ce94e01d3821bba0154 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Average consensus module.
Args:
dim (int): Decide which dim consensus function to apply.
Default: 1.
"""
def __init__(self, dim=1):
super().__init__()
self.dim = dim
def forward(self, x):
"... |
OffsetNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 OffsetNet(nn.Module):
"""OffsetNet in Temporal interlace module.
The OffsetNet consists of one convolution layer and two fc layers
with a relu activation following with a sigmoid function. Following
the convolution layer, two fc layers and relu are applied to ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | giahaowjx/mmaction2 | OffsetNet | false | 10,333 | [
"Apache-2.0"
] | 0 | 4f95e9b91354acdcae768ce94e01d3821bba0154 | https://github.com/giahaowjx/mmaction2/tree/4f95e9b91354acdcae768ce94e01d3821bba0154 | import torch
import torch.nn as nn
class Model(nn.Module):
"""OffsetNet in Temporal interlace module.
The OffsetNet consists of one convolution layer and two fc layers
with a relu activation following with a sigmoid function. Following
the convolution layer, two fc layers and relu are applied to the ... |
ScaledDotProductAttentionMemory | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
from torch import nn
class ScaledDotProductAttentionMemory(nn.Module):
"""
Scaled dot-product attention with memory
"""
def __init__(self, d_model, d_k, d_v, h, m):
"""
:param d_model: Output dimensionality of the model
:param d_k: Dimensionalit... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | jmhessel/meshed-memory-transformer | ScaledDotProductAttentionMemory | false | 10,334 | [
"BSD-3-Clause"
] | 0 | b502da2522f2e25d602fba547ed6ebf7968857a9 | https://github.com/jmhessel/meshed-memory-transformer/tree/b502da2522f2e25d602fba547ed6ebf7968857a9 | import torch
import numpy as np
from torch import nn
class Model(nn.Module):
"""
Scaled dot-product attention with memory
"""
def __init__(self, d_model, d_k, d_v, h, m):
"""
:param d_model: Output dimensionality of the model
:param d_k: Dimensionality of queries and keys
... |
Glu | # 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 Glu(nn.Module):
def __init__(self, dim):
super(Glu, self).__init__()
self.dim = dim
def forward(self, x):
x_in, x_gate = x.chunk(2, dim=self.dim)
return x_in * x_gate.sigmoid()
def get_inputs():
return [torch.rand([4, 4, 4, 4, 4]... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | debasish-mihup/EfficientConformer | Glu | false | 10,335 | [
"Apache-2.0"
] | 0 | bddd927cebcde044a999aaa7766fa6d44dc20576 | https://github.com/debasish-mihup/EfficientConformer/tree/bddd927cebcde044a999aaa7766fa6d44dc20576 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, dim):
super().__init__()
self.dim = dim
def forward(self, x):
x_in, x_gate = x.chunk(2, dim=self.dim)
return x_in * x_gate.sigmoid()
def get_inputs():
return [torch.rand([4, 4, 4, 4, 4])]
de... |
WeightNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 WeightNet(nn.Module):
"""WeightNet in Temporal interlace module.
The WeightNet consists of two parts: one convolution layer
and a sigmoid function. Following the convolution layer, the sigmoid
function and rescale module can scale our output to the range (0, 2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | giahaowjx/mmaction2 | WeightNet | false | 10,336 | [
"Apache-2.0"
] | 0 | 4f95e9b91354acdcae768ce94e01d3821bba0154 | https://github.com/giahaowjx/mmaction2/tree/4f95e9b91354acdcae768ce94e01d3821bba0154 | import torch
import torch.nn as nn
class Model(nn.Module):
"""WeightNet in Temporal interlace module.
The WeightNet consists of two parts: one convolution layer
and a sigmoid function. Following the convolution layer, the sigmoid
function and rescale module can scale our output to the range (0, 2).
... |
UpscaleBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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.jit
import torch.nn as nn
import torch.nn.init as init
import torch.onnx
def _initialize_orthogonal(conv):
prelu_gain = math.sqrt(2)
init.orthogonal(conv.weight, gain=prelu_gain)
if conv.bias is not None:
conv.bias.data.zero_()
class UpscaleBlock(nn.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
import math
import torch.jit
import torch.nn as nn
import torch.nn.init as init
... | jamesr66a/onnx-fb-universe | UpscaleBlock | false | 10,337 | [
"MIT"
] | 0 | 3c0d1ea06d90c3788c47c0d32d160499afabe2fb | https://github.com/jamesr66a/onnx-fb-universe/tree/3c0d1ea06d90c3788c47c0d32d160499afabe2fb | import math
import torch
import torch.jit
import torch.nn as nn
import torch.nn.init as init
import torch.onnx
def _initialize_orthogonal(conv):
prelu_gain = math.sqrt(2)
init.orthogonal(conv.weight, gain=prelu_gain)
if conv.bias is not None:
conv.bias.data.zero_()
class Model(nn.Module):
d... |
MultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
import numpy as np
from torch import nn
class ScaledDotProductAttention(nn.Module):
"""
Scaled dot-product attention
"""
def __init__(self, d_model, d_k, d_v, h):
"""
:param d_model: Output dimensionality of the model
:param d_k: Dimens... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | jmhessel/meshed-memory-transformer | MultiHeadAttention | false | 10,338 | [
"BSD-3-Clause"
] | 0 | b502da2522f2e25d602fba547ed6ebf7968857a9 | https://github.com/jmhessel/meshed-memory-transformer/tree/b502da2522f2e25d602fba547ed6ebf7968857a9 | from torch.nn import Module
import torch
import numpy as np
from torch import nn
class ScaledDotProductAttention(nn.Module):
"""
Scaled dot-product attention
"""
def __init__(self, d_model, d_k, d_v, h):
"""
:param d_model: Output dimensionality of the model
:param d_k: Dimens... |
BMNLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
def binary_logistic_regression_loss(reg_score, label, threshold=0.5,
ratio_range=(1.05, 21), eps=1e-05):
"""Binary Logistic Regression Loss."""
label = label.view(-1)
reg_score = reg_score.contiguous().view(-1)
pmask = (label > thr... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_ma... | giahaowjx/mmaction2 | BMNLoss | false | 10,339 | [
"Apache-2.0"
] | 0 | 4f95e9b91354acdcae768ce94e01d3821bba0154 | https://github.com/giahaowjx/mmaction2/tree/4f95e9b91354acdcae768ce94e01d3821bba0154 | import torch
import torch.nn.functional as F
import torch.nn as nn
def binary_logistic_regression_loss(reg_score, label, threshold=0.5,
ratio_range=(1.05, 21), eps=1e-05):
"""Binary Logistic Regression Loss."""
label = label.view(-1)
reg_score = reg_score.contiguous().view(-1)
pmask = (label > thr... |
ResidualAttentionBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.utils.checkpoint
from collections import OrderedDict
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(LayerNorm, self).__init__... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | jiazheng-xing/Swin_Multimodal | ResidualAttentionBlock | false | 10,340 | [
"MIT"
] | 0 | 7bc41977fe7d8d4f0091852c63a6a32a0fada0fb | https://github.com/jiazheng-xing/Swin_Multimodal/tree/7bc41977fe7d8d4f0091852c63a6a32a0fada0fb | import torch
from torch import nn
import torch.utils.checkpoint
from collections import OrderedDict
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super().__init__()
self... |
VideoAttText | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.utils.checkpoint
from collections import OrderedDict
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(LayerNorm, self).__init__... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | jiazheng-xing/Swin_Multimodal | VideoAttText | false | 10,341 | [
"MIT"
] | 0 | 7bc41977fe7d8d4f0091852c63a6a32a0fada0fb | https://github.com/jiazheng-xing/Swin_Multimodal/tree/7bc41977fe7d8d4f0091852c63a6a32a0fada0fb | import torch
from torch import nn
import torch.utils.checkpoint
from collections import OrderedDict
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super().__init__()
self... |
Word2Vec | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.functional as F
import torch.nn.functional as F
class Word2Vec(torch.nn.Module):
def __init__(self, vocab_size, embedding_size=300):
super(Word2Vec, self).__init__()
self.E = nn.Linear(vocab_size, embedding_size, bias=False)
self.W = nn.Linea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | kfaRabi/NNTI-WS2021-NLP-Project | Word2Vec | false | 10,342 | [
"MIT"
] | 0 | 9b0d28e64e3abc373e88265e47a4be4503d59a93 | https://github.com/kfaRabi/NNTI-WS2021-NLP-Project/tree/9b0d28e64e3abc373e88265e47a4be4503d59a93 | import torch
from torch import nn
import torch.functional as F
import torch.nn.functional as F
class Model(torch.nn.Module):
def __init__(self, vocab_size, embedding_size=300):
super().__init__()
self.E = nn.Linear(vocab_size, embedding_size, bias=False)
self.W = nn.Linear(embedding_size,... |
GroupedMultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Linear(nn.Linear):
def __init__(self, in_features, out_features, bias=True):
super(Linear, self).__init__(in_features=in_features, out_features=
out_features, bias=bias)
self.noise = None
self.vn_std = No... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | debasish-mihup/EfficientConformer | GroupedMultiHeadAttention | false | 10,343 | [
"Apache-2.0"
] | 0 | bddd927cebcde044a999aaa7766fa6d44dc20576 | https://github.com/debasish-mihup/EfficientConformer/tree/bddd927cebcde044a999aaa7766fa6d44dc20576 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Linear(nn.Linear):
def __init__(self, in_features, out_features, bias=True):
super().__init__(in_features=in_features, out_features=
out_features, bias=bias)
self.noise = None
self.vn_std = None
def ... |
Conv1d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Conv1d(nn.Conv1d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding='same', dilation=1, groups=1, bias=True):
super(Conv1d, self).__init__(in_channels=in_channels, out_channels=
out_ch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | debasish-mihup/EfficientConformer | Conv1d | false | 10,344 | [
"Apache-2.0"
] | 0 | bddd927cebcde044a999aaa7766fa6d44dc20576 | https://github.com/debasish-mihup/EfficientConformer/tree/bddd927cebcde044a999aaa7766fa6d44dc20576 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Conv1d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding='same', dilation=1, groups=1, bias=True):
super().__init__(in_channels=in_channels, out_channels=
out_channels, kerne... |
InnerProductLayer | # 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 sklearn.metrics import *
import torch.onnx
import torch as torch
class InnerProductLayer(nn.Module):
"""InnerProduct Layer used in PNN that compute the element-wise
product or inner product between feature vectors.
Input shape
- a list of 3D tensor with sh... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
import torch.onnx
import torch as torch
assert_size_stride = torch._C._dynamo.guards.ass... | dulvqingyunLT/DeepCTR-Torch | InnerProductLayer | false | 10,345 | [
"Apache-2.0"
] | 0 | f40cf08f3469aa471f9ca69e44c5de51180341cc | https://github.com/dulvqingyunLT/DeepCTR-Torch/tree/f40cf08f3469aa471f9ca69e44c5de51180341cc | import torch
import torch.nn as nn
from sklearn.metrics import *
import torch.onnx
import torch as torch
class Model(nn.Module):
"""InnerProduct Layer used in PNN that compute the element-wise
product or inner product between feature vectors.
Input shape
- a list of 3D tensor with shape: ``(batc... |
SequenceBias | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.utils.data.distributed
import torch.nn.parallel
from torch.nn.parameter import Parameter
class SequenceBias(nn.Module):
""" Adds one bias element to the end of the sequence
Args:
embed_dim: Embedding dimension
Shape:
... | 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
import torch.utils.data.distributed
import torch.nn.parallel
from torch.nn.parameter import Pa... | jyhong836/pytorch-dp | SequenceBias | false | 10,346 | [
"Apache-2.0"
] | 0 | e050b98d630d4db50cacc4fff82575daf345f012 | https://github.com/jyhong836/pytorch-dp/tree/e050b98d630d4db50cacc4fff82575daf345f012 | import torch
import torch.nn as nn
import torch.utils.data
import torch.utils.data.distributed
import torch.nn.parallel
from torch.nn.parameter import Parameter
class Model(nn.Module):
""" Adds one bias element to the end of the sequence
Args:
embed_dim: Embedding dimension
Shape:
- Input... |
AGRUCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 sklearn.metrics import *
import torch.onnx
import torch as torch
class AGRUCell(nn.Module):
""" Attention based GRU (AGRU)
Reference:
- Deep Interest Evolution Network for Click-Through Rate Prediction[J]. arXiv preprint arX... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | dulvqingyunLT/DeepCTR-Torch | AGRUCell | false | 10,347 | [
"Apache-2.0"
] | 0 | f40cf08f3469aa471f9ca69e44c5de51180341cc | https://github.com/dulvqingyunLT/DeepCTR-Torch/tree/f40cf08f3469aa471f9ca69e44c5de51180341cc | import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import *
import torch.onnx
import torch as torch
class Model(nn.Module):
""" Attention based GRU (AGRU)
Reference:
- Deep Interest Evolution Network for Click-Through Rate Prediction[J]. arXiv preprint arXiv:... |
NoiseInjection | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NoiseInjection(nn.Module):
def __init__(self, channel):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1, channel, 1, 1))
def forward(self, image, noise):
return image + self.weight * noise
def get_inputs():
return [torch.rand(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | jeromepl/style-based-gan-pytorch | NoiseInjection | false | 10,348 | [
"MIT"
] | 0 | 97c13e54316dc57a7cb44c0cb910c29aaed11738 | https://github.com/jeromepl/style-based-gan-pytorch/tree/97c13e54316dc57a7cb44c0cb910c29aaed11738 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, channel):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1, channel, 1, 1))
def forward(self, image, noise):
return image + self.weight * noise
def get_inputs():
return [torch.rand([4, 4, 4,... |
MultiHeadLinearAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Linear(nn.Linear):
def __init__(self, in_features, out_features, bias=True):
super(Linear, self).__init__(in_features=in_features, out_features=
out_features, bias=bias)
self.noise = None
self.vn_std = No... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | debasish-mihup/EfficientConformer | MultiHeadLinearAttention | false | 10,349 | [
"Apache-2.0"
] | 0 | bddd927cebcde044a999aaa7766fa6d44dc20576 | https://github.com/debasish-mihup/EfficientConformer/tree/bddd927cebcde044a999aaa7766fa6d44dc20576 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Linear(nn.Linear):
def __init__(self, in_features, out_features, bias=True):
super().__init__(in_features=in_features, out_features=
out_features, bias=bias)
self.noise = None
self.vn_std = None
def ... |
AdaptiveInstanceNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from math import sqrt
def equal_lr(module, name='weight'):
EqualLR.apply(module, name)
return module
class EqualLR:
def __init__(self, name):
self.name = name
def compute_weight(self, module):
weight = getattr(module, self.name + '_orig')
f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | jeromepl/style-based-gan-pytorch | AdaptiveInstanceNorm | false | 10,350 | [
"MIT"
] | 0 | 97c13e54316dc57a7cb44c0cb910c29aaed11738 | https://github.com/jeromepl/style-based-gan-pytorch/tree/97c13e54316dc57a7cb44c0cb910c29aaed11738 | import torch
from torch import nn
from math import sqrt
def equal_lr(module, name='weight'):
EqualLR.apply(module, name)
return module
class EqualLR:
def __init__(self, name):
self.name = name
def compute_weight(self, module):
weight = getattr(module, self.name + '_orig')
f... |
ATT | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ATT(nn.Module):
def __init__(self, din):
super(ATT, self).__init__()
self.fc1 = nn.Linear(din, 64)
self.fc2 = nn.Linear(64, 64)
self.fc3 = nn.Linear(64, 1)
def forward(self, x):
y = F.relu(self.f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | jungwoohan72/DGN_pytorch | ATT | false | 10,351 | [
"MIT"
] | 0 | 65fe7ab4df661d97725f2a72a1fdb49df1b2ea44 | https://github.com/jungwoohan72/DGN_pytorch/tree/65fe7ab4df661d97725f2a72a1fdb49df1b2ea44 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, din):
super().__init__()
self.fc1 = nn.Linear(din, 64)
self.fc2 = nn.Linear(64, 64)
self.fc3 = nn.Linear(64, 1)
def forward(self, x):
y = F.relu(self.fc1(x))
... |
LocalMultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Linear(nn.Linear):
def __init__(self, in_features, out_features, bias=True):
super(Linear, self).__init__(in_features=in_features, out_features=
out_features, bias=bias)
self.noise = None
self.vn_std = No... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | debasish-mihup/EfficientConformer | LocalMultiHeadAttention | false | 10,352 | [
"Apache-2.0"
] | 0 | bddd927cebcde044a999aaa7766fa6d44dc20576 | https://github.com/debasish-mihup/EfficientConformer/tree/bddd927cebcde044a999aaa7766fa6d44dc20576 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Linear(nn.Linear):
def __init__(self, in_features, out_features, bias=True):
super().__init__(in_features=in_features, out_features=
out_features, bias=bias)
self.noise = None
self.vn_std = None
def ... |
MLPTanH | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
import torch.onnx
import torch.optim
import torch.utils.data.distributed
class MLPTanH(nn.Module):
def __init__(self, input_dim, hidden_dim, vocab_size):
super(MLPTanH, self).__init__()
self.input_dim = input_dim
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | kiathwe97/examples | MLPTanH | false | 10,353 | [
"BSD-3-Clause"
] | 0 | b4a8792023db8c50c7e9fb186bd982edd0dce3ce | https://github.com/kiathwe97/examples/tree/b4a8792023db8c50c7e9fb186bd982edd0dce3ce | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
import torch.onnx
import torch.optim
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, input_dim, hidden_dim, vocab_size):
super().__init__()
self.input_dim = input_dim
self.hi... |
Critic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
def __init__(self, num_inputs, num_actions):
super(Critic, self).__init__()
self.fc1 = nn.Linear(num_inputs, 100)
self.state_value = nn.Linear(100, 1)
def forward(self, x):
x = torch.f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | kama1kant/rl-autonomous-driving | Critic | false | 10,354 | [
"MIT"
] | 0 | 8f8687ff81892874a32c6a556c6be2e686012731 | https://github.com/kama1kant/rl-autonomous-driving/tree/8f8687ff81892874a32c6a556c6be2e686012731 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_inputs, num_actions):
super().__init__()
self.fc1 = nn.Linear(num_inputs, 100)
self.state_value = nn.Linear(100, 1)
def forward(self, x):
x = torch.flatten(x, sta... |
CustomGruCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
from torch import nn
class CustomGruCell(nn.Module):
"""
A forward only GRU cell.
Input should be: (sequence length x batch size x input_size).
The output is the output of the final forward call.
It's not clear if it would be possible to use the output from each cel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 numpy as np
... | kouohhashi/PySyft | CustomGruCell | false | 10,355 | [
"Apache-2.0"
] | 0 | 7415961b459f1d25f762467b346b7b94c1d6943f | https://github.com/kouohhashi/PySyft/tree/7415961b459f1d25f762467b346b7b94c1d6943f | import torch
import numpy as np
from torch import nn
class Model(nn.Module):
"""
A forward only GRU cell.
Input should be: (sequence length x batch size x input_size).
The output is the output of the final forward call.
It's not clear if it would be possible to use the output from each cell in a P... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, num_inputs, num_actions):
super(Actor, self).__init__()
self.fc1 = nn.Linear(num_inputs, 100)
self.action_head = nn.Linear(100, num_actions)
def forward(self, x):
x =... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | kama1kant/rl-autonomous-driving | Actor | false | 10,356 | [
"MIT"
] | 0 | 8f8687ff81892874a32c6a556c6be2e686012731 | https://github.com/kama1kant/rl-autonomous-driving/tree/8f8687ff81892874a32c6a556c6be2e686012731 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_inputs, num_actions):
super().__init__()
self.fc1 = nn.Linear(num_inputs, 100)
self.action_head = nn.Linear(100, num_actions)
def forward(self, x):
x = torch.flat... |
AttModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 AttModel(nn.Module):
def __init__(self, n_node, din, hidden_dim, dout):
super(AttModel, self).__init__()
self.fcv = nn.Linear(din, hidden_dim)
self.fck = nn.Linear(din, hidden_dim)
self.fcq = nn.Linear(din, h... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | jungwoohan72/DGN_pytorch | AttModel | false | 10,357 | [
"MIT"
] | 0 | 65fe7ab4df661d97725f2a72a1fdb49df1b2ea44 | https://github.com/jungwoohan72/DGN_pytorch/tree/65fe7ab4df661d97725f2a72a1fdb49df1b2ea44 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, n_node, din, hidden_dim, dout):
super().__init__()
self.fcv = nn.Linear(din, hidden_dim)
self.fck = nn.Linear(din, hidden_dim)
self.fcq = nn.Linear(din, hidden_dim)
... |
Downsample | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
class Downsample(nn.Module):
"""
Image to Patch Embedding, downsampling between stage1 and stage2
"""
def __init__(self, in_embed_dim, out_embed_dim, patch_size):
super().__init__()
self.proj = nn.Conv2d(in_embed_dim, out_emb... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
assert_size_stride = torch._C._dy... | javierrodenas/clearml_javi | Downsample | false | 10,358 | [
"Apache-2.0"
] | 0 | b6326104fe6a6f522223c2ac3d87468990a9e6f2 | https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2 | import torch
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""
Image to Patch Embedding, downsampling between stage1 and stage2
"""
def __init__(self, in_embed_dim, out_embed_dim, patch_size):
super().__init__()
self.proj = nn.Conv2d(in_embed_dim, out_embed_di... |
BiInteractionPooling | # 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 sklearn.metrics import *
import torch.onnx
import torch as torch
class BiInteractionPooling(nn.Module):
"""Bi-Interaction Layer used in Neural FM,compress the
pairwise element-wise product of features into one single vector.
Input shape
- A 3D tensor wit... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
import torch.onnx
import torch as torch
assert_size_stride = torch._C._dynamo.guards.ass... | dulvqingyunLT/DeepCTR-Torch | BiInteractionPooling | false | 10,359 | [
"Apache-2.0"
] | 0 | f40cf08f3469aa471f9ca69e44c5de51180341cc | https://github.com/dulvqingyunLT/DeepCTR-Torch/tree/f40cf08f3469aa471f9ca69e44c5de51180341cc | import torch
import torch.nn as nn
from sklearn.metrics import *
import torch.onnx
import torch as torch
class Model(nn.Module):
"""Bi-Interaction Layer used in Neural FM,compress the
pairwise element-wise product of features into one single vector.
Input shape
- A 3D tensor with shape:``(batc... |
SoftTargetCrossEntropy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class SoftTargetCrossEntropy(nn.Module):
"""
The native CE loss with soft target
input: x is output of model, target is ground truth
return: loss
"""
def __init__(self, weights):
super(SoftTarg... | 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
... | javierrodenas/clearml_javi | SoftTargetCrossEntropy | false | 10,360 | [
"Apache-2.0"
] | 0 | b6326104fe6a6f522223c2ac3d87468990a9e6f2 | https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class Model(nn.Module):
"""
The native CE loss with soft target
input: x is output of model, target is ground truth
return: loss
"""
def __init__(self, weights):
super().__init__()
self... |
SqueezeAndExcitationModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Swish(nn.Module):
def __init__(self):
super(Swish, self).__init__()
def forward(self, x):
return x * x.sigmoid()
class Conv1d(nn.Conv1d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | debasish-mihup/EfficientConformer | SqueezeAndExcitationModule | false | 10,361 | [
"Apache-2.0"
] | 0 | bddd927cebcde044a999aaa7766fa6d44dc20576 | https://github.com/debasish-mihup/EfficientConformer/tree/bddd927cebcde044a999aaa7766fa6d44dc20576 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Swish(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x * x.sigmoid()
class Conv1d(nn.Conv1d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=... |
DGN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
def __init__(self, din=32, hidden_dim=128):
super(Encoder, self).__init__()
self.fc = nn.Linear(din, hidden_dim)
def forward(self, x):
embedding = F.relu(self.fc(x))
return embedding
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | jungwoohan72/DGN_pytorch | DGN | false | 10,362 | [
"MIT"
] | 0 | 65fe7ab4df661d97725f2a72a1fdb49df1b2ea44 | https://github.com/jungwoohan72/DGN_pytorch/tree/65fe7ab4df661d97725f2a72a1fdb49df1b2ea44 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
def __init__(self, din=32, hidden_dim=128):
super().__init__()
self.fc = nn.Linear(din, hidden_dim)
def forward(self, x):
embedding = F.relu(self.fc(x))
return embedding
class AttMo... |
CircleLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import Tensor
from torch import nn
class CircleLoss(nn.Module):
def __init__(self, m: 'float', gamma: 'float') ->None:
super(CircleLoss, self).__init__()
self.m = m
self.gamma = gamma
self.soft_plus = nn.Softplus()
def forward(self, sp: 'Tensor', sn: '... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | kagawa123/Person_reID_baseline_pytorch | CircleLoss | false | 10,363 | [
"MIT"
] | 0 | a503af2fa329406e97c5347bf3b13629ad0ffd10 | https://github.com/kagawa123/Person_reID_baseline_pytorch/tree/a503af2fa329406e97c5347bf3b13629ad0ffd10 | import torch
from torch import Tensor
from torch import nn
class Model(nn.Module):
def __init__(self, m: 'float', gamma: 'float') ->None:
super().__init__()
self.m = m
self.gamma = gamma
self.soft_plus = nn.Softplus()
def forward(self, sp: 'Tensor', sn: 'Tensor') ->Tensor:
... |
PatchEmbed | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
class PatchEmbed(nn.Module):
"""
Image to Patch Embedding.
Different with ViT use 1 conv layer, we use 4 conv layers to do patch embedding
"""
def __init__(self, img_size=224, stem_conv=False, stem_stride=1,
patch_size=8, in_chan... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
assert_size_stride = torch._C._dy... | javierrodenas/clearml_javi | PatchEmbed | false | 10,364 | [
"Apache-2.0"
] | 0 | b6326104fe6a6f522223c2ac3d87468990a9e6f2 | https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2 | import torch
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""
Image to Patch Embedding.
Different with ViT use 1 conv layer, we use 4 conv layers to do patch embedding
"""
def __init__(self, img_size=224, stem_conv=False, stem_stride=1,
patch_size=8, in_chans=3, ... |
C3D | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import logging
import torch
import torch.nn as nn
class C3D(nn.Module):
def __init__(self, pretrained=None, modality='RGB'):
super(C3D, self).__init__()
self.pretrained = pretrained
self.modality = modality
inplace = True
assert modality in ['RGB']
self.conv1a = 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 logging
import torch.n... | hushunda/mmaction | C3D | false | 10,365 | [
"Apache-2.0"
] | 0 | b599273ddb80fd74ecf51ef5fa0c81639ea723c5 | https://github.com/hushunda/mmaction/tree/b599273ddb80fd74ecf51ef5fa0c81639ea723c5 | import logging
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, pretrained=None, modality='RGB'):
super().__init__()
self.pretrained = pretrained
self.modality = modality
inplace = True
assert modality in ['RGB']
self.conv1a = nn.Conv3d... |
MeanStd | # 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 MeanStd(nn.Module):
def __init__(self):
super(MeanStd, self).__init__()
def forward(self, x):
x = x.view(x.size(0), x.size(1), -1)
mean_x = torch.mean(x, dim=2)
var_x = torch.mean(x ** 2, dim=2) - mean_x * mean_x
return torch.c... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | jwen307/pytorch_GAN_zoo | MeanStd | false | 10,366 | [
"BSD-3-Clause"
] | 0 | b1e538a2f03fda42bd7a12872238b770ea5e0f23 | https://github.com/jwen307/pytorch_GAN_zoo/tree/b1e538a2f03fda42bd7a12872238b770ea5e0f23 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
x = x.view(x.size(0), x.size(1), -1)
mean_x = torch.mean(x, dim=2)
var_x = torch.mean(x ** 2, dim=2) - mean_x * mean_x
return torch.cat([mean_x, var... |
InnerProductNetwork | # 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 InnerProductNetwork(torch.nn.Module):
def forward(self, x):
"""
:param x: Float tensor of size ``(batch_size, num_fields, embed_dim)``
"""
num_fields = x.shape[1]
row, col = list(), list()
for i in range(num_fields - 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
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_... | jqsl2012/pytorch-fm | InnerProductNetwork | false | 10,367 | [
"MIT"
] | 0 | de6240d0a17750303bbc97dba676b667c3a27829 | https://github.com/jqsl2012/pytorch-fm/tree/de6240d0a17750303bbc97dba676b667c3a27829 | import torch
import torch.utils.data
class Model(torch.nn.Module):
def forward(self, x):
"""
:param x: Float tensor of size ``(batch_size, num_fields, embed_dim)``
"""
num_fields = x.shape[1]
row, col = list(), list()
for i in range(num_fields - 1):
for... |
ConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=
5, padding=2)
self.conv2 = nn.Conv2d(in_channels=32, out_channels=32, kernel_size
=3... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | krishsethi19/dffml | ConvNet | false | 10,368 | [
"MIT"
] | 0 | 2dd0a9c4a125a9739d27228128bbd381a8e0fef4 | https://github.com/krishsethi19/dffml/tree/2dd0a9c4a125a9739d27228128bbd381a8e0fef4 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=
5, padding=2)
self.conv2 = nn.Conv2d(in_channels=32, out_channels=32, kernel_size
=3, padding=1)
... |
learned_similarity_8 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 learned_similarity_8(nn.Module):
def __init__(self, in_size=1024):
super(learned_similarity_8, self).__init__()
self.lin = nn.Linear(1, 1)
self.lin2 = nn.Linear(1, 1)
self.tanh = nn.Tanh()
self.sigmoid = nn.Sigmoid()
def forwar... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | laurinwagner/grouploss_plus | learned_similarity_8 | false | 10,369 | [
"MIT"
] | 0 | add9e3e7b4fcfccf0393124aeb6e1f35a442ed88 | https://github.com/laurinwagner/grouploss_plus/tree/add9e3e7b4fcfccf0393124aeb6e1f35a442ed88 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_size=1024):
super().__init__()
self.lin = nn.Linear(1, 1)
self.lin2 = nn.Linear(1, 1)
self.tanh = nn.Tanh()
self.sigmoid = nn.Sigmoid()
def forward(self, xi, xj):
out = torch.resh... |
OutlookAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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
import torch.nn.parallel
class OutlookAttention(nn.Module):
"""
Implementation of outlook attention
--dim: hidden dim
--num_heads: number of heads
--kernel_size: kernel size in each window for outlook attention
retu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | javierrodenas/clearml_javi | OutlookAttention | false | 10,370 | [
"Apache-2.0"
] | 0 | b6326104fe6a6f522223c2ac3d87468990a9e6f2 | https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class Model(nn.Module):
"""
Implementation of outlook attention
--dim: hidden dim
--num_heads: number of heads
--kernel_size: kernel size in each window for outlook attention
return: token f... |
AdaIN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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
from numpy import prod
def getLayerNormalizationFactor(x, gain, fromTF):
"""
Get He's constant for the given layer
https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf
"""
size = x.weight.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.... | jwen307/pytorch_GAN_zoo | AdaIN | false | 10,371 | [
"BSD-3-Clause"
] | 0 | b1e538a2f03fda42bd7a12872238b770ea5e0f23 | https://github.com/jwen307/pytorch_GAN_zoo/tree/b1e538a2f03fda42bd7a12872238b770ea5e0f23 | import math
import torch
import torch.nn as nn
from numpy import prod
def getLayerNormalizationFactor(x, gain, fromTF):
"""
Get He's constant for the given layer
https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf
"""
size = x.weight.size()
... |
Model | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.conv1 = nn.Conv2d(1, 60, kernel_size=5)
self.conv2 = nn.Conv2d(60, 60, kernel_size=5)
self.conv3 = nn.Conv2d(60... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | kproshakov/SudokuCV | Model | false | 10,372 | [
"MIT"
] | 0 | 8c29f4f1ac32513e7bd7d194d1fefb249c5d7921 | https://github.com/kproshakov/SudokuCV/tree/8c29f4f1ac32513e7bd7d194d1fefb249c5d7921 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.conv1 = nn.Conv2d(1, 60, kernel_size=5)
self.conv2 = nn.Conv2d(60, 60, kernel_size=5)
self.conv3 = nn.Conv2d(60... |
LNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch.nn import functional as F
import torch.utils.data
class LNN(torch.nn.Module):
"""
A pytorch implementation of LNN layer
Input shape
- A 3D tensor with shape: ``(batch_size,field_size,embedding_size)``.
Output shape
- 2D tensor with shape:``(batch_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.... | jqsl2012/pytorch-fm | LNN | false | 10,373 | [
"MIT"
] | 0 | de6240d0a17750303bbc97dba676b667c3a27829 | https://github.com/jqsl2012/pytorch-fm/tree/de6240d0a17750303bbc97dba676b667c3a27829 | import math
import torch
from torch.nn import functional as F
import torch.utils.data
class Model(torch.nn.Module):
"""
A pytorch implementation of LNN layer
Input shape
- A 3D tensor with shape: ``(batch_size,field_size,embedding_size)``.
Output shape
- 2D tensor with shape:``(batch_s... |
ClassBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
class Mlp(nn.Module):
"""Implementation of MLP"""
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | javierrodenas/clearml_javi | ClassBlock | false | 10,374 | [
"Apache-2.0"
] | 0 | b6326104fe6a6f522223c2ac3d87468990a9e6f2 | https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2 | import torch
import torch.nn as nn
import torch.nn.parallel
class Mlp(nn.Module):
"""Implementation of MLP"""
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hi... |
Conv2D | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
from torch import nn
class Conv2D(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, dilation_h
=1, dilation_w=1, causal=True):
super(Conv2D, self).__init__()
self.causal = causal
self.dilation_h, self.dilation_w = dilatio... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | leoauri/WaveFlow | Conv2D | false | 10,375 | [
"BSD-3-Clause"
] | 0 | a34843f06a8b70acf8d4a3ffa5c2e8d5a07a7d66 | https://github.com/leoauri/WaveFlow/tree/a34843f06a8b70acf8d4a3ffa5c2e8d5a07a7d66 | import torch
import torch.utils.data
from torch import nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, dilation_h
=1, dilation_w=1, causal=True):
super().__init__()
self.causal = causal
self.dilation_h, self.dilation_w = dilation_h, dilation... |
LatentAtten | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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
class LatentAtten(nn.Module):
"""
Attention on latent representation
"""
def __init__(self, h_dim, key_dim=None) ->None:
super(LatentAtten, self).__init__()
if key_dim is None:
key_dim = h_dim
self.key_dim = key_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.... | kage08/CAMul | LatentAtten | false | 10,376 | [
"MIT"
] | 0 | 79f8a27f472943229fb087bae8e405e38e5e0b47 | https://github.com/kage08/CAMul/tree/79f8a27f472943229fb087bae8e405e38e5e0b47 | import math
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Attention on latent representation
"""
def __init__(self, h_dim, key_dim=None) ->None:
super().__init__()
if key_dim is None:
key_dim = h_dim
self.key_dim = key_dim
self.key_layer = ... |
SpatialPyramidPooling | # 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 SpatialPyramidPooling(nn.Module):
def __init__(self, pool_sizes=[5, 9, 13]):
super(SpatialPyramidPooling, self).__init__()
self.maxpools = nn.ModuleList([nn.MaxPool2d(pool_size, 1, pool_size //
2) for pool_size in pool_sizes])
def forward(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | janewen134/fyp | SpatialPyramidPooling | false | 10,377 | [
"Apache-2.0"
] | 0 | 8fb93ac22d21d5d862035ba794fe9d264add2e63 | https://github.com/janewen134/fyp/tree/8fb93ac22d21d5d862035ba794fe9d264add2e63 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, pool_sizes=[5, 9, 13]):
super().__init__()
self.maxpools = nn.ModuleList([nn.MaxPool2d(pool_size, 1, pool_size //
2) for pool_size in pool_sizes])
def forward(self, x):
features = [maxpool(x) fo... |
Affine | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch import optim as optim
class Affine(nn.Module):
def __init__(self, dim):
super().__init__()
self.alpha = nn.Parameter(torch.ones((1, 1, dim)))
self.beta = nn.Parameter(torch.zeros((1, 1, dim)))
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch import optim as optim
assert_size_stride = torch._C._dynam... | liangmuxue/pytorch-image-models | Affine | false | 10,378 | [
"Apache-2.0"
] | 0 | 84da7fdbedda76b1cb513ae128c612ab885e5e3f | https://github.com/liangmuxue/pytorch-image-models/tree/84da7fdbedda76b1cb513ae128c612ab885e5e3f | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch import optim as optim
class Model(nn.Module):
def __init__(self, dim):
super().__init__()
self.alpha = nn.Parameter(torch.ones((1, 1, dim)))
self.beta = nn.Parameter(torch.zeros((1, 1, dim)))
... |
EqualLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 math import sqrt
def equal_lr(module, name='weight'):
EqualLR.apply(module, name)
return module
class EqualLR:
def __init__(self, name):
self.name = name
def compute_weight(self, module):
weight = getattr(module, self.name + '_orig')
f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from math import sqrt
assert_size_stride = torch._C._dynamo... | jeromepl/style-based-gan-pytorch | EqualLinear | false | 10,379 | [
"MIT"
] | 0 | 97c13e54316dc57a7cb44c0cb910c29aaed11738 | https://github.com/jeromepl/style-based-gan-pytorch/tree/97c13e54316dc57a7cb44c0cb910c29aaed11738 | import torch
from torch import nn
from math import sqrt
def equal_lr(module, name='weight'):
EqualLR.apply(module, name)
return module
class EqualLR:
def __init__(self, name):
self.name = name
def compute_weight(self, module):
weight = getattr(module, self.name + '_orig')
f... |
SentinelMBSI | # 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 typing import *
class SentinelMBSI(torch.nn.Module):
def __init__(self, band_count):
super(SentinelMBSI, self).__init__()
self.no_weights = True
def forward(self, x):
self.red = x[:, 3:4, :, :]
self.green = x[:, 2:3, :, :]
return 2 * (self.red - self... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from typing import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | geotrellis/deeplab-nlcd | SentinelMBSI | false | 10,380 | [
"MIT"
] | 0 | 9444299597e1d1bc34ee187f2092890449c188be | https://github.com/geotrellis/deeplab-nlcd/tree/9444299597e1d1bc34ee187f2092890449c188be | import torch
from typing import *
class Model(torch.nn.Module):
def __init__(self, band_count):
super().__init__()
self.no_weights = True
def forward(self, x):
self.red = x[:, 3:4, :, :]
self.green = x[:, 2:3, :, :]
return 2 * (self.red - self.green) / (self.red + sel... |
CNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 CNN(torch.nn.Module):
"""Basic CNN architecture."""
def __init__(self, in_channels=1):
super(CNN, self).__init__()
self.conv1 = nn.Conv2d(in_channels, 64, 8, 1)
self.conv2 = nn.Conv2d(64, 128, 6, 2)
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 import triton_helpers
from torch import nn
assert_s... | kylematoba/cleverhans | CNN | false | 10,381 | [
"MIT"
] | 0 | acfd87e065ec5aabff1295ffbffafaf54057cb6c | https://github.com/kylematoba/cleverhans/tree/acfd87e065ec5aabff1295ffbffafaf54057cb6c | import torch
from torch import nn
import torch.nn.functional as F
class Model(torch.nn.Module):
"""Basic CNN architecture."""
def __init__(self, in_channels=1):
super().__init__()
self.conv1 = nn.Conv2d(in_channels, 64, 8, 1)
self.conv2 = nn.Conv2d(64, 128, 6, 2)
self.conv3 = ... |
Flip | # 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 Flip(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
xf = torch.flip(x, [2])
y1 = xf[:, :, 0::2, :]
y2 = xf[:, :, 1::2, :]
y = torch.cat((y1, y2), dim=2)
return y
def get_inputs():
return ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | liorkad3/ncnn | Flip | false | 10,382 | [
"BSD-3-Clause"
] | 0 | bcabffdf1ddc3739dc1051accba53a7f0a43863d | https://github.com/liorkad3/ncnn/tree/bcabffdf1ddc3739dc1051accba53a7f0a43863d | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
xf = torch.flip(x, [2])
y1 = xf[:, :, 0::2, :]
y2 = xf[:, :, 1::2, :]
y = torch.cat((y1, y2), dim=2)
return y
def get_inputs():
return... |
StyleResidual | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.utils.data
import torch.optim
class StyleResidual(nn.Module):
"""Styling."""
def __init__(self, d_channel: 'int', d_style: 'int', kernel_size: 'int'=1):
super().__init__()
self.rs = nn.Conv1d(in_channels=d_style, out_channels=d_channel,
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.utils.data
import torch.optim
assert_size_stri... | jinsongpan/NeMo | StyleResidual | false | 10,383 | [
"Apache-2.0"
] | 0 | 27f5f2dc6ecf7e0fd4225eedb2500cee6284e7d7 | https://github.com/jinsongpan/NeMo/tree/27f5f2dc6ecf7e0fd4225eedb2500cee6284e7d7 | import torch
from torch import nn
import torch.utils.data
import torch.optim
class Model(nn.Module):
"""Styling."""
def __init__(self, d_channel: 'int', d_style: 'int', kernel_size: 'int'=1):
super().__init__()
self.rs = nn.Conv1d(in_channels=d_style, out_channels=d_channel,
kerne... |
Relation | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch.nn as nn
from torch.nn import functional as F
class Relation(nn.Module):
def __init__(self, C, H, out_size):
super(Relation, self).__init__()
self.out_size = out_size
self.M = torch.nn.Parameter(torch.randn(H, H, out_size))
self.W ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | liangshb/few-shot-text-classification | Relation | false | 10,384 | [
"Apache-2.0"
] | 0 | 3bb2b3e87215ccf0fb6d5b0d436774557ac9ddd0 | https://github.com/liangshb/few-shot-text-classification/tree/3bb2b3e87215ccf0fb6d5b0d436774557ac9ddd0 | import torch
import torch.utils.data
import torch.nn as nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, C, H, out_size):
super().__init__()
self.out_size = out_size
self.M = torch.nn.Parameter(torch.randn(H, H, out_size))
self.W = torch.nn.Parame... |
MultAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 MultAttention(nn.Module):
"""
Multiplicative attention similar to Vaswani et al.
"""
def __init__(self, key_dim: 'int', val_dim: 'int', out_dim: 'int'):
super(MultAttention, self).__init__()
self.key_encoder = nn.Linear(key_dim, out_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.... | kage08/CAMul | MultAttention | false | 10,385 | [
"MIT"
] | 0 | 79f8a27f472943229fb087bae8e405e38e5e0b47 | https://github.com/kage08/CAMul/tree/79f8a27f472943229fb087bae8e405e38e5e0b47 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Multiplicative attention similar to Vaswani et al.
"""
def __init__(self, key_dim: 'int', val_dim: 'int', out_dim: 'int'):
super().__init__()
self.key_encoder = nn.Linear(key_dim, out_dim)
self.val_encoder = nn.Lin... |
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
from torch import nn
from torch.nn.functional import leaky_relu
class FusedLeakyReLU(nn.Module):
def __init__(self, channel, negative_slope=0.2, scale=2 ** 0.5):
super().__init__()
self.bias = nn.Parameter(torch.zeros(channel))
self.negative_slope = negative_slope
sel... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | jchetboun/anycost-gan | FusedLeakyReLU | false | 10,386 | [
"MIT"
] | 0 | 7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | https://github.com/jchetboun/anycost-gan/tree/7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | import torch
from torch import nn
from torch.nn.functional import leaky_relu
class Model(nn.Module):
def __init__(self, channel, negative_slope=0.2, scale=2 ** 0.5):
super().__init__()
self.bias = nn.Parameter(torch.zeros(channel))
self.negative_slope = negative_slope
self.scale =... |
MixedCycleLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.nn.functional as F
class MixedCycleLoss(nn.Module):
def __init__(self, reduction: 'str'='none') ->None:
super(MixedCycleLoss, self).__init__()
self.reduction = reduction
def forward(self, input_2d, input_3d, target_2d, target_3d, w_cycle=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... | koustav123/SemGCN | MixedCycleLoss | false | 10,387 | [
"Apache-2.0"
] | 0 | e74014378933c19027865499080629b36ac6a5c9 | https://github.com/koustav123/SemGCN/tree/e74014378933c19027865499080629b36ac6a5c9 | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, reduction: 'str'='none') ->None:
super().__init__()
self.reduction = reduction
def forward(self, input_2d, input_3d, target_2d, target_3d, w_cycle=1,
w_3d=1):
loss_cyc... |
EqualLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.functional import leaky_relu
def fused_leaky_relu(input_, bias, negative_slope=0.2, scale=2 ** 0.5):
return scale * leaky_relu(input_ + bias[:input_.shape[1]],
negative_slope, inplace=True)
class EqualLinear... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
from torch import nn
from torch.nn.functional import leaky_relu
asse... | jchetboun/anycost-gan | EqualLinear | false | 10,388 | [
"MIT"
] | 0 | 7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | https://github.com/jchetboun/anycost-gan/tree/7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | import math
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.functional import leaky_relu
def fused_leaky_relu(input_, bias, negative_slope=0.2, scale=2 ** 0.5):
return scale * leaky_relu(input_ + bias[:input_.shape[1]],
negative_slope, inplace=True)
class Model(nn.Mo... |
EqualConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import nn
from torch.nn import functional as F
class EqualConv2d(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, stride=1,
padding=0, bias=True):
super().__init__()
self.weight = nn.Parameter(torch.randn(out_channel, in_channel,
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
from torch import nn
assert_size_stride = torch._C._dynamo.guards.as... | jchetboun/anycost-gan | EqualConv2d | false | 10,389 | [
"MIT"
] | 0 | 7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | https://github.com/jchetboun/anycost-gan/tree/7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | import math
import torch
from torch import nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, stride=1,
padding=0, bias=True):
super().__init__()
self.weight = nn.Parameter(torch.randn(out_channel, in_channel,
... |
GeM | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class GeM(nn.Module):
def __init__(self, dim=1, p=0.0, eps=1e-06):
super(GeM, self).__init__()
self.p = nn.Parameter(torch.ones(()) * p, requires_grad=True)
self.eps = eps
self.dim = dim
def forward(self, x):
return self.gem(x, p=sel... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | layumi/dgcnn | GeM | false | 10,390 | [
"MIT"
] | 0 | a7b58796ffe549f2d8bdb06a84f62aba03e1d3a1 | https://github.com/layumi/dgcnn/tree/a7b58796ffe549f2d8bdb06a84f62aba03e1d3a1 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, dim=1, p=0.0, eps=1e-06):
super().__init__()
self.p = nn.Parameter(torch.ones(()) * p, requires_grad=True)
self.eps = eps
self.dim = dim
def forward(self, x):
return self.gem(x, p=self.p, ep... |
BertOutput | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.data
import torch.utils.data.distributed
import torch.utils.checkpoint
import torch.utils.tensorboard
class BertOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Line... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | ali-senguel/fairo-explore | BertOutput | false | 10,391 | [
"MIT"
] | 0 | 893481da270eed1e6d504c71e483d685ca9218d1 | https://github.com/ali-senguel/fairo-explore/tree/893481da270eed1e6d504c71e483d685ca9218d1 | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.data
import torch.utils.data.distributed
import torch.utils.checkpoint
import torch.utils.tensorboard
class Model(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(co... |
AttentionConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 as init
class AttentionConv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=False):
super(AttentionConv, self).__init__()
self.out_channels = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | khy0809/Stand-Alone-Self-Attention | AttentionConv | false | 10,392 | [
"MIT"
] | 0 | 019718c8983faac24d69bd9b37eaf33cd28e1c4a | https://github.com/khy0809/Stand-Alone-Self-Attention/tree/019718c8983faac24d69bd9b37eaf33cd28e1c4a | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=False):
super().__init__()
self.out_channels = out_channels
self.k... |
Transformer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
class Mlp(nn.Module):
"""Implementation of MLP"""
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | javierrodenas/clearml_javi | Transformer | false | 10,393 | [
"Apache-2.0"
] | 0 | b6326104fe6a6f522223c2ac3d87468990a9e6f2 | https://github.com/javierrodenas/clearml_javi/tree/b6326104fe6a6f522223c2ac3d87468990a9e6f2 | import torch
import torch.nn as nn
import torch.nn.parallel
class Mlp(nn.Module):
"""Implementation of MLP"""
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hi... |
MSEWithLogitsLoss | # 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.nn import MSELoss
class MSEWithLogitsLoss(MSELoss):
"""
This loss combines a `Sigmoid` layer and the `MSELoss` in one single class.
"""
def __init__(self):
super(MSEWithLogitsLoss, self).__init__()
self.sigmoid = nn.Sigmoid()
def forwa... | 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 MSELoss
assert_size_stride = torch._C._dynamo.g... | joowlim/pytorch-3dunet | MSEWithLogitsLoss | false | 10,394 | [
"MIT"
] | 0 | d08049f60b619627521efd0fb171247e1536b262 | https://github.com/joowlim/pytorch-3dunet/tree/d08049f60b619627521efd0fb171247e1536b262 | import torch
from torch import nn
from torch.nn import MSELoss
class Model(MSELoss):
"""
This loss combines a `Sigmoid` layer and the `MSELoss` in one single class.
"""
def __init__(self):
super().__init__()
self.sigmoid = nn.Sigmoid()
def forward(self, input, target):
re... |
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... | from torch.autograd import Function
import math
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.functional import leaky_relu
def fused_leaky_relu(input_, bias, negative_slope=0.2, scale=2 ** 0.5):
return scale * leaky_relu(input_ + bias[:input_.shape[1]],
negative_slop... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.autograd import Function
import math
from torch import nn
from torch.... | jchetboun/anycost-gan | ToRGB | false | 10,395 | [
"MIT"
] | 0 | 7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | https://github.com/jchetboun/anycost-gan/tree/7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | from torch.autograd import Function
import math
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.functional import leaky_relu
def fused_leaky_relu(input_, bias, negative_slope=0.2, scale=2 ** 0.5):
return scale * leaky_relu(input_ + bias[:input_.shape[1]],
negative_slop... |
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... | from torch.autograd import Function
import math
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.functional import leaky_relu
def fused_leaky_relu(input_, bias, negative_slope=0.2, scale=2 ** 0.5):
return scale * leaky_relu(input_ + bias[:input_.shape[1]],
negative_slop... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.autograd... | jchetboun/anycost-gan | ModulatedConv2d | false | 10,396 | [
"MIT"
] | 0 | 7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | https://github.com/jchetboun/anycost-gan/tree/7e0005e50b915e2dfeb90fe7a9846c5df38d7c06 | from torch.autograd import Function
import math
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.functional import leaky_relu
def fused_leaky_relu(input_, bias, negative_slope=0.2, scale=2 ** 0.5):
return scale * leaky_relu(input_ + bias[:input_.shape[1]],
negative_slop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.