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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
FeedForward_NN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 FeedForward_NN(nn.Module):
def __init__(self, input_size, hidden_layer, output_size):
super(FeedForward_NN, self).__init__()
self.layer1 = nn.Linear(input_size, hidden_layer)
self.relu = nn.ReLU()
self.layer2 = nn.Linear(hidden_layer, outpu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | AqibJavaid899/PyTorch_Models | FeedForward_NN | false | 11,204 | [
"MIT"
] | 0 | cf81f6ef5d81aed76dca3f1a15be1a308b5d450f | https://github.com/AqibJavaid899/PyTorch_Models/tree/cf81f6ef5d81aed76dca3f1a15be1a308b5d450f | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_size, hidden_layer, output_size):
super().__init__()
self.layer1 = nn.Linear(input_size, hidden_layer)
self.relu = nn.ReLU()
self.layer2 = nn.Linear(hidden_layer, output_size)
def forward(self... |
SpatialGatherModule | # 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._C
import torch.serialization
class SpatialGatherModule(nn.Module):
"""Aggregate the context features according to the initial predicted
probability distribution.
Employ the soft-weighted method to aggregate the context.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | AlexanderDokuchaev/mmsegmentation | SpatialGatherModule | false | 11,205 | [
"Apache-2.0"
] | 0 | 0c443ee370cce6227661b802184072174c4e3f64 | https://github.com/AlexanderDokuchaev/mmsegmentation/tree/0c443ee370cce6227661b802184072174c4e3f64 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch._C
import torch.serialization
class Model(nn.Module):
"""Aggregate the context features according to the initial predicted
probability distribution.
Employ the soft-weighted method to aggregate the context.
"""
def _... |
BalancedL1Loss | # 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 as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
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
from torch._inductor.runtime.triton_helpers import math as tl_math
import functools
impor... | AtticusJohnson/mmdetection | BalancedL1Loss | false | 11,206 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import functools
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tenso... |
WeightNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class WeightNet(nn.Module):
"""WeightNet in Temporal interlace module.
The WeightNet consists of two parts: one convolution layer
and a sigmoid function. Following the convolution layer, the sigmoid
function and rescale module can scale our output to the range (0, 2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Alexis-Fab/mmaction2 | WeightNet | false | 11,207 | [
"Apache-2.0"
] | 0 | 6f76bb465a7164f907318cf58f77fc3d613f8f0f | https://github.com/Alexis-Fab/mmaction2/tree/6f76bb465a7164f907318cf58f77fc3d613f8f0f | import torch
import torch.nn as nn
class Model(nn.Module):
"""WeightNet in Temporal interlace module.
The WeightNet consists of two parts: one convolution layer
and a sigmoid function. Following the convolution layer, the sigmoid
function and rescale module can scale our output to the range (0, 2).
... |
NN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NN(nn.Module):
def __init__(self, input, hidden, output):
super(NN, self).__init__()
self.lin1 = nn.Linear(input, hidden)
self.lin2 = nn.Linear(hidden, output)
def forward(self, X):
out = torch.sigmoid(self.lin1(X))
out = torch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | AqibJavaid899/PyTorch_Models | NN | false | 11,208 | [
"MIT"
] | 0 | cf81f6ef5d81aed76dca3f1a15be1a308b5d450f | https://github.com/AqibJavaid899/PyTorch_Models/tree/cf81f6ef5d81aed76dca3f1a15be1a308b5d450f | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input, hidden, output):
super().__init__()
self.lin1 = nn.Linear(input, hidden)
self.lin2 = nn.Linear(hidden, output)
def forward(self, X):
out = torch.sigmoid(self.lin1(X))
out = torch.sigm... |
TorchModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class TorchLinearModule(torch.nn.Module):
def __init__(self, in_size, out_size):
super(TorchLinearModule, self).__init__()
self._linear = torch.nn.Linear(in_size, out_size)
def forward(self, x):
return self._linear(x)
class TorchModule(torch.nn.Module):... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn
ass... | AnimeshGurjar/ivy | TorchModule | false | 11,209 | [
"Apache-2.0"
] | 0 | e598872d96b8f7a1db461f005bec99cd0400ecec | https://github.com/AnimeshGurjar/ivy/tree/e598872d96b8f7a1db461f005bec99cd0400ecec | import torch
import torch.nn
class TorchLinearModule(torch.nn.Module):
def __init__(self, in_size, out_size):
super().__init__()
self._linear = torch.nn.Linear(in_size, out_size)
def forward(self, x):
return self._linear(x)
class Model(torch.nn.Module):
def __init__(self, in_s... |
BinaryLogisticRegressionLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def binary_logistic_regression_loss(reg_score, label, threshold=0.5,
ratio_range=(1.05, 21), eps=1e-05):
"""Binary Logistic Regression Loss."""
label = label.view(-1)
reg_score = reg_score.contiguous().view(-1)
pmask = (label > threshold).float()
num_positive... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | Alexis-Fab/mmaction2 | BinaryLogisticRegressionLoss | false | 11,210 | [
"Apache-2.0"
] | 0 | 6f76bb465a7164f907318cf58f77fc3d613f8f0f | https://github.com/Alexis-Fab/mmaction2/tree/6f76bb465a7164f907318cf58f77fc3d613f8f0f | import torch
import torch.nn as nn
def binary_logistic_regression_loss(reg_score, label, threshold=0.5,
ratio_range=(1.05, 21), eps=1e-05):
"""Binary Logistic Regression Loss."""
label = label.view(-1)
reg_score = reg_score.contiguous().view(-1)
pmask = (label > threshold).float()
num_positive... |
CrossEntropyLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss 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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | AtticusJohnson/mmdetection | CrossEntropyLoss | false | 11,211 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
... |
OutConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 OutConv(nn.Module):
def __init__(self, in_channels, out_channels):
super(OutConv, self).__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1)
def forward(self, x):
return self.conv(x)
def get_inputs():
return [torch.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | AtharvBhat/EstimateDepth | OutConv | false | 11,212 | [
"MIT"
] | 0 | f440a9e8372ca2346cae8634f396bac06d004bf7 | https://github.com/AtharvBhat/EstimateDepth/tree/f440a9e8372ca2346cae8634f396bac06d004bf7 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1)
def forward(self, x):
return self.conv(x)
def get_inputs():
return [torch.rand([4, 4, 4, ... |
OffsetNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class OffsetNet(nn.Module):
"""OffsetNet in Temporal interlace module.
The OffsetNet consists of one convolution layer and two fc layers
with a relu activation following with a sigmoid function. Following
the convolution layer, two fc layers and relu are applied to ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Alexis-Fab/mmaction2 | OffsetNet | false | 11,213 | [
"Apache-2.0"
] | 0 | 6f76bb465a7164f907318cf58f77fc3d613f8f0f | https://github.com/Alexis-Fab/mmaction2/tree/6f76bb465a7164f907318cf58f77fc3d613f8f0f | import torch
import torch.nn as nn
class Model(nn.Module):
"""OffsetNet in Temporal interlace module.
The OffsetNet consists of one convolution layer and two fc layers
with a relu activation following with a sigmoid function. Following
the convolution layer, two fc layers and relu are applied to the ... |
PFF | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 PFF(nn.Module):
def __init__(self, model_dimension, width_mult=4):
super().__init__()
self.linear1 = nn.Linear(model_dimension, width_mult * model_dimension)
self.linear2 = nn.Linear(width_mult * model_dimension, model_dimension)
self.norm ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | AmitNikhade/MyTransformer | PFF | false | 11,214 | [
"Apache-2.0"
] | 0 | d717ee1db59ba60bb6b3f1b8a705f6ebed6df1e5 | https://github.com/AmitNikhade/MyTransformer/tree/d717ee1db59ba60bb6b3f1b8a705f6ebed6df1e5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model_dimension, width_mult=4):
super().__init__()
self.linear1 = nn.Linear(model_dimension, width_mult * model_dimension)
self.linear2 = nn.Linear(width_mult * model_dimension, model_dimension)
self.nor... |
BertLayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 BertLayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(BertLayerNorm, self).__init__()
self.weight = nn.Parameter(torch.ones(hidden_s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | AterhiM/BERT-E2E-ABSA | BertLayerNorm | false | 11,215 | [
"Apache-2.0"
] | 0 | 9266a851fd1d7164eb0fc422d3f5eb02e474080b | https://github.com/AterhiM/BERT-E2E-ABSA/tree/9266a851fd1d7164eb0fc422d3f5eb02e474080b | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, hidden_size, eps=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super().__init__()
self.weight = nn.Parameter(torch.ones(hidden_size))
self.bias = n... |
GHMR | # 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 GHMR(nn.Module):
"""GHM Regression Loss.
Details of the theorem can be viewed in the paper
"Gradient Harmonized Single-stage Detector"
https://arxiv.org/abs/1811.05181
Args:
mu (float): The parameter for the Authentic Smooth L1 loss.
bins ... | 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... | AtticusJohnson/mmdetection | GHMR | false | 11,216 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import torch
import torch.nn as nn
class Model(nn.Module):
"""GHM Regression Loss.
Details of the theorem can be viewed in the paper
"Gradient Harmonized Single-stage Detector"
https://arxiv.org/abs/1811.05181
Args:
mu (float): The parameter for the Authentic Smooth L1 loss.
bins... |
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
class SEModule(nn.Module):
def __init__(self, channels, reduction):
super().__init__()
self.avg_pool = nn.AdaptiveAvgPool3d(1)
self.bottleneck = self._round_width(channels, reduction)
self.fc1 = nn.Conv3d(channels, self.bottleneck, kernel_size=1,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Alexis-Fab/mmaction2 | SEModule | false | 11,217 | [
"Apache-2.0"
] | 0 | 6f76bb465a7164f907318cf58f77fc3d613f8f0f | https://github.com/Alexis-Fab/mmaction2/tree/6f76bb465a7164f907318cf58f77fc3d613f8f0f | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, channels, reduction):
super().__init__()
self.avg_pool = nn.AdaptiveAvgPool3d(1)
self.bottleneck = self._round_width(channels, reduction)
self.fc1 = nn.Conv3d(channels, self.bottleneck, kernel_size=1,
... |
GHMC | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
def _expand_onehot_labels(labels, label_weights, label_channels):
bin_labels = labels.new_full((labels.size(0), label_channels), 0)
inds = torch.nonzero((labels >= 0) & (labels < label_channels),
as_tuple=False).squeeze()
if inds.n... | 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
... | AtticusJohnson/mmdetection | GHMC | false | 11,218 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import torch
import torch.nn as nn
import torch.nn.functional as F
def _expand_onehot_labels(labels, label_weights, label_channels):
bin_labels = labels.new_full((labels.size(0), label_channels), 0)
inds = torch.nonzero((labels >= 0) & (labels < label_channels),
as_tuple=False).squeeze()
if inds.n... |
EmbedE | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.functional import F
class EmbedE(nn.Module):
def __init__(self, l_in, l_h, l_g):
super(EmbedE, self).__init__()
self.fc = nn.Linear(l_in, l_h * l_g)
def forward(self, h):
h = F.relu(self.fc(h))
return h
def get_inputs():
retu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | AnnaNikitaML/GraphConvolutionalNetwork | EmbedE | false | 11,219 | [
"MIT"
] | 0 | 2f3153b82fad10cdd33d261a77e08f77fa37d36a | https://github.com/AnnaNikitaML/GraphConvolutionalNetwork/tree/2f3153b82fad10cdd33d261a77e08f77fa37d36a | import torch
from torch import nn
from torch.functional import F
class Model(nn.Module):
def __init__(self, l_in, l_h, l_g):
super().__init__()
self.fc = nn.Linear(l_in, l_h * l_g)
def forward(self, h):
h = F.relu(self.fc(h))
return h
def get_inputs():
return [torch.ran... |
ConvWS2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
def conv_ws_2d(input, weight, bias=None, stride=1, padding=0, dilation=1,
groups=1, eps=1e-05):
c_in = weight.size(0)
weight_flat = weight.view(c_in, -1)
mean = weight_flat.mean(dim=1, keepdim=True).view(c_in, 1, 1, 1)
std = 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.triton_helpers import libdevice
import torch.nn as ... | AtticusJohnson/mmdetection | ConvWS2d | false | 11,220 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import torch
import torch.nn as nn
import torch.nn.functional as F
def conv_ws_2d(input, weight, bias=None, stride=1, padding=0, dilation=1,
groups=1, eps=1e-05):
c_in = weight.size(0)
weight_flat = weight.view(c_in, -1)
mean = weight_flat.mean(dim=1, keepdim=True).view(c_in, 1, 1, 1)
std = weight... |
ConvTemporalGraphical | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ConvTemporalGraphical(nn.Module):
"""The basic module for applying a graph convolution.
Args:
in_channels (int): Number of channels in the input sequence data
out_channels (int): Number of channels produced by the convolution
kernel_size (int):... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Alexis-Fab/mmaction2 | ConvTemporalGraphical | false | 11,221 | [
"Apache-2.0"
] | 0 | 6f76bb465a7164f907318cf58f77fc3d613f8f0f | https://github.com/Alexis-Fab/mmaction2/tree/6f76bb465a7164f907318cf58f77fc3d613f8f0f | import torch
import torch.nn as nn
class Model(nn.Module):
"""The basic module for applying a graph convolution.
Args:
in_channels (int): Number of channels in the input sequence data
out_channels (int): Number of channels produced by the convolution
kernel_size (int): Size of the gra... |
L1Loss | # 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 torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss ten... | 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... | AtticusJohnson/mmdetection | L1Loss | false | 11,222 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss ten... |
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
class Model(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim):
super(Model, self).__init__()
self.layer1 = nn.Linear(input_dim, hidden_dim)
self.sigmoid = nn.Sigmoid()
self.layer2 = nn.Linear(hidden_dim, output_dim)
def forwa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | AyushSomani001/CreditCardFraud | Model | false | 11,223 | [
"MIT"
] | 0 | 015d4992e543889edb6a47ba13d997ace8d1c51c | https://github.com/AyushSomani001/CreditCardFraud/tree/015d4992e543889edb6a47ba13d997ace8d1c51c | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim):
super(Model, self).__init__()
self.layer1 = nn.Linear(input_dim, hidden_dim)
self.sigmoid = nn.Sigmoid()
self.layer2 = nn.Linear(hidden_dim, output_dim)
def forwa... |
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
import torch.nn as nn
class GlobalAvgPool2d(nn.Module):
def __init__(self):
"""Global average pooling over the input's spatial dimensions"""
super(GlobalAvgPool2d, self).__init__()
def forward(self, inputs):
in_size = inputs.size()
return inputs.view((in_size[0],... | 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... | AwaleSajil/BiSeNet | GlobalAvgPool2d | false | 11,224 | [
"MIT"
] | 0 | 2724941ef4052224c5581e6e42389e71a7c5cd5d | https://github.com/AwaleSajil/BiSeNet/tree/2724941ef4052224c5581e6e42389e71a7c5cd5d | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
"""Global average pooling over the input's spatial dimensions"""
super().__init__()
def forward(self, inputs):
in_size = inputs.size()
return inputs.view((in_size[0], in_size[1], -1)).mean(dim=2)
... |
L2Norm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 L2Norm(nn.Module):
def __init__(self, n_dims, scale=20.0, eps=1e-10):
super(L2Norm, self).__init__()
self.n_dims = n_dims
self.weight = nn.Parameter(torch.Tensor(self.n_dims))
self.eps = eps
self.scale = scale
def forward(self,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | AtticusJohnson/mmdetection | L2Norm | false | 11,225 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, n_dims, scale=20.0, eps=1e-10):
super().__init__()
self.n_dims = n_dims
self.weight = nn.Parameter(torch.Tensor(self.n_dims))
self.eps = eps
self.scale = scale
def forward(self, x):
... |
BMNLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
def binary_logistic_regression_loss(reg_score, label, threshold=0.5,
ratio_range=(1.05, 21), eps=1e-05):
"""Binary Logistic Regression Loss."""
label = label.view(-1)
reg_score = reg_score.contiguous().view(-1)
pmask = (label > thr... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_ma... | Alexis-Fab/mmaction2 | BMNLoss | false | 11,226 | [
"Apache-2.0"
] | 0 | 6f76bb465a7164f907318cf58f77fc3d613f8f0f | https://github.com/Alexis-Fab/mmaction2/tree/6f76bb465a7164f907318cf58f77fc3d613f8f0f | import torch
import torch.nn.functional as F
import torch.nn as nn
def binary_logistic_regression_loss(reg_score, label, threshold=0.5,
ratio_range=(1.05, 21), eps=1e-05):
"""Binary Logistic Regression Loss."""
label = label.view(-1)
reg_score = reg_score.contiguous().view(-1)
pmask = (label > thr... |
AffineChannel2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
from torch import nn
class AffineChannel2d(nn.Module):
""" A simple channel-wise affine transformation operation """
def __init__(self, num_channels, eps=1e-05):
super().__init__()
self.num_channels = num_channels
self.eps = eps
self.weight... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._... | BUPT-PRIV/detectron2 | AffineChannel2d | false | 11,227 | [
"Apache-2.0"
] | 0 | 3163664cd5f43d50ea1966f410dc82410b9ccbf4 | https://github.com/BUPT-PRIV/detectron2/tree/3163664cd5f43d50ea1966f410dc82410b9ccbf4 | import torch
import torch.utils.data
from torch import nn
class Model(nn.Module):
""" A simple channel-wise affine transformation operation """
def __init__(self, num_channels, eps=1e-05):
super().__init__()
self.num_channels = num_channels
self.eps = eps
self.weight = nn.Para... |
Accuracy | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
class Accuracy(nn.Module):
def __init__(self):
super().__init__()
def forward(self, prediction, target, mask=None, token_dim=-1,
sequence_dim=-2):
prediction = F.softmax(prediction, token_dim).argmax(sequence_dim)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | BShennette/Pno-ai | Accuracy | false | 11,228 | [
"MIT"
] | 0 | 486434bfb40887d06e3d12a66831b9e0e7d020c2 | https://github.com/BShennette/Pno-ai/tree/486434bfb40887d06e3d12a66831b9e0e7d020c2 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, prediction, target, mask=None, token_dim=-1,
sequence_dim=-2):
prediction = F.softmax(prediction, token_dim).argmax(sequence_dim)
... |
TripletLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
class TripletLoss(nn.Module):
"""
Triplet loss
Takes embeddings of an anchor sample, a positive sample and a negative sample
"""
def __init__(self, margin):
super(TripletLoss, self).__init__()
self.margin = margin
... | 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... | AytacKahveci/siamese-triplet | TripletLoss | false | 11,229 | [
"BSD-3-Clause"
] | 0 | 09860e36d934bb1773a4d49dbad183a5152cb0b0 | https://github.com/AytacKahveci/siamese-triplet/tree/09860e36d934bb1773a4d49dbad183a5152cb0b0 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Triplet loss
Takes embeddings of an anchor sample, a positive sample and a negative sample
"""
def __init__(self, margin):
super().__init__()
self.margin = margin
def forward(self, ... |
ContrastiveLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
class ContrastiveLoss(nn.Module):
"""
Contrastive loss
Takes embeddings of two samples and a target label == 1 if samples are from the same class and label == 0 otherwise
"""
def __init__(self, margin):
super(ContrastiveLo... | 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... | AytacKahveci/siamese-triplet | ContrastiveLoss | false | 11,230 | [
"BSD-3-Clause"
] | 0 | 09860e36d934bb1773a4d49dbad183a5152cb0b0 | https://github.com/AytacKahveci/siamese-triplet/tree/09860e36d934bb1773a4d49dbad183a5152cb0b0 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Contrastive loss
Takes embeddings of two samples and a target label == 1 if samples are from the same class and label == 0 otherwise
"""
def __init__(self, margin):
super().__init__()
se... |
MSELoss | # 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 torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss ten... | 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 functools
import torch.nn as nn
import torch.nn.functional as F
assert_size_stride... | AtticusJohnson/mmdetection | MSELoss | false | 11,231 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss ten... |
Net | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 5 * 5, 120)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | AlexHoffman9/HAET-2021-competition-baseline-code | Net | false | 11,232 | [
"MIT"
] | 0 | 1d71c94c68c9903854eceda6caf07442930caa44 | https://github.com/AlexHoffman9/HAET-2021-competition-baseline-code/tree/1d71c94c68c9903854eceda6caf07442930caa44 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 5 * 5, 120)
s... |
ConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 5 * 5,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | AndrewAltimit/Scene-Classification-AWS-Serverless | ConvNet | false | 11,234 | [
"MIT"
] | 0 | caa4bff102987338dcfa597b9ec1638e6e5e63f5 | https://github.com/AndrewAltimit/Scene-Classification-AWS-Serverless/tree/caa4bff102987338dcfa597b9ec1638e6e5e63f5 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 5 * 5, 120)
s... |
CustomizedLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 CustomizedLayer(nn.Module):
def __init__(self, in_dim):
super().__init__()
self.in_dim = in_dim
self.scale = nn.Parameter(torch.Tensor(self.in_dim))
self.bias = nn.Parameter(torch.Tensor(self.in_dim))
def forwar... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dy... | B06901052/Torch-Pruning | CustomizedLayer | false | 11,235 | [
"MIT"
] | 0 | 43c99e1ea6039c7641e01cd7527492d69bfce35a | https://github.com/B06901052/Torch-Pruning/tree/43c99e1ea6039c7641e01cd7527492d69bfce35a | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, in_dim):
super().__init__()
self.in_dim = in_dim
self.scale = nn.Parameter(torch.Tensor(self.in_dim))
self.bias = nn.Parameter(torch.Tensor(self.in_dim))
def forward(self, x)... |
DoubleResolutionLayer | # 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 DoubleResolutionLayer(nn.Module):
def forward(self, x):
x = nn.functional.interpolate(x, scale_factor=2, mode='nearest')
return x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | BeningSobariah/ark-stroller | DoubleResolutionLayer | false | 11,236 | [
"Apache-2.0"
] | 0 | af2036a1726523d5aca9b1040bfc1fad5c3420f2 | https://github.com/BeningSobariah/ark-stroller/tree/af2036a1726523d5aca9b1040bfc1fad5c3420f2 | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x):
x = nn.functional.interpolate(x, scale_factor=2, mode='nearest')
return x
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... | from torch.nn import Module
import torch
from torch.nn import Conv2d
from torch.nn import Dropout2d
from torch.nn import Linear
from torch.nn.functional import relu
from torch.nn.functional import max_pool2d
from torch.nn.functional import log_softmax
from torch import flatten
class Net(Module):
def __init__(sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | AhmetTavli/Olivetti-CNN | Net | false | 11,237 | [
"MIT"
] | 0 | 174747382f17e02c0e5f964d08a449429ac6fbd8 | https://github.com/AhmetTavli/Olivetti-CNN/tree/174747382f17e02c0e5f964d08a449429ac6fbd8 | from torch.nn import Module
import torch
from torch.nn import Conv2d
from torch.nn import Dropout2d
from torch.nn import Linear
from torch.nn.functional import relu
from torch.nn.functional import max_pool2d
from torch.nn.functional import log_softmax
from torch import flatten
class Model(Module):
def __init__(s... |
IIDIsotropicGaussianUVLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.utils.data
import torch.nn.functional as F
from torch import nn
class IIDIsotropicGaussianUVLoss(nn.Module):
"""
Loss for the case of iid residuals with isotropic covariance:
$Sigma_i = sigma_i^2 I$
The loss (negative log likelihood) is then:
$1/2 sum_{i=1}^n ... | 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 math... | BUPT-PRIV/detectron2 | IIDIsotropicGaussianUVLoss | false | 11,238 | [
"Apache-2.0"
] | 0 | 3163664cd5f43d50ea1966f410dc82410b9ccbf4 | https://github.com/BUPT-PRIV/detectron2/tree/3163664cd5f43d50ea1966f410dc82410b9ccbf4 | import math
import torch
import torch.utils.data
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
"""
Loss for the case of iid residuals with isotropic covariance:
$Sigma_i = sigma_i^2 I$
The loss (negative log likelihood) is then:
$1/2 sum_{i=1}^n (log(2 pi) + 2 log si... |
IndepAnisotropicGaussianUVLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.utils.data
import torch.nn.functional as F
from torch import nn
class IndepAnisotropicGaussianUVLoss(nn.Module):
"""
Loss for the case of independent residuals with anisotropic covariances:
$Sigma_i = sigma_i^2 I + r_i r_i^T$
The loss (negative log likelihood) is ... | 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 math... | BUPT-PRIV/detectron2 | IndepAnisotropicGaussianUVLoss | false | 11,239 | [
"Apache-2.0"
] | 0 | 3163664cd5f43d50ea1966f410dc82410b9ccbf4 | https://github.com/BUPT-PRIV/detectron2/tree/3163664cd5f43d50ea1966f410dc82410b9ccbf4 | import math
import torch
import torch.utils.data
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
"""
Loss for the case of independent residuals with anisotropic covariances:
$Sigma_i = sigma_i^2 I + r_i r_i^T$
The loss (negative log likelihood) is then:
$1/2 sum_{i=1}^... |
SpatialPyramidPooling | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class SpatialPyramidPooling(nn.Module):
def __init__(self, pool_sizes=[5, 9, 13]):
super(SpatialPyramidPooling, self).__init__()
self.maxpools = nn.ModuleList([nn.MaxPool2d(pool_size, 1, pool_size //
2) for pool_size in pool_sizes])
def forward(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | Arcofcosmos/MyYolov4_Pytorch | SpatialPyramidPooling | false | 11,240 | [
"MIT"
] | 0 | 14c445503d0fc69b8a8b64ecdc87256ac4c1fce1 | https://github.com/Arcofcosmos/MyYolov4_Pytorch/tree/14c445503d0fc69b8a8b64ecdc87256ac4c1fce1 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, pool_sizes=[5, 9, 13]):
super().__init__()
self.maxpools = nn.ModuleList([nn.MaxPool2d(pool_size, 1, pool_size //
2) for pool_size in pool_sizes])
def forward(self, x):
features = [maxpool(x) fo... |
PixelNormLayer | # 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 PixelNormLayer(nn.Module):
def __init__(self):
super(PixelNormLayer, self).__init__()
def forward(self, x):
return x / torch.sqrt(torch.mean(x ** 2, dim=1, keepdim=True) + 1e-08)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_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.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | BeningSobariah/ark-stroller | PixelNormLayer | false | 11,241 | [
"Apache-2.0"
] | 0 | af2036a1726523d5aca9b1040bfc1fad5c3420f2 | https://github.com/BeningSobariah/ark-stroller/tree/af2036a1726523d5aca9b1040bfc1fad5c3420f2 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x / torch.sqrt(torch.mean(x ** 2, dim=1, keepdim=True) + 1e-08)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
Convolution | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Convolution(nn.Module):
def __init__(self, c_in, c_out):
super().__init__()
self.conv = nn.Conv2d(c_in, c_out, 3, stride=1, padding=1)
self.relu = nn.ReLU(True)
def forward(self, x):
return self.relu(self.conv(x))
def get_inputs():
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | Baymine/Dassl | Convolution | false | 11,242 | [
"MIT"
] | 0 | 0836fb1f08393e2204326618e783d796741f657e | https://github.com/Baymine/Dassl/tree/0836fb1f08393e2204326618e783d796741f657e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, c_in, c_out):
super().__init__()
self.conv = nn.Conv2d(c_in, c_out, 3, stride=1, padding=1)
self.relu = nn.ReLU(True)
def forward(self, x):
return self.relu(self.conv(x))
def get_inputs():
ret... |
ScaledLeakyReLU | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
class ScaledLeakyReLU(nn.Module):
"""Scaled LeakyReLU.
Args:
negative_slope (float): Negative slope. Default: 0.2.
"""
def __init__(self, negative_slope=0.2):
super(ScaledLeakyReLU, self).__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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | ArdWang/GFPGAN | ScaledLeakyReLU | false | 11,243 | [
"BSD-3-Clause"
] | 0 | f984ec32754190fad0b9b7a60d372aac84e57173 | https://github.com/ArdWang/GFPGAN/tree/f984ec32754190fad0b9b7a60d372aac84e57173 | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
class Model(nn.Module):
"""Scaled LeakyReLU.
Args:
negative_slope (float): Negative slope. Default: 0.2.
"""
def __init__(self, negative_slope=0.2):
super().__init__()
self.negative_slope = ne... |
Prototypes | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
class Prototypes(nn.Module):
def __init__(self, fdim, num_classes, temp=0.05):
super().__init__()
self.prototypes = nn.Linear(fdim, num_classes, bias=False)
self.temp = temp
def forward(self, x):
x = F.no... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Baymine/Dassl | Prototypes | false | 11,244 | [
"MIT"
] | 0 | 0836fb1f08393e2204326618e783d796741f657e | https://github.com/Baymine/Dassl/tree/0836fb1f08393e2204326618e783d796741f657e | import torch
import torch.nn as nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, fdim, num_classes, temp=0.05):
super().__init__()
self.prototypes = nn.Linear(fdim, num_classes, bias=False)
self.temp = temp
def forward(self, x):
x = F.normali... |
SmoothL1Loss | # 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 torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss ten... | 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... | AtticusJohnson/mmdetection | SmoothL1Loss | false | 11,245 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss ten... |
EqualConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
class EqualConv2d(nn.Module):
"""Equalized Linear as StyleGAN2.
Args:
in_channels (int): Channel number of the input.
out_channels (int): Channel number of the output.
kernel_size (int): Size of the co... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | ArdWang/GFPGAN | EqualConv2d | false | 11,246 | [
"BSD-3-Clause"
] | 0 | f984ec32754190fad0b9b7a60d372aac84e57173 | https://github.com/ArdWang/GFPGAN/tree/f984ec32754190fad0b9b7a60d372aac84e57173 | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
class Model(nn.Module):
"""Equalized Linear as StyleGAN2.
Args:
in_channels (int): Channel number of the input.
out_channels (int): Channel number of the output.
kernel_size (int): Size of the convolvi... |
EdgeFeatures | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 EdgeFeatures(nn.Module):
"""Convnet features for edges.
e_ij = U*e_ij + V*(x_i + x_j)
"""
def __init__(self, hidden_dim):
super(EdgeFeatures, self).__init__()
self.U = nn.Linear(hidden_dim, hidden_dim, True)
self.V = nn.Linear(hidden_d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | BrandonKates/graph-convnet-tsp | EdgeFeatures | false | 11,247 | [
"MIT"
] | 0 | f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | https://github.com/BrandonKates/graph-convnet-tsp/tree/f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Convnet features for edges.
e_ij = U*e_ij + V*(x_i + x_j)
"""
def __init__(self, hidden_dim):
super().__init__()
self.U = nn.Linear(hidden_dim, hidden_dim, True)
self.V = nn.Linear(hidden_dim, hidden_dim, True)
... |
EqualLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
class EqualLinear(nn.Module):
"""Equalized Linear as StyleGAN2.
Args:
in_channels (int): Size of each sample.
out_channels (int): Size of each output sample.
bias (bool): If set to ``False``, the layer... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | ArdWang/GFPGAN | EqualLinear | false | 11,248 | [
"BSD-3-Clause"
] | 0 | f984ec32754190fad0b9b7a60d372aac84e57173 | https://github.com/ArdWang/GFPGAN/tree/f984ec32754190fad0b9b7a60d372aac84e57173 | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
class Model(nn.Module):
"""Equalized Linear as StyleGAN2.
Args:
in_channels (int): Size of each sample.
out_channels (int): Size of each output sample.
bias (bool): If set to ``False``, the layer will ... |
L2Norm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 itertools import product as product
import torch.nn.init as init
class L2Norm(nn.Module):
def __init__(self, n_channels, scale):
super(L2Norm, self).__init__()
self.n_channels = n_channels
self.gamma = scale or None
self.eps = 1e-10
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
from itertools import product as product
import torch.nn.... | AnupKumarGupta/syncnet_python | L2Norm | false | 11,249 | [
"MIT"
] | 0 | 932b4621cf6aa090baac7c7de22d0649bde9fbbd | https://github.com/AnupKumarGupta/syncnet_python/tree/932b4621cf6aa090baac7c7de22d0649bde9fbbd | import torch
import torch.nn as nn
from itertools import product as product
import torch.nn.init as init
class Model(nn.Module):
def __init__(self, n_channels, scale):
super().__init__()
self.n_channels = n_channels
self.gamma = scale or None
self.eps = 1e-10
self.weight =... |
NormStyleCode | # 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 NormStyleCode(nn.Module):
def forward(self, x):
"""Normalize the style codes.
Args:
x (Tensor): Style codes with shape (b, c).
Returns:
Tensor: Normalized tensor.
"""
return x * torch.rsqrt(torch.mean(x ** ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | ArdWang/GFPGAN | NormStyleCode | false | 11,250 | [
"BSD-3-Clause"
] | 0 | f984ec32754190fad0b9b7a60d372aac84e57173 | https://github.com/ArdWang/GFPGAN/tree/f984ec32754190fad0b9b7a60d372aac84e57173 | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x):
"""Normalize the style codes.
Args:
x (Tensor): Style codes with shape (b, c).
Returns:
Tensor: Normalized tensor.
"""
return x * torch.rsqrt(torch.mean(x ** 2, dim=1... |
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
class Sine(nn.Module):
def __init__(self, w0: 'float'=30.0):
super(Sine, self).__init__()
self.w0 = w0
def forward(self, x: 'torch.Tensor') ->torch.Tensor:
return torch.sin(self.w0 * x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | CGruich/ocp | Sine | false | 11,251 | [
"MIT",
"BSD-3-Clause"
] | 0 | dd97972b39d4a05e37f745e393a5245657ef5f9e | https://github.com/CGruich/ocp/tree/dd97972b39d4a05e37f745e393a5245657ef5f9e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, w0: 'float'=30.0):
super().__init__()
self.w0 = w0
def forward(self, x: 'torch.Tensor') ->torch.Tensor:
return torch.sin(self.w0 * x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init... |
Combiner | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
def FC(shape=None, init=None):
if init is None:
K = shape[-2]
init = [torch.rand(shape) * 2 - 1]
shape_bias = shape.copy()
shape_bias[-2] = 1
init.append(torch.rand(shape_bias) * 2 - 1)
else:
K = init[0].shap... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | BaharAzari/EquiGenDyna | Combiner | false | 11,252 | [
"MIT"
] | 0 | 1f71d9f7bf278880c61ceacec705bbb23852227c | https://github.com/BaharAzari/EquiGenDyna/tree/1f71d9f7bf278880c61ceacec705bbb23852227c | import torch
import numpy as np
import torch.nn as nn
def FC(shape=None, init=None):
if init is None:
K = shape[-2]
init = [torch.rand(shape) * 2 - 1]
shape_bias = shape.copy()
shape_bias[-2] = 1
init.append(torch.rand(shape_bias) * 2 - 1)
else:
K = init[0].shap... |
GaussianSmearing | # 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 GaussianSmearing(nn.Module):
def __init__(self, in_features, start=0, end=1, num_freqs=50):
super(GaussianSmearing, self).__init__()
self.num_freqs = num_freqs
offset = torch.linspace(start, end, num_freqs)
self.coeff = -0.5 / (offset[1] - ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | CGruich/ocp | GaussianSmearing | false | 11,253 | [
"MIT",
"BSD-3-Clause"
] | 0 | dd97972b39d4a05e37f745e393a5245657ef5f9e | https://github.com/CGruich/ocp/tree/dd97972b39d4a05e37f745e393a5245657ef5f9e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_features, start=0, end=1, num_freqs=50):
super().__init__()
self.num_freqs = num_freqs
offset = torch.linspace(start, end, num_freqs)
self.coeff = -0.5 / (offset[1] - offset[0]).item() ** 2
se... |
AttnConnector | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 AttnConnector(nn.Module):
def __init__(self, rnn_cell, query_size, key_size, content_size,
output_size, attn_size):
super(AttnConnector, self).__init__()
self.query_embed = nn.Linear(query_size, attn_size)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | BinLiu777/NeuralDialog-LAED | AttnConnector | false | 11,256 | [
"Apache-2.0"
] | 0 | 3f52a75e5bcb314e567cafe94925cca32ccfbba1 | https://github.com/BinLiu777/NeuralDialog-LAED/tree/3f52a75e5bcb314e567cafe94925cca32ccfbba1 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, rnn_cell, query_size, key_size, content_size,
output_size, attn_size):
super().__init__()
self.query_embed = nn.Linear(query_size, attn_size)
self.key_embed = nn.Linear(ke... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Actor(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | BruceChanJianLe/drlnd-tennis-project3 | Actor | false | 11,257 | [
"MIT"
] | 0 | cb2b880c55eedb6eef3775ed19e90aeec60174d8 | https://github.com/BruceChanJianLe/drlnd-tennis-project3/tree/cb2b880c55eedb6eef3775ed19e90aeec60174d8 | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Model(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, f... |
ATLoss | # 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 as nn
import torch.nn.functional as F
class ATLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, logits: 'Tensor', labels: 'Tensor') ->float:
"""
Args:
logits: predicted probabilities (shape: bat... | 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 Tens... | BunnyNoBugs/DeepPavlov | ATLoss | false | 11,258 | [
"Apache-2.0"
] | 0 | b2213db633a669d27d6f745dd780530574ccf8b5 | https://github.com/BunnyNoBugs/DeepPavlov/tree/b2213db633a669d27d6f745dd780530574ccf8b5 | import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, logits: 'Tensor', labels: 'Tensor') ->float:
"""
Args:
logits: predicted probabilities (shape: batc... |
BatchNormNode | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 BatchNormNode(nn.Module):
"""Batch normalization for node features.
"""
def __init__(self, hidden_dim):
super(BatchNormNode, self).__init__()
self.batch_norm = nn.BatchNorm1d(hidden_dim, track_running_stats=False)
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.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | BrandonKates/graph-convnet-tsp | BatchNormNode | false | 11,259 | [
"MIT"
] | 0 | f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | https://github.com/BrandonKates/graph-convnet-tsp/tree/f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Batch normalization for node features.
"""
def __init__(self, hidden_dim):
super().__init__()
self.batch_norm = nn.BatchNorm1d(hidden_dim, track_running_stats=False)
def forward(self, x):
"""
Args:
... |
BatchNormEdge | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 BatchNormEdge(nn.Module):
"""Batch normalization for edge features.
"""
def __init__(self, hidden_dim):
super(BatchNormEdge, self).__init__()
self.batch_norm = nn.BatchNorm2d(hidden_dim, track_running_stats=False)
def forward(self, e):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | BrandonKates/graph-convnet-tsp | BatchNormEdge | false | 11,260 | [
"MIT"
] | 0 | f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | https://github.com/BrandonKates/graph-convnet-tsp/tree/f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Batch normalization for edge features.
"""
def __init__(self, hidden_dim):
super().__init__()
self.batch_norm = nn.BatchNorm2d(hidden_dim, track_running_stats=False)
def forward(self, e):
"""
Args:
... |
GlobalAttentionGeneral | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.onnx
def conv1x1(in_planes, out_planes, bias=False):
"""1x1 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=1,
padding=0, bias=bias)
class GlobalAttentionGeneral(nn.Module):
def __... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Amritds/AttnGAN | GlobalAttentionGeneral | false | 11,261 | [
"MIT"
] | 0 | 806ae70142a699bfe384c4964be2f7fce2b83d29 | https://github.com/Amritds/AttnGAN/tree/806ae70142a699bfe384c4964be2f7fce2b83d29 | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.onnx
def conv1x1(in_planes, out_planes, bias=False):
"""1x1 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=1,
padding=0, bias=bias)
class Model(nn.Module):
def __init__(self, idf,... |
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.utils.data
class Hswish(nn.Module):
def __init__(self, inplace=True):
super(Hswish, self).__init__()
self.relu = nn.ReLU6(inplace=inplace)
def forward(self, x):
return self.relu(x + 3) / 6
def get_inputs():
return [torch.rand([4, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guard... | COEN-390/YOLOv5-Lite | Hswish | false | 11,262 | [
"MIT"
] | 0 | 06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | https://github.com/COEN-390/YOLOv5-Lite/tree/06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, inplace=True):
super().__init__()
self.relu = nn.ReLU6(inplace=inplace)
def forward(self, x):
return self.relu(x + 3) / 6
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
... |
ADD | # 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 ADD(nn.Module):
def __init__(self, alpha=0.5):
super(ADD, self).__init__()
self.a = alpha
def forward(self, x):
return torch.add(x, self.a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | COEN-390/YOLOv5-Lite | ADD | false | 11,263 | [
"MIT"
] | 0 | 06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | https://github.com/COEN-390/YOLOv5-Lite/tree/06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, alpha=0.5):
super().__init__()
self.a = alpha
def forward(self, x):
return torch.add(x, self.a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
... |
NodeFeatures | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NodeFeatures(nn.Module):
"""Convnet features for nodes.
Using `sum` aggregation:
x_i = U*x_i + sum_j [ gate_ij * (V*x_j) ]
Using `mean` aggregation:
x_i = U*x_i + ( sum_j [ gate_ij * (V*x_j) ] / sum_j [ gate_ij] )
"""
def __init_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | BrandonKates/graph-convnet-tsp | NodeFeatures | false | 11,264 | [
"MIT"
] | 0 | f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | https://github.com/BrandonKates/graph-convnet-tsp/tree/f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Convnet features for nodes.
Using `sum` aggregation:
x_i = U*x_i + sum_j [ gate_ij * (V*x_j) ]
Using `mean` aggregation:
x_i = U*x_i + ( sum_j [ gate_ij * (V*x_j) ] / sum_j [ gate_ij] )
"""
def __init__(self,... |
L2Norm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 L2Norm(nn.Module):
def __init__(self, n_channels, scale=1.0):
super(L2Norm, self).__init__()
self.n_channels = n_channels
self.scale = scale
self.eps = 1e-10
self.weight = nn.Parameter(torch.Tensor(self.n_channels))
self.wei... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | CCC-123/ECCVC | L2Norm | false | 11,265 | [
"MIT"
] | 0 | 322009a3423dba831cb3ae4182e7129be3441e70 | https://github.com/CCC-123/ECCVC/tree/322009a3423dba831cb3ae4182e7129be3441e70 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, n_channels, scale=1.0):
super().__init__()
self.n_channels = n_channels
self.scale = scale
self.eps = 1e-10
self.weight = nn.Parameter(torch.Tensor(self.n_channels))
self.weight.data *= 0... |
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):
"""Critic (Value) Model."""
def __init__(self, state_size, action_size, seed, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | BruceChanJianLe/drlnd-tennis-project3 | Critic | false | 11,266 | [
"MIT"
] | 0 | cb2b880c55eedb6eef3775ed19e90aeec60174d8 | https://github.com/BruceChanJianLe/drlnd-tennis-project3/tree/cb2b880c55eedb6eef3775ed19e90aeec60174d8 | 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):
"""Critic (Value) Model."""
def __init__(self, state_size, action_size, seed, f... |
SuperpointDescriptor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SuperpointDescriptor(nn.Module):
""" Descriptor decoder based on the SuperPoint arcihtecture. """
def __init__(self, input_feat_dim=128):
super(SuperpointDescriptor, self).__init__()
self.relu = torch.nn.ReLU(inplace=True)
self.convPa = torch.n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | B1ueber2y/SOLD2 | SuperpointDescriptor | false | 11,267 | [
"MIT"
] | 0 | f85ca5387ea7464314614c3fb4d07af5678a9de3 | https://github.com/B1ueber2y/SOLD2/tree/f85ca5387ea7464314614c3fb4d07af5678a9de3 | import torch
import torch.nn as nn
class Model(nn.Module):
""" Descriptor decoder based on the SuperPoint arcihtecture. """
def __init__(self, input_feat_dim=128):
super().__init__()
self.relu = torch.nn.ReLU(inplace=True)
self.convPa = torch.nn.Conv2d(input_feat_dim, 256, kernel_size... |
LinearBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
import torch.nn.init
import torch.optim
class Model(nn.Module):
""" Class representing sampleable neural network model """
def num_params(self):
""" Get the number of model parameters. """
return sum(p.numel() for p in self.parameters())
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | CBIIT/NCI-DOE-Colab-Pilot1-Combo | LinearBlock | false | 11,268 | [
"MIT"
] | 0 | 8d60900c29618083e0944b5b8ef43a2e98881b32 | https://github.com/CBIIT/NCI-DOE-Colab-Pilot1-Combo/tree/8d60900c29618083e0944b5b8ef43a2e98881b32 | import torch
import torch.nn as nn
import torch.nn
import torch.nn.init
import torch.optim
class Model(nn.Module):
""" Class representing sampleable neural network model """
def num_params(self):
""" Get the number of model parameters. """
return sum(p.numel() for p in self.parameters())
... |
Encoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
import torch.nn.init
import torch.optim
class Model(nn.Module):
""" Class representing sampleable neural network model """
def num_params(self):
""" Get the number of model parameters. """
return sum(p.numel() for p in self.parameters())
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | CBIIT/NCI-DOE-Colab-Pilot1-Combo | Encoder | false | 11,269 | [
"MIT"
] | 0 | 8d60900c29618083e0944b5b8ef43a2e98881b32 | https://github.com/CBIIT/NCI-DOE-Colab-Pilot1-Combo/tree/8d60900c29618083e0944b5b8ef43a2e98881b32 | import torch
import torch.nn as nn
import torch.nn
import torch.nn.init
import torch.optim
class Model(nn.Module):
""" Class representing sampleable neural network model """
def num_params(self):
""" Get the number of model parameters. """
return sum(p.numel() for p in self.parameters())
... |
LinearDrop | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn
import torch.nn.init
import torch.optim
class Model(nn.Module):
""" Class representing sampleable neural network model """
def num_params(self):
""" Get the number of model parameters. """
return sum(p.numel() ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | CBIIT/NCI-DOE-Colab-Pilot1-Combo | LinearDrop | false | 11,270 | [
"MIT"
] | 0 | 8d60900c29618083e0944b5b8ef43a2e98881b32 | https://github.com/CBIIT/NCI-DOE-Colab-Pilot1-Combo/tree/8d60900c29618083e0944b5b8ef43a2e98881b32 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn
import torch.nn.init
import torch.optim
class Model(nn.Module):
""" Class representing sampleable neural network model """
def num_params(self):
""" Get the number of model parameters. """
return sum(p.numel() ... |
SuperpointDecoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SuperpointDecoder(nn.Module):
""" Junction decoder based on the SuperPoint architecture. """
def __init__(self, input_feat_dim=128, backbone_name='lcnn'):
super(SuperpointDecoder, self).__init__()
self.relu = torch.nn.ReLU(inplace=True)
if back... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | B1ueber2y/SOLD2 | SuperpointDecoder | false | 11,271 | [
"MIT"
] | 0 | f85ca5387ea7464314614c3fb4d07af5678a9de3 | https://github.com/B1ueber2y/SOLD2/tree/f85ca5387ea7464314614c3fb4d07af5678a9de3 | import torch
import torch.nn as nn
class Model(nn.Module):
""" Junction decoder based on the SuperPoint architecture. """
def __init__(self, input_feat_dim=128, backbone_name='lcnn'):
super().__init__()
self.relu = torch.nn.ReLU(inplace=True)
if backbone_name == 'lcnn':
se... |
skip_connection | # 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 skip_connection(nn.Module):
def __init__(self, inchannel, outchannel, keep_dim=True):
super(skip_connection, self).__init__()
if inchannel != outchannel:
self.conv1d = nn.Conv1d(inchannel, outchannel, 1)
def forward(self, before, after):
... | 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... | CMI-Laboratory/CAE | skip_connection | false | 11,272 | [
"Apache-2.0"
] | 0 | 11c94f2152a51c9d4e86f8956ea75c575094256b | https://github.com/CMI-Laboratory/CAE/tree/11c94f2152a51c9d4e86f8956ea75c575094256b | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, inchannel, outchannel, keep_dim=True):
super().__init__()
if inchannel != outchannel:
self.conv1d = nn.Conv1d(inchannel, outchannel, 1)
def forward(self, before, after):
"""
:param befor... |
LC_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.utils.data
class LC_SEModule(nn.Module):
def __init__(self, channel, reduction=4):
super().__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.conv1 = nn.Conv2d(in_channels=channel, out_channels=channel //
reduction, kernel_s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | COEN-390/YOLOv5-Lite | LC_SEModule | false | 11,273 | [
"MIT"
] | 0 | 06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | https://github.com/COEN-390/YOLOv5-Lite/tree/06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, channel, reduction=4):
super().__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.conv1 = nn.Conv2d(in_channels=channel, out_channels=channel //
reduction, kernel_size=1,... |
Upsample | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Upsample(nn.Module):
def __init__(self, scale_factor=1, mode='nearest'):
super(Upsample, self).__init__()
self.scale_factor = scale_factor
self.mode = mode
def forward(self, x):
return F.interpolate(x, 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | CV-YYDS/YOLOv3 | Upsample | false | 11,274 | [
"MIT"
] | 0 | a433064721dfc932509aaed6cb44a785b24bc768 | https://github.com/CV-YYDS/YOLOv3/tree/a433064721dfc932509aaed6cb44a785b24bc768 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, scale_factor=1, mode='nearest'):
super().__init__()
self.scale_factor = scale_factor
self.mode = mode
def forward(self, x):
return F.interpolate(x, scale_factor=self.... |
Route | # 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 Route(nn.Module):
def __init__(self):
super(Route, self).__init__()
def forward(self, x1, x2):
"""
x1 means previous output; x2 means current output
"""
out = torch.cat((x2, x1), dim=1)
return out
def get_inputs():
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | CV-YYDS/YOLOv3 | Route | false | 11,275 | [
"MIT"
] | 0 | a433064721dfc932509aaed6cb44a785b24bc768 | https://github.com/CV-YYDS/YOLOv3/tree/a433064721dfc932509aaed6cb44a785b24bc768 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x1, x2):
"""
x1 means previous output; x2 means current output
"""
out = torch.cat((x2, x1), dim=1)
return out
def get_inputs():
return [t... |
SEBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class SEBlock(nn.Module):
def __init__(self, input_channels, internal_neurons):
super(SEBlock, self).__init__()
self.down = nn.Conv2d(in_channels=input_channels, out_channels=
internal_neurons, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | COEN-390/YOLOv5-Lite | SEBlock | false | 11,276 | [
"MIT"
] | 0 | 06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | https://github.com/COEN-390/YOLOv5-Lite/tree/06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Model(nn.Module):
def __init__(self, input_channels, internal_neurons):
super().__init__()
self.down = nn.Conv2d(in_channels=input_channels, out_channels=
internal_neurons, kernel_size=1, ... |
Standardize | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch.nn import init
from torch.nn.parameter import Parameter
class Standardize(Module):
"""
Applies (element-wise) standardization with trainable translation parameter μ and scale parameter σ, i.e. computes
(x - μ) / σ where '/' is applied element-wise.
... | 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.nn import Module
from torch.nn import init
from torch.nn.parameter import Parameter
assert_size_stride = torch._C._dynamo.guards.... | COMP6248-Reproducability-Challenge/MoveBrick_Reproducibility_DeepSAD | Standardize | false | 11,277 | [
"MIT"
] | 0 | 8985dc9cd8741010362c6ca51e72648b7bd3908f | https://github.com/COMP6248-Reproducability-Challenge/MoveBrick_Reproducibility_DeepSAD/tree/8985dc9cd8741010362c6ca51e72648b7bd3908f | from torch.nn import Module
import torch
from torch.nn import init
from torch.nn.parameter import Parameter
class Model(Module):
"""
Applies (element-wise) standardization with trainable translation parameter μ and scale parameter σ, i.e. computes
(x - μ) / σ where '/' is applied element-wise.
Args:
... |
GeneralRelu | # 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
from typing import *
class GeneralRelu(nn.Module):
def __init__(self, leak=None, sub=None, maxv=None):
super().__init__()
self.leak, self.sub, self.maxv = leak, sub, maxv
def forward(self, x):
x = F.leaky_relu(x, self... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from typing import *
assert_size_stride = torch._C._dynamo.guards.a... | Cedric-Perauer/DL_from_Foundations | GeneralRelu | false | 11,278 | [
"Apache-2.0"
] | 0 | c53722216a088cc9f67a2e1bf955d043023e6a85 | https://github.com/Cedric-Perauer/DL_from_Foundations/tree/c53722216a088cc9f67a2e1bf955d043023e6a85 | import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import *
class Model(nn.Module):
def __init__(self, leak=None, sub=None, maxv=None):
super().__init__()
self.leak, self.sub, self.maxv = leak, sub, maxv
def forward(self, x):
x = F.leaky_relu(x, self.leak)... |
MyActivation | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class MyActivation(torch.nn.Module):
def __init__(self):
super(MyActivation, self).__init__()
self.relu = torch.nn.ReLU6(inplace=False)
def forward(self, x):
return x * self.relu(x + 3) / 6
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs()... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | CaichaoGitHub/model_optimization_demo | MyActivation | false | 11,279 | [
"Apache-2.0"
] | 0 | b3bca3ad4a1b972fe069049f9efd7365a22733c6 | https://github.com/CaichaoGitHub/model_optimization_demo/tree/b3bca3ad4a1b972fe069049f9efd7365a22733c6 | import torch
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.relu = torch.nn.ReLU6(inplace=False)
def forward(self, x):
return x * self.relu(x + 3) / 6
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
AdaptiveConcatPool2d | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from typing import *
class AdaptiveConcatPool2d(nn.Module):
def __init__(self, sz=1):
super().__init__()
self.output_size = sz
self.ap = nn.AdaptiveAvgPool2d(sz)
self.mp = nn.AdaptiveMaxPool2d(sz)
def forward(self, x):
return torch.c... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from typing import *
assert_size_stride = torch._C._dynamo.guards.a... | Cedric-Perauer/DL_from_Foundations | AdaptiveConcatPool2d | false | 11,280 | [
"Apache-2.0"
] | 0 | c53722216a088cc9f67a2e1bf955d043023e6a85 | https://github.com/Cedric-Perauer/DL_from_Foundations/tree/c53722216a088cc9f67a2e1bf955d043023e6a85 | import torch
import torch.nn as nn
from typing import *
class Model(nn.Module):
def __init__(self, sz=1):
super().__init__()
self.output_size = sz
self.ap = nn.AdaptiveAvgPool2d(sz)
self.mp = nn.AdaptiveMaxPool2d(sz)
def forward(self, x):
return torch.cat([self.mp(x),... |
testHSwish | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
class MyActivation(torch.nn.Module):
def __init__(self):
super(MyActivation, self).__init__()
self.relu = torch.nn.ReLU6(inplace=False)
def forward(self, x):
return x * self.relu(x + 3) / 6
class testHSwish(torch.nn.Module):
def __init__(self):
super(testH... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C... | CaichaoGitHub/model_optimization_demo | testHSwish | false | 11,281 | [
"Apache-2.0"
] | 0 | b3bca3ad4a1b972fe069049f9efd7365a22733c6 | https://github.com/CaichaoGitHub/model_optimization_demo/tree/b3bca3ad4a1b972fe069049f9efd7365a22733c6 | import torch
class MyActivation(torch.nn.Module):
def __init__(self):
super().__init__()
self.relu = torch.nn.ReLU6(inplace=False)
def forward(self, x):
return x * self.relu(x + 3) / 6
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.qu... |
SuperpointBackbone | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 SuperpointBackbone(nn.Module):
""" SuperPoint backbone. """
def __init__(self):
super(SuperpointBackbone, self).__init__()
self.relu = torch.nn.ReLU(inplace=True)
self.pool = torch.nn.MaxPool2d(kernel_size=2, stride=2)
c1, c2, c3, c4 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | B1ueber2y/SOLD2 | SuperpointBackbone | false | 11,282 | [
"MIT"
] | 0 | f85ca5387ea7464314614c3fb4d07af5678a9de3 | https://github.com/B1ueber2y/SOLD2/tree/f85ca5387ea7464314614c3fb4d07af5678a9de3 | import torch
import torch.nn as nn
class Model(nn.Module):
""" SuperPoint backbone. """
def __init__(self):
super().__init__()
self.relu = torch.nn.ReLU(inplace=True)
self.pool = torch.nn.MaxPool2d(kernel_size=2, stride=2)
c1, c2, c3, c4 = 64, 64, 128, 128
self.conv1a ... |
TransformerLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 TransformerLayer(nn.Module):
def __init__(self, c, num_heads):
super().__init__()
self.q = nn.Linear(c, c, bias=False)
self.k = nn.Linear(c, c, bias=False)
self.v = nn.Linear(c, c, bias=False)
self.ma = nn.Mu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | COEN-390/YOLOv5-Lite | TransformerLayer | false | 11,283 | [
"MIT"
] | 0 | 06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | https://github.com/COEN-390/YOLOv5-Lite/tree/06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, c, num_heads):
super().__init__()
self.q = nn.Linear(c, c, bias=False)
self.k = nn.Linear(c, c, bias=False)
self.v = nn.Linear(c, c, bias=False)
self.ma = nn.MultiheadAtte... |
ContrastiveLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.cuda
import torch.nn.functional as F
class ContrastiveLoss(torch.nn.Module):
"""
Triplet loss function based on Contrastive loss function.
Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
"""
def __init__(self, margin=0.2):
super(Contra... | 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.cuda
assert_siz... | CS5590-0001-Projject/CS5590-0001-Project | ContrastiveLoss | false | 11,284 | [
"MIT"
] | 0 | 18a9f0df7b2ef0f5e9ec7a4bd4e77f761abfd8f3 | https://github.com/CS5590-0001-Projject/CS5590-0001-Project/tree/18a9f0df7b2ef0f5e9ec7a4bd4e77f761abfd8f3 | import torch
import torch.cuda
import torch.nn.functional as F
class Model(torch.nn.Module):
"""
Triplet loss function based on Contrastive loss function.
Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
"""
def __init__(self, margin=0.2):
super().__init__()
... |
TokenEmbedding | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 TokenEmbedding(nn.Module):
def __init__(self, c_in, d_model):
super(TokenEmbedding, self).__init__()
padding = 1 if torch.__version__ >= '1.5.0' else 2
self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_model,
kernel_size=3, pa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Ares-Long/Time | TokenEmbedding | false | 11,285 | [
"Apache-2.0"
] | 0 | 7827463613f45baea82de189a890afb7394e73e4 | https://github.com/Ares-Long/Time/tree/7827463613f45baea82de189a890afb7394e73e4 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, c_in, d_model):
super().__init__()
padding = 1 if torch.__version__ >= '1.5.0' else 2
self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_model,
kernel_size=3, padding=padding, padding_mode='... |
TwoLayerCNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 TwoLayerCNN(nn.Module):
def __init__(self, C, M, embedding, channel, mtc_input):
super(TwoLayerCNN, self).__init__()
self.C = C
self.M = M
self.embedding = embedding
self.mtc_input = C if mtc_input el... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | Changxi-Liu/EditDistance | TwoLayerCNN | false | 11,288 | [
"MIT"
] | 0 | 925f43c3cf0bd6fdd8f5f0e919ac49916a020459 | https://github.com/Changxi-Liu/EditDistance/tree/925f43c3cf0bd6fdd8f5f0e919ac49916a020459 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, C, M, embedding, channel, mtc_input):
super().__init__()
self.C = C
self.M = M
self.embedding = embedding
self.mtc_input = C if mtc_input else 1
self.conv1... |
Dense | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Dense(nn.Module):
def __init__(self, num_channels, num_filters, filter_size, dropout_prob):
super().__init__()
self.dense_conv = nn.Conv2d(in_channels=num_channels, out_channels=
num_filters, kernel_size=filter_size, str... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | COEN-390/YOLOv5-Lite | Dense | false | 11,289 | [
"MIT"
] | 0 | 06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | https://github.com/COEN-390/YOLOv5-Lite/tree/06a53f5d001c5d37729f55f47cbd46cc8eb63f84 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, num_channels, num_filters, filter_size, dropout_prob):
super().__init__()
self.dense_conv = nn.Conv2d(in_channels=num_channels, out_channels=
num_filters, kernel_size=filter_size, str... |
LUConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
def ELUCons(elu, nchan):
if elu:
return nn.ELU(inplace=True)
else:
return nn.PReLU(nchan)
class LUConv(nn.Module):
def __init__(self, inChans, outChans, elu):
super(LUConv, self).__init__()
self.relu1 = ELUCons(elu, outChans)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | CheerL/lancunar | LUConv | false | 11,290 | [
"BSD-3-Clause"
] | 0 | fb00a331b5381af555fd2a7f0d03324a5355fe8c | https://github.com/CheerL/lancunar/tree/fb00a331b5381af555fd2a7f0d03324a5355fe8c | import torch
import torch.nn as nn
def ELUCons(elu, nchan):
if elu:
return nn.ELU(inplace=True)
else:
return nn.PReLU(nchan)
class Model(nn.Module):
def __init__(self, inChans, outChans, elu):
super().__init__()
self.relu1 = ELUCons(elu, outChans)
self.conv1 = nn... |
ResidualGatedGCNLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 BatchNormNode(nn.Module):
"""Batch normalization for node features.
"""
def __init__(self, hidden_dim):
super(BatchNormNode, self).__init__()
self.batch_norm = nn.BatchNorm1d(hidden_dim, track_running_stats=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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | BrandonKates/graph-convnet-tsp | ResidualGatedGCNLayer | false | 11,292 | [
"MIT"
] | 0 | f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | https://github.com/BrandonKates/graph-convnet-tsp/tree/f6e17e84311c23fd5cab041b7a27b4e0636c44f8 | import torch
import torch.nn.functional as F
import torch.nn as nn
class BatchNormNode(nn.Module):
"""Batch normalization for node features.
"""
def __init__(self, hidden_dim):
super().__init__()
self.batch_norm = nn.BatchNorm1d(hidden_dim, track_running_stats=False)
def forward(self... |
Mlp | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Mlp(nn.Module):
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hidden_features = hidden_features or in_features
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | ChangeTheWorld20191008/SwinIR | Mlp | false | 11,293 | [
"Apache-2.0"
] | 0 | a0cf7330b10e7c7294f11f59e1b89eff973b9093 | https://github.com/ChangeTheWorld20191008/SwinIR/tree/a0cf7330b10e7c7294f11f59e1b89eff973b9093 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_features, hidden_features=None, out_features=None,
act_layer=nn.GELU, drop=0.0):
super().__init__()
out_features = out_features or in_features
hidden_features = hidden_features or in_features
... |
TemporalEmbedding | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.nn as nn
class FixedEmbedding(nn.Module):
def __init__(self, c_in, d_model):
super(FixedEmbedding, self).__init__()
w = torch.zeros(c_in, d_model).float()
w.require_grad = False
position = torch.arange(0, c_in).float().unsqueeze(1)
div... | 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 math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | Ares-Long/Time | TemporalEmbedding | false | 11,294 | [
"Apache-2.0"
] | 0 | 7827463613f45baea82de189a890afb7394e73e4 | https://github.com/Ares-Long/Time/tree/7827463613f45baea82de189a890afb7394e73e4 | import math
import torch
import torch.nn as nn
class FixedEmbedding(nn.Module):
def __init__(self, c_in, d_model):
super().__init__()
w = torch.zeros(c_in, d_model).float()
w.require_grad = False
position = torch.arange(0, c_in).float().unsqueeze(1)
div_term = (torch.arang... |
cell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
class cell(nn.Module):
def __init__(self, input_sz: 'int', hidden_sz: 'int', output_sz: 'int'):
super().__init__()
self.weights1 = nn.Parameter(torch.randn(input_sz, hidden_sz) /
math.sqrt(input_sz), requires_grad=True)
self.bias1... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | Cemu0/Network-of-Neural-Network | cell | false | 11,295 | [
"MIT"
] | 0 | 6a4a097a960fbbec6ea0c5946804666b27c2da0f | https://github.com/Cemu0/Network-of-Neural-Network/tree/6a4a097a960fbbec6ea0c5946804666b27c2da0f | import math
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_sz: 'int', hidden_sz: 'int', output_sz: 'int'):
super().__init__()
self.weights1 = nn.Parameter(torch.randn(input_sz, hidden_sz) /
math.sqrt(input_sz), requires_grad=True)
self.bias... |
Discriminator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self, n_h):
super(Discriminator, self).__init__()
self.f_k = nn.Bilinear(n_h, n_h, 1)
for m in self.modules():
self.weights_init(m)
def weights_init(self, m):
if isinstance(m, nn.Bilin... | 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... | ChenChengKuan/DGI | Discriminator | false | 11,296 | [
"MIT"
] | 0 | 432bf78418b8dd52648c9cac45e8841bee4c5032 | https://github.com/ChenChengKuan/DGI/tree/432bf78418b8dd52648c9cac45e8841bee4c5032 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, n_h):
super().__init__()
self.f_k = nn.Bilinear(n_h, n_h, 1)
for m in self.modules():
self.weights_init(m)
def weights_init(self, m):
if isinstance(m, nn.Bilinear):
torch.nn.... |
Linear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
class Linear(torch.nn.Module):
def __init__(self, in_size, out_size):
super().__init__()
self.weight = torch.nn.Parameter(2 * (torch.rand(in_size, out_size) -
0.5))
self.bias = torch.nn.Parameter(2 * (torch.rand(out_size) - 0.5))
def forward(self, x):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cu... | Cesarscc/MiniTorch_Clase | Linear | false | 11,297 | [
"MIT"
] | 0 | 1f159bc86f35dce170068b37dd47940ea4a4ba04 | https://github.com/Cesarscc/MiniTorch_Clase/tree/1f159bc86f35dce170068b37dd47940ea4a4ba04 | import torch
class Model(torch.nn.Module):
def __init__(self, in_size, out_size):
super().__init__()
self.weight = torch.nn.Parameter(2 * (torch.rand(in_size, out_size) -
0.5))
self.bias = torch.nn.Parameter(2 * (torch.rand(out_size) - 0.5))
def forward(self, x):
... |
BertGELU | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
from torch import nn
class BertGELU(nn.Module):
"""Bert uses GELU as the activation function for the position-wise network.
"""
def forward(self, x):
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | Codle/texar-pytorch | BertGELU | false | 11,298 | [
"Apache-2.0"
] | 0 | d63556e7a8f48076c396467314a771d56552d595 | https://github.com/Codle/texar-pytorch/tree/d63556e7a8f48076c396467314a771d56552d595 | import math
import torch
from torch import nn
class Model(nn.Module):
"""Bert uses GELU as the activation function for the position-wise network.
"""
def forward(self, x):
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_in... |
DotProductSimilarity | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.nn as nn
class SimilarityFunction(nn.Module):
"""
A ``SimilarityFunction`` takes a pair of tensors with the same shape, and computes a similarity
function on the vectors in the last dimension. For example, the tensors might both have shape
`(batch_size, sentence_... | 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... | Aunsiels/qagnn | DotProductSimilarity | false | 11,299 | [
"MIT"
] | 0 | d89a3dd650ac4b8b8aae34e0cce7cfc698892d80 | https://github.com/Aunsiels/qagnn/tree/d89a3dd650ac4b8b8aae34e0cce7cfc698892d80 | import math
import torch
import torch.nn as nn
class SimilarityFunction(nn.Module):
"""
A ``SimilarityFunction`` takes a pair of tensors with the same shape, and computes a similarity
function on the vectors in the last dimension. For example, the tensors might both have shape
`(batch_size, sentence_... |
EncoderImagePrecomp | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
import torch.nn.init
def l2norm(matrix, dim, eps=1e-08):
norm = torch.pow(matrix, 2).sum(dim=dim, keepdim=True).sqrt() + eps
matrix = matrix / norm
return matrix
class EncoderImagePrecomp(nn.Module):
def __init__(self, img_size, embed_size, use_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import numpy as np
... | Closer1/CARRN | EncoderImagePrecomp | false | 11,300 | [
"MIT"
] | 0 | b64588f1f4f6b6f51939ff125e06268d4c294679 | https://github.com/Closer1/CARRN/tree/b64588f1f4f6b6f51939ff125e06268d4c294679 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.init
def l2norm(matrix, dim, eps=1e-08):
norm = torch.pow(matrix, 2).sum(dim=dim, keepdim=True).sqrt() + eps
matrix = matrix / norm
return matrix
class Model(nn.Module):
def __init__(self, img_size, embed_size, use_abs=False, img... |
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
class SEModule(nn.Module):
def __init__(self, channels, reduction):
super(SEModule, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc1 = nn.Conv2d(channels, channels // reduction, kernel_size=1,
padding=0)
self.relu = n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | ChrisLee63/reid-strong-baseline | SEModule | false | 11,301 | [
"MIT"
] | 0 | da755d3812da3c2e6e69920066badaad42f6fa6b | https://github.com/ChrisLee63/reid-strong-baseline/tree/da755d3812da3c2e6e69920066badaad42f6fa6b | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, channels, reduction):
super().__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc1 = nn.Conv2d(channels, channels // reduction, kernel_size=1,
padding=0)
self.relu = nn.ReLU(inplace=Tr... |
AvgReducePool1d | # 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 AvgReducePool1d(nn.Module):
"""A subclass of :torch_nn:`Module`.
Avg Pool layer for 1D inputs. The same as :torch_nn:`AvgPool1d` except that
the pooling dimension is entirely reduced (i.e., `pool_size=input_length`).
"""
def forward(self, input: 'torch.Tens... | 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... | Codle/texar-pytorch | AvgReducePool1d | false | 11,302 | [
"Apache-2.0"
] | 0 | d63556e7a8f48076c396467314a771d56552d595 | https://github.com/Codle/texar-pytorch/tree/d63556e7a8f48076c396467314a771d56552d595 | import torch
from torch import nn
class Model(nn.Module):
"""A subclass of :torch_nn:`Module`.
Avg Pool layer for 1D inputs. The same as :torch_nn:`AvgPool1d` except that
the pooling dimension is entirely reduced (i.e., `pool_size=input_length`).
"""
def forward(self, input: 'torch.Tensor') ->tor... |
MatrixAttention | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.nn as nn
class SimilarityFunction(nn.Module):
"""
A ``SimilarityFunction`` takes a pair of tensors with the same shape, and computes a similarity
function on the vectors in the last dimension. For example, the tensors might both have shape
`(batch_size, sentence_... | 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 math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | Aunsiels/qagnn | MatrixAttention | false | 11,303 | [
"MIT"
] | 0 | d89a3dd650ac4b8b8aae34e0cce7cfc698892d80 | https://github.com/Aunsiels/qagnn/tree/d89a3dd650ac4b8b8aae34e0cce7cfc698892d80 | import math
import torch
import torch.nn as nn
class SimilarityFunction(nn.Module):
"""
A ``SimilarityFunction`` takes a pair of tensors with the same shape, and computes a similarity
function on the vectors in the last dimension. For example, the tensors might both have shape
`(batch_size, sentence_... |
NeuralNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NeuralNet(nn.Module):
def __init__(self, input_size, hidden_size, num_classes):
super(NeuralNet, self).__init__()
self.l1 = nn.Linear(input_size, hidden_size)
self.l2 = nn.Linear(hidden_size, hidden_size)
self.l3 = nn.Linear(hidden_size, nu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | Chris01e/Minh-V- | NeuralNet | false | 11,304 | [
"MIT"
] | 0 | 87e080f8583c0658f683e5a82cfa9ba2d116901e | https://github.com/Chris01e/Minh-V-/tree/87e080f8583c0658f683e5a82cfa9ba2d116901e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_size, hidden_size, num_classes):
super().__init__()
self.l1 = nn.Linear(input_size, hidden_size)
self.l2 = nn.Linear(hidden_size, hidden_size)
self.l3 = nn.Linear(hidden_size, num_classes)
... |
BalancedL1Loss | # AOT ID: ['1_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def balanced_l1_loss(pred, target, beta=1.0, alpha=0.5, gamma=1.5,
reduction='none'):
assert beta > 0
assert pred.size() == target.size() and target.numel() > 0
diff = torch.abs(pred - target)
b = np.e ** (gamma ... | 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 numpy as np
imp... | Complicateddd/Complicateddd-ROITransformer | BalancedL1Loss | false | 11,305 | [
"Apache-2.0"
] | 0 | 2adfbf98892d569c460d100c6e2169c5fa3a9b82 | https://github.com/Complicateddd/Complicateddd-ROITransformer/tree/2adfbf98892d569c460d100c6e2169c5fa3a9b82 | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def balanced_l1_loss(pred, target, beta=1.0, alpha=0.5, gamma=1.5,
reduction='none'):
assert beta > 0
assert pred.size() == target.size() and target.numel() > 0
diff = torch.abs(pred - target)
b = np.e ** (gamma ... |
EPE | # 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 EPE(nn.Module):
def __init__(self):
super(EPE, self).__init__()
def forward(self, flow, gt, loss_mask):
loss_map = (flow - gt.detach()) ** 2
loss_map = (loss_map.sum(1, True) + 1e-06) ** 0.5
return loss_map * loss_mask
def get_inputs... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | Conrekatsu/arXiv2020-RIFE | EPE | false | 11,306 | [
"MIT"
] | 0 | 15cb7f2389ccd93e8b8946546d4665c9b41541a3 | https://github.com/Conrekatsu/arXiv2020-RIFE/tree/15cb7f2389ccd93e8b8946546d4665c9b41541a3 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, flow, gt, loss_mask):
loss_map = (flow - gt.detach()) ** 2
loss_map = (loss_map.sum(1, True) + 1e-06) ** 0.5
return loss_map * loss_mask
def get_inputs():
... |
GELU | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import math
import torch
import torch.nn as nn
def gelu(x):
""" Implementation of the gelu activation function currently in Google Bert repo (identical to OpenAI GPT).
Also see https://arxiv.org/abs/1606.08415
"""
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
to... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.... | Aunsiels/qagnn | GELU | false | 11,307 | [
"MIT"
] | 0 | d89a3dd650ac4b8b8aae34e0cce7cfc698892d80 | https://github.com/Aunsiels/qagnn/tree/d89a3dd650ac4b8b8aae34e0cce7cfc698892d80 | import math
import torch
import torch.nn as nn
def gelu(x):
""" Implementation of the gelu activation function currently in Google Bert repo (identical to OpenAI GPT).
Also see https://arxiv.org/abs/1606.08415
"""
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
to... |
Scale | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Scale(nn.Module):
def __init__(self, scale=1.0):
super(Scale, self).__init__()
self.scale = nn.Parameter(torch.tensor(scale, dtype=torch.float))
def forward(self, x):
return x * self.scale
def get_inputs():
return [torch.rand([4, 4, 4, 4... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | Complicateddd/Complicateddd-ROITransformer | Scale | false | 11,308 | [
"Apache-2.0"
] | 0 | 2adfbf98892d569c460d100c6e2169c5fa3a9b82 | https://github.com/Complicateddd/Complicateddd-ROITransformer/tree/2adfbf98892d569c460d100c6e2169c5fa3a9b82 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, scale=1.0):
super().__init__()
self.scale = nn.Parameter(torch.tensor(scale, dtype=torch.float))
def forward(self, x):
return x * self.scale
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def g... |
ConvModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 warnings
import torch.nn as nn
def build_norm_layer(cfg, num_features, postfix=''):
""" Build normalization layer
Args:
cfg (dict): cfg should contain:
type (str): identify norm layer type.
layer args: args needed to instantiate a norm layer.
re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import warnings
import torch.... | Complicateddd/Complicateddd-ROITransformer | ConvModule | false | 11,309 | [
"Apache-2.0"
] | 0 | 2adfbf98892d569c460d100c6e2169c5fa3a9b82 | https://github.com/Complicateddd/Complicateddd-ROITransformer/tree/2adfbf98892d569c460d100c6e2169c5fa3a9b82 | import torch
import warnings
import torch.nn as nn
def build_norm_layer(cfg, num_features, postfix=''):
""" Build normalization layer
Args:
cfg (dict): cfg should contain:
type (str): identify norm layer type.
layer args: args needed to instantiate a norm layer.
re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.