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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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.... | quanha72/mesh-memory-transformer | MultiHeadAttention | false | 12,929 | [
"BSD-3-Clause"
] | 0 | 0eeae459efdb8e85926ce8595536409fdbfc4f99 | https://github.com/quanha72/mesh-memory-transformer/tree/0eeae459efdb8e85926ce8595536409fdbfc4f99 | 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... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Actor(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, 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
import numpy as np
... | rbak/deep-rl-udacity-project-3 | Actor | false | 12,930 | [
"MIT"
] | 0 | 4bf2aec6b0ef27636ebd11dfd4b442554208cffb | https://github.com/rbak/deep-rl-udacity-project-3/tree/4bf2aec6b0ef27636ebd11dfd4b442554208cffb | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Model(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, f... |
BertAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
import torch.utils.data
class BertSelfAttention(nn.Module):
def __init__(self, config):
super(BertSelfAttention, self).__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | rahul-art/DeepSpeedExamples | BertAttention | false | 12,931 | [
"MIT"
] | 0 | f6b901516a336f91ee2a2dd735b9d20ab2c87d85 | https://github.com/rahul-art/DeepSpeedExamples/tree/f6b901516a336f91ee2a2dd735b9d20ab2c87d85 | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
import torch.utils.data
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise ValueError(
... |
distLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from torch.nn.utils.weight_norm import WeightNorm
class distLinear(nn.Module):
def __init__(self, indim, outdim):
super(distLinear, self).__init__()
self.L = nn.Linear(indim, outdim, bias=False)
self.class_wise_learnable_norm = True
if self.class... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | raphael-baena/clean-train | distLinear | false | 12,932 | [
"MIT"
] | 0 | f65fcecc11203b12f27d14964944db6941b513cc | https://github.com/raphael-baena/clean-train/tree/f65fcecc11203b12f27d14964944db6941b513cc | import torch
import torch.nn as nn
from torch.nn.utils.weight_norm import WeightNorm
class Model(nn.Module):
def __init__(self, indim, outdim):
super().__init__()
self.L = nn.Linear(indim, outdim, bias=False)
self.class_wise_learnable_norm = True
if self.class_wise_learnable_norm:... |
ncm_output | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ncm_output(nn.Module):
def __init__(self, indim, outdim):
super(ncm_output, self).__init__()
self.linear = nn.Linear(indim, outdim)
def forward(self, x):
return -1 * torch.norm(x.reshape(x.shape[0], 1, -1) - self.linear.
weight.tra... | 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_... | raphael-baena/clean-train | ncm_output | false | 12,933 | [
"MIT"
] | 0 | f65fcecc11203b12f27d14964944db6941b513cc | https://github.com/raphael-baena/clean-train/tree/f65fcecc11203b12f27d14964944db6941b513cc | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, indim, outdim):
super().__init__()
self.linear = nn.Linear(indim, outdim)
def forward(self, x):
return -1 * torch.norm(x.reshape(x.shape[0], 1, -1) - self.linear.
weight.transpose(0, 1).reshape(... |
Resizer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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.functional as F
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class DWConv(nn.Module):
"""
Depthwise separable 1d convolution
"""
def _... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
import torch.nn.functional as F
import torch.f... | remzawi/squad | Resizer | false | 12,934 | [
"MIT"
] | 0 | 234eaea858969f4f1fe58504b8fae19e42306296 | https://github.com/remzawi/squad/tree/234eaea858969f4f1fe58504b8fae19e42306296 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.functional as F
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class DWConv(nn.Module):
"""
Depthwise separable 1d convolution
"""
def _... |
DeconvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class DeconvBlock(nn.Module):
def __init__(self, in_channels, out_channels):
super(DeconvBlock, self).__init__()
self.conv = nn.ConvTranspose2d(in_channels, out_channels,
kernel_size=3, stride=2, padding=1, output_padding=0)
self.pad = nn.Ref... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | richardlyf/FeatDepth | DeconvBlock | false | 12,935 | [
"MIT"
] | 0 | 6739ee0ded5a91a97d6cea1aa259c64f8b520fcd | https://github.com/richardlyf/FeatDepth/tree/6739ee0ded5a91a97d6cea1aa259c64f8b520fcd | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.conv = nn.ConvTranspose2d(in_channels, out_channels,
kernel_size=3, stride=2, padding=1, output_padding=0)
self.pad = nn.ReflectionPad2d((0, 1, 0, ... |
ShuffleCatChunk | # 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 ShuffleCatChunk(nn.Module):
def forward(self, a, b):
assert a.size() == b.size()
_n, c, _h, _w = a.size()
a = torch.chunk(a, chunks=c, dim=1)
b = torch.chunk(b, chunks=c, dim=1)
x = [None] * (c * 2)
x[::2] = a
x[1::2... | 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... | rbli-john/yolact_edge | ShuffleCatChunk | false | 12,936 | [
"MIT"
] | 0 | 48305b45baf2154c336884aeb8a98cfc2c0a8cee | https://github.com/rbli-john/yolact_edge/tree/48305b45baf2154c336884aeb8a98cfc2c0a8cee | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, a, b):
assert a.size() == b.size()
_n, c, _h, _w = a.size()
a = torch.chunk(a, chunks=c, dim=1)
b = torch.chunk(b, chunks=c, dim=1)
x = [None] * (c * 2)
x[::2] = a
x[1::2] = b
... |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class DiceLoss(nn.Module):
def __init__(self, loss_weight=1.0):
super(DiceLoss, self).__init__()
self.loss_weight = loss_weight
def forward(self, input, target, mask, reduce=True):
batch_size = input.size(0)
input = torch.sigmoid(input)
... | 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... | rigvedsah000/PAN- | DiceLoss | false | 12,937 | [
"Apache-2.0"
] | 0 | 16f8482886c5eccecf29fe072025ba54c64e4b9d | https://github.com/rigvedsah000/PAN-/tree/16f8482886c5eccecf29fe072025ba54c64e4b9d | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, loss_weight=1.0):
super().__init__()
self.loss_weight = loss_weight
def forward(self, input, target, mask, reduce=True):
batch_size = input.size(0)
input = torch.sigmoid(input)
input = input... |
LayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 LayerNorm(nn.Module):
def __init__(self, dim, eps=1e-05):
super().__init__()
self.eps = eps
self.g = nn.Parameter(torch.ones(1, dim, 1, 1))
self.b = nn.Parameter(torch.zeros(1, dim, 1, 1))
def forward(self, x):
var = torch.var(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
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | psemchyshyn/diffusion_reconstruction | LayerNorm | false | 12,938 | [
"MIT"
] | 0 | c7ccc8c9f47c858606a46c2c29fcb64016565b4e | https://github.com/psemchyshyn/diffusion_reconstruction/tree/c7ccc8c9f47c858606a46c2c29fcb64016565b4e | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim, eps=1e-05):
super().__init__()
self.eps = eps
self.g = nn.Parameter(torch.ones(1, dim, 1, 1))
self.b = nn.Parameter(torch.zeros(1, dim, 1, 1))
def forward(self, x):
var = torch.var(x, di... |
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from abc import *
import torch.nn.functional as F
from torch.optim import *
def orthogonal_init(layer, nonlinearity='relu'):
if isinstance(nonlinearity, str):
if nonlinearity == 'policy':
gain = 0.01
else:
gain = torch.nn.init.calculate_gain(nonlinearity)
e... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 abc import *
from torch.... | ramanuzan/JORLDY | MLP | false | 12,939 | [
"Apache-2.0"
] | 0 | be371ad0607e5dba5d5082101c38c6a9f2c96767 | https://github.com/ramanuzan/JORLDY/tree/be371ad0607e5dba5d5082101c38c6a9f2c96767 | import torch
from abc import *
import torch.nn.functional as F
from torch.optim import *
def orthogonal_init(layer, nonlinearity='relu'):
if isinstance(nonlinearity, str):
if nonlinearity == 'policy':
gain = 0.01
else:
gain = torch.nn.init.calculate_gain(nonlinearity)
e... |
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch.nn import Linear
from torch.nn import Tanh
from torch.nn.init import kaiming_uniform_
from torch.nn.init import xavier_uniform_
class MLP(Module):
"""
Summary: 1 hidden layer NN
@param n_inputs (int): number of inputs in the current environment
"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.nn impor... | roee89871324/Evolutionary_Selective_Imitation | MLP | false | 12,940 | [
"MIT"
] | 0 | 84b31fce6dcd6d79686244b9b53cde584a713723 | https://github.com/roee89871324/Evolutionary_Selective_Imitation/tree/84b31fce6dcd6d79686244b9b53cde584a713723 | from torch.nn import Module
import torch
from torch.nn import Linear
from torch.nn import Tanh
from torch.nn.init import kaiming_uniform_
from torch.nn.init import xavier_uniform_
class Model(Module):
"""
Summary: 1 hidden layer NN
@param n_inputs (int): number of inputs in the current environment
""... |
eca_layer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.optim
class eca_layer(nn.Module):
"""Constructs a ECA module.
Args:
channel: Number of channels of the input feature map
k_size: Adaptive selection of kernel size
"""
def __init__(self, channel, k_size=3):
super(eca_layer, self).... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.optim
assert_size_stride = torch._C._dynamo.g... | purbayankar/PyTorch-Zero-Shot-Super-Resolution | eca_layer | false | 12,941 | [
"MIT"
] | 0 | 434fe5e84e166eef1f8c03880fc83c7e8749c49c | https://github.com/purbayankar/PyTorch-Zero-Shot-Super-Resolution/tree/434fe5e84e166eef1f8c03880fc83c7e8749c49c | import torch
import torch.nn as nn
import torch.optim
class Model(nn.Module):
"""Constructs a ECA module.
Args:
channel: Number of channels of the input feature map
k_size: Adaptive selection of kernel size
"""
def __init__(self, channel, k_size=3):
super().__init__()
... |
GridPredictionModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 GridPredictionModel(nn.Module):
def __init__(self):
super(GridPredictionModel, self).__init__()
self.conv1 = nn.Conv2d(in_channels=1, out_channels=100, kernel_size
=3, padding=2)
self.conv2 = nn.Conv2d(in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | rickmarson/game_of_life_nn | GridPredictionModel | false | 12,942 | [
"MIT"
] | 0 | 728bb009b9d54268e96f33bb752a3e5ba1ae15d1 | https://github.com/rickmarson/game_of_life_nn/tree/728bb009b9d54268e96f33bb752a3e5ba1ae15d1 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=1, out_channels=100, kernel_size
=3, padding=2)
self.conv2 = nn.Conv2d(in_channels=100, out_channels=1, kernel_s... |
Conv5x5 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Conv5x5(nn.Module):
def __init__(self, in_channels, out_channels, use_refl=True):
super(Conv5x5, self).__init__()
if use_refl:
self.pad = nn.ReflectionPad2d(2)
else:
self.pad = nn.ZeroPad2d(2)
self.conv = nn.Conv2d(i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | richardlyf/FeatDepth | Conv5x5 | false | 12,943 | [
"MIT"
] | 0 | 6739ee0ded5a91a97d6cea1aa259c64f8b520fcd | https://github.com/richardlyf/FeatDepth/tree/6739ee0ded5a91a97d6cea1aa259c64f8b520fcd | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, use_refl=True):
super().__init__()
if use_refl:
self.pad = nn.ReflectionPad2d(2)
else:
self.pad = nn.ZeroPad2d(2)
self.conv = nn.Conv2d(int(in_channels)... |
pHAbsModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 pHAbsLayer(nn.Module):
"""Custom pHAbs Layer: Amax/(1+e^(pKa-pH)/phi)"""
def __init__(self):
super().__init__()
weights = np.random.normal([1, 7.6, 0.5], [0.2, 0.5, 0.1])
weights = torch.from_numpy(weights)
self.weight... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import numpy as np
from torch import nn
assert_size_stride = torch._C._dy... | rokapre/Nonlinear_Regression | pHAbsModel | false | 12,944 | [
"MIT"
] | 0 | d705f6a010fc0bf000531c967ffcf8ed79a5f92e | https://github.com/rokapre/Nonlinear_Regression/tree/d705f6a010fc0bf000531c967ffcf8ed79a5f92e | import torch
import numpy as np
from torch import nn
class pHAbsLayer(nn.Module):
"""Custom pHAbs Layer: Amax/(1+e^(pKa-pH)/phi)"""
def __init__(self):
super().__init__()
weights = np.random.normal([1, 7.6, 0.5], [0.2, 0.5, 0.1])
weights = torch.from_numpy(weights)
self.weight... |
LR_PAD | # 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 lr_pad(x, padding=1):
return torch.cat([x[..., -padding:], x, x[..., :padding]], dim=3)
class LR_PAD(nn.Module):
def __init__(self, padding=1):
super(LR_PAD, self).__init__()
self.padding = padding
def forward(self, x):
return lr_pad(x, se... | 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... | roxyrypler/HorizonNet | LR_PAD | false | 12,945 | [
"MIT"
] | 0 | 303322deb652d0985936f084ba9a08d232a60427 | https://github.com/roxyrypler/HorizonNet/tree/303322deb652d0985936f084ba9a08d232a60427 | import torch
import torch.nn as nn
def lr_pad(x, padding=1):
return torch.cat([x[..., -padding:], x, x[..., :padding]], dim=3)
class Model(nn.Module):
def __init__(self, padding=1):
super().__init__()
self.padding = padding
def forward(self, x):
return lr_pad(x, self.padding)
... |
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 *
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 with shape:``(batch_size,field_size,embeddi... | 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 *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = tor... | liyunrui/DeepCTR-Torch | BiInteractionPooling | false | 12,946 | [
"Apache-2.0"
] | 0 | 392fd6d39d9ca0ac854022136cdb4d5c68e3a592 | https://github.com/liyunrui/DeepCTR-Torch/tree/392fd6d39d9ca0ac854022136cdb4d5c68e3a592 | import torch
import torch.nn as nn
from sklearn.metrics import *
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:``(batch_size,field_size,embedding_size)``.
... |
Decoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import nn
def overlap_and_add(signal, frame_step):
outer_dimensions = signal.size()[:-2]
frames, frame_length = signal.size()[-2:]
subframe_length = math.gcd(frame_length, frame_step)
subframe_step = frame_step // subframe_length
subframes_per_frame = frame_leng... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | roger-tseng/demucs | Decoder | false | 12,947 | [
"MIT"
] | 0 | 4a54a3c523a86345df294798994b60c8194e0a43 | https://github.com/roger-tseng/demucs/tree/4a54a3c523a86345df294798994b60c8194e0a43 | import math
import torch
from torch import nn
def overlap_and_add(signal, frame_step):
outer_dimensions = signal.size()[:-2]
frames, frame_length = signal.size()[-2:]
subframe_length = math.gcd(frame_length, frame_step)
subframe_step = frame_step // subframe_length
subframes_per_frame = frame_leng... |
DiceCoefMultilabelLoss | # 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 DiceCoefMultilabelLoss(nn.Module):
def __init__(self, cuda=True):
super().__init__()
self.one = torch.tensor(1.0, dtype=torch.float32)
self.activation = torch.nn.Softmax2d()
def dice_loss(self, predict, target):
predict = predict.contig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | rominashirazi/SpineSegmentation | DiceCoefMultilabelLoss | false | 12,948 | [
"MIT"
] | 0 | fb08122ac6d9a598b60aecb4f1a1a2a31fba96ab | https://github.com/rominashirazi/SpineSegmentation/tree/fb08122ac6d9a598b60aecb4f1a1a2a31fba96ab | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, cuda=True):
super().__init__()
self.one = torch.tensor(1.0, dtype=torch.float32)
self.activation = torch.nn.Softmax2d()
def dice_loss(self, predict, target):
predict = predict.contiguous().view(-1)
... |
PositionWiseFFN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from torch.nn.functional import relu
class PositionWiseFFN(nn.Module):
def __init__(self, model_dim, dropout=0.0):
super().__init__()
dff = model_dim * 4
self.l = nn.Linear(model_dim, dff)
self.o = nn.Linear(dff, model_dim)
self.dropout = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ruifan831/NLP-Tutorials | PositionWiseFFN | false | 12,949 | [
"MIT"
] | 0 | d1fe27b2891156be4d8054022b762f758e9113a9 | https://github.com/ruifan831/NLP-Tutorials/tree/d1fe27b2891156be4d8054022b762f758e9113a9 | import torch
from torch import nn
from torch.nn.functional import relu
class Model(nn.Module):
def __init__(self, model_dim, dropout=0.0):
super().__init__()
dff = model_dim * 4
self.l = nn.Linear(model_dim, dff)
self.o = nn.Linear(dff, model_dim)
self.dropout = nn.Dropout... |
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
import torch.nn as nn
import torch.nn.functional as F
class CNN(nn.Module):
def __init__(self):
super(CNN, self).__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
self.conv2_drop = nn.Dropout2d()
self.fc1 = n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | rondagdag/onnx-pected | CNN | false | 12,950 | [
"MIT"
] | 0 | 63eb1c7edf2ddb3127073dc6c09b8edba32a9530 | https://github.com/rondagdag/onnx-pected/tree/63eb1c7edf2ddb3127073dc6c09b8edba32a9530 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
self.conv2_drop = nn.Dropout2d()
self.fc1 = nn.Linea... |
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 *
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 shape: ``(batch_size,1,embedding_size)``.
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = tor... | liyunrui/DeepCTR-Torch | InnerProductLayer | false | 12,951 | [
"Apache-2.0"
] | 0 | 392fd6d39d9ca0ac854022136cdb4d5c68e3a592 | https://github.com/liyunrui/DeepCTR-Torch/tree/392fd6d39d9ca0ac854022136cdb4d5c68e3a592 | import torch
import torch.nn as nn
from sklearn.metrics import *
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: ``(batch_size,1,embedding_size)``.
Output... |
MultiHeadAttentionLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 MultiHeadAttentionLayer(nn.Module):
def __init__(self, hidden_dim, n_heads, dropout=0.1):
super().__init__()
assert hidden_dim % n_heads == 0
self.hidden_dim = hidden_dim
self.n_heads = n_heads
self.head_dim = hidden_dim... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | rigvedsah000/PAN- | MultiHeadAttentionLayer | false | 12,952 | [
"Apache-2.0"
] | 0 | 16f8482886c5eccecf29fe072025ba54c64e4b9d | https://github.com/rigvedsah000/PAN-/tree/16f8482886c5eccecf29fe072025ba54c64e4b9d | import math
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, hidden_dim, n_heads, dropout=0.1):
super().__init__()
assert hidden_dim % n_heads == 0
self.hidden_dim = hidden_dim
self.n_heads = n_heads
self.head_dim = hidden_dim // n_heads
... |
SharedLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SharedLinear(nn.Linear):
def __init__(self, in_features, out_features, share_weight=False):
super(SharedLinear, self).__init__(in_features, out_features, bias=True
)
if share_weight:
self.weight = nn.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | sdw95927/deconvGAN | SharedLinear | false | 12,954 | [
"MIT"
] | 0 | 49dbbfe4827ed8366242870877165482d4ec1e75 | https://github.com/sdw95927/deconvGAN/tree/49dbbfe4827ed8366242870877165482d4ec1e75 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Linear):
def __init__(self, in_features, out_features, share_weight=False):
super().__init__(in_features, out_features, bias=True
)
if share_weight:
self.weight = nn.Parameter(torch.Tensor(1,... |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class DiceLoss(torch.nn.Module):
def __init__(self, weight=None, size_average=True, per_image=False, eps
=1e-06):
super().__init__()
self.size_average = size_average
self.register_buffer('weight', weight)
self.per_image = per_image
self.eps = eps
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | sebasmos/Spacenet7TRDP | DiceLoss | false | 12,955 | [
"Apache-2.0"
] | 0 | 03b5819321108017f8f8c2d359264c8e18d9e38a | https://github.com/sebasmos/Spacenet7TRDP/tree/03b5819321108017f8f8c2d359264c8e18d9e38a | import torch
class Model(torch.nn.Module):
def __init__(self, weight=None, size_average=True, per_image=False, eps
=1e-06):
super().__init__()
self.size_average = size_average
self.register_buffer('weight', weight)
self.per_image = per_image
self.eps = eps
def... |
IoU | # 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 IoU(nn.Module):
def __init__(self, mode='iou', axis=1, eps=0.0):
""" Return a matrix of [batch * num_classes].
Note: In order to separate from iou=0, function WILL return NaN if both
y_true and y_pred are 0. Need further treatment to remo... | 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... | sdw95927/deconvGAN | IoU | false | 12,956 | [
"MIT"
] | 0 | 49dbbfe4827ed8366242870877165482d4ec1e75 | https://github.com/sdw95927/deconvGAN/tree/49dbbfe4827ed8366242870877165482d4ec1e75 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, mode='iou', axis=1, eps=0.0):
""" Return a matrix of [batch * num_classes].
Note: In order to separate from iou=0, function WILL return NaN if both
y_true and y_pred are 0. Need further treatment to re... |
DiceLoss_TRDP | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch.nn.modules.loss import _Loss
class DiceLoss_TRDP(_Loss):
def __init__(self, per_image=False):
super(DiceLoss_TRDP, self).__init__()
self.per_image = per_image
def forward(self, y_pred, y_true):
"""
:param y_pred: NxCxHxW
:param y_true: NxCxHxW
... | 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.nn.modules.loss import _Loss
assert_size_stride = torch._C._dynamo.guards.asse... | sebasmos/Spacenet7TRDP | DiceLoss_TRDP | false | 12,957 | [
"Apache-2.0"
] | 0 | 03b5819321108017f8f8c2d359264c8e18d9e38a | https://github.com/sebasmos/Spacenet7TRDP/tree/03b5819321108017f8f8c2d359264c8e18d9e38a | import torch
from torch.nn.modules.loss import _Loss
class Model(_Loss):
def __init__(self, per_image=False):
super().__init__()
self.per_image = per_image
def forward(self, y_pred, y_true):
"""
:param y_pred: NxCxHxW
:param y_true: NxCxHxW
:return: scalar
... |
TemporalPooling | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class TemporalPooling(nn.Module):
def __init__(self, frames, kernel_size=3, stride=2, mode='avg'):
"""
Parameters
----------
frames (int): nu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
assert_size_st... | peter-yys-yoon/traditional-dance-recognition | TemporalPooling | false | 12,958 | [
"Apache-2.0"
] | 0 | be4939d53b838624a04dba0826532c65421d1325 | https://github.com/peter-yys-yoon/traditional-dance-recognition/tree/be4939d53b838624a04dba0826532c65421d1325 | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, frames, kernel_size=3, stride=2, mode='avg'):
"""
Parameters
----------
frames (int): number of in... |
SoftDiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import numpy as np
import torch.nn as nn
class IoU(nn.Module):
def __init__(self, mode='iou', axis=1, eps=0.0):
""" Return a matrix of [batch * num_classes].
Note: In order to separate from iou=0, function WILL return NaN if both
y_true and y_pred are 0. Need furthe... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dyna... | sdw95927/deconvGAN | SoftDiceLoss | false | 12,959 | [
"MIT"
] | 0 | 49dbbfe4827ed8366242870877165482d4ec1e75 | https://github.com/sdw95927/deconvGAN/tree/49dbbfe4827ed8366242870877165482d4ec1e75 | import torch
import numpy as np
import torch.nn as nn
class IoU(nn.Module):
def __init__(self, mode='iou', axis=1, eps=0.0):
""" Return a matrix of [batch * num_classes].
Note: In order to separate from iou=0, function WILL return NaN if both
y_true and y_pred are 0. Need furthe... |
TAM | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class SEModule(nn.Module):
def __init__(self, channels, dw_conv):
super().__init__()
ks = 1
pad = (ks - 1) // 2
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | peter-yys-yoon/traditional-dance-recognition | TAM | false | 12,960 | [
"Apache-2.0"
] | 0 | be4939d53b838624a04dba0826532c65421d1325 | https://github.com/peter-yys-yoon/traditional-dance-recognition/tree/be4939d53b838624a04dba0826532c65421d1325 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class SEModule(nn.Module):
def __init__(self, channels, dw_conv):
super().__init__()
ks = 1
pad = (ks - 1) // 2
... |
_Enc | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 _NestedEnc(torch.nn.Module):
def __init__(self, f):
super().__init__()
self.f = f
def forward(self, x):
return self.f(x)
class _Enc(torch.nn.Module):
def __init__(self):
super().__init__()
self.e1 = _NestedEnc(torch.nn.Linear(4, 2))
s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cu... | pminervini/higher | _Enc | false | 12,961 | [
"Apache-2.0"
] | 0 | c4a7697a013f7b909b3c3453fd56401d6bb91fab | https://github.com/pminervini/higher/tree/c4a7697a013f7b909b3c3453fd56401d6bb91fab | import torch
class _NestedEnc(torch.nn.Module):
def __init__(self, f):
super().__init__()
self.f = f
def forward(self, x):
return self.f(x)
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.e1 = _NestedEnc(torch.nn.Linear(4, 2))
... |
MultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class MultiHeadAttention(nn.Module):
def __init__(self, heads, d_model):
super(MultiHeadAttention, self).__init__()
assert d_model % heads == 0
self.d_k = d_model // heads
self.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.... | sd2001/seqModeling | MultiHeadAttention | false | 12,962 | [
"MIT"
] | 0 | 393f680de711ea8477e5450633b492298d253368 | https://github.com/sd2001/seqModeling/tree/393f680de711ea8477e5450633b492298d253368 | import math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, heads, d_model):
super().__init__()
assert d_model % heads == 0
self.d_k = d_model // heads
self.heads = heads
self.dropout = n... |
TransformerDecoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch import Tensor
from typing import Optional
import torch.nn.functional as F
from torch.nn.modules import Module
from torch.nn.modules.activation import MultiheadAttention
from torch.nn.modules import Dropout
from torch.nn.modules import Linear
from torch.nn.modules impo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | ruiguo-bio/smer | TransformerDecoderLayer | false | 12,963 | [
"MIT"
] | 0 | e50c814629d02d9e0892b705d5b6273a3537cb11 | https://github.com/ruiguo-bio/smer/tree/e50c814629d02d9e0892b705d5b6273a3537cb11 | from torch.nn import Module
import torch
from torch import Tensor
from typing import Optional
import torch.nn.functional as F
from torch.nn.modules import Module
from torch.nn.modules.activation import MultiheadAttention
from torch.nn.modules import Dropout
from torch.nn.modules import Linear
from torch.nn.modules impo... |
LinearScalerModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch.nn as nn
class LinearScalerModel(nn.Module):
def __init__(self, load_from: 'dict'=None):
super().__init__()
initial = torch.zeros(4)
initial[2] = 1
initial[3] = 10
self.params = nn.Parameter(initial, requires_grad=False)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | sergiolib/pytorch-CycleGAN-and-pix2pix | LinearScalerModel | false | 12,964 | [
"BSD-3-Clause"
] | 0 | cd3058a6a0522a0ed9178682b06cda538947e335 | https://github.com/sergiolib/pytorch-CycleGAN-and-pix2pix/tree/cd3058a6a0522a0ed9178682b06cda538947e335 | import torch
import torch.utils.data
import torch.nn as nn
class Model(nn.Module):
def __init__(self, load_from: 'dict'=None):
super().__init__()
initial = torch.zeros(4)
initial[2] = 1
initial[3] = 10
self.params = nn.Parameter(initial, requires_grad=False)
self.p... |
StackTime | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.utils.data
import torch.jit
import torch.optim
import torch.utils.collect_env
import torch.nn.parallel
import torch.utils.data.distributed
class StackTime(nn.Module):
def __init__(self, factor):
super().__init__()
self.factor = int(factor)
def ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
import torch.jit
import torch.optim
import torch.utils.collect_env
import torch.nn.parallel
im... | sharathts/training | StackTime | false | 12,965 | [
"Apache-2.0"
] | 0 | f294d135a6b1ac12a19ea68c1f0e42e8acc39401 | https://github.com/sharathts/training/tree/f294d135a6b1ac12a19ea68c1f0e42e8acc39401 | import torch
import torch.nn as nn
import torch.utils.data
import torch.jit
import torch.optim
import torch.utils.collect_env
import torch.nn.parallel
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, factor):
super().__init__()
self.factor = int(factor)
def forw... |
Block | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from torch.nn import functional as F
def get_conv(in_dim, out_dim, kernel_size, stride, padding, zero_bias=True,
zero_weights=False, groups=1, scaled=False):
c = nn.Conv2d(in_dim, out_dim, kernel_size, stride, padding, groups=groups)
if zero_bias:
c.bias.data *= 0... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | seunghyukcho/vdvae | Block | false | 12,966 | [
"MIT"
] | 0 | 3a552d80351d670fdbde8302c556a6e668d33762 | https://github.com/seunghyukcho/vdvae/tree/3a552d80351d670fdbde8302c556a6e668d33762 | import torch
from torch import nn
from torch.nn import functional as F
def get_conv(in_dim, out_dim, kernel_size, stride, padding, zero_bias=True,
zero_weights=False, groups=1, scaled=False):
c = nn.Conv2d(in_dim, out_dim, kernel_size, stride, padding, groups=groups)
if zero_bias:
c.bias.data *= 0... |
VirtualBatchNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 VirtualBatchNorm(nn.Module):
"""Virtual Batch Normalization Module as proposed in the paper
`"Improved Techniques for Training GANs by Salimans et. al." <https://arxiv.org/abs/1805.08318>`_
Performs Normalizes the features of a batch based on the statistics collec... | 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_... | shi-weili/torchgan | VirtualBatchNorm | false | 12,967 | [
"MIT"
] | 0 | 28ffd4026b8c0db2217b667d30a222d6758bfc41 | https://github.com/shi-weili/torchgan/tree/28ffd4026b8c0db2217b667d30a222d6758bfc41 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Virtual Batch Normalization Module as proposed in the paper
`"Improved Techniques for Training GANs by Salimans et. al." <https://arxiv.org/abs/1805.08318>`_
Performs Normalizes the features of a batch based on the statistics collected on a re... |
SRNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.optim
class eca_layer(nn.Module):
"""Constructs a ECA module.
Args:
channel: Number of channels of the input feature map
k_size: Adaptive selection of kernel size
"""
def __init__(self, channel, k_size=3):
super(eca_layer, self).... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | purbayankar/PyTorch-Zero-Shot-Super-Resolution | SRNet | false | 12,968 | [
"MIT"
] | 0 | 434fe5e84e166eef1f8c03880fc83c7e8749c49c | https://github.com/purbayankar/PyTorch-Zero-Shot-Super-Resolution/tree/434fe5e84e166eef1f8c03880fc83c7e8749c49c | import torch
import torch.nn as nn
import torch.optim
class eca_layer(nn.Module):
"""Constructs a ECA module.
Args:
channel: Number of channels of the input feature map
k_size: Adaptive selection of kernel size
"""
def __init__(self, channel, k_size=3):
super().__init__()
... |
EncoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class MultiHeadAttention(nn.Module):
def __init__(self, heads, d_model):
super(MultiHeadAttention, self).__init__()
assert d_model % heads == 0
self.d_k = d_model // heads
self.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.... | sd2001/seqModeling | EncoderLayer | false | 12,969 | [
"MIT"
] | 0 | 393f680de711ea8477e5450633b492298d253368 | https://github.com/sd2001/seqModeling/tree/393f680de711ea8477e5450633b492298d253368 | import math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class MultiHeadAttention(nn.Module):
def __init__(self, heads, d_model):
super().__init__()
assert d_model % heads == 0
self.d_k = d_model // heads
self.heads = heads
sel... |
WassersteinDiscriminatorLoss | # 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 reduce(x, reduction=None):
"""Applies reduction on a torch.Tensor.
Args:
x (torch.Tensor): The tensor on which reduction is to be applied.
reduction (str, optional): The reduction to be applied. If ``mean`` the mean value of the
Tensor is re... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | shi-weili/torchgan | WassersteinDiscriminatorLoss | false | 12,970 | [
"MIT"
] | 0 | 28ffd4026b8c0db2217b667d30a222d6758bfc41 | https://github.com/shi-weili/torchgan/tree/28ffd4026b8c0db2217b667d30a222d6758bfc41 | import torch
import torch.nn as nn
def reduce(x, reduction=None):
"""Applies reduction on a torch.Tensor.
Args:
x (torch.Tensor): The tensor on which reduction is to be applied.
reduction (str, optional): The reduction to be applied. If ``mean`` the mean value of the
Tensor is re... |
_BoundaryRefineModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 _BoundaryRefineModule(nn.Module):
def __init__(self, dim):
super(_BoundaryRefineModule, self).__init__()
self.relu = nn.ReLU(inplace=True)
self.conv1 = nn.Conv2d(dim, dim, kernel_size=3, padding=1)
self.conv2 = nn.Conv2d(dim, dim, kernel_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 import nn
assert_s... | sharanry/pytorch-semantic-segmentation | _BoundaryRefineModule | false | 12,971 | [
"MIT"
] | 0 | 47d637e3d5fcc1e2569203306c2fa5dca6f0e68a | https://github.com/sharanry/pytorch-semantic-segmentation/tree/47d637e3d5fcc1e2569203306c2fa5dca6f0e68a | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim):
super().__init__()
self.relu = nn.ReLU(inplace=True)
self.conv1 = nn.Conv2d(dim, dim, kernel_size=3, padding=1)
self.conv2 = nn.Conv2d(dim, dim, kernel_size=3, padding=1)
def forward(self, x):
... |
MinimaxDiscriminatorLoss | # 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
def minimax_discriminator_loss(dx, dgz, label_smoothing=0.0, reduction='mean'):
target_ones = torch.ones_like(dgz) * (1.0 - label_smoothing)
target_zeros = torch.zeros_like(dx)
loss = F.binary_cross_entropy_with_logits(dx, target_ones, red... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | shi-weili/torchgan | MinimaxDiscriminatorLoss | false | 12,972 | [
"MIT"
] | 0 | 28ffd4026b8c0db2217b667d30a222d6758bfc41 | https://github.com/shi-weili/torchgan/tree/28ffd4026b8c0db2217b667d30a222d6758bfc41 | import torch
import torch.nn as nn
import torch.nn.functional as F
def minimax_discriminator_loss(dx, dgz, label_smoothing=0.0, reduction='mean'):
target_ones = torch.ones_like(dgz) * (1.0 - label_smoothing)
target_zeros = torch.zeros_like(dx)
loss = F.binary_cross_entropy_with_logits(dx, target_ones, red... |
WassersteinGeneratorLoss | # 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 reduce(x, reduction=None):
"""Applies reduction on a torch.Tensor.
Args:
x (torch.Tensor): The tensor on which reduction is to be applied.
reduction (str, optional): The reduction to be applied. If ``mean`` the mean value of the
Tensor is re... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | shi-weili/torchgan | WassersteinGeneratorLoss | false | 12,973 | [
"MIT"
] | 0 | 28ffd4026b8c0db2217b667d30a222d6758bfc41 | https://github.com/shi-weili/torchgan/tree/28ffd4026b8c0db2217b667d30a222d6758bfc41 | import torch
import torch.nn as nn
def reduce(x, reduction=None):
"""Applies reduction on a torch.Tensor.
Args:
x (torch.Tensor): The tensor on which reduction is to be applied.
reduction (str, optional): The reduction to be applied. If ``mean`` the mean value of the
Tensor is re... |
MinibatchDiscrimination1d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 MinibatchDiscrimination1d(nn.Module):
"""1D Minibatch Discrimination Module as proposed in the paper `"Improved Techniques for
Training GANs by Salimans et. al." <https://arxiv.org/abs/1805.08318>`_
Allows the Discriminator to easily detect mode collapse by augmen... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | shi-weili/torchgan | MinibatchDiscrimination1d | false | 12,974 | [
"MIT"
] | 0 | 28ffd4026b8c0db2217b667d30a222d6758bfc41 | https://github.com/shi-weili/torchgan/tree/28ffd4026b8c0db2217b667d30a222d6758bfc41 | import torch
import torch.nn as nn
class Model(nn.Module):
"""1D Minibatch Discrimination Module as proposed in the paper `"Improved Techniques for
Training GANs by Salimans et. al." <https://arxiv.org/abs/1805.08318>`_
Allows the Discriminator to easily detect mode collapse by augmenting the activations... |
Swish | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.distributed
class Swish(nn.Module):
def __init__(self):
super(Swish, self).__init__()
self.beta = nn.Parameter(torch.tensor(1.0))
def forward(self, x):
return x * torch.sigmoid(self.beta * x)
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
import torch.nn as nn
import torch.distributed
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | shnhrtkyk/PointFlow | Swish | false | 12,975 | [
"MIT"
] | 0 | 26b8fac79bf3e71533f5c8b12f90cf5f9a385a99 | https://github.com/shnhrtkyk/PointFlow/tree/26b8fac79bf3e71533f5c8b12f90cf5f9a385a99 | import torch
import torch.nn as nn
import torch.distributed
class Model(nn.Module):
def __init__(self):
super().__init__()
self.beta = nn.Parameter(torch.tensor(1.0))
def forward(self, x):
return x * torch.sigmoid(self.beta * x)
def get_inputs():
return [torch.rand([4, 4, 4, 4]... |
PerceptronTanh | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from typing import Any
import torch.nn.functional as F
class PerceptronTanh(nn.Module):
"""Implements a 1-layer perceptron with Tanh activaton."""
def _forward_unimplemented(self, *input: Any) ->None:
pass
def __init__(self, input_dimension, hidden_dimension, o... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | shi27feng/PDP-Solver | PerceptronTanh | false | 12,976 | [
"MIT"
] | 0 | bf6e392f72f8a3572e0987313230943d94d53c95 | https://github.com/shi27feng/PDP-Solver/tree/bf6e392f72f8a3572e0987313230943d94d53c95 | import torch
import torch.nn as nn
from typing import Any
import torch.nn.functional as F
class Model(nn.Module):
"""Implements a 1-layer perceptron with Tanh activaton."""
def _forward_unimplemented(self, *input: Any) ->None:
pass
def __init__(self, input_dimension, hidden_dimension, output_dim... |
Perceptron | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from typing import Any
import torch.nn.functional as fn
class Perceptron(nn.Module):
"""Implements a 1-layer perceptron."""
def _forward_unimplemented(self, *input: Any) ->None:
pass
def __init__(self, input_dimension, hidden_dimension, output_dimension):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ty... | shi27feng/PDP-Solver | Perceptron | false | 12,977 | [
"MIT"
] | 0 | bf6e392f72f8a3572e0987313230943d94d53c95 | https://github.com/shi27feng/PDP-Solver/tree/bf6e392f72f8a3572e0987313230943d94d53c95 | import torch
import torch.nn as nn
from typing import Any
import torch.nn.functional as fn
class Model(nn.Module):
"""Implements a 1-layer perceptron."""
def _forward_unimplemented(self, *input: Any) ->None:
pass
def __init__(self, input_dimension, hidden_dimension, output_dimension):
su... |
MinimaxGeneratorLoss | # 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
def minimax_generator_loss(dgz, nonsaturating=True, reduction='mean'):
if nonsaturating:
target = torch.ones_like(dgz)
return F.binary_cross_entropy_with_logits(dgz, target, reduction=
reduction)
else:
targe... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | shi-weili/torchgan | MinimaxGeneratorLoss | false | 12,978 | [
"MIT"
] | 0 | 28ffd4026b8c0db2217b667d30a222d6758bfc41 | https://github.com/shi-weili/torchgan/tree/28ffd4026b8c0db2217b667d30a222d6758bfc41 | import torch
import torch.nn as nn
import torch.nn.functional as F
def minimax_generator_loss(dgz, nonsaturating=True, reduction='mean'):
if nonsaturating:
target = torch.ones_like(dgz)
return F.binary_cross_entropy_with_logits(dgz, target, reduction=
reduction)
else:
targe... |
SpatialCrossMapLRN | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
class SpatialCrossMapLRN(nn.Module):
def __init__(self, local_size=1, alpha=1.0, beta=0.75, k=1,
ACROSS_CHANNELS=True):
super(SpatialCrossMapLRN, self).__init__()
self.ACROSS_CHANNELS = ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.... | shubham1206agra/pretrained-models.pytorch | SpatialCrossMapLRN | false | 12,979 | [
"BSD-3-Clause"
] | 0 | a2940f79dd65656eabe5a0cd6d5d014ef1fc2523 | https://github.com/shubham1206agra/pretrained-models.pytorch/tree/a2940f79dd65656eabe5a0cd6d5d014ef1fc2523 | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
class Model(nn.Module):
def __init__(self, local_size=1, alpha=1.0, beta=0.75, k=1,
ACROSS_CHANNELS=True):
super().__init__()
self.ACROSS_CHANNELS = ACROSS_CHANNELS
if ACROSS_CHA... |
GraphConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
import torch.autograd
def sparse_bmm(sparse_matrix, dense_matrix_batch):
"""
Perform torch.bmm on an unbatched sparse matrix and a batched dense matrix.
Args:
sparse_matrix (torch.sparse.FloatTensor): Shape = (m, n)
dense_matrix_batch (tor... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.nn
import torch.autograd
assert_size_stride = ... | shumash/kaolin | GraphConv | false | 12,980 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 2158b5ec7a28d57d7df7e606adbb0c693a0145f0 | https://github.com/shumash/kaolin/tree/2158b5ec7a28d57d7df7e606adbb0c693a0145f0 | import torch
from torch import nn
import torch.nn
import torch.autograd
def sparse_bmm(sparse_matrix, dense_matrix_batch):
"""
Perform torch.bmm on an unbatched sparse matrix and a batched dense matrix.
Args:
sparse_matrix (torch.sparse.FloatTensor): Shape = (m, n)
dense_matrix_batch (tor... |
Qnet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import random
import torch
import torch.nn as nn
import torch.nn.functional as F
class Qnet(nn.Module):
def __init__(self):
super(Qnet, self).__init__()
self.fc1 = nn.Linear(4, 128)
self.fc2 = nn.Linear(128, 128)
self.fc3 = nn.Linear(128, 2)
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
import random
import torch.nn... | shwetasrsh/minimalRL | Qnet | false | 12,981 | [
"MIT"
] | 0 | e6fef1730238dd268b1a43fd9fca0b0c40d97837 | https://github.com/shwetasrsh/minimalRL/tree/e6fef1730238dd268b1a43fd9fca0b0c40d97837 | import random
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(4, 128)
self.fc2 = nn.Linear(128, 128)
self.fc3 = nn.Linear(128, 2)
def forward(self, x):
x = F.relu(se... |
ScaleHead | # 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 ScaleHead(nn.Module):
def __init__(self):
super().__init__()
self.flatten = torch.flatten
self.dot = torch.dot
def forward(self, mag, height):
curr_mag = self.flatten(mag, start_dim=1)
curr_height = self.flatten(height, start_d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | shvedfun/geo_pos_baseline | ScaleHead | false | 12,982 | [
"Apache-2.0"
] | 0 | 024716bfdaefd23baccfb5a0d2686015385d7b9c | https://github.com/shvedfun/geo_pos_baseline/tree/024716bfdaefd23baccfb5a0d2686015385d7b9c | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.flatten = torch.flatten
self.dot = torch.dot
def forward(self, mag, height):
curr_mag = self.flatten(mag, start_dim=1)
curr_height = self.flatten(height, start_dim=1... |
RNNCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 RNNCell(nn.Module):
def __init__(self, embed_dim, hidden_size, vocab_dim):
super().__init__()
self.hidden_size = hidden_size
self.input2hidden = nn.Linear(embed_dim + hidden_size, hidden_size)
def forward(self, inputs, hidden):
combine... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | saidulislam/RNN-Sequential-Data-Processing | RNNCell | false | 12,983 | [
"Apache-2.0"
] | 0 | 2e043f37f9a67177a3dc19cbfe67d187c9cbb5f9 | https://github.com/saidulislam/RNN-Sequential-Data-Processing/tree/2e043f37f9a67177a3dc19cbfe67d187c9cbb5f9 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, embed_dim, hidden_size, vocab_dim):
super().__init__()
self.hidden_size = hidden_size
self.input2hidden = nn.Linear(embed_dim + hidden_size, hidden_size)
def forward(self, inputs, hidden):
combined ... |
EnsembleFC | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 EnsembleFC(nn.Module):
def __init__(self, in_features: 'int', out_features: 'int',
ensemble_size: 'int', weight_decay: 'float'=0.0, bias: 'bool'=True
) ->None:
super(EnsembleFC, self).__init__()
self.in_features = in_features
self.o... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | si0wang/transfer_dmc | EnsembleFC | false | 12,984 | [
"MIT"
] | 0 | 6bda773244e0b709b3c13add2597f5f1cd01bfd7 | https://github.com/si0wang/transfer_dmc/tree/6bda773244e0b709b3c13add2597f5f1cd01bfd7 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_features: 'int', out_features: 'int',
ensemble_size: 'int', weight_decay: 'float'=0.0, bias: 'bool'=True
) ->None:
super().__init__()
self.in_features = in_features
self.out_features = out_fea... |
DynamicsModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 weights_init_(m):
if isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d) or isinstance(m,
nn.ConvTranspose2d):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.constant_(m.bias, 0)
class Swish(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 torch.nn as nn
import torch.nn.functional as F
assert_size_stride = torch... | si0wang/transfer_dmc | DynamicsModel | false | 12,985 | [
"MIT"
] | 0 | 6bda773244e0b709b3c13add2597f5f1cd01bfd7 | https://github.com/si0wang/transfer_dmc/tree/6bda773244e0b709b3c13add2597f5f1cd01bfd7 | import torch
import torch.nn as nn
import torch.nn.functional as F
def weights_init_(m):
if isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d) or isinstance(m,
nn.ConvTranspose2d):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.constant_(m.bias, 0)
class Swish(nn.Module)... |
MnistMlp | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 as nn
from torch.nn import functional as F
class MnistMlp(nn.Module):
def __init__(self, width, dropout_p):
super().__init__()
self.fc1 = nn.Linear(784, width)
self.fc2 = nn.Linear(width, 10)
self.dropout = nn.Dropout(dropout_p)
def forward(s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | shyam196/exptune | MnistMlp | false | 12,986 | [
"MIT"
] | 0 | be9bb23355ecd1a464dbc93dc35050b7f9d40227 | https://github.com/shyam196/exptune/tree/be9bb23355ecd1a464dbc93dc35050b7f9d40227 | import torch
from torch import nn as nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, width, dropout_p):
super().__init__()
self.fc1 = nn.Linear(784, width)
self.fc2 = nn.Linear(width, 10)
self.dropout = nn.Dropout(dropout_p)
def forward(self... |
EnsembleFC | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 EnsembleFC(nn.Module):
__constants__ = ['in_features', 'out_features']
in_features: 'int'
out_features: 'int'
ensemble_size: 'int'
weight: 'torch.Tensor'
def __init__(self, in_features: 'int', out_features: 'int',
ensemble_size: 'int', weight_d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | simonat2011/DI-engine | EnsembleFC | false | 12,987 | [
"Apache-2.0"
] | 0 | 3a91c4297d58b3beff40b48bd37eb0b399c724a7 | https://github.com/simonat2011/DI-engine/tree/3a91c4297d58b3beff40b48bd37eb0b399c724a7 | import torch
import torch.nn as nn
class Model(nn.Module):
__constants__ = ['in_features', 'out_features']
in_features: 'int'
out_features: 'int'
ensemble_size: 'int'
weight: 'torch.Tensor'
def __init__(self, in_features: 'int', out_features: 'int',
ensemble_size: 'int', weight_decay:... |
EnsembleModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 weights_init_(m):
if isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d) or isinstance(m,
nn.ConvTranspose2d):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.constant_(m.bias, 0)
class Swish(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 torch.nn as nn
import torch.nn.functional as F
assert_size_stride = torch... | si0wang/transfer_dmc | EnsembleModel | false | 12,988 | [
"MIT"
] | 0 | 6bda773244e0b709b3c13add2597f5f1cd01bfd7 | https://github.com/si0wang/transfer_dmc/tree/6bda773244e0b709b3c13add2597f5f1cd01bfd7 | import torch
import torch.nn as nn
import torch.nn.functional as F
def weights_init_(m):
if isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d) or isinstance(m,
nn.ConvTranspose2d):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.constant_(m.bias, 0)
class Swish(nn.Module)... |
Quantization | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torch.nn as nn
class Quant(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
input = torch.clamp(input, 0, 1)
output = (input * 255.0).round() / 255.0
return output
@staticmethod
def backward(ctx, grad_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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.data
impo... | skipper17/Invertible-Image-Rescaling | Quantization | false | 12,989 | [
"Apache-2.0"
] | 0 | 4755f21faa5f7c4599dfb971a875ecee86bc35a1 | https://github.com/skipper17/Invertible-Image-Rescaling/tree/4755f21faa5f7c4599dfb971a875ecee86bc35a1 | import torch
import torch.utils.data
import torch.nn as nn
class Quant(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
input = torch.clamp(input, 0, 1)
output = (input * 255.0).round() / 255.0
return output
@staticmethod
def backward(ctx, grad_output):
... |
FocalLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.nn.functional as F
class FocalLoss(nn.Module):
def __init__(self, gamma=2):
super().__init__()
self.gamma = gamma
def forward(self, logit, target, epoch=0):
target = target.float()
max_val = (-logit).clamp(min=0)
loss = l... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | sin1012/kaggle_baidu_autonomous_driving | FocalLoss | false | 12,990 | [
"Apache-2.0"
] | 0 | afa0da4fc06a05548306b885c6c804881104b403 | https://github.com/sin1012/kaggle_baidu_autonomous_driving/tree/afa0da4fc06a05548306b885c6c804881104b403 | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, gamma=2):
super().__init__()
self.gamma = gamma
def forward(self, logit, target, epoch=0):
target = target.float()
max_val = (-logit).clamp(min=0)
loss = logit... |
PretrainedUNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 torchvision
class Block(torch.nn.Module):
def __init__(self, in_channels, mid_channel, out_channels, batch_norm=False
):
super().__init__()
self.conv1 = torch.nn.Conv2d(in_channels=in_channels, out_channels=
mid_channel, kernel_size=3, padding=1)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torchvision
assert_siz... | amrane99/lung-segmentation | PretrainedUNet | false | 12,991 | [
"MIT"
] | 0 | ab29db75ac78918da5cbf66b830acaf36cf7b44a | https://github.com/amrane99/lung-segmentation/tree/ab29db75ac78918da5cbf66b830acaf36cf7b44a | import torch
import torchvision
class Block(torch.nn.Module):
def __init__(self, in_channels, mid_channel, out_channels, batch_norm=False
):
super().__init__()
self.conv1 = torch.nn.Conv2d(in_channels=in_channels, out_channels=
mid_channel, kernel_size=3, padding=1)
se... |
BertSelfAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = int(config.hidden_size / config.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | shrishabh/cs769-assignments | BertSelfAttention | false | 12,992 | [
"MIT"
] | 0 | babce1def0d65728bf1d4e4a725d8939f1d5f9a7 | https://github.com/shrishabh/cs769-assignments/tree/babce1def0d65728bf1d4e4a725d8939f1d5f9a7 | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = int(config.hidden_size / config.
... |
diceloss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class diceloss(torch.nn.Module):
def init(self):
super(diceloss, self).init()
def forward(self, pred, target):
smooth = 1.0
iflat = pred.contiguous().view(-1)
tflat = target.contiguous().view(-1)
intersection = (iflat * tflat).sum()
A_sum = torch.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | soffiafdz/nma-dl-modality-mongoose | diceloss | false | 12,993 | [
"MIT"
] | 0 | 41ac1f2e0e818538bafedae93e5c68f8857411bd | https://github.com/soffiafdz/nma-dl-modality-mongoose/tree/41ac1f2e0e818538bafedae93e5c68f8857411bd | import torch
class Model(torch.nn.Module):
def init(self):
super(diceloss, self).init()
def forward(self, pred, target):
smooth = 1.0
iflat = pred.contiguous().view(-1)
tflat = target.contiguous().view(-1)
intersection = (iflat * tflat).sum()
A_sum = torch.sum... |
ConvReluPool | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch.nn import Conv2d
from torch import nn
from torch.nn import functional as F
def Pool(k, stride=1, pad=0):
return torch.nn.MaxPool2d(k, stride=stride, padding=pad)
class ConvReluPool(nn.Module):
def __init__(self, fIn, fOut, k, stride=1, pool=2):
super().__init__()
sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Conv2d
f... | smearle/neural-mmo | ConvReluPool | false | 12,994 | [
"MIT"
] | 0 | 7f1e98857cb32bdb59a273eb71ec43bbd9793b34 | https://github.com/smearle/neural-mmo/tree/7f1e98857cb32bdb59a273eb71ec43bbd9793b34 | import torch
from torch.nn import Conv2d
from torch import nn
from torch.nn import functional as F
def Pool(k, stride=1, pad=0):
return torch.nn.MaxPool2d(k, stride=stride, padding=pad)
class Model(nn.Module):
def __init__(self, fIn, fOut, k, stride=1, pool=2):
super().__init__()
self.conv ... |
mix_Linear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
def Binarize(tensor):
"""
Binarize function: binarize input tensors
Input:
tensor: the input tensor.
Output:
binarized: the binarized tensor.
"""
binarized = torch.where(tensor > 0, torch.ones_like(tensor, dtype=torch
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | snudatalab/SensiMix | mix_Linear | false | 12,995 | [
"Apache-2.0"
] | 0 | e5d790f48a96806e9ae01449bb4a66e8f09c4d3a | https://github.com/snudatalab/SensiMix/tree/e5d790f48a96806e9ae01449bb4a66e8f09c4d3a | import torch
from torch import nn
def Binarize(tensor):
"""
Binarize function: binarize input tensors
Input:
tensor: the input tensor.
Output:
binarized: the binarized tensor.
"""
binarized = torch.where(tensor > 0, torch.ones_like(tensor, dtype=torch
... |
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, 128)
self.l2 = nn.Linear(128, 128)
self.l3 = nn.Linear(128, 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.... | sridas123/TD3 | Actor | false | 12,996 | [
"MIT"
] | 0 | 2556c952ef7623c8201fdfdd9102e23d98101f5c | https://github.com/sridas123/TD3/tree/2556c952ef7623c8201fdfdd9102e23d98101f5c | 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, 128)
self.l2 = nn.Linear(128, 128)
self.l3 = nn.Linear(128, action_dim)
self.... |
BackwardsNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 BackwardsNet(nn.Module):
def __init__(self, h, ydim):
super().__init__()
self.loss = torch.nn.CrossEntropyLoss()
self.fc1 = torch.nn.Linear(2 * h, h)
self.fc2 = torch.nn.Linear(h, ydim)
def forward(self, phiPrev, phi, atn):
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.... | smearle/neural-mmo | BackwardsNet | false | 12,997 | [
"MIT"
] | 0 | 7f1e98857cb32bdb59a273eb71ec43bbd9793b34 | https://github.com/smearle/neural-mmo/tree/7f1e98857cb32bdb59a273eb71ec43bbd9793b34 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, h, ydim):
super().__init__()
self.loss = torch.nn.CrossEntropyLoss()
self.fc1 = torch.nn.Linear(2 * h, h)
self.fc2 = torch.nn.Linear(h, ydim)
def forward(self, phiPrev, phi, atn):
x = torch.c... |
DQN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class DQN(nn.Module):
"""A simple deep Q network implementation.
Computes Q values for each (action, object) tuple given an input state vector
"""
def __init__(self, state_dim, action_dim, object_dim, hidden_size=100):
super(D... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | stepinski/machinelearning | DQN | false | 12,998 | [
"MIT"
] | 0 | 1f84883a25616da4cd76bb4655267efd3421e561 | https://github.com/stepinski/machinelearning/tree/1f84883a25616da4cd76bb4655267efd3421e561 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
"""A simple deep Q network implementation.
Computes Q values for each (action, object) tuple given an input state vector
"""
def __init__(self, state_dim, action_dim, object_dim, hidden_size=100):
super... |
SelfAttentionPooling | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SelfAttentionPooling(nn.Module):
"""
Implementation of SelfAttentionPooling
Original Paper: Self-Attention Encoding and Pooling for Speaker Recognition
https://arxiv.org/pdf/2008.01077v1.pdf
"""
def __init__(self, input_dim):
super(SelfAttenti... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | sumanthd17/s3prl | SelfAttentionPooling | false | 12,999 | [
"MIT"
] | 0 | bb74c705295d121c4308ceb6b6a2c8d1814d6f4c | https://github.com/sumanthd17/s3prl/tree/bb74c705295d121c4308ceb6b6a2c8d1814d6f4c | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Implementation of SelfAttentionPooling
Original Paper: Self-Attention Encoding and Pooling for Speaker Recognition
https://arxiv.org/pdf/2008.01077v1.pdf
"""
def __init__(self, input_dim):
super().__init__()
self.... |
BertSelfAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | sleepope/cs769-assignments | BertSelfAttention | false | 13,000 | [
"MIT"
] | 0 | 36c7a75d39507b7fe7b2b1bf1de6b8033b110da5 | https://github.com/sleepope/cs769-assignments/tree/36c7a75d39507b7fe7b2b1bf1de6b8033b110da5 | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = int(config.h... |
Critic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
def __init__(self, state_dim, action_dim):
super(Critic, self).__init__()
self.l1 = nn.Linear(state_dim + action_dim, 128)
self.l2 = nn.Linear(128, 128)
self.l3 = nn.Linear(128, 1)
def... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | sridas123/TD3 | Critic | false | 13,001 | [
"MIT"
] | 0 | 2556c952ef7623c8201fdfdd9102e23d98101f5c | https://github.com/sridas123/TD3/tree/2556c952ef7623c8201fdfdd9102e23d98101f5c | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, state_dim, action_dim):
super().__init__()
self.l1 = nn.Linear(state_dim + action_dim, 128)
self.l2 = nn.Linear(128, 128)
self.l3 = nn.Linear(128, 1)
def forward(self... |
BertLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | shrishabh/cs769-assignments | BertLayer | false | 13,002 | [
"MIT"
] | 0 | babce1def0d65728bf1d4e4a725d8939f1d5f9a7 | https://github.com/shrishabh/cs769-assignments/tree/babce1def0d65728bf1d4e4a725d8939f1d5f9a7 | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = ... |
DecoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class MultiHeadAttention(nn.Module):
def __init__(self, heads, d_model):
super(MultiHeadAttention, self).__init__()
assert d_model % heads == 0
self.d_k = d_model // heads
self.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.... | sd2001/seqModeling | DecoderLayer | false | 13,003 | [
"MIT"
] | 0 | 393f680de711ea8477e5450633b492298d253368 | https://github.com/sd2001/seqModeling/tree/393f680de711ea8477e5450633b492298d253368 | import math
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class MultiHeadAttention(nn.Module):
def __init__(self, heads, d_model):
super().__init__()
assert d_model % heads == 0
self.d_k = d_model // heads
self.heads = heads
sel... |
BertLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | sleepope/cs769-assignments | BertLayer | false | 13,004 | [
"MIT"
] | 0 | 36c7a75d39507b7fe7b2b1bf1de6b8033b110da5 | https://github.com/sleepope/cs769-assignments/tree/36c7a75d39507b7fe7b2b1bf1de6b8033b110da5 | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = ... |
FuseUnit | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 FuseUnit(nn.Module):
def __init__(self, channels):
super(FuseUnit, self).__init__()
self.proj1 = nn.Conv2d(2 * channels, channels, (1, 1))
self.proj2 = nn.Conv2d(channels, channels, (1, 1))
self.proj3 = nn.Conv2d(channels, channels, (1, 1))... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | sugi-san/PAMA | FuseUnit | false | 13,005 | [
"MIT"
] | 0 | 95141ebf0d3b61828a0e545f989f96b8ef569f34 | https://github.com/sugi-san/PAMA/tree/95141ebf0d3b61828a0e545f989f96b8ef569f34 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, channels):
super().__init__()
self.proj1 = nn.Conv2d(2 * channels, channels, (1, 1))
self.proj2 = nn.Conv2d(channels, channels, (1, 1))
self.proj3 = nn.Conv2d(channels, channels, (1, 1))
self.fus... |
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_... | slowy07/dffml | ConvNet | false | 13,006 | [
"MIT"
] | 0 | bbf491064470f1170be75b6bec572b6e576940b9 | https://github.com/slowy07/dffml/tree/bbf491064470f1170be75b6bec572b6e576940b9 | 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)
... |
SAP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SelfAttentionPooling(nn.Module):
"""
Implementation of SelfAttentionPooling
Original Paper: Self-Attention Encoding and Pooling for Speaker Recognition
https://arxiv.org/pdf/2008.01077v1.pdf
"""
def __init__(self, input_dim):
super(SelfAttenti... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | sumanthd17/s3prl | SAP | false | 13,007 | [
"MIT"
] | 0 | bb74c705295d121c4308ceb6b6a2c8d1814d6f4c | https://github.com/sumanthd17/s3prl/tree/bb74c705295d121c4308ceb6b6a2c8d1814d6f4c | import torch
import torch.nn as nn
class SelfAttentionPooling(nn.Module):
"""
Implementation of SelfAttentionPooling
Original Paper: Self-Attention Encoding and Pooling for Speaker Recognition
https://arxiv.org/pdf/2008.01077v1.pdf
"""
def __init__(self, input_dim):
super().__init__(... |
MultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from torch import matmul
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropout, inp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | superMC5657/BiLSTMTransformer | MultiHeadAttention | false | 13,008 | [
"MIT"
] | 0 | 43aa7bb4d8831a898c79ea89fcb1d3f5e09d564a | https://github.com/superMC5657/BiLSTMTransformer/tree/43aa7bb4d8831a898c79ea89fcb1d3f5e09d564a | import torch
import torch.nn as nn
from torch import matmul
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropout, inp... |
AttentionUnit | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
def calc_mean_std(feat, eps=1e-05):
size = feat.size()
assert len(size) == 4
N, C = size[:2]
feat_var = feat.view(N, C, -1).var(dim=2) + eps
feat_std = feat_var.sqrt().view(N, C, 1, 1)
feat_mean = feat.view(N, C, -1).mean(dim=2).view(N, C, 1, 1)
return fe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | sugi-san/PAMA | AttentionUnit | false | 13,009 | [
"MIT"
] | 0 | 95141ebf0d3b61828a0e545f989f96b8ef569f34 | https://github.com/sugi-san/PAMA/tree/95141ebf0d3b61828a0e545f989f96b8ef569f34 | import torch
import torch.nn as nn
def calc_mean_std(feat, eps=1e-05):
size = feat.size()
assert len(size) == 4
N, C = size[:2]
feat_var = feat.view(N, C, -1).var(dim=2) + eps
feat_std = feat_var.sqrt().view(N, C, 1, 1)
feat_mean = feat.view(N, C, -1).mean(dim=2).view(N, C, 1, 1)
return fe... |
Critic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def hidden_init(layer):
in_size = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(in_size)
return -lim, lim
class Critic(nn.Module):
def __init__(self, state_size, action_size, seed=0, fc1_size=128,
fc2_si... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | swastiknath/rl_ud_2 | Critic | false | 13,010 | [
"MIT"
] | 0 | 666e538f967252fa609c6b31cb5d66f9415eae82 | https://github.com/swastiknath/rl_ud_2/tree/666e538f967252fa609c6b31cb5d66f9415eae82 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def hidden_init(layer):
in_size = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(in_size)
return -lim, lim
class Model(nn.Module):
def __init__(self, state_size, action_size, seed=0, fc1_size=128,
fc2_siz... |
LinearEmbedding | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.utils.data
import torch.nn as nn
class LinearEmbedding(nn.Module):
def __init__(self, inp_size, d_model):
super(LinearEmbedding, self).__init__()
self.lut = nn.Linear(inp_size, d_model)
self.d_model = d_model
def forward(self, x):
return ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dyn... | swift88-clone/Trajectory-Transformer | LinearEmbedding | false | 13,011 | [
"MIT"
] | 0 | 62983b645ec88d8972bc2c2af1b7b4a299d3feb0 | https://github.com/swift88-clone/Trajectory-Transformer/tree/62983b645ec88d8972bc2c2af1b7b4a299d3feb0 | import math
import torch
import torch.utils.data
import torch.nn as nn
class Model(nn.Module):
def __init__(self, inp_size, d_model):
super().__init__()
self.lut = nn.Linear(inp_size, d_model)
self.d_model = d_model
def forward(self, x):
return self.lut(x) * math.sqrt(self.d_... |
FFN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Conv(nn.Module):
"""
Convolution Module
"""
def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,
padding=0, dilation=1, bias=True, w_init='linear'):
"""
:param in_channels: dimension of input
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | supikiti/FastSpeech | FFN | false | 13,012 | [
"MIT"
] | 0 | 775a9429c273450aefc2d346e5fc66c3f1e36832 | https://github.com/supikiti/FastSpeech/tree/775a9429c273450aefc2d346e5fc66c3f1e36832 | import torch
import torch.nn as nn
import torch.utils.data
class Conv(nn.Module):
"""
Convolution Module
"""
def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,
padding=0, dilation=1, bias=True, w_init='linear'):
"""
:param in_channels: dimension of input
... |
HubertFeatureProjection | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.checkpoint
class HubertFeatureProjection(nn.Module):
def __init__(self, config):
super().__init__()
self.layer_norm = nn.LayerNorm(config.conv_dim[-1], eps=config.
layer_norm_eps)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | Clemens123/transformers | HubertFeatureProjection | false | 13,013 | [
"Apache-2.0"
] | 0 | 22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | https://github.com/Clemens123/transformers/tree/22abe7bbc587c16ec30f9d1aa549dcbeba6e9e26 | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.utils.checkpoint
class Model(nn.Module):
def __init__(self, config):
super().__init__()
self.layer_norm = nn.LayerNorm(config.conv_dim[-1], eps=config.
layer_norm_eps)
self.projection ... |
MaskNorm | # 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 MaskNorm(nn.Module):
def __init__(self, norm_nc):
super(MaskNorm, self).__init__()
self.norm_layer = nn.InstanceNorm2d(norm_nc, affine=False)
def normalize_region(self, region, mask):
_b, _c, h, w = region.size()
num_pixels = mask.sum((... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | swpang/xray-align-AR | MaskNorm | false | 13,014 | [
"MIT"
] | 0 | 43cb0173ada9d1d71a6a923d605cb6fdae4d27aa | https://github.com/swpang/xray-align-AR/tree/43cb0173ada9d1d71a6a923d605cb6fdae4d27aa | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, norm_nc):
super().__init__()
self.norm_layer = nn.InstanceNorm2d(norm_nc, affine=False)
def normalize_region(self, region, mask):
_b, _c, h, w = region.size()
num_pixels = mask.sum((2, 3), keepdim=Tr... |
FeatureCorrelation | # 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 FeatureCorrelation(nn.Module):
def __init__(self):
super(FeatureCorrelation, self).__init__()
def forward(self, featureA, featureB):
b, c, h, w = featureA.size()
featureA = featureA.permute(0, 3, 2, 1).reshape(b, w * h, c)
featureB = fe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | swpang/xray-align-AR | FeatureCorrelation | false | 13,015 | [
"MIT"
] | 0 | 43cb0173ada9d1d71a6a923d605cb6fdae4d27aa | https://github.com/swpang/xray-align-AR/tree/43cb0173ada9d1d71a6a923d605cb6fdae4d27aa | import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, featureA, featureB):
b, c, h, w = featureA.size()
featureA = featureA.permute(0, 3, 2, 1).reshape(b, w * h, c)
featureB = featureB.reshape(b, c, h * w)
c... |
Discriminator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self, num_inputs, hidden_size):
super(Discriminator, self).__init__()
self.linear1 = nn.Linear(num_inputs, hidden_size)
self.linear2 = nn.Linear(hidden_size, hidden_size)
self.linear3 = nn.Linear(hidde... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | syuntoku14/flow | Discriminator | false | 13,016 | [
"MIT"
] | 0 | 3a1157cde31d0b7d6a3cc2f91eef0ec9ea53575e | https://github.com/syuntoku14/flow/tree/3a1157cde31d0b7d6a3cc2f91eef0ec9ea53575e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_inputs, hidden_size):
super().__init__()
self.linear1 = nn.Linear(num_inputs, hidden_size)
self.linear2 = nn.Linear(hidden_size, hidden_size)
self.linear3 = nn.Linear(hidden_size, 1)
self.lin... |
Generator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Generator(nn.Module):
def __init__(self, input_size, hidden_size, out_size):
super(Generator, self).__init__()
self.map1 = nn.Linear(input_size, hidden_size)
self.map2 = nn.Linear(hidden_size, hidden_size)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | tan-huaiyu/Network_science-and-Evolutionary_dynamics | Generator | false | 13,017 | [
"Apache-2.0"
] | 0 | 4bdaaed18c6f230213fd69a31144db8e97eb0c7b | https://github.com/tan-huaiyu/Network_science-and-Evolutionary_dynamics/tree/4bdaaed18c6f230213fd69a31144db8e97eb0c7b | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_size, hidden_size, out_size):
super().__init__()
self.map1 = nn.Linear(input_size, hidden_size)
self.map2 = nn.Linear(hidden_size, hidden_size)
self.map3 = nn.Linear... |
DepthwiseSeparableConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 DepthwiseSeparableConv(nn.Module):
def __init__(self, in_ch, out_ch, k, bias=True):
super().__init__()
self.depthwise_conv = nn.Conv1d(in_channels=in_ch, out_channels=
in_ch, kernel_size=k, groups=in_ch, padding=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | raghavjajodia/squad | DepthwiseSeparableConv | false | 13,018 | [
"MIT"
] | 0 | 4eb6ccdfaa904aa97215c8bc65cd77b54ff54601 | https://github.com/raghavjajodia/squad/tree/4eb6ccdfaa904aa97215c8bc65cd77b54ff54601 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, in_ch, out_ch, k, bias=True):
super().__init__()
self.depthwise_conv = nn.Conv1d(in_channels=in_ch, out_channels=
in_ch, kernel_size=k, groups=in_ch, padding=k // 2, bias=Fals... |
Matcher | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Matcher(nn.Module):
"""
Matching between a pair of nodes to conduct link prediction.
Use multi-head attention as matching model.
"""
def __init__(self, n_hid):
super(Matcher, self).__init__()
self.left_linear = nn.Linear... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | syyunn/pyHGT-1 | Matcher | false | 13,019 | [
"MIT"
] | 0 | ad0918a48777add1495b80f35b5f2b7a44b74625 | https://github.com/syyunn/pyHGT-1/tree/ad0918a48777add1495b80f35b5f2b7a44b74625 | import math
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Matching between a pair of nodes to conduct link prediction.
Use multi-head attention as matching model.
"""
def __init__(self, n_hid):
super().__init__()
self.left_linear = nn.Linear(n_hid, n_hid)
... |
FusionLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from torch.nn import init
class FusionLayer(nn.Module):
def __init__(self, nums=6):
super(FusionLayer, self).__init__()
self.weights = nn.Parameter(torch.randn(nums))
self.nums = nums
self._reset_parameters()
def _reset_parameters(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 import nn
from torch.nn import init
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | tansyl/6883-SOD | FusionLayer | false | 13,020 | [
"MIT"
] | 0 | 3a32c45be1c6c449fc7de145fe01746e3eeb16df | https://github.com/tansyl/6883-SOD/tree/3a32c45be1c6c449fc7de145fe01746e3eeb16df | import torch
from torch import nn
from torch.nn import init
class Model(nn.Module):
def __init__(self, nums=6):
super().__init__()
self.weights = nn.Parameter(torch.randn(nums))
self.nums = nums
self._reset_parameters()
def _reset_parameters(self):
init.constant_(self... |
GRUCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn.functional as F
import torch.utils.data
import torch.nn as nn
class GRUCell(nn.Module):
def __init__(self, input_size, hidden_size, bias=True):
super(GRUCell, self).__init__()
self.input_size = input_size
self.hidden_size = hidden_size
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import numpy as np
... | systemshift/PyGrid | GRUCell | false | 13,021 | [
"Apache-2.0"
] | 0 | d0ee3df8731a7576d6689fa8b4f5d3fe05ac11ff | https://github.com/systemshift/PyGrid/tree/d0ee3df8731a7576d6689fa8b4f5d3fe05ac11ff | import torch
import numpy as np
import torch.nn.functional as F
import torch.utils.data
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_size, hidden_size, bias=True):
super().__init__()
self.input_size = input_size
self.hidden_size = hidden_size
self.bias = ... |
Debayer2x2 | # 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
import torch.nn.functional
class Debayer2x2(torch.nn.Module):
"""Demosaicing of Bayer images using 2x2 convolutions.
Requires BG-Bayer color filter array layout. That is,
the image[1,1]='B', image[1,2]='G'. This corresponds
to OpenCV naming conventions.
""... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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
import torch.... | tasptz/pytorch-debayer | Debayer2x2 | false | 13,022 | [
"MIT"
] | 0 | ec35f34a57c045eb2319f4ef87f371d95f7394c3 | https://github.com/tasptz/pytorch-debayer/tree/ec35f34a57c045eb2319f4ef87f371d95f7394c3 | import torch
import torch.nn
import torch.nn.functional
class Model(torch.nn.Module):
"""Demosaicing of Bayer images using 2x2 convolutions.
Requires BG-Bayer color filter array layout. That is,
the image[1,1]='B', image[1,2]='G'. This corresponds
to OpenCV naming conventions.
"""
... |
PowerLaw_Compressed_Loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.utils.data
class PowerLaw_Compressed_Loss(nn.Module):
def __init__(self, power=0.3, complex_loss_ratio=0.113):
super(PowerLaw_Compressed_Loss, self).__init__()
self.power = power
self.complex_loss_ratio = complex_loss_ratio
self.crit... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | taylorjdlee/VoiceSplit | PowerLaw_Compressed_Loss | false | 13,023 | [
"Apache-2.0"
] | 0 | bd914c42ae065bdda95d81a0ce0c173c29bb040f | https://github.com/taylorjdlee/VoiceSplit/tree/bd914c42ae065bdda95d81a0ce0c173c29bb040f | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, power=0.3, complex_loss_ratio=0.113):
super().__init__()
self.power = power
self.complex_loss_ratio = complex_loss_ratio
self.criterion = nn.MSELoss()
self.epsilon = 1e-16... |
Discriminator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Discriminator(nn.Module):
def __init__(self, input_size, hidden_size, out_size):
super(Discriminator, self).__init__()
self.map1 = nn.Linear(input_size, hidden_size)
self.map2 = nn.Linear(hidden_size, hidden_size)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | tan-huaiyu/Network_science-and-Evolutionary_dynamics | Discriminator | false | 13,024 | [
"Apache-2.0"
] | 0 | 4bdaaed18c6f230213fd69a31144db8e97eb0c7b | https://github.com/tan-huaiyu/Network_science-and-Evolutionary_dynamics/tree/4bdaaed18c6f230213fd69a31144db8e97eb0c7b | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_size, hidden_size, out_size):
super().__init__()
self.map1 = nn.Linear(input_size, hidden_size)
self.map2 = nn.Linear(hidden_size, hidden_size)
self.map3 = nn.Linear... |
Conv2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Conv2(nn.Module):
""" 1D conv with (kernel, stride)=(4, 2).
Input:
x: (N, 2L+2, in_channels) numeric tensor
global_cond: (N, global_cond_channels) numeric tensor
Output:
y: (N, L, out_channels) numeric tensor... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | tarepan/vqvaevc | Conv2 | false | 13,025 | [
"MIT"
] | 0 | dabbb9bae5ccb9d5dcb110caf3f0a59f68006a97 | https://github.com/tarepan/vqvaevc/tree/dabbb9bae5ccb9d5dcb110caf3f0a59f68006a97 | import math
import torch
import torch.nn as nn
class Model(nn.Module):
""" 1D conv with (kernel, stride)=(4, 2).
Input:
x: (N, 2L+2, in_channels) numeric tensor
global_cond: (N, global_cond_channels) numeric tensor
Output:
y: (N, L, out_channels) numeric tensor... |
Debayer3x3 | # 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
import torch.nn.functional
class Debayer3x3(torch.nn.Module):
"""Demosaicing of Bayer images using 3x3 convolutions.
Requires BG-Bayer color filter array layout. That is,
the image[1,1]='B', image[1,2]='G'. This corresponds
to OpenCV naming conventions.
Compared to D... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn
import torch.nn.functional
assert_size_stride = torch._C._dynamo... | tasptz/pytorch-debayer | Debayer3x3 | false | 13,026 | [
"MIT"
] | 0 | ec35f34a57c045eb2319f4ef87f371d95f7394c3 | https://github.com/tasptz/pytorch-debayer/tree/ec35f34a57c045eb2319f4ef87f371d95f7394c3 | import torch
import torch.nn
import torch.nn.functional
class Model(torch.nn.Module):
"""Demosaicing of Bayer images using 3x3 convolutions.
Requires BG-Bayer color filter array layout. That is,
the image[1,1]='B', image[1,2]='G'. This corresponds
to OpenCV naming conventions.
Compared to Debaye... |
nSGC | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn.functional as F
import torch.utils.dlpack
import torch.nn as nn
class nSGC(nn.Module):
def __init__(self, nfeat, nclass):
super(nSGC, self).__init__()
self.W1 = nn.Linear(nfeat, nclass * 2)
self.W2 = nn.Linear(nclass * 2, nclass)
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
import math
import torch.util... | tealminivan/FinalProject | nSGC | false | 13,027 | [
"MIT"
] | 0 | ef6e0cda619b7e00f112ffadd56d259a5cc8a85b | https://github.com/tealminivan/FinalProject/tree/ef6e0cda619b7e00f112ffadd56d259a5cc8a85b | import math
import torch
import torch.nn.functional as F
import torch.utils.dlpack
import torch.nn as nn
class Model(nn.Module):
def __init__(self, nfeat, nclass):
super().__init__()
self.W1 = nn.Linear(nfeat, nclass * 2)
self.W2 = nn.Linear(nclass * 2, nclass)
self.init()
de... |
Joiner | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Joiner(nn.Module):
def __init__(self, input_dim: 'int', output_dim: 'int'):
super().__init__()
self.output_linear = nn.Linear(input_dim, output_dim)
def forward(self, encoder_out: 'torch.Tensor', decoder_out: 'torch.Tens... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | thangdepzai/icefall | Joiner | false | 13,028 | [
"Apache-2.0"
] | 0 | 8c7995d493c4309c3d09bdabfa1ab12b4eec2657 | https://github.com/thangdepzai/icefall/tree/8c7995d493c4309c3d09bdabfa1ab12b4eec2657 | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim: 'int', output_dim: 'int'):
super().__init__()
self.output_linear = nn.Linear(input_dim, output_dim)
def forward(self, encoder_out: 'torch.Tensor', decoder_out: 'torch.Tenso... |
NNTest | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NNTest(nn.Module):
def __init__(self, input_size, output_size):
super(NNTest, self).__init__()
self.fc1 = nn.Linear(input_size, 50)
self.fc2 = nn.Linear(50, 100)
self.fc3 = nn.Linear(100, 50)
self.fc4... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | tassotirap/data-science | NNTest | false | 13,029 | [
"Apache-2.0"
] | 0 | 644bc351740cda90c0d8c907132d9da9630266c9 | https://github.com/tassotirap/data-science/tree/644bc351740cda90c0d8c907132d9da9630266c9 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_size, output_size):
super().__init__()
self.fc1 = nn.Linear(input_size, 50)
self.fc2 = nn.Linear(50, 100)
self.fc3 = nn.Linear(100, 50)
self.fc4 = nn.Linear(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.