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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
TwoLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.onnx
class TwoLayer(nn.Module):
def __init__(self, inputSize, hiddenSize, outputSize):
super(TwoLayer, self).__init__()
self.fc1 = nn.Linear(inputSize, hiddenSize)
self.fc2 = nn.Linear(hiddenSize, outputSize)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | dashesy/ELL | TwoLayer | false | 6,527 | [
"MIT"
] | 1 | b4a2b852fc0479d8f0854b1133ee324e14c66bf8 | https://github.com/dashesy/ELL/tree/b4a2b852fc0479d8f0854b1133ee324e14c66bf8 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Model(nn.Module):
def __init__(self, inputSize, hiddenSize, outputSize):
super().__init__()
self.fc1 = nn.Linear(inputSize, hiddenSize)
self.fc2 = nn.Linear(hiddenSize, outputSize)
def forward(... |
ZonoConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 typing import Tuple
from typing import Union
import torch.utils.data
class ZonoConv(torch.nn.Module):
"""
Wrapper around pytorch's convolutional layer.
We only add the bias to the zeroth element of the zonotope
"""
def __init__(self, in_channels: 'int', out_channels: 'int', kern... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from typing import Tuple
from typing import Union
import torch.utils.data
assert... | david-shmailov/adversarial-robustness-toolbox | ZonoConv | false | 6,528 | [
"MIT"
] | 1 | ad8b94d3928abe218cd6ab2eed1c5c21f1d6e420 | https://github.com/david-shmailov/adversarial-robustness-toolbox/tree/ad8b94d3928abe218cd6ab2eed1c5c21f1d6e420 | import torch
from typing import Tuple
from typing import Union
import torch.utils.data
class Model(torch.nn.Module):
"""
Wrapper around pytorch's convolutional layer.
We only add the bias to the zeroth element of the zonotope
"""
def __init__(self, in_channels: 'int', out_channels: 'int', kernel_... |
ZonoDenseLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
class ZonoDenseLayer(torch.nn.Module):
"""
Class implementing a dense layer on a zonotope.
Bias is only added to the zeroth term.
"""
def __init__(self, in_features: 'int', out_features: 'int'):
super().__init__()
self.weight = torch.nn.Paramet... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size... | david-shmailov/adversarial-robustness-toolbox | ZonoDenseLayer | false | 6,529 | [
"MIT"
] | 1 | ad8b94d3928abe218cd6ab2eed1c5c21f1d6e420 | https://github.com/david-shmailov/adversarial-robustness-toolbox/tree/ad8b94d3928abe218cd6ab2eed1c5c21f1d6e420 | import torch
import torch.utils.data
class Model(torch.nn.Module):
"""
Class implementing a dense layer on a zonotope.
Bias is only added to the zeroth term.
"""
def __init__(self, in_features: 'int', out_features: 'int'):
super().__init__()
self.weight = torch.nn.Parameter(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 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):
def __init__(self, actor_in, actor_out, seed, fc1_units=256, fc2_units=128
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | davidhtf/drlnd | Actor | false | 6,530 | [
"MIT"
] | 1 | 221601f38659055824763ce41c6d9edd3d476fd4 | https://github.com/davidhtf/drlnd/tree/221601f38659055824763ce41c6d9edd3d476fd4 | 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):
def __init__(self, actor_in, actor_out, seed, fc1_units=256, fc2_units=128
... |
QNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class QNetwork(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc1_units=64,
fc2_units=32):
"""Initialize parameters and build model.
Params
======
state_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
import torch.nn as nn
assert_... | davidhtf/drlnd | QNetwork | false | 6,531 | [
"MIT"
] | 1 | 221601f38659055824763ce41c6d9edd3d476fd4 | https://github.com/davidhtf/drlnd/tree/221601f38659055824763ce41c6d9edd3d476fd4 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc1_units=64,
fc2_units=32):
"""Initialize parameters and build model.
Params
======
state_size ... |
CosAttention | # 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 CosAttention(nn.Module):
def __init__(self):
super(CosAttention, self).__init__()
def forward(self, title_output, attr_output):
"""
title_output (batchsize, seqlen, hidden_dim)
attr_output (batchsize, hidden_dim)
"""
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert... | deepframwork/TorchBlocks | CosAttention | false | 6,532 | [
"MIT"
] | 1 | 35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | https://github.com/deepframwork/TorchBlocks/tree/35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, title_output, attr_output):
"""
title_output (batchsize, seqlen, hidden_dim)
attr_output (batchsize, hidden_dim)
"""
seq_len = title_output.size... |
AttentionModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 AttentionModule(nn.Module):
def __init__(self, feat_chans: 'int', state_chans: 'int',
attention_units: 'int') ->None:
super().__init__()
self.feat_conv = nn.Conv2d(feat_chans, attention_units, 3, padding=1)
self.state_conv = nn.Conv2d(state_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | das-projects/deepOCR | AttentionModule | false | 6,533 | [
"Apache-2.0"
] | 1 | ffc6db691605b7b4837da9619ab6e918fa1c18de | https://github.com/das-projects/deepOCR/tree/ffc6db691605b7b4837da9619ab6e918fa1c18de | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, feat_chans: 'int', state_chans: 'int',
attention_units: 'int') ->None:
super().__init__()
self.feat_conv = nn.Conv2d(feat_chans, attention_units, 3, padding=1)
self.state_conv = nn.Conv2d(state_chans, att... |
CPAMDec | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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 torchvision.datasets import *
from torch.nn import Conv2d
from torch.nn import Parameter
from torch.nn import Linear
from torch.nn import Softmax
from torchvision.transforms import *
class CPAMDec(Module):
"""
CPAM decoding module
"""
def __init__(self, i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | coolgrasshopper/amodal_road_segmentation | CPAMDec | false | 6,534 | [
"MIT"
] | 1 | 462209242973815055f085ada99772af32082f5c | https://github.com/coolgrasshopper/amodal_road_segmentation/tree/462209242973815055f085ada99772af32082f5c | from torch.nn import Module
import torch
from torchvision.datasets import *
from torch.nn import Conv2d
from torch.nn import Parameter
from torch.nn import Linear
from torch.nn import Softmax
from torchvision.transforms import *
class Model(Module):
"""
CPAM decoding module
"""
def __init__(self, in_... |
NoNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NoNorm(nn.Module):
def __init__(self, feat_size):
super(NoNorm, self).__init__()
self.bias = nn.Parameter(torch.zeros(feat_size))
self.weight = nn.Parameter(torch.ones(feat_size))
def forward(self, input_tensor):
return input_tensor * ... | 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... | deepframwork/TorchBlocks | NoNorm | false | 6,535 | [
"MIT"
] | 1 | 35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | https://github.com/deepframwork/TorchBlocks/tree/35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, feat_size):
super().__init__()
self.bias = nn.Parameter(torch.zeros(feat_size))
self.weight = nn.Parameter(torch.ones(feat_size))
def forward(self, input_tensor):
return input_tensor * self.weight +... |
ConvAutoencoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
from torch import nn
import torch.utils.data
class ConvAutoencoder(nn.Module):
def __init__(self):
super(ConvAutoencoder, self).__init__()
self.conv1 = nn.Conv2d(12, 16, 3)
self.conv2 = nn.Conv2d(16, 4, 3)
self.t_conv1 = nn.ConvTranspos... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | dedbox/TOAD-GAN | ConvAutoencoder | false | 6,536 | [
"MIT"
] | 1 | 8a0a84d10f9c5975ae4b1c54f7da99567c8ffd67 | https://github.com/dedbox/TOAD-GAN/tree/8a0a84d10f9c5975ae4b1c54f7da99567c8ffd67 | import torch
import torch.nn.functional as F
from torch import nn
import torch.utils.data
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(12, 16, 3)
self.conv2 = nn.Conv2d(16, 4, 3)
self.t_conv1 = nn.ConvTranspose2d(4, 16, 3)
self.t_co... |
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.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 Critic(nn.Module):
def __init__(self, critic_in, action_size, seed, fc1_units=512,
fc2_units=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import numpy as np
import tor... | davidhtf/drlnd | Critic | false | 6,537 | [
"MIT"
] | 1 | 221601f38659055824763ce41c6d9edd3d476fd4 | https://github.com/davidhtf/drlnd/tree/221601f38659055824763ce41c6d9edd3d476fd4 | 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):
def __init__(self, critic_in, action_size, seed, fc1_units=512,
fc2_units=2... |
DenseSynthesizer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 DenseSynthesizer(nn.Module):
def __init__(self, head_dim, n_heads, n_tokens, big=True):
super().__init__()
h = max(head_dim, n_tokens) if big else min(head_dim, n_tokens)
w1 = torch.empty(n_heads, head_dim, h)
b1 = torch.empty(n_heads, h)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | darkmatter08/dfa-scales-to-modern-deep-learning | DenseSynthesizer | false | 6,538 | [
"MIT"
] | 1 | 72bf8a045b4bb7eb81736d8ec1d671c4949fb01e | https://github.com/darkmatter08/dfa-scales-to-modern-deep-learning/tree/72bf8a045b4bb7eb81736d8ec1d671c4949fb01e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, head_dim, n_heads, n_tokens, big=True):
super().__init__()
h = max(head_dim, n_tokens) if big else min(head_dim, n_tokens)
w1 = torch.empty(n_heads, head_dim, h)
b1 = torch.empty(n_heads, h)
w2 =... |
MaskUpdate | # 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 MaskUpdate(nn.Module):
def __init__(self, alpha):
super(MaskUpdate, self).__init__()
self.updateFunc = nn.ReLU(True)
self.alpha = alpha
def forward(self, inputMaskMap):
return torch.pow(self.updateFunc(inputMaskMap), self.alpha)
def g... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | delldu/ImagePatch | MaskUpdate | false | 6,539 | [
"MIT"
] | 1 | aaeadba9fe9f40e9bf900468f100a06bafc8231f | https://github.com/delldu/ImagePatch/tree/aaeadba9fe9f40e9bf900468f100a06bafc8231f | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, alpha):
super().__init__()
self.updateFunc = nn.ReLU(True)
self.alpha = alpha
def forward(self, inputMaskMap):
return torch.pow(self.updateFunc(inputMaskMap), self.alpha)
def get_inputs():
retu... |
decoder3 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 decoder3(nn.Module):
def __init__(self):
super(decoder3, self).__init__()
self.reflecPad7 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv7 = nn.Conv2d(256, 128, 3, 1, 0)
self.relu7 = nn.ReLU(inplace=True)
self.unpool = nn.UpsamplingNea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | cy-xu/LinearStyleTransfer | decoder3 | false | 6,540 | [
"BSD-2-Clause"
] | 1 | a07ab32db037f60a122e252588d6bd504b7d70d7 | https://github.com/cy-xu/LinearStyleTransfer/tree/a07ab32db037f60a122e252588d6bd504b7d70d7 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.reflecPad7 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv7 = nn.Conv2d(256, 128, 3, 1, 0)
self.relu7 = nn.ReLU(inplace=True)
self.unpool = nn.UpsamplingNearest2d(scale_fact... |
JointL2Loss | # 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 JointL2Loss(nn.Module):
def __init__(self):
super(JointL2Loss, self).__init__()
def forward(self, joint_pred, joint_gt):
batch_size, joint_num, _ = joint_gt.shape
joint_pred = joint_pred.view(batch_size * joint_num, -1)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import... | dejianwei/HigherA2J | JointL2Loss | false | 6,541 | [
"MIT"
] | 1 | 655d993d4b835ec58396887a85b68ef506b5df9e | https://github.com/dejianwei/HigherA2J/tree/655d993d4b835ec58396887a85b68ef506b5df9e | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, joint_pred, joint_gt):
batch_size, joint_num, _ = joint_gt.shape
joint_pred = joint_pred.view(batch_size * joint_num, -1)
joint_gt = joi... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Attention(nn.Module):
def __init__(self, feature_dim, maxlen=70):
super().__init__()
self.attention_fc = nn.Linear(feature_dim, 1)
self.bias = nn.Parameter(torch.zeros(1, maxlen, 1, requires_grad=True))
def forward(self, rnn_output):
"... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | deepframwork/TorchBlocks | Attention | false | 6,542 | [
"MIT"
] | 1 | 35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | https://github.com/deepframwork/TorchBlocks/tree/35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, feature_dim, maxlen=70):
super().__init__()
self.attention_fc = nn.Linear(feature_dim, 1)
self.bias = nn.Parameter(torch.zeros(1, maxlen, 1, requires_grad=True))
def forward(self, rnn_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
import torch.nn as nn
class FocalLoss(nn.Module):
def __init__(self, gamma=2, eps=1e-07):
super(FocalLoss, self).__init__()
self.gamma = gamma
self.eps = eps
self.ce = nn.CrossEntropyLoss(reduction='none')
def forward(self, input, target):
logp = self.ce(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | delldu/EQFace | FocalLoss | false | 6,543 | [
"MIT"
] | 1 | a088e80709c1e31a57e302cabfa85ab96f2c0aa5 | https://github.com/delldu/EQFace/tree/a088e80709c1e31a57e302cabfa85ab96f2c0aa5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, gamma=2, eps=1e-07):
super().__init__()
self.gamma = gamma
self.eps = eps
self.ce = nn.CrossEntropyLoss(reduction='none')
def forward(self, input, target):
logp = self.ce(input, target)
... |
GaussActivation | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
from torch.nn.parameter import Parameter
class GaussActivation(nn.Module):
def __init__(self, a, mu, sigma1, sigma2):
super(GaussActivation, self).__init__()
self.a = Parameter(torch.tensor(a, dtype=torch.float32))
self.mu = Parameter(torch.tensor(mu, dty... | 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
f... | delldu/ImagePatch | GaussActivation | false | 6,544 | [
"MIT"
] | 1 | aaeadba9fe9f40e9bf900468f100a06bafc8231f | https://github.com/delldu/ImagePatch/tree/aaeadba9fe9f40e9bf900468f100a06bafc8231f | import torch
from torch import nn
from torch.nn.parameter import Parameter
class Model(nn.Module):
def __init__(self, a, mu, sigma1, sigma2):
super().__init__()
self.a = Parameter(torch.tensor(a, dtype=torch.float32))
self.mu = Parameter(torch.tensor(mu, dtype=torch.float32))
self... |
MultiHeadedAttentionBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Callable
class MLP(nn.Module):
"""Multi Layer Perceptron class"""
def __init__(self, in_feats: 'int', hidden_feats: 'int'=None, out_feats:
'int'=None, act_layer: 'Callable[[torch.Tensor], torch.Tensor]'=nn.
GELU, drop_rate: 'float'=0.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 import triton_helpers
from torch._inductor.runtime.... | cvpr22sub7201/SpeechDrivenTongueAnimation | MultiHeadedAttentionBlock | false | 6,545 | [
"MIT"
] | 1 | 82caf9d7f4331e039e3b2f0d31df6393d24ccb1c | https://github.com/cvpr22sub7201/SpeechDrivenTongueAnimation/tree/82caf9d7f4331e039e3b2f0d31df6393d24ccb1c | import torch
import torch.nn as nn
from typing import Callable
class MLP(nn.Module):
"""Multi Layer Perceptron class"""
def __init__(self, in_feats: 'int', hidden_feats: 'int'=None, out_feats:
'int'=None, act_layer: 'Callable[[torch.Tensor], torch.Tensor]'=nn.
GELU, drop_rate: 'float'=0.0):
... |
TransformerEncoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import TransformerEncoderLayer
from typing import Optional
from torch.nn.init import xavier_uniform_
class TransformerEncoderLayer(nn.Module):
def __init__(self, dim_model, nhead, dim_feedforward=2048, dropout=0.1,
activatio... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | d-michele/Graph-MPNN-transformer | TransformerEncoderLayer | false | 6,546 | [
"MIT"
] | 1 | 1aafc44e1433a61d1a6a7c9e35564635bb9f8afc | https://github.com/d-michele/Graph-MPNN-transformer/tree/1aafc44e1433a61d1a6a7c9e35564635bb9f8afc | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import TransformerEncoderLayer
from typing import Optional
from torch.nn.init import xavier_uniform_
class Model(nn.Module):
def __init__(self, dim_model, nhead, dim_feedforward=2048, dropout=0.1,
activation='relu', layer_no... |
FusedLeakyReLU | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from torch.nn import functional as F
class FusedLeakyReLU(nn.Module):
def __init__(self, channel):
super().__init__()
self.bias = nn.Parameter(torch.zeros(channel))
self.scale = 1.414
def forward(self, input):
shape = 1, self.bias.shape[0], 1... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | delldu/StyleGAN2 | FusedLeakyReLU | false | 6,547 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3 | https://github.com/delldu/StyleGAN2/tree/4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3 | import torch
from torch import nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, channel):
super().__init__()
self.bias = nn.Parameter(torch.zeros(channel))
self.scale = 1.414
def forward(self, input):
shape = 1, self.bias.shape[0], 1, 1
... |
ResidualBlockNoBN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 import init as init
from torch.nn.modules.batchnorm import _BatchNorm
from torchvision.models import vgg as vgg
from torch import autograd as autograd
@torch.no_grad()
def default_init_weights(module_list, scale=1, bias_fill=0, **kwargs):
"""Initialize network weig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 to... | cyysc1998/EDVRDarts | ResidualBlockNoBN | false | 6,548 | [
"MIT"
] | 1 | 201badbc8c6469b519647a8869c3782ebe1176cf | https://github.com/cyysc1998/EDVRDarts/tree/201badbc8c6469b519647a8869c3782ebe1176cf | import torch
import torch.nn as nn
from torch.nn import init as init
from torch.nn.modules.batchnorm import _BatchNorm
from torchvision.models import vgg as vgg
from torch import autograd as autograd
@torch.no_grad()
def default_init_weights(module_list, scale=1, bias_fill=0, **kwargs):
"""Initialize network weig... |
HDRLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
from numpy import *
from math import sqrt as sqrt
from itertools import product as product
class HDRLoss(nn.Module):
"""High dynamic range loss."""
def __init__(self, eps=0.01):
"""Initializes loss with numerical stability epsilon."""
super(HDRLoss, self).__i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from numpy import *
from math import sqrt as sqrt
from itertools imp... | davidpqc1231/AnnotatedNetworkModelGit | HDRLoss | false | 6,549 | [
"MIT"
] | 1 | 419e6c9ef31f1efe7fd63d693b12c08a7d8c0f33 | https://github.com/davidpqc1231/AnnotatedNetworkModelGit/tree/419e6c9ef31f1efe7fd63d693b12c08a7d8c0f33 | import torch
from torch import nn
from numpy import *
from math import sqrt as sqrt
from itertools import product as product
class Model(nn.Module):
"""High dynamic range loss."""
def __init__(self, eps=0.01):
"""Initializes loss with numerical stability epsilon."""
super().__init__()
... |
EqualLinearWithLeakyRelu | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import nn
from torch.nn import functional as F
class EqualLinearWithLeakyRelu(nn.Module):
"""Add this class for onnx -- data driven flow is difficult tracing."""
def __init__(self, in_dim, out_dim, lr_mul=0.01):
super().__init__()
self.weight = nn.Parameter... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
from torch import nn
assert_size_stride = torch._C._dynamo.guards.as... | delldu/StyleGAN2 | EqualLinearWithLeakyRelu | false | 6,550 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3 | https://github.com/delldu/StyleGAN2/tree/4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3 | import math
import torch
from torch import nn
from torch.nn import functional as F
class Model(nn.Module):
"""Add this class for onnx -- data driven flow is difficult tracing."""
def __init__(self, in_dim, out_dim, lr_mul=0.01):
super().__init__()
self.weight = nn.Parameter(torch.randn(out_di... |
GatedConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class SpectralNorm(nn.Module):
def __init__(self, module, name='weight', power_iterations=1):
super(SpectralNorm, self).__init__()
self.module = module
self.n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | delldu/DeepFillv2 | GatedConv2d | false | 6,551 | [
"MIT"
] | 1 | a564b9589c1b42bcdddd3d7601f4059c4594a439 | https://github.com/delldu/DeepFillv2/tree/a564b9589c1b42bcdddd3d7601f4059c4594a439 | import torch
import torch.nn as nn
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class SpectralNorm(nn.Module):
def __init__(self, module, name='weight', power_iterations=1):
super().__init__()
self.module = module
self.name = name
... |
CNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch.nn import functional as F
from torch import nn
class CNN(nn.Module):
"""Regularization for sparse-data CT and XPCI CT.
* The CNN has 3 layers:
inChannels -> Layer 1 -> n_cnn -> Layer 2 ->
n_cnn -> Layer_3 -> 1 channel
Args:
n_cnn (int): Number of output channels i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | dennis-j-lee/AirNet-SNL | CNN | false | 6,552 | [
"BSD-3-Clause"
] | 1 | c35b84b50b7f1351a450a5970b19d8a8b83053d1 | https://github.com/dennis-j-lee/AirNet-SNL/tree/c35b84b50b7f1351a450a5970b19d8a8b83053d1 | import torch
from torch.nn import functional as F
from torch import nn
class Model(nn.Module):
"""Regularization for sparse-data CT and XPCI CT.
* The CNN has 3 layers:
inChannels -> Layer 1 -> n_cnn -> Layer 2 ->
n_cnn -> Layer_3 -> 1 channel
Args:
n_cnn (int): Number of output channels... |
ContourDTConsistency | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from typing import Optional
import torch.utils.data
import torch.nn as nn
import torch.nn.parallel
class ContourDTConsistency(nn.Module):
"""Consistency regularization between the instance contour map and
signed distance transform.
Args:
pred1 (torch.Tensor): contour logits.
... | 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... | devaansh100/pytorch_connectomics | ContourDTConsistency | false | 6,553 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
from typing import Optional
import torch.utils.data
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""Consistency regularization between the instance contour map and
signed distance transform.
Args:
pred1 (torch.Tensor): contour logits.
pred2 (torch.Te... |
ReverseMaskConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.parameter import Parameter
def weights_init():
"""
Gaussian init.
"""
def init_fun(m):
classname = m.__class__.__name__
if (classname.find('Conv') == 0 or classname.find('Linear') == 0
) and hasattr(m, 'weight'):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | delldu/ImagePatch | ReverseMaskConv | false | 6,554 | [
"MIT"
] | 1 | aaeadba9fe9f40e9bf900468f100a06bafc8231f | https://github.com/delldu/ImagePatch/tree/aaeadba9fe9f40e9bf900468f100a06bafc8231f | import torch
from torch import nn
from torch.nn.parameter import Parameter
def weights_init():
"""
Gaussian init.
"""
def init_fun(m):
classname = m.__class__.__name__
if (classname.find('Conv') == 0 or classname.find('Linear') == 0
) and hasattr(m, 'weight'):
... |
BinaryReg | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from typing import Optional
import torch.utils.data
import torch.nn as nn
import torch.nn.parallel
class BinaryReg(nn.Module):
"""Regularization for encouraging the outputs to be binary.
Args:
pred (torch.Tensor): foreground logits.
mask (Optional[torch.Tensor], optional): 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 import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.utils.dat... | devaansh100/pytorch_connectomics | BinaryReg | false | 6,555 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
from typing import Optional
import torch.utils.data
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""Regularization for encouraging the outputs to be binary.
Args:
pred (torch.Tensor): foreground logits.
mask (Optional[torch.Tensor], optional): weight mas... |
NonoverlapReg | # 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
import torch.nn.parallel
class NonoverlapReg(nn.Module):
"""Regularization to prevent overlapping prediction of pre- and post-synaptic
masks in synaptic polarity prediction ("1" in MODEL.TARGET_OPT).
Args:
fg_masked (bool): mask the regul... | 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
import torch.nn.parallel
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty... | devaansh100/pytorch_connectomics | NonoverlapReg | false | 6,556 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""Regularization to prevent overlapping prediction of pre- and post-synaptic
masks in synaptic polarity prediction ("1" in MODEL.TARGET_OPT).
Args:
fg_masked (bool): mask the regularizatio... |
WeightedBCEFocalLoss | # 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
import torch.nn.functional as F
import torch.nn.parallel
class WeightedBCEFocalLoss(nn.Module):
"""Weighted binary focal loss with logits.
"""
def __init__(self, gamma=2.0, alpha=0.25, eps=0.0):
super().__init__()
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
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | devaansh100/pytorch_connectomics | WeightedBCEFocalLoss | false | 6,557 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class Model(nn.Module):
"""Weighted binary focal loss with logits.
"""
def __init__(self, gamma=2.0, alpha=0.25, eps=0.0):
super().__init__()
self.eps = eps
self.gam... |
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.utils.data
import torch.nn as nn
import torch.nn.parallel
class DiceLoss(nn.Module):
"""DICE loss.
"""
def __init__(self, reduce=True, smooth=100.0, power=1):
super(DiceLoss, self).__init__()
self.smooth = smooth
self.reduce = reduce
self.power = ... | 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
import torch.nn.parallel
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty... | devaansh100/pytorch_connectomics | DiceLoss | false | 6,558 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
"""DICE loss.
"""
def __init__(self, reduce=True, smooth=100.0, power=1):
super().__init__()
self.smooth = smooth
self.reduce = reduce
self.power = power
def di... |
NoiseInjection | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class NoiseInjection(nn.Module):
def __init__(self):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1))
def forward(self, image):
noise = torch.randn_like(image[:, 0:1, :, :])
return image + self.weight * noise * 0.9
def get_inpu... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | delldu/StyleGAN2 | NoiseInjection | false | 6,559 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3 | https://github.com/delldu/StyleGAN2/tree/4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1))
def forward(self, image):
noise = torch.randn_like(image[:, 0:1, :, :])
return image + self.weight * noise * 0.9
def get_inputs():
... |
PositionwiseFeedForward | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import nn
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class PositionwiseFeedForward(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_in, d_hid, dropout=0.1):
super()... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
from to... | desmarg/ehr_ml | PositionwiseFeedForward | false | 6,560 | [
"MIT"
] | 1 | 48a385fe2ebdbef655bd4c6b6dd9a73a4e3f76b4 | https://github.com/desmarg/ehr_ml/tree/48a385fe2ebdbef655bd4c6b6dd9a73a4e3f76b4 | import math
import torch
from torch import nn
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class Model(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_in, d_hid, dropout=0.1):
super().__init__()
... |
WeightedBCEWithLogitsLoss | # 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
import torch.nn.functional as F
import torch.nn.parallel
class WeightedBCEWithLogitsLoss(nn.Module):
"""Weighted binary cross-entropy with logits.
"""
def __init__(self, size_average=True, reduce=True, eps=0.0):
super().__init__()
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | devaansh100/pytorch_connectomics | WeightedBCEWithLogitsLoss | false | 6,561 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class Model(nn.Module):
"""Weighted binary cross-entropy with logits.
"""
def __init__(self, size_average=True, reduce=True, eps=0.0):
super().__init__()
self.size_average =... |
ForegroundDTConsistency | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from typing import Optional
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class ForegroundDTConsistency(nn.Module):
"""Consistency regularization between the binary foreground mask and
signed distance transform.
Args:
pred1 (to... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | devaansh100/pytorch_connectomics | ForegroundDTConsistency | false | 6,562 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
from typing import Optional
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class Model(nn.Module):
"""Consistency regularization between the binary foreground mask and
signed distance transform.
Args:
pred1 (torch.Tensor): foreg... |
HSwish | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.quantization
class HSigmoid(nn.Module):
"""Hard Sigmoid."""
def __init__(self, inplace: 'bool'=True) ->None:
"""Initialize."""
super(HSigmoid, self).__init__()
self.relu6 = nn.ReLU6(inplace=inplace)
def forward(self, x: 'torch.Tenso... | 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
import torch.quantization
assert_size_stride = torch._C._dynamo.gua... | dhlee347/model_compression | HSwish | false | 6,563 | [
"MIT"
] | 1 | 274b85ff56d81f0b7cf6907cbc1bd10e16cdb956 | https://github.com/dhlee347/model_compression/tree/274b85ff56d81f0b7cf6907cbc1bd10e16cdb956 | import torch
import torch.nn as nn
import torch.quantization
class HSigmoid(nn.Module):
"""Hard Sigmoid."""
def __init__(self, inplace: 'bool'=True) ->None:
"""Initialize."""
super().__init__()
self.relu6 = nn.ReLU6(inplace=inplace)
def forward(self, x: 'torch.Tensor') ->torch.Te... |
encoder3 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 encoder3(nn.Module):
def __init__(self):
super(encoder3, self).__init__()
self.conv1 = nn.Conv2d(3, 3, 1, 1, 0)
self.reflecPad1 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv2 = nn.Conv2d(3, 64, 3, 1, 0)
self.relu2 = nn.ReLU(inplace=T... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | cy-xu/LinearStyleTransfer | encoder3 | false | 6,564 | [
"BSD-2-Clause"
] | 1 | a07ab32db037f60a122e252588d6bd504b7d70d7 | https://github.com/cy-xu/LinearStyleTransfer/tree/a07ab32db037f60a122e252588d6bd504b7d70d7 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 3, 1, 1, 0)
self.reflecPad1 = nn.ReflectionPad2d((1, 1, 1, 1))
self.conv2 = nn.Conv2d(3, 64, 3, 1, 0)
self.relu2 = nn.ReLU(inplace=True)
self... |
TransposeGatedConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 import functional as F
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class SpectralNorm(nn.Module):
def __init__(self, module, name='weight', power_iterations=1):
super(SpectralNorm, 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.triton_helpers import libdevice
import torch.nn as ... | delldu/DeepFillv2 | TransposeGatedConv2d | false | 6,565 | [
"MIT"
] | 1 | a564b9589c1b42bcdddd3d7601f4059c4594a439 | https://github.com/delldu/DeepFillv2/tree/a564b9589c1b42bcdddd3d7601f4059c4594a439 | import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class SpectralNorm(nn.Module):
def __init__(self, module, name='weight', power_iterations=1):
super().__init__()
self.module = mo... |
WSDiceLoss | # 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
import torch.nn.parallel
class WSDiceLoss(nn.Module):
def __init__(self, smooth=100.0, power=2.0, v2=0.85, v1=0.15):
super().__init__()
self.smooth = smooth
self.power = power
self.v2 = v2
self.v1 = v1
def dic... | 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
import torch.nn.parallel
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty... | devaansh100/pytorch_connectomics | WSDiceLoss | false | 6,566 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
def __init__(self, smooth=100.0, power=2.0, v2=0.85, v1=0.15):
super().__init__()
self.smooth = smooth
self.power = power
self.v2 = v2
self.v1 = v1
def dice_los... |
QuantizableHSigmoid | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.quantization
class QuantizableHSigmoid(nn.Module):
"""Hard Sigmoid for quantization."""
def __init__(self, inplace: 'bool'=True) ->None:
"""Initialize."""
super(QuantizableHSigmoid, self).__init__()
self.relu6 = nn.ReLU6(inplace=inplace)... | 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
import torch.quantization
assert_size_stride = torch._C._dynamo.gua... | dhlee347/model_compression | QuantizableHSigmoid | false | 6,567 | [
"MIT"
] | 1 | 274b85ff56d81f0b7cf6907cbc1bd10e16cdb956 | https://github.com/dhlee347/model_compression/tree/274b85ff56d81f0b7cf6907cbc1bd10e16cdb956 | import torch
import torch.nn as nn
import torch.quantization
class Model(nn.Module):
"""Hard Sigmoid for quantization."""
def __init__(self, inplace: 'bool'=True) ->None:
"""Initialize."""
super().__init__()
self.relu6 = nn.ReLU6(inplace=inplace)
self.add_scalar = nn.quantized... |
HSigmoid | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.quantization
class HSigmoid(nn.Module):
"""Hard Sigmoid."""
def __init__(self, inplace: 'bool'=True) ->None:
"""Initialize."""
super(HSigmoid, self).__init__()
self.relu6 = nn.ReLU6(inplace=inplace)
def forward(self, x: 'torch.Tenso... | 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
import torch.quantization
assert_size_stride = torch._C._dynamo.gua... | dhlee347/model_compression | HSigmoid | false | 6,568 | [
"MIT"
] | 1 | 274b85ff56d81f0b7cf6907cbc1bd10e16cdb956 | https://github.com/dhlee347/model_compression/tree/274b85ff56d81f0b7cf6907cbc1bd10e16cdb956 | import torch
import torch.nn as nn
import torch.quantization
class Model(nn.Module):
"""Hard Sigmoid."""
def __init__(self, inplace: 'bool'=True) ->None:
"""Initialize."""
super().__init__()
self.relu6 = nn.ReLU6(inplace=inplace)
def forward(self, x: 'torch.Tensor') ->torch.Tenso... |
WeightedCE | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from typing import Optional
from typing import List
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class WeightedCE(nn.Module):
"""Mask weighted multi-class cross-entropy (CE) loss.
"""
def __init__(self, class_weight: 'Optional[List[fl... | 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 typing import Opt... | devaansh100/pytorch_connectomics | WeightedCE | false | 6,569 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 | import torch
from typing import Optional
from typing import List
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
class Model(nn.Module):
"""Mask weighted multi-class cross-entropy (CE) loss.
"""
def __init__(self, class_weight: 'Optional[List[float]]... |
QuantizableHSwish | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.quantization
class QuantizableHSigmoid(nn.Module):
"""Hard Sigmoid for quantization."""
def __init__(self, inplace: 'bool'=True) ->None:
"""Initialize."""
super(QuantizableHSigmoid, self).__init__()
self.relu6 = nn.ReLU6(inplace=inplace)... | 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
import torch.quantization
assert_size_stride = torch._C._dynamo.gua... | dhlee347/model_compression | QuantizableHSwish | false | 6,570 | [
"MIT"
] | 1 | 274b85ff56d81f0b7cf6907cbc1bd10e16cdb956 | https://github.com/dhlee347/model_compression/tree/274b85ff56d81f0b7cf6907cbc1bd10e16cdb956 | import torch
import torch.nn as nn
import torch.quantization
class QuantizableHSigmoid(nn.Module):
"""Hard Sigmoid for quantization."""
def __init__(self, inplace: 'bool'=True) ->None:
"""Initialize."""
super().__init__()
self.relu6 = nn.ReLU6(inplace=inplace)
self.add_scalar ... |
SEModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
import torch.utils.data
def make_divisible(v, divisor, min_val=None):
"""
This function is taken from the original tf repo.
It ensures that all layers have a channel number that is divisible by 8
It ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | dercaft/XNAS | SEModule | false | 6,571 | [
"MIT"
] | 1 | d6d0fde0d4475210a41607181939188b177e44b1 | https://github.com/dercaft/XNAS/tree/d6d0fde0d4475210a41607181939188b177e44b1 | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
import torch.utils.data
def make_divisible(v, divisor, min_val=None):
"""
This function is taken from the original tf repo.
It ensures that all layers have a channel number that is divisible by 8
It ... |
BinaryReg | # 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 BinaryReg(nn.Module):
"""Regularization for encouraging the outputs to be binary.
"""
def __init__(self, alpha=1.0):
super().__init__()
self.alpha = alpha
def forward(self, pred):
diff = pred - 0.5
diff ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | divyam-goel/pytorch_connectomics | BinaryReg | false | 6,572 | [
"MIT"
] | 1 | a2c70a7cc60fd84d67be6f225c123ff11daadb83 | https://github.com/divyam-goel/pytorch_connectomics/tree/a2c70a7cc60fd84d67be6f225c123ff11daadb83 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""Regularization for encouraging the outputs to be binary.
"""
def __init__(self, alpha=1.0):
super().__init__()
self.alpha = alpha
def forward(self, pred):
diff = pred - 0.5
diff = to... |
Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn as nn
from torch.nn import functional as F
class Attention(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.decoder_proj = nn.Linear(hidden_size, hidden_size)
self.encoder_proj = nn.Linear(hidden_size, hidden_size)
nn.init.xavi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | devjwsong/dialogue-error-correction-pytorch | Attention | false | 6,573 | [
"MIT"
] | 1 | ee0fa1f27eb995893a5943181a1fd0099a9e9202 | https://github.com/devjwsong/dialogue-error-correction-pytorch/tree/ee0fa1f27eb995893a5943181a1fd0099a9e9202 | import torch
from torch import nn as nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.decoder_proj = nn.Linear(hidden_size, hidden_size)
self.encoder_proj = nn.Linear(hidden_size, hidden_size)
nn.init.xavier_u... |
MMTMBi | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Sequence
class MMTMBi(nn.Module):
"""
bi moludal fusion
"""
def __init__(self, dim_tab, dim_img, ratio=4):
"""
Parameters
----------
dim_tab: feature dimension of tabular data
dim_img: feature dimension of ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | ditannan/Multi-modal-Multi-instance-Learning | MMTMBi | false | 6,575 | [
"Apache-2.0"
] | 1 | 06aada1ff85784d5ed50aa528c506947c892d584 | https://github.com/ditannan/Multi-modal-Multi-instance-Learning/tree/06aada1ff85784d5ed50aa528c506947c892d584 | import torch
import torch.nn as nn
from typing import Sequence
class Model(nn.Module):
"""
bi moludal fusion
"""
def __init__(self, dim_tab, dim_img, ratio=4):
"""
Parameters
----------
dim_tab: feature dimension of tabular data
dim_img: feature dimension of M... |
JaccardLoss | # 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 JaccardLoss(nn.Module):
"""Jaccard loss.
"""
def __init__(self, size_average=True, reduce=True, smooth=1.0):
super(JaccardLoss, self).__init__()
self.smooth = smooth
self.reduce = reduce
def jaccard_loss(self, p... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | divyam-goel/pytorch_connectomics | JaccardLoss | false | 6,576 | [
"MIT"
] | 1 | a2c70a7cc60fd84d67be6f225c123ff11daadb83 | https://github.com/divyam-goel/pytorch_connectomics/tree/a2c70a7cc60fd84d67be6f225c123ff11daadb83 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""Jaccard loss.
"""
def __init__(self, size_average=True, reduce=True, smooth=1.0):
super().__init__()
self.smooth = smooth
self.reduce = reduce
def jaccard_loss(self, pred, target):
l... |
MMTMTri | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Sequence
class MMTMTri(nn.Module):
"""
tri-modal fusion
"""
def __init__(self, dim_img, ratio=4):
"""
Parameters
----------
dim_tab: feature dimension of tabular data
dim_img: feature dimension of MIL model... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | ditannan/Multi-modal-Multi-instance-Learning | MMTMTri | false | 6,577 | [
"Apache-2.0"
] | 1 | 06aada1ff85784d5ed50aa528c506947c892d584 | https://github.com/ditannan/Multi-modal-Multi-instance-Learning/tree/06aada1ff85784d5ed50aa528c506947c892d584 | import torch
import torch.nn as nn
from typing import Sequence
class Model(nn.Module):
"""
tri-modal fusion
"""
def __init__(self, dim_img, ratio=4):
"""
Parameters
----------
dim_tab: feature dimension of tabular data
dim_img: feature dimension of MIL model
... |
Sine | # 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
import torch.nn.parallel
import torch.utils.data.distributed
class Sine(nn.Module):
""" Applies the sine function element-wise.
`"Implicit Neural Representations with Periodic Activation Functions" <https://arxiv.org/pdf/2006.09661.pdf>`_
Exa... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel... | doansangg/CGAN-PyTorch | Sine | false | 6,578 | [
"Apache-2.0"
] | 1 | 941f5bd75102bed7f2eccd7feb9af8e6134af0e4 | https://github.com/doansangg/CGAN-PyTorch/tree/941f5bd75102bed7f2eccd7feb9af8e6134af0e4 | import torch
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel
import torch.utils.data.distributed
class Model(nn.Module):
""" Applies the sine function element-wise.
`"Implicit Neural Representations with Periodic Activation Functions" <https://arxiv.org/pdf/2006.09661.pdf>`_
Ex... |
SimpleCNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SimpleCNN(nn.Module):
def __init__(self, num_channels, num_classes):
super(SimpleCNN, self).__init__()
C = num_channels
self.conv1 = nn.Conv2d(in_channels=C, out_channels=C * 8,
kernel_size=3, stride=2, p... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | diogo149/doo | SimpleCNN | false | 6,579 | [
"MIT"
] | 1 | d83a1715fb9d4e5eac9f5d3d384a45cfc26fec2f | https://github.com/diogo149/doo/tree/d83a1715fb9d4e5eac9f5d3d384a45cfc26fec2f | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_channels, num_classes):
super().__init__()
C = num_channels
self.conv1 = nn.Conv2d(in_channels=C, out_channels=C * 8,
kernel_size=3, stride=2, padding=1)
s... |
HSigmoid | # 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
import torch.nn.parallel
import torch.utils.data.distributed
class HSigmoid(nn.Module):
""" Applies the Hard-Sigmoid function element-wise.
`"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_
Examples:
>>> m = Mish()... | 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
import torch.nn.functional
import torch.nn.parallel
import torch.ut... | doansangg/CGAN-PyTorch | HSigmoid | false | 6,580 | [
"Apache-2.0"
] | 1 | 941f5bd75102bed7f2eccd7feb9af8e6134af0e4 | https://github.com/doansangg/CGAN-PyTorch/tree/941f5bd75102bed7f2eccd7feb9af8e6134af0e4 | import torch
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel
import torch.utils.data.distributed
class Model(nn.Module):
""" Applies the Hard-Sigmoid function element-wise.
`"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_
Examples:
>>> m = Mish()
... |
MyInstanceNorm2d | # 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 AffineChannelwise(nn.Module):
def __init__(self, num_channels):
super().__init__()
self.num_channels = num_channels
self.register_parameter('weight', nn.Parameter(torch.ones(
num_channels)))
self.register_parameter('bias', nn.Par... | 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... | dniku/dl-norms | MyInstanceNorm2d | false | 6,581 | [
"MIT"
] | 1 | 0f1eef942bd318ac988ec7dfa9caea300d17e82a | https://github.com/dniku/dl-norms/tree/0f1eef942bd318ac988ec7dfa9caea300d17e82a | import torch
from torch import nn
class AffineChannelwise(nn.Module):
def __init__(self, num_channels):
super().__init__()
self.num_channels = num_channels
self.register_parameter('weight', nn.Parameter(torch.ones(
num_channels)))
self.register_parameter('bias', nn.Par... |
TSAFusion | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
class TSAFusion(nn.Module):
"""Temporal Spatial Attention (TSA) fusion module.
Temporal: Calculate the correlation between center frame and
neighboring... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 to... | cyysc1998/EDVRDarts | TSAFusion | false | 6,582 | [
"MIT"
] | 1 | 201badbc8c6469b519647a8869c3782ebe1176cf | https://github.com/cyysc1998/EDVRDarts/tree/201badbc8c6469b519647a8869c3782ebe1176cf | import torch
import torch.nn as nn
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
class Model(nn.Module):
"""Temporal Spatial Attention (TSA) fusion module.
Temporal: Calculate the correlation between center frame and
neighboring fra... |
MyGroupNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 AffineChannelwise(nn.Module):
def __init__(self, num_channels):
super().__init__()
self.num_channels = num_channels
self.register_parameter('weight', nn.Parameter(torch.ones(
num_channels)))
self.register_parameter('bias', nn.Par... | 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... | dniku/dl-norms | MyGroupNorm | false | 6,583 | [
"MIT"
] | 1 | 0f1eef942bd318ac988ec7dfa9caea300d17e82a | https://github.com/dniku/dl-norms/tree/0f1eef942bd318ac988ec7dfa9caea300d17e82a | import torch
from torch import nn
class AffineChannelwise(nn.Module):
def __init__(self, num_channels):
super().__init__()
self.num_channels = num_channels
self.register_parameter('weight', nn.Parameter(torch.ones(
num_channels)))
self.register_parameter('bias', nn.Par... |
HSwish | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel
import torch.utils.data.distributed
class HSwish(nn.Module):
""" Applies the Hard-Swish function element-wise.
`"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_
Examples:
>>> m = Mish()
... | 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
import torch.nn.functional
import torch.nn.parallel
import torch.ut... | doansangg/CGAN-PyTorch | HSwish | false | 6,584 | [
"Apache-2.0"
] | 1 | 941f5bd75102bed7f2eccd7feb9af8e6134af0e4 | https://github.com/doansangg/CGAN-PyTorch/tree/941f5bd75102bed7f2eccd7feb9af8e6134af0e4 | import torch
import torch.nn as nn
import torch.nn.functional
import torch.nn.parallel
import torch.utils.data.distributed
class Model(nn.Module):
""" Applies the Hard-Swish function element-wise.
`"Searching for MobileNetV3" <https://arxiv.org/pdf/1905.02244.pdf>`_
Examples:
>>> m = Mish()
... |
AffineChannelwise | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 AffineChannelwise(nn.Module):
def __init__(self, num_channels):
super().__init__()
self.num_channels = num_channels
self.register_parameter('weight', nn.Parameter(torch.ones(
num_channels)))
self.register_parameter('bias', nn.Par... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | dniku/dl-norms | AffineChannelwise | false | 6,585 | [
"MIT"
] | 1 | 0f1eef942bd318ac988ec7dfa9caea300d17e82a | https://github.com/dniku/dl-norms/tree/0f1eef942bd318ac988ec7dfa9caea300d17e82a | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, num_channels):
super().__init__()
self.num_channels = num_channels
self.register_parameter('weight', nn.Parameter(torch.ones(
num_channels)))
self.register_parameter('bias', nn.Parameter(torch... |
Model | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils.data
import torch.nn.functional as f
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.conv = nn.Conv2d(1, 16, 5)
self.pool = nn.MaxPool2d(2, 2)
self.fc = nn.Linear(2304, 10)
def forward(self, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | dohmatob/adversarial-robustness-toolbox | Model | false | 6,586 | [
"MIT"
] | 1 | 7d3ba7d2d6690be69c08754fbc632947c2d10a97 | https://github.com/dohmatob/adversarial-robustness-toolbox/tree/7d3ba7d2d6690be69c08754fbc632947c2d10a97 | import torch
import torch.nn as nn
import torch.utils.data
import torch.nn.functional as f
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.conv = nn.Conv2d(1, 16, 5)
self.pool = nn.MaxPool2d(2, 2)
self.fc = nn.Linear(2304, 10)
def forward(self, ... |
PowerPropLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 PowerPropLinear(nn.Linear):
"""Powerpropagation Linear module."""
def __init__(self, in_features, out_fetaures, alpha, bias=True, *args,
**kwargs):
self._alpha = alpha
super(PowerPropLinear, self).__init__(in_fea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | dlpbc/powerpropagation-pytorch | PowerPropLinear | false | 6,587 | [
"MIT"
] | 1 | 99e29ce25ede9330cb8f624cb1fa7ffef6f82f03 | https://github.com/dlpbc/powerpropagation-pytorch/tree/99e29ce25ede9330cb8f624cb1fa7ffef6f82f03 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Linear):
"""Powerpropagation Linear module."""
def __init__(self, in_features, out_fetaures, alpha, bias=True, *args,
**kwargs):
self._alpha = alpha
super().__init__(in_features, out_fetaures,
... |
AllReduceLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import Tensor
import torch.distributed as dist
import torch.nn as nn
from torch.nn import Linear
class ParallelModule(nn.Module):
"""Parents of all parallel layer classes"""
def __init__(self):
super().__init__()
self.mp_group = None
def allreduce(self, outputs):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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.distributed as dist
import torch.nn as nn
from torch.nn import Line... | dobbytk/parallelformers | AllReduceLinear | false | 6,588 | [
"Apache-2.0"
] | 1 | a05780b1d178b4ac5100e42c2b6eec7aedc7dd33 | https://github.com/dobbytk/parallelformers/tree/a05780b1d178b4ac5100e42c2b6eec7aedc7dd33 | import torch
from torch import Tensor
import torch.distributed as dist
import torch.nn as nn
from torch.nn import Linear
class ParallelModule(nn.Module):
"""Parents of all parallel layer classes"""
def __init__(self):
super().__init__()
self.mp_group = None
def allreduce(self, outputs):
... |
PredictTargets | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class PredictTargets(nn.Module):
def __init__(self, dim):
super(PredictTargets, self).__init__()
self.linear1 = nn.Linear(2 * dim, dim)
self.linear2 = nn.Linear(dim, 1)
def forward(self, targets, embeddings):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | dmcinerney/ehr-extraction-models | PredictTargets | false | 6,589 | [
"Apache-2.0"
] | 1 | c7e7e176f69a2558d420c607254ed7e98b5e836a | https://github.com/dmcinerney/ehr-extraction-models/tree/c7e7e176f69a2558d420c607254ed7e98b5e836a | import torch
from torch import nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, dim):
super().__init__()
self.linear1 = nn.Linear(2 * dim, dim)
self.linear2 = nn.Linear(dim, 1)
def forward(self, targets, embeddings):
nt, b, vs = targets.shape... |
SimpleEncoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Tensor
import torch.nn as nn
class PositionalEncoding(nn.Module):
"""
Learnable position embeddings
Args:
pe_type (str): type of position embeddings,
which is chosen from ['fully_learnable', 'sinusoidal']
d_model (int): embed dim (req... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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 Tensor
import torch.nn as nn
assert_size_stride = ... | doiken23/mccformers.pytorch | SimpleEncoder | false | 6,590 | [
"MIT"
] | 1 | 678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | https://github.com/doiken23/mccformers.pytorch/tree/678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | import math
import torch
from torch import Tensor
import torch.nn as nn
class PositionalEncoding(nn.Module):
"""
Learnable position embeddings
Args:
pe_type (str): type of position embeddings,
which is chosen from ['fully_learnable', 'sinusoidal']
d_model (int): embed dim (req... |
MMTMQuad | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Sequence
class MMTMQuad(nn.Module):
"""
quad modal fusion
"""
def __init__(self, dim_tab, dim_img, ratio=4):
"""
Parameters
----------
dim_tab: feature dimension of tabular data
dim_img: feature 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
import torch.nn as nn
assert_... | ditannan/Multi-modal-Multi-instance-Learning | MMTMQuad | false | 6,591 | [
"Apache-2.0"
] | 1 | 06aada1ff85784d5ed50aa528c506947c892d584 | https://github.com/ditannan/Multi-modal-Multi-instance-Learning/tree/06aada1ff85784d5ed50aa528c506947c892d584 | import torch
import torch.nn as nn
from typing import Sequence
class Model(nn.Module):
"""
quad modal fusion
"""
def __init__(self, dim_tab, dim_img, ratio=4):
"""
Parameters
----------
dim_tab: feature dimension of tabular data
dim_img: feature dimension of M... |
Discrete | # 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 Discrete(nn.Module):
def __init__(self, num_outputs):
super(Discrete, self).__init__()
def forward(self, x):
probs = nn.functional.softmax(x, dim=0)
dist = torch.distributions.Categorical(probs=probs)
return dist.entropy()
def get_in... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | dreamflasher/client | Discrete | false | 6,592 | [
"MIT"
] | 1 | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | https://github.com/dreamflasher/client/tree/c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_outputs):
super().__init__()
def forward(self, x):
probs = nn.functional.softmax(x, dim=0)
dist = torch.distributions.Categorical(probs=probs)
return dist.entropy()
def get_inputs():
retur... |
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 functools
import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
import torch._C
import torch.serialization
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import functools
impor... | dkswxd/Swin-Spectral | DiceLoss | false | 6,593 | [
"Apache-2.0"
] | 1 | 5d8c364b0d89e4dd21590bb58f7a434a5b97254c | https://github.com/dkswxd/Swin-Spectral/tree/5d8c364b0d89e4dd21590bb58f7a434a5b97254c | import functools
import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
import torch._C
import torch.serialization
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "... |
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, 400)
self.l2 = nn.Linear(400 + action_dim, 300)
self.l3 = nn.Linear(300, 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_... | dmund95/bcq | Critic | false | 6,594 | [
"MIT"
] | 1 | b1ae39ad7789443f02273aaa1a433c55c6836a5f | https://github.com/dmund95/bcq/tree/b1ae39ad7789443f02273aaa1a433c55c6836a5f | 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, 400)
self.l2 = nn.Linear(400 + action_dim, 300)
self.l3 = nn.Linear(300, 1)
def forward(self... |
SquareRoot | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional
from torch import nn
class SquareRoot(nn.Module):
def forward(self, x):
return x.sqrt()
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn.functional
from torch import nn
assert_size_stride = torch._C._... | drivendataorg/DrivenData-2021-Geopose-Solution | SquareRoot | false | 6,595 | [
"MIT"
] | 1 | fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | https://github.com/drivendataorg/DrivenData-2021-Geopose-Solution/tree/fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | import torch
import torch.nn.functional
from torch import nn
class Model(nn.Module):
def forward(self, x):
return x.sqrt()
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
Net | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.fc1 = nn.Linear(4, 64)
self.fc2 = nn.Linear(64, 64)
self.fc3 = nn.Linear(64, 2)
def forward(self, x):
x = torch.tanh(self.fc1(x))
x = torch.tanh(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.triton_helpers import libdevice
import torch.nn as ... | dongminlee94/supplement4deeprl | Net | false | 6,596 | [
"MIT"
] | 1 | 4db1a83f5dd3254abd8135fe94734a0d8d14a957 | https://github.com/dongminlee94/supplement4deeprl/tree/4db1a83f5dd3254abd8135fe94734a0d8d14a957 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(4, 64)
self.fc2 = nn.Linear(64, 64)
self.fc3 = nn.Linear(64, 2)
def forward(self, x):
x = torch.tanh(self.fc1(x))
x = torch.tanh(self.fc2(x))... |
Value | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Value(nn.Module):
def __init__(self, num_inputs):
super(Value, self).__init__()
self.affine1 = nn.Linear(num_inputs, 64)
self.affine2 = nn.Linear(64, 64)
self.value_head = nn.Linear(64, 1)
self.value_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | dragen1860/TRPO-Pytorch | Value | false | 6,597 | [
"MIT"
] | 1 | c5a8e5ac890ec50e331db12fd5885dd4fb753a3b | https://github.com/dragen1860/TRPO-Pytorch/tree/c5a8e5ac890ec50e331db12fd5885dd4fb753a3b | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_inputs):
super().__init__()
self.affine1 = nn.Linear(num_inputs, 64)
self.affine2 = nn.Linear(64, 64)
self.value_head = nn.Linear(64, 1)
self.value_head.weight... |
Policy | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Policy(nn.Module):
def __init__(self, num_inputs, num_outputs):
super(Policy, self).__init__()
self.affine1 = nn.Linear(num_inputs, 64)
self.affine2 = nn.Linear(64, 64)
self.action_mean = nn.Linear(64, num_ou... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | dragen1860/TRPO-Pytorch | Policy | false | 6,598 | [
"MIT"
] | 1 | c5a8e5ac890ec50e331db12fd5885dd4fb753a3b | https://github.com/dragen1860/TRPO-Pytorch/tree/c5a8e5ac890ec50e331db12fd5885dd4fb753a3b | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_inputs, num_outputs):
super().__init__()
self.affine1 = nn.Linear(num_inputs, 64)
self.affine2 = nn.Linear(64, 64)
self.action_mean = nn.Linear(64, num_outputs)
... |
GlobalWeightedAvgPool2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 GlobalWeightedAvgPool2d(nn.Module):
"""
Global Weighted Average Pooling from paper "Global Weighted Average
Pooling Bridges Pixel-level Localization and Image-level Classification"
"""
def __init__(self, features: 'int', flatten=False):
super().__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.... | dong03/DogNoseLandmarks | GlobalWeightedAvgPool2d | false | 6,599 | [
"MIT"
] | 1 | ac5d1e0436e9e0835a6939f8d125f1d36007bc62 | https://github.com/dong03/DogNoseLandmarks/tree/ac5d1e0436e9e0835a6939f8d125f1d36007bc62 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Global Weighted Average Pooling from paper "Global Weighted Average
Pooling Bridges Pixel-level Localization and Image-level Classification"
"""
def __init__(self, features: 'int', flatten=False):
super().__init__()
se... |
MSELossWithIgnore | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional
from torch import nn
class MSELossWithIgnore(nn.Module):
def __init__(self, ignore_value: 'int', fraction: 'float'=1.0):
super().__init__()
self.ignore_value = ignore_value
self.fraction = fraction
def forward(self, output, target):
los... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn.functional
from torch import nn
assert_size_stride = torch._C._dynamo.gua... | drivendataorg/DrivenData-2021-Geopose-Solution | MSELossWithIgnore | false | 6,600 | [
"MIT"
] | 1 | fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | https://github.com/drivendataorg/DrivenData-2021-Geopose-Solution/tree/fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | import torch
import torch.nn.functional
from torch import nn
class Model(nn.Module):
def __init__(self, ignore_value: 'int', fraction: 'float'=1.0):
super().__init__()
self.ignore_value = ignore_value
self.fraction = fraction
def forward(self, output, target):
loss = torch.nn... |
ATTA | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ATTA(nn.Module):
def __init__(self):
super(ATTA, self).__init__()
self.conv1 = nn.Conv2d(3, 3, 16, padding='same', groups=1, bias=False)
self.lr = nn.LeakyReLU(0.2)
self.conv2 = nn.Conv2d(3, 3, 3, padding='same', groups=1, bias=False)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | dreamflake/ODI | ATTA | false | 6,601 | [
"MIT"
] | 1 | d58001b96821c8a74d6ebb5402bd2be2b524890a | https://github.com/dreamflake/ODI/tree/d58001b96821c8a74d6ebb5402bd2be2b524890a | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 3, 16, padding='same', groups=1, bias=False)
self.lr = nn.LeakyReLU(0.2)
self.conv2 = nn.Conv2d(3, 3, 3, padding='same', groups=1, bias=False)
torch.... |
Exponent | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional
from torch import nn
class Exponent(nn.Module):
def forward(self, x):
return x.exp()
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn.functional
from torch import nn
assert_size_stride = torc... | drivendataorg/DrivenData-2021-Geopose-Solution | Exponent | false | 6,602 | [
"MIT"
] | 1 | fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | https://github.com/drivendataorg/DrivenData-2021-Geopose-Solution/tree/fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | import torch
import torch.nn.functional
from torch import nn
class Model(nn.Module):
def forward(self, x):
return x.exp()
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
LogCoshWithIgnore | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional
from torch import nn
class LogCoshWithIgnore(nn.Module):
def __init__(self, ignore_value, fraction: 'float'=1.0):
super().__init__()
self.ignore_value = ignore_value
self.fraction = fraction
def forward(self, output, target):
r = 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, math as tl_math
import torc... | drivendataorg/DrivenData-2021-Geopose-Solution | LogCoshWithIgnore | false | 6,603 | [
"MIT"
] | 1 | fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | https://github.com/drivendataorg/DrivenData-2021-Geopose-Solution/tree/fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | import torch
import torch.nn.functional
from torch import nn
class Model(nn.Module):
def __init__(self, ignore_value, fraction: 'float'=1.0):
super().__init__()
self.ignore_value = ignore_value
self.fraction = fraction
def forward(self, output, target):
r = output - target
... |
GlobalAvgPool2d | # 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 GlobalAvgPool2d(nn.Module):
"""Performs global average pooling over the entire height and width of a batched 2D tensor
# Arguments
input: Input tensor
"""
def forward(self, input):
return nn.functional.avg_pool2d(input, kernel_size=input.size()... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | drjosephliu/few-shot-learning | GlobalAvgPool2d | false | 6,604 | [
"MIT"
] | 1 | 707c7ce2a0b1813327fb4e39660415b9437b8ec1 | https://github.com/drjosephliu/few-shot-learning/tree/707c7ce2a0b1813327fb4e39660415b9437b8ec1 | import torch
from torch import nn
class Model(nn.Module):
"""Performs global average pooling over the entire height and width of a batched 2D tensor
# Arguments
input: Input tensor
"""
def forward(self, input):
return nn.functional.avg_pool2d(input, kernel_size=input.size()[2:]
... |
CosineSimilarityLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional
from torch import nn
class CosineSimilarityLoss(nn.Module):
def __init__(self, gamma=1):
super().__init__()
self.gamma = gamma
def forward(self, output, target):
loss = 1.0 - torch.clamp(torch.nn.functional.cosine_similarity(
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.nn.functional
f... | drivendataorg/DrivenData-2021-Geopose-Solution | CosineSimilarityLoss | false | 6,605 | [
"MIT"
] | 1 | fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | https://github.com/drivendataorg/DrivenData-2021-Geopose-Solution/tree/fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | import torch
import torch.nn.functional
from torch import nn
class Model(nn.Module):
def __init__(self, gamma=1):
super().__init__()
self.gamma = gamma
def forward(self, output, target):
loss = 1.0 - torch.clamp(torch.nn.functional.cosine_similarity(
output, target, dim=1... |
HuberLossWithIgnore | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import Tensor
import torch.nn.functional
from torch import nn
class HuberLossWithIgnore(nn.Module):
def __init__(self, ignore_value: 'int', delta: 'float'=1, fraction:
'float'=1.0):
super().__init__()
self.ignore_value = ignore_value
self.delta = delta
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn.functi... | drivendataorg/DrivenData-2021-Geopose-Solution | HuberLossWithIgnore | false | 6,606 | [
"MIT"
] | 1 | fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | https://github.com/drivendataorg/DrivenData-2021-Geopose-Solution/tree/fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | import torch
from torch import Tensor
import torch.nn.functional
from torch import nn
class Model(nn.Module):
def __init__(self, ignore_value: 'int', delta: 'float'=1, fraction:
'float'=1.0):
super().__init__()
self.ignore_value = ignore_value
self.delta = delta
self.fract... |
SmoothL1LossWithIgnore | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional
from torch import nn
class SmoothL1LossWithIgnore(nn.Module):
def __init__(self, ignore_value: 'int', fraction: 'float'=1.0):
super().__init__()
self.ignore_value = ignore_value
self.fraction = fraction
def forward(self, output, target):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn.functi... | drivendataorg/DrivenData-2021-Geopose-Solution | SmoothL1LossWithIgnore | false | 6,607 | [
"MIT"
] | 1 | fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | https://github.com/drivendataorg/DrivenData-2021-Geopose-Solution/tree/fc1dead0aeb1ade9e9d87b55f56e631c57e966a6 | import torch
import torch.nn.functional
from torch import nn
class Model(nn.Module):
def __init__(self, ignore_value: 'int', fraction: 'float'=1.0):
super().__init__()
self.ignore_value = ignore_value
self.fraction = fraction
def forward(self, output, target):
loss = torch.nn... |
MyLeakyReLU | # 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 MyLeakyReLU(nn.Module):
def __init__(self, negative_slope=0.01):
super(MyLeakyReLU, self).__init__()
self.negative_slope = negative_slope
def forward(self, x):
return torch.clamp(x, min=0.0) + torch.clamp(x, max=0.0
) * self.negati... | 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... | dsarrut/gaga | MyLeakyReLU | false | 6,608 | [
"Apache-2.0"
] | 1 | 4b34210074f8f82acb12e0ffb38858e83c319dc3 | https://github.com/dsarrut/gaga/tree/4b34210074f8f82acb12e0ffb38858e83c319dc3 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, negative_slope=0.01):
super().__init__()
self.negative_slope = negative_slope
def forward(self, x):
return torch.clamp(x, min=0.0) + torch.clamp(x, max=0.0
) * self.negative_slope
def get_inpu... |
GlobalMaxPool1d | # 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 GlobalMaxPool1d(nn.Module):
"""Performs global max pooling over the entire length of a batched 1D tensor
# Arguments
input: Input tensor
"""
def forward(self, input):
return nn.functional.max_pool1d(input, kernel_size=input.size()[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
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | drjosephliu/few-shot-learning | GlobalMaxPool1d | false | 6,609 | [
"MIT"
] | 1 | 707c7ce2a0b1813327fb4e39660415b9437b8ec1 | https://github.com/drjosephliu/few-shot-learning/tree/707c7ce2a0b1813327fb4e39660415b9437b8ec1 | import torch
from torch import nn
class Model(nn.Module):
"""Performs global max pooling over the entire length of a batched 1D tensor
# Arguments
input: Input tensor
"""
def forward(self, input):
return nn.functional.max_pool1d(input, kernel_size=input.size()[2:]
).view(... |
LabelSmoothing | # 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 LabelSmoothing(nn.Module):
"""
Label Smoothing
Attributes
----------
criterion : torch.nn.KLDivLoss
padding_idx : int
eps : float
n_vocab : int
"""
def __init__(self, n_vocab, eps, padding_idx=0):
"""
Param... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch import nn
assert_size_stride = torch._C._dynamo.gua... | dugusword/transformer | LabelSmoothing | false | 6,610 | [
"MIT"
] | 1 | 7aa10968f0e60d545bbd17f1f8c1dfb7ee88c62b | https://github.com/dugusword/transformer/tree/7aa10968f0e60d545bbd17f1f8c1dfb7ee88c62b | import torch
from torch import nn
class Model(nn.Module):
"""
Label Smoothing
Attributes
----------
criterion : torch.nn.KLDivLoss
padding_idx : int
eps : float
n_vocab : int
"""
def __init__(self, n_vocab, eps, padding_idx=0):
"""
Parameters
... |
ViTClassifierPipe | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class ViTClassifierPipe(nn.Module):
def __init__(self, config: 'ViTConfig'):
super().__init__()
self.layernorm = nn.LayerNorm(config.hidden_size, eps=config.
layer_norm_eps)
self.classifier = nn.L... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | drunkcoding/huggingface-utils | ViTClassifierPipe | false | 6,611 | [
"MIT"
] | 1 | 4baad306857c357d94607076c6ab0cb5d6350cbe | https://github.com/drunkcoding/huggingface-utils/tree/4baad306857c357d94607076c6ab0cb5d6350cbe | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, config: 'ViTConfig'):
super().__init__()
self.layernorm = nn.LayerNorm(config.hidden_size, eps=config.
layer_norm_eps)
self.classifier = nn.Linear(config... |
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
from torch import nn
class ScaledDotProductAttention(nn.Module):
"""
Scaled Dot-Product Attention Layer
Attributes
----------
softmax : nn.Functional
softmax function applied at the last dimension
"""
def __init__(self, dropout=0.1):
super(ScaledD... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | dugusword/transformer | MultiHeadAttention | false | 6,612 | [
"MIT"
] | 1 | 7aa10968f0e60d545bbd17f1f8c1dfb7ee88c62b | https://github.com/dugusword/transformer/tree/7aa10968f0e60d545bbd17f1f8c1dfb7ee88c62b | import math
import torch
from torch import nn
class ScaledDotProductAttention(nn.Module):
"""
Scaled Dot-Product Attention Layer
Attributes
----------
softmax : nn.Functional
softmax function applied at the last dimension
"""
def __init__(self, dropout=0.1):
super().__ini... |
Fusion | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.checkpoint
class Fusion(nn.Module):
"""
The subnetwork that is used in TFN for video and audio in the pre-fusion stage
"""
def __init__(self, in_size, hidden_size, n_class, dropout, modal_name=
'text'):
"""
Args:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | dumpmemory/MMSA | Fusion | false | 6,613 | [
"MIT"
] | 1 | 08b3a7f4529c380356eeb1cf6bf9a89e7c9701e7 | https://github.com/dumpmemory/MMSA/tree/08b3a7f4529c380356eeb1cf6bf9a89e7c9701e7 | import torch
import torch.nn as nn
import torch.utils.checkpoint
class Model(nn.Module):
"""
The subnetwork that is used in TFN for video and audio in the pre-fusion stage
"""
def __init__(self, in_size, hidden_size, n_class, dropout, modal_name=
'text'):
"""
Args:
... |
FeatureVolume | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 FeatureVolume(nn.Module):
def __init__(self, fdim, fsize):
super().__init__()
self.fsize = fsize
self.fdim = fdim
var = 0.01
self.fmx = nn.Parameter(torch.randn(1, fdim, fsize, fsize) * var)
s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | drixs2050/nglod | FeatureVolume | false | 6,614 | [
"MIT"
] | 1 | 0f3627d3ece82464335b0fab89c2269fcb016308 | https://github.com/drixs2050/nglod/tree/0f3627d3ece82464335b0fab89c2269fcb016308 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, fdim, fsize):
super().__init__()
self.fsize = fsize
self.fdim = fdim
var = 0.01
self.fmx = nn.Parameter(torch.randn(1, fdim, fsize, fsize) * var)
self.spar... |
CoAttentionTransformerEncoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import Tensor
from typing import Optional
import torch.nn as nn
import torch.nn.functional as F
def _get_activation_fn(activation):
if activation == 'relu':
return F.relu
elif activation == 'gelu':
return F.gelu
raise ValueError('activation should be relu/gelu, not ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | doiken23/mccformers.pytorch | CoAttentionTransformerEncoderLayer | false | 6,615 | [
"MIT"
] | 1 | 678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | https://github.com/doiken23/mccformers.pytorch/tree/678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | import torch
from torch import Tensor
from typing import Optional
import torch.nn as nn
import torch.nn.functional as F
def _get_activation_fn(activation):
if activation == 'relu':
return F.relu
elif activation == 'gelu':
return F.gelu
raise ValueError('activation should be relu/gelu, not ... |
Adversarial_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
from numpy import *
class Adversarial_Loss(nn.Module):
def __init__(self, lambda_adv):
super(Adversarial_Loss, self).__init__()
self.lambda_adv = lambda_adv
pass
def forward(self, input_p, input_h):
dis_p = input_p * torch.log(input_p)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | ducviet00/HMER | Adversarial_Loss | false | 6,616 | [
"MIT"
] | 1 | 0fa322ed35412737a24ec3955c9a3d96d1989bd4 | https://github.com/ducviet00/HMER/tree/0fa322ed35412737a24ec3955c9a3d96d1989bd4 | import torch
import torch.nn as nn
from numpy import *
class Model(nn.Module):
def __init__(self, lambda_adv):
super().__init__()
self.lambda_adv = lambda_adv
pass
def forward(self, input_p, input_h):
dis_p = input_p * torch.log(input_p)
dis_h = torch.log(torch.ones_l... |
MixedPad | # 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
def mixed_pad(input, pad, mode='constant', value=0, reversed_axes=False):
"""Mixed mode padding.
:type input: tensor[B,C,D1,D2,...,DD]
:type pad: int or tuple of ints with 2*D length
:type mode: str or tuple
:type value: float or tuple
Dimension numbering: reverse... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | dvolgyes/highresnet | MixedPad | false | 6,617 | [
"MIT"
] | 1 | 12b8831ed52e2dc45d2e14cc6f2954c583c97a46 | https://github.com/dvolgyes/highresnet/tree/12b8831ed52e2dc45d2e14cc6f2954c583c97a46 | import torch
def mixed_pad(input, pad, mode='constant', value=0, reversed_axes=False):
"""Mixed mode padding.
:type input: tensor[B,C,D1,D2,...,DD]
:type pad: int or tuple of ints with 2*D length
:type mode: str or tuple
:type value: float or tuple
Dimension numbering: reverse... |
NetworkDQN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NetworkDQN(nn.Module):
def __init__(self, fs, input_dim, fc1, fc2, n_actions):
super(NetworkDQN, self).__init__()
self.conv1 = nn.Conv2d(fs, 64, 8, 4)
self.pool1 = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(64... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | doganjr/MarioDQN | NetworkDQN | false | 6,618 | [
"MIT"
] | 1 | 62daa390f8ee0b732275e71675a2b9eae85c43a4 | https://github.com/doganjr/MarioDQN/tree/62daa390f8ee0b732275e71675a2b9eae85c43a4 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, fs, input_dim, fc1, fc2, n_actions):
super().__init__()
self.conv1 = nn.Conv2d(fs, 64, 8, 4)
self.pool1 = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(64, 64, 4, 2)
s... |
Loss_D | # 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 numpy import *
class Loss_D(nn.Module):
"""docstring for Loss_D"""
def __init__(self):
super(Loss_D, self).__init__()
def forward(self, input_h):
return -input_h * torch.log(input_h)
pass
def get_inputs():
return [torch.rand([4, 4, 4,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
from numpy import *
assert_size_stride = torch._C._... | ducviet00/HMER | Loss_D | false | 6,619 | [
"MIT"
] | 1 | 0fa322ed35412737a24ec3955c9a3d96d1989bd4 | https://github.com/ducviet00/HMER/tree/0fa322ed35412737a24ec3955c9a3d96d1989bd4 | import torch
import torch.nn as nn
from numpy import *
class Model(nn.Module):
"""docstring for Loss_D"""
def __init__(self):
super().__init__()
def forward(self, input_h):
return -input_h * torch.log(input_h)
pass
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def g... |
Invertible1x1Conv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
from torch.autograd import Variable
import torch.utils.data
import torch.nn
class Invertible1x1Conv(torch.nn.Module):
"""
The layer outputs both the convolution, and the log determinant
of its weight matrix. If reverse=True it does convolution with
inverse... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional as F
from torch.autograd import Variable
import torch... | drostifrosti/TensorRT | Invertible1x1Conv | false | 6,620 | [
"Apache-2.0"
] | 1 | 76d673366139538fcb47a67e08734ff429306162 | https://github.com/drostifrosti/TensorRT/tree/76d673366139538fcb47a67e08734ff429306162 | import torch
import torch.nn.functional as F
from torch.autograd import Variable
import torch.utils.data
import torch.nn
class Model(torch.nn.Module):
"""
The layer outputs both the convolution, and the log determinant
of its weight matrix. If reverse=True it does convolution with
inverse
"""
... |
InterpolationBlock | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class InterpolationBlock(nn.Module):
"""
Interpolation block.
Parameters:
----------
scale_factor : float
Multiplier for spatial size.
"""
def __init__(self, scale_factor):
super(In... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guard... | earhian/imgclsmob | InterpolationBlock | false | 6,621 | [
"MIT"
] | 1 | c87c0942420876941868c016211073dec4392e4d | https://github.com/earhian/imgclsmob/tree/c87c0942420876941868c016211073dec4392e4d | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Model(nn.Module):
"""
Interpolation block.
Parameters:
----------
scale_factor : float
Multiplier for spatial size.
"""
def __init__(self, scale_factor):
super().__init__()
... |
DiracConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 DiracConv(nn.Module):
"""
DiracNetV2 specific convolution block with pre-activation.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels.
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
import torch.nn as nn
import ... | earhian/imgclsmob | DiracConv | false | 6,622 | [
"MIT"
] | 1 | c87c0942420876941868c016211073dec4392e4d | https://github.com/earhian/imgclsmob/tree/c87c0942420876941868c016211073dec4392e4d | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""
DiracNetV2 specific convolution block with pre-activation.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels.
kernel_size : ... |
MaxPoolBranch | # 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 MaxPoolBranch(nn.Module):
"""
PolyNet specific max pooling branch block.
"""
def __init__(self):
super(MaxPoolBranch, self).__init__()
self.pool = nn.MaxPool2d(kernel_size=3, stride=2, padding=0)
def forward(self, x... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guard... | earhian/imgclsmob | MaxPoolBranch | false | 6,623 | [
"MIT"
] | 1 | c87c0942420876941868c016211073dec4392e4d | https://github.com/earhian/imgclsmob/tree/c87c0942420876941868c016211073dec4392e4d | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""
PolyNet specific max pooling branch block.
"""
def __init__(self):
super().__init__()
self.pool = nn.MaxPool2d(kernel_size=3, stride=2, padding=0)
def forward(self, x):
x = self.pool(x)... |
DiracInitBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 DiracInitBlock(nn.Module):
"""
DiracNetV2 specific initial block.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels.
"""
def __init__(self, i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | earhian/imgclsmob | DiracInitBlock | false | 6,624 | [
"MIT"
] | 1 | c87c0942420876941868c016211073dec4392e4d | https://github.com/earhian/imgclsmob/tree/c87c0942420876941868c016211073dec4392e4d | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""
DiracNetV2 specific initial block.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels.
"""
def __init__(self, in_channel... |
NasAvgPoolBlock | # 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 NasAvgPoolBlock(nn.Module):
"""
NASNet specific 3x3 Average pooling layer with extra padding.
Parameters:
----------
extra_padding : bool, default False
Whether to use extra padding.
"""
def __init__(self, extra_pad... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | earhian/imgclsmob | NasAvgPoolBlock | false | 6,625 | [
"MIT"
] | 1 | c87c0942420876941868c016211073dec4392e4d | https://github.com/earhian/imgclsmob/tree/c87c0942420876941868c016211073dec4392e4d | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""
NASNet specific 3x3 Average pooling layer with extra padding.
Parameters:
----------
extra_padding : bool, default False
Whether to use extra padding.
"""
def __init__(self, extra_padding=False... |
IBNbConvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 IBNbConvBlock(nn.Module):
"""
IBN(b)-ResNet specific convolution block with Instance normalization and ReLU activation.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | earhian/imgclsmob | IBNbConvBlock | false | 6,626 | [
"MIT"
] | 1 | c87c0942420876941868c016211073dec4392e4d | https://github.com/earhian/imgclsmob/tree/c87c0942420876941868c016211073dec4392e4d | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""
IBN(b)-ResNet specific convolution block with Instance normalization and ReLU activation.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of outp... |
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
from numpy import *
class Discriminator(nn.Module):
"""docstring for Discriminator"""
def __init__(self, in_dim, out_dim):
super(Discriminator, self).__init__()
self.Linear1 = nn.Linear(in_dim, out_dim)
self.Relu = nn.ReLU()
self.Linear2 = nn... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from nu... | ducviet00/HMER | Discriminator | false | 6,627 | [
"MIT"
] | 1 | 0fa322ed35412737a24ec3955c9a3d96d1989bd4 | https://github.com/ducviet00/HMER/tree/0fa322ed35412737a24ec3955c9a3d96d1989bd4 | import torch
import torch.nn as nn
from numpy import *
class Model(nn.Module):
"""docstring for Discriminator"""
def __init__(self, in_dim, out_dim):
super().__init__()
self.Linear1 = nn.Linear(in_dim, out_dim)
self.Relu = nn.ReLU()
self.Linear2 = nn.Linear(out_dim, 1)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.