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
ConcatSquashConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ConcatSquashConv2d(nn.Module): def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0, dilation=1, groups=1, bias=True, transpose=False): super(ConcatSquashConv2d, self).__init__() module = nn.ConvTranspose2d if transpose else nn.Conv2d ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
D-hash-code/ffjord-rnode-finalweek-mnist
ConcatSquashConv2d
false
2,155
[ "MIT" ]
0
4cabcbadda79c68df53ec25f1f8fe03cfeee78f9
https://github.com/D-hash-code/ffjord-rnode-finalweek-mnist/tree/4cabcbadda79c68df53ec25f1f8fe03cfeee78f9
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0, dilation=1, groups=1, bias=True, transpose=False): super().__init__() module = nn.ConvTranspose2d if transpose else nn.Conv2d self._layer = module(dim_in, d...
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): def __init__(self, device, margin): super(TripletLoss, self).__init__() self.margin = margin self.device = device self.loss = nn.TripletMarginLoss(margin) def forward(self, anchor...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import...
Devanshu-singh-VR/FaceRecognition
TripletLoss
false
2,156
[ "MIT" ]
0
f596d1964f4f43174ffe5bac6d6437a7d22c3593
https://github.com/Devanshu-singh-VR/FaceRecognition/tree/f596d1964f4f43174ffe5bac6d6437a7d22c3593
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, device, margin): super().__init__() self.margin = margin self.device = device self.loss = nn.TripletMarginLoss(margin) def forward(self, anchor, positive, negative): ...
ConLoss
# 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 ConLoss(nn.Module): def __init__(self, device, margin=2): super(ConLoss, self).__init__() self.margin = margin self.device = device def forward(self, output1, output2, label): diff = F.pairwise_distance(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import...
Devanshu-singh-VR/FaceRecognition
ConLoss
false
2,157
[ "MIT" ]
0
f596d1964f4f43174ffe5bac6d6437a7d22c3593
https://github.com/Devanshu-singh-VR/FaceRecognition/tree/f596d1964f4f43174ffe5bac6d6437a7d22c3593
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, device, margin=2): super().__init__() self.margin = margin self.device = device def forward(self, output1, output2, label): diff = F.pairwise_distance(output1, output...
CNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class CNN(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(in_channels=1, out_channels=32, kernel_size= 3, padding=1) self.conv2 = nn.Conv2d(in_channels=32, out_channels=64, kernel_size =3, padding=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_...
DavidCarlyn/cnn_visualize
CNN
false
2,158
[ "MIT" ]
0
6b4e554e1a6ac3b4951f0e914e0414cfa8bd3686
https://github.com/DavidCarlyn/cnn_visualize/tree/6b4e554e1a6ac3b4951f0e914e0414cfa8bd3686
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(in_channels=1, out_channels=32, kernel_size= 3, padding=1) self.conv2 = nn.Conv2d(in_channels=32, out_channels=64, kernel_size =3, padding=1) ...
MyLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn import torch.utils.data class MyLoss(nn.Module): def __init__(self): super(MyLoss, self).__init__() def forward(self, pred, truth): return torch.sum((pred - truth) ** 2) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] de...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards...
Dora-The-Kid/culture_network
MyLoss
false
2,159
[ "Apache-2.0" ]
0
bc2bac86e821faa797eeb2670d179395724f7922
https://github.com/Dora-The-Kid/culture_network/tree/bc2bac86e821faa797eeb2670d179395724f7922
import torch from torch import nn import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() def forward(self, pred, truth): return torch.sum((pred - truth) ** 2) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_in...
ConvNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ConvNorm(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=None, dilation=1, bias=True, w_init_gain='linear'): super(ConvNorm, self).__init__() if padding is None: assert kernel_size % 2 == 1 padding...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride reinterpret_tens...
Dannynis/NeMo
ConvNorm
false
2,160
[ "Apache-2.0" ]
0
0d703d2c48158ec271d84cca76c3f423195327b2
https://github.com/Dannynis/NeMo/tree/0d703d2c48158ec271d84cca76c3f423195327b2
import torch class Model(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=None, dilation=1, bias=True, w_init_gain='linear'): super().__init__() if padding is None: assert kernel_size % 2 == 1 padding = int(dilation *...
Generator
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import functional as F import torch.utils.data class Generator(nn.Module): def __init__(self, input_size, hidden_size, output_size): super(Generator, self).__init__() self.map1 = nn.Linear(input_size, hidden_size) self.map2 = nn.Linear(hidde...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Dora-The-Kid/culture_network
Generator
false
2,161
[ "Apache-2.0" ]
0
bc2bac86e821faa797eeb2670d179395724f7922
https://github.com/Dora-The-Kid/culture_network/tree/bc2bac86e821faa797eeb2670d179395724f7922
import torch from torch import nn from torch.nn import functional as F import torch.utils.data class Model(nn.Module): def __init__(self, input_size, hidden_size, output_size): super().__init__() self.map1 = nn.Linear(input_size, hidden_size) self.map2 = nn.Linear(hidden_size, hidden_size...
IOU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch def _iou(pred, target, size_average=True): b = pred.shape[0] IoU = 0.0 for i in range(0, b): Iand1 = torch.sum(target[i, :, :, :] * pred[i, :, :, :]) Ior1 = torch.sum(target[i, :, :, :]) + torch.sum(pred[i, :, :, :] ) - Iand1 IoU1 = Iand1 / Ior1 IoU...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
DoJing/BASNet
IOU
false
2,162
[ "MIT" ]
0
46bd3462326e6c7a02c90273c15da6fa71cec0e2
https://github.com/DoJing/BASNet/tree/46bd3462326e6c7a02c90273c15da6fa71cec0e2
import torch def _iou(pred, target, size_average=True): b = pred.shape[0] IoU = 0.0 for i in range(0, b): Iand1 = torch.sum(target[i, :, :, :] * pred[i, :, :, :]) Ior1 = torch.sum(target[i, :, :, :]) + torch.sum(pred[i, :, :, :] ) - Iand1 IoU1 = Iand1 / Ior1 IoU...
Max2d
# 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 as T class Max2d(T.nn.Module): def forward(self, x): return x.view(*x.shape[:-2], -1).max(-1)[0] def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch as T assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_s...
DouglasOrr/Snippets
Max2d
false
2,163
[ "MIT" ]
0
026e15a422b518ee7d9ce4849f971c4403ad9fe8
https://github.com/DouglasOrr/Snippets/tree/026e15a422b518ee7d9ce4849f971c4403ad9fe8
import torch import torch as T class Model(T.nn.Module): def forward(self, x): return x.view(*x.shape[:-2], -1).max(-1)[0] def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Avg2d
# 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 as T class Avg2d(T.nn.Module): def forward(self, x): return x.mean((-2, -1)) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch as T assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_stride...
DouglasOrr/Snippets
Avg2d
false
2,164
[ "MIT" ]
0
026e15a422b518ee7d9ce4849f971c4403ad9fe8
https://github.com/DouglasOrr/Snippets/tree/026e15a422b518ee7d9ce4849f971c4403ad9fe8
import torch import torch as T class Model(T.nn.Module): def forward(self, x): return x.mean((-2, -1)) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
LocationLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 LinearNorm(torch.nn.Module): def __init__(self, in_dim, out_dim, bias=True, w_init_gain='linear'): super(LinearNorm, self).__init__() self.linear_layer = torch.nn.Linear(in_dim, out_dim, bias=bias) torch.nn.init.xavier_uniform_(self.linear_layer.we...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
Dannynis/NeMo
LocationLayer
false
2,165
[ "Apache-2.0" ]
0
0d703d2c48158ec271d84cca76c3f423195327b2
https://github.com/Dannynis/NeMo/tree/0d703d2c48158ec271d84cca76c3f423195327b2
import torch import torch.nn as nn class LinearNorm(torch.nn.Module): def __init__(self, in_dim, out_dim, bias=True, w_init_gain='linear'): super().__init__() self.linear_layer = torch.nn.Linear(in_dim, out_dim, bias=bias) torch.nn.init.xavier_uniform_(self.linear_layer.weight, gain=torch...
Conv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import math import torch from torch.nn import functional as F import torch.utils.data from torch.nn.parameter import Parameter from torch.nn.modules import Module from torch.nn.modules.utils import _pair def conv2d_same_padding(input, weight, bias=None, stride=[1], padding=1, dilation=...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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 import math from torch.nn import functional as F imp...
Dora-The-Kid/culture_network
Conv2d
false
2,166
[ "Apache-2.0" ]
0
bc2bac86e821faa797eeb2670d179395724f7922
https://github.com/Dora-The-Kid/culture_network/tree/bc2bac86e821faa797eeb2670d179395724f7922
from torch.nn import Module import math import torch from torch.nn import functional as F import torch.utils.data from torch.nn.parameter import Parameter from torch.nn.modules import Module from torch.nn.modules.utils import _pair def conv2d_same_padding(input, weight, bias=None, stride=[1], padding=1, dilation=...
FEM
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class FEM(nn.Module): def __init__(self, channel_size): super(FEM, self).__init__() self.cs = channel_size self.cpm1 = nn.Conv2d(self.cs, 256, kernel_size=3, dilation=1, stride=1, padding=1) self.cpm2 =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
DannyDannyDanny/DeepPrivacy
FEM
false
2,167
[ "MIT" ]
0
749e260bdcc28a0c12d526f24e4f5315d1b447ad
https://github.com/DannyDannyDanny/DeepPrivacy/tree/749e260bdcc28a0c12d526f24e4f5315d1b447ad
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, channel_size): super().__init__() self.cs = channel_size self.cpm1 = nn.Conv2d(self.cs, 256, kernel_size=3, dilation=1, stride=1, padding=1) self.cpm2 = nn.Con...
Conv1d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np from torch import nn import torch.utils.data class Conv1d(nn.Module): """ inputs: tensor of shape (batch size, num channels, height, width) returns: tensor of shape (batch size, num channels, height, width) """ def __init__(self, in_channels, out_channel, kernal_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 import numpy as np from torch import nn import torch.utils.data assert_size_stri...
Dora-The-Kid/culture_network
Conv1d
false
2,168
[ "Apache-2.0" ]
0
bc2bac86e821faa797eeb2670d179395724f7922
https://github.com/Dora-The-Kid/culture_network/tree/bc2bac86e821faa797eeb2670d179395724f7922
import torch import numpy as np from torch import nn import torch.utils.data class Model(nn.Module): """ inputs: tensor of shape (batch size, num channels, height, width) returns: tensor of shape (batch size, num channels, height, width) """ def __init__(self, in_channels, out_channel, kernal_si...
RegressionModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 RegressionModel(nn.Module): def __init__(self, num_features_in, num_anchors=9, feature_size=256): super(RegressionModel, self).__init__() self.conv1 = nn.Conv2d(num_features_in, feature_size, kernel_size=3, padding=1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
DerekGloudemans/3D-detector-trials
RegressionModel
false
2,169
[ "MIT" ]
0
480274567eaa84c5c883260ef62f150c7a23ffd3
https://github.com/DerekGloudemans/3D-detector-trials/tree/480274567eaa84c5c883260ef62f150c7a23ffd3
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, num_features_in, num_anchors=9, feature_size=256): super().__init__() self.conv1 = nn.Conv2d(num_features_in, feature_size, kernel_size=3, padding=1) self.act1 = nn.ReLU() ...
ResnetBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 actvn(x): out = F.leaky_relu(x, 0.2) return out class ResnetBlock(nn.Module): def __init__(self, fin, fout, fhidden=None, is_bias=True): super().__init__() self.is_bias = is_bias self.learned_shortcut = fin !...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.functional as F assert_size_stride = torch...
DrLSimon/precision-recall-distributions-icml19
ResnetBlock
false
2,170
[ "Apache-2.0" ]
0
364188eaa26ac1bf39ebf038136c79aeee97da3a
https://github.com/DrLSimon/precision-recall-distributions-icml19/tree/364188eaa26ac1bf39ebf038136c79aeee97da3a
import torch import torch.nn as nn import torch.nn.functional as F def actvn(x): out = F.leaky_relu(x, 0.2) return out class Model(nn.Module): def __init__(self, fin, fout, fhidden=None, is_bias=True): super().__init__() self.is_bias = is_bias self.learned_shortcut = fin != fout...
InnerProductNetwork
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data class InnerProductNetwork(torch.nn.Module): def forward(self, x): """ :param x: Float tensor of size ``(batch_size, num_fields, embed_dim)`` """ num_fields = x.shape[1] row, col = list(), list() for i in range(num_fields - 1): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_...
Drone-Banks/pytorch-fm
InnerProductNetwork
false
2,171
[ "MIT" ]
0
3e41b4fe1dfcd9e768af02b6a8365fe46de2df78
https://github.com/Drone-Banks/pytorch-fm/tree/3e41b4fe1dfcd9e768af02b6a8365fe46de2df78
import torch import torch.utils.data class Model(torch.nn.Module): def forward(self, x): """ :param x: Float tensor of size ``(batch_size, num_fields, embed_dim)`` """ num_fields = x.shape[1] row, col = list(), list() for i in range(num_fields - 1): for...
ConvTranspose
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ConvTranspose(nn.Module): """Convolution Module with transposes of last two dimensions.""" def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0, dilation=1, bias=True, w_init='relu'): super(ConvTranspose, self).__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Dannynis/NeMo
ConvTranspose
false
2,172
[ "Apache-2.0" ]
0
0d703d2c48158ec271d84cca76c3f423195327b2
https://github.com/Dannynis/NeMo/tree/0d703d2c48158ec271d84cca76c3f423195327b2
import torch import torch.nn as nn class Model(nn.Module): """Convolution Module with transposes of last two dimensions.""" def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0, dilation=1, bias=True, w_init='relu'): super().__init__() self.conv = nn.Conv1d...
h_sigmoid
# 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 h_sigmoid(nn.Module): def __init__(self, inplace=True): super(h_sigmoid, 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, 4, 4, 4])] def g...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
EileenWang90/mmpose
h_sigmoid
false
2,173
[ "Apache-2.0" ]
0
3fa1328a3b6351bf9b35df60d4d959973a6f8a71
https://github.com/EileenWang90/mmpose/tree/3fa1328a3b6351bf9b35df60d4d959973a6f8a71
import torch import torch.nn as nn 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])] def get_init_inputs(): ...
TransformerBasicHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 itertools import chain as chain import torch.utils.data import torch.nn as nn class TransformerBasicHead(nn.Module): """ BasicHead. No pool. """ def __init__(self, dim_in, num_classes, dropout_rate=0.0, act_func= 'softmax'): """ Perform linear projection and ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Drill-D/SlowFast
TransformerBasicHead
false
2,174
[ "Apache-2.0" ]
0
d55ae1cf30a9415858a9bd5da983790a2b418653
https://github.com/Drill-D/SlowFast/tree/d55ae1cf30a9415858a9bd5da983790a2b418653
import torch from itertools import chain as chain import torch.utils.data import torch.nn as nn class Model(nn.Module): """ BasicHead. No pool. """ def __init__(self, dim_in, num_classes, dropout_rate=0.0, act_func= 'softmax'): """ Perform linear projection and activation as h...
h_swish
# 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 h_sigmoid(nn.Module): def __init__(self, inplace=True): super(h_sigmoid, self).__init__() self.relu = nn.ReLU6(inplace=inplace) def forward(self, x): return self.relu(x + 3) / 6 class h_swish(nn.Module): def __init__(self, inplace=True)...
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...
EileenWang90/mmpose
h_swish
false
2,175
[ "Apache-2.0" ]
0
3fa1328a3b6351bf9b35df60d4d959973a6f8a71
https://github.com/EileenWang90/mmpose/tree/3fa1328a3b6351bf9b35df60d4d959973a6f8a71
import torch import torch.nn as nn class h_sigmoid(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 class Model(nn.Module): def __init__(self, inplace=True): super()...
LeNet300
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class LeNet300(nn.Module): def __init__(self): super(LeNet300, self).__init__() self.fc1 = nn.Linear(784, 300, bias=True) self.r1 = nn.ReLU() self.fc2 = nn.Linear(300, 100, bias=True) self.r2 = nn.ReLU() self.fc3 = nn.Linear(100, 1...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
EIDOSlab/pruning-validation
LeNet300
false
2,176
[ "BSD-3-Clause" ]
0
bd8e83cf6f564def0e193a4be0f753c768fe9e75
https://github.com/EIDOSlab/pruning-validation/tree/bd8e83cf6f564def0e193a4be0f753c768fe9e75
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 300, bias=True) self.r1 = nn.ReLU() self.fc2 = nn.Linear(300, 100, bias=True) self.r2 = nn.ReLU() self.fc3 = nn.Linear(100, 10, bias=True) ...
TreeLSTM
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 TreeLSTM(nn.Module): """ Implementation of the Tree-LSTM model: https://arxiv.org/pdf/1503.00075.pdf """ def __init__(self, num_units): super(TreeLSTM, self).__init__() self.left = nn.Linear(num_units, 5 * num_units) self.right = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
Devin-Taylor/pytorch-dynamic-batching-benchmark
TreeLSTM
false
2,177
[ "Apache-2.0" ]
0
aaf913b13a77a2898dfdf8d92cd25b01789a548a
https://github.com/Devin-Taylor/pytorch-dynamic-batching-benchmark/tree/aaf913b13a77a2898dfdf8d92cd25b01789a548a
import torch import torch.nn as nn class Model(nn.Module): """ Implementation of the Tree-LSTM model: https://arxiv.org/pdf/1503.00075.pdf """ def __init__(self, num_units): super().__init__() self.left = nn.Linear(num_units, 5 * num_units) self.right = nn.Linear(num_units...
SequenceBias
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from torch.nn.parameter import Parameter class SequenceBias(nn.Module): """ Adds one bias element to the end of the sequence. so if the input has a shape ``(L, N, E)``, where ``L`` i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from torch.nn.parameter import Pa...
EXAPPAI/opacus
SequenceBias
false
2,178
[ "Apache-2.0" ]
0
11e188a2f03a8a08be51fdf2367cc1387879312a
https://github.com/EXAPPAI/opacus/tree/11e188a2f03a8a08be51fdf2367cc1387879312a
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from torch.nn.parameter import Parameter class Model(nn.Module): """ Adds one bias element to the end of the sequence. so if the input has a shape ``(L, N, E)``, where ``L`` is the s...
SE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 itertools import chain as chain import torch.utils.data import torch.nn as nn class SwishEfficient(torch.autograd.Function): """Swish activation function: x * sigmoid(x).""" @staticmethod def forward(ctx, x): result = x * torch.sigmoid(x) ctx.save_for_backward(x) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from itertools import chain a...
Drill-D/SlowFast
SE
false
2,180
[ "Apache-2.0" ]
0
d55ae1cf30a9415858a9bd5da983790a2b418653
https://github.com/Drill-D/SlowFast/tree/d55ae1cf30a9415858a9bd5da983790a2b418653
import torch from itertools import chain as chain import torch.utils.data import torch.nn as nn class SwishEfficient(torch.autograd.Function): """Swish activation function: x * sigmoid(x).""" @staticmethod def forward(ctx, x): result = x * torch.sigmoid(x) ctx.save_for_backward(x) ...
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 from torch import nn from torch.nn import functional as F import torch.utils.data class Discriminator(nn.Module): def __init__(self, input_size, hidden_size, output_size): super(Discriminator, self).__init__() self.map1 = nn.Linear(input_size, hidden_size) self.map2 = nn.Line...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Dora-The-Kid/culture_network
Discriminator
false
2,182
[ "Apache-2.0" ]
0
bc2bac86e821faa797eeb2670d179395724f7922
https://github.com/Dora-The-Kid/culture_network/tree/bc2bac86e821faa797eeb2670d179395724f7922
import torch from torch import nn from torch.nn import functional as F import torch.utils.data class Model(nn.Module): def __init__(self, input_size, hidden_size, output_size): super().__init__() self.map1 = nn.Linear(input_size, hidden_size) self.map2 = nn.Linear(hidden_size, hidden_size...
AbsoluteRelativeErrorLoss
# 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 AbsoluteRelativeErrorLoss(nn.Module): def __init__(self, epsilon=0.0001): super().__init__() self.epsilon = epsilon def forward(self, pred, target): error = (pred - target) / (target + self.epsilon) return torch.abs(error) def get_inp...
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 from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_...
ElectronicElephant/openpilot-reimplementation
AbsoluteRelativeErrorLoss
false
2,183
[ "MIT" ]
0
063a9f5c6bbbf02c03dadc59e236e8f7c253a350
https://github.com/ElectronicElephant/openpilot-reimplementation/tree/063a9f5c6bbbf02c03dadc59e236e8f7c253a350
import torch from torch import nn class Model(nn.Module): def __init__(self, epsilon=0.0001): super().__init__() self.epsilon = epsilon def forward(self, pred, target): error = (pred - target) / (target + self.epsilon) return torch.abs(error) def get_inputs(): return [t...
MultiLayerPerceptron
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 MultiLayerPerceptron(nn.Module): """ A simple MLP that can either be used independently or put on top of pretrained models (such as BERT) and act as a classifier. Args: hidden_size (int): the size of each layer num_classes (int): number of outp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Dannynis/NeMo
MultiLayerPerceptron
false
2,184
[ "Apache-2.0" ]
0
0d703d2c48158ec271d84cca76c3f423195327b2
https://github.com/Dannynis/NeMo/tree/0d703d2c48158ec271d84cca76c3f423195327b2
import torch import torch.nn as nn class Model(nn.Module): """ A simple MLP that can either be used independently or put on top of pretrained models (such as BERT) and act as a classifier. Args: hidden_size (int): the size of each layer num_classes (int): number of output classes ...
SqueezeExcite
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 _make_divisible(v, divisor, min_value=None): """ This function is taken from the original tf repo. It ensures that all layers have a channel number that is divisible by 8 It can be seen here: https://github.com/tensorflow/model...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
EileenWang90/mmpose
SqueezeExcite
false
2,185
[ "Apache-2.0" ]
0
3fa1328a3b6351bf9b35df60d4d959973a6f8a71
https://github.com/EileenWang90/mmpose/tree/3fa1328a3b6351bf9b35df60d4d959973a6f8a71
import torch import torch.nn as nn import torch.nn.functional as F def _make_divisible(v, divisor, min_value=None): """ This function is taken from the original tf repo. It ensures that all layers have a channel number that is divisible by 8 It can be seen here: https://github.com/tensorflow/model...
ClassificationModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ClassificationModel(nn.Module): def __init__(self, num_features_in, num_anchors=9, num_classes=80, prior=0.01, feature_size=256): super(ClassificationModel, self).__init__() self.num_classes = num_classes self.num_an...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
DerekGloudemans/3D-detector-trials
ClassificationModel
false
2,186
[ "MIT" ]
0
480274567eaa84c5c883260ef62f150c7a23ffd3
https://github.com/DerekGloudemans/3D-detector-trials/tree/480274567eaa84c5c883260ef62f150c7a23ffd3
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, num_features_in, num_anchors=9, num_classes=80, prior=0.01, feature_size=256): super().__init__() self.num_classes = num_classes self.num_anchors = num_anchors self.conv1 ...
PA
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class PA(nn.Module): def __init__(self, dim): super().__init__() self.pa_conv = nn.Conv2d(dim, dim, 3, 1, 1, groups=dim) def forward(self, x): return x * self.pa_conv(x).sigmoid() def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
EmanuelNk/semantic-segmentation
PA
false
2,187
[ "MIT" ]
0
20ff16da49691fb407724909d9c7e84b47e2fee0
https://github.com/EmanuelNk/semantic-segmentation/tree/20ff16da49691fb407724909d9c7e84b47e2fee0
import torch from torch import nn class Model(nn.Module): def __init__(self, dim): super().__init__() self.pa_conv = nn.Conv2d(dim, dim, 3, 1, 1, groups=dim) def forward(self, x): return x * self.pa_conv(x).sigmoid() def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get...
BasicBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): """ BasicBlock implementation for ResNet reference: https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnet.py """ expansion = 1 def __init__(self, device, in_planes, planes, strid...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
EgonFerri/Final_project_Aml_ARC
BasicBlock
false
2,188
[ "MIT" ]
0
d5290a0bfef5e1aa0feb5988cdfe6de704180485
https://github.com/EgonFerri/Final_project_Aml_ARC/tree/d5290a0bfef5e1aa0feb5988cdfe6de704180485
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ BasicBlock implementation for ResNet reference: https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnet.py """ expansion = 1 def __init__(self, device, in_planes, planes, stride=1):...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch class Attention(torch.nn.Module): """ attention_size_1: Number of neurons in 1st attention layer. attention_size_2: Number of neurons in 2nd attention layer. """ def __init__(self, attention_size_1, attention_size_2): super(Attention, self).__init__() self.att...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
EgemenGuray/Subgraph-Classifier
Attention
false
2,189
[ "MIT" ]
0
b85d28c521701f41dcd698aed40d4c80d454e893
https://github.com/EgemenGuray/Subgraph-Classifier/tree/b85d28c521701f41dcd698aed40d4c80d454e893
import torch class Model(torch.nn.Module): """ attention_size_1: Number of neurons in 1st attention layer. attention_size_2: Number of neurons in 2nd attention layer. """ def __init__(self, attention_size_1, attention_size_2): super().__init__() self.attention_1 = torch.nn...
NonLocalEncoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import Tensor from torch import nn import torch.utils.data from typing import Optional from abc import ABCMeta class _NonLocalNd(nn.Module, metaclass=ABCMeta): """Basic Non-local module. This module is proposed in "Non-local Neural Networks" Paper reference: https://arxiv.org/...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Dwrety/detr
NonLocalEncoder
false
2,190
[ "Apache-2.0" ]
0
b369c4c12354f18e9e66d56fcfda6fc058d6d593
https://github.com/Dwrety/detr/tree/b369c4c12354f18e9e66d56fcfda6fc058d6d593
import torch from torch import Tensor from torch import nn import torch.utils.data from typing import Optional from abc import ABCMeta class _NonLocalNd(nn.Module, metaclass=ABCMeta): """Basic Non-local module. This module is proposed in "Non-local Neural Networks" Paper reference: https://arxiv.org/...
Envelope
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data class Envelope(torch.nn.Module): def __init__(self, exponent): super(Envelope, self).__init__() self.p = exponent + 1 self.a = -(self.p + 1) * (self.p + 2) / 2 self.b = self.p * (self.p + 2) self.c = -self.p * (self.p + 1) / 2 def ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_...
EricAlcaide/pytorch_geometric
Envelope
false
2,191
[ "MIT" ]
0
31cef566cfe22602459155fdf91e9b6ce398bfe7
https://github.com/EricAlcaide/pytorch_geometric/tree/31cef566cfe22602459155fdf91e9b6ce398bfe7
import torch import torch.utils.data class Model(torch.nn.Module): def __init__(self, exponent): super().__init__() self.p = exponent + 1 self.a = -(self.p + 1) * (self.p + 2) / 2 self.b = self.p * (self.p + 2) self.c = -self.p * (self.p + 1) / 2 def forward(self, x):...
Multi_Head_Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super(Scaled_Dot_Product_Attention, self).__init__() def forward(self, Q, K, V, scale=None): """ Args: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
Ergtou/TextWord
Multi_Head_Attention
false
2,192
[ "MIT" ]
0
f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30
https://github.com/Ergtou/TextWord/tree/f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30
import torch import torch.nn as nn import torch.nn.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super().__init__() def forward(self, Q, K, V, scale=None): """ Args: Q: [batch_size, len_Q, dim_Q]...
Downsample
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import Tensor from torch import nn class Downsample(nn.Module): """Downsample transition stage""" def __init__(self, c1, c2): super().__init__() self.proj = nn.Conv2d(c1, c2, 3, 2, 1) def forward(self, x: 'Tensor') ->Tensor: x = x.permute(0, 3, 1, 2) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
EmanuelNk/semantic-segmentation
Downsample
false
2,193
[ "MIT" ]
0
20ff16da49691fb407724909d9c7e84b47e2fee0
https://github.com/EmanuelNk/semantic-segmentation/tree/20ff16da49691fb407724909d9c7e84b47e2fee0
import torch from torch import Tensor from torch import nn class Model(nn.Module): """Downsample transition stage""" def __init__(self, c1, c2): super().__init__() self.proj = nn.Conv2d(c1, c2, 3, 2, 1) def forward(self, x: 'Tensor') ->Tensor: x = x.permute(0, 3, 1, 2) x ...
Scaled_Dot_Product_Attention
# 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 Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super(Scaled_Dot_Product_Attention, self).__init__() def forward(self, Q, K, V, scale=None): """ Args: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Ergtou/TextWord
Scaled_Dot_Product_Attention
false
2,194
[ "MIT" ]
0
f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30
https://github.com/Ergtou/TextWord/tree/f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super().__init__() def forward(self, Q, K, V, scale=None): """ Args: Q: [batch_size, len_Q, dim_Q] K: [batch_...
DPLSTMCell
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Tuple from typing import Optional class LSTMLinear(nn.Linear): """ This function is the same as a nn.Linear layer, except that in the backward pass the gra...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
EXAPPAI/opacus
DPLSTMCell
false
2,195
[ "Apache-2.0" ]
0
11e188a2f03a8a08be51fdf2367cc1387879312a
https://github.com/EXAPPAI/opacus/tree/11e188a2f03a8a08be51fdf2367cc1387879312a
import math import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Tuple from typing import Optional class LSTMLinear(nn.Linear): """ This function is the same as a nn.Linear layer, except that in the backward pass the gra...
MaxMarginRankingLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import numpy as np import torch as th import torch.nn.functional as F class MaxMarginRankingLoss(th.nn.Module): def __init__(self, margin=1.0, negative_weighting=False, batch_size=1, n_pair=1, hard_negative_rate=0.5): super(MaxMarginRankingLoss, self).__init__() self.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 numpy as np import torch as th assert_size_stride = torch._C._dynamo.guards.assert...
ErinZhang1998/howto100m-erin
MaxMarginRankingLoss
false
2,196
[ "Apache-2.0" ]
0
1152ea0fe328d20fcf2218a1d548644881632656
https://github.com/ErinZhang1998/howto100m-erin/tree/1152ea0fe328d20fcf2218a1d548644881632656
import torch import numpy as np import torch as th import torch.nn.functional as F class Model(th.nn.Module): def __init__(self, margin=1.0, negative_weighting=False, batch_size=1, n_pair=1, hard_negative_rate=0.5): super().__init__() self.margin = margin self.n_pair = n_pair ...
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.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super(Scaled_Dot_Product_Attention, self).__init__() def forward(self, Q, K, V, scale=None): """ Args: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Ergtou/TextWord
Encoder
false
2,197
[ "MIT" ]
0
f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30
https://github.com/Ergtou/TextWord/tree/f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30
import torch import torch.nn as nn import torch.nn.functional as F class Scaled_Dot_Product_Attention(nn.Module): """Scaled Dot-Product Attention """ def __init__(self): super().__init__() def forward(self, Q, K, V, scale=None): """ Args: Q: [batch_size, len_Q, dim_Q]...
MLP
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import Tensor from torch import nn class MLP(nn.Module): def __init__(self, dim, embed_dim): super().__init__() self.proj = nn.Linear(dim, embed_dim) def forward(self, x: 'Tensor') ->Tensor: x = x.flatten(2).transpose(1, 2) x = self.proj(x) ret...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
EmanuelNk/semantic-segmentation
MLP
false
2,198
[ "MIT" ]
0
20ff16da49691fb407724909d9c7e84b47e2fee0
https://github.com/EmanuelNk/semantic-segmentation/tree/20ff16da49691fb407724909d9c7e84b47e2fee0
import torch from torch import Tensor from torch import nn class Model(nn.Module): def __init__(self, dim, embed_dim): super().__init__() self.proj = nn.Linear(dim, embed_dim) def forward(self, x: 'Tensor') ->Tensor: x = x.flatten(2).transpose(1, 2) x = self.proj(x) r...
Flatten
# 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 Flatten(nn.Module): def __init__(self): super(Flatten, self).__init__() def forward(self, x): """ Arguments: x: a float tensor with shape [batch_size, c, h, w]. Returns: a float tensor with shape [batch_size, c*...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
Escaton615/mtcnn-pytorch
Flatten
false
2,199
[ "MIT" ]
0
4a645c1bf8dca0b5410cc0454ee0a538ada2d241
https://github.com/Escaton615/mtcnn-pytorch/tree/4a645c1bf8dca0b5410cc0454ee0a538ada2d241
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): """ Arguments: x: a float tensor with shape [batch_size, c, h, w]. Returns: a float tensor with shape [batch_size, c*h*w]. "...
SigmoidAbsoluteRelativeErrorLoss
# 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 SigmoidAbsoluteRelativeErrorLoss(nn.Module): def __init__(self, epsilon=0.0001): super().__init__() self.epsilon = epsilon def forward(self, pred, target): error = (pred - target) / (target + self.epsilon) return torch.sigmoid(torch.abs...
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 from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_...
ElectronicElephant/openpilot-reimplementation
SigmoidAbsoluteRelativeErrorLoss
false
2,200
[ "MIT" ]
0
063a9f5c6bbbf02c03dadc59e236e8f7c253a350
https://github.com/ElectronicElephant/openpilot-reimplementation/tree/063a9f5c6bbbf02c03dadc59e236e8f7c253a350
import torch from torch import nn class Model(nn.Module): def __init__(self, epsilon=0.0001): super().__init__() self.epsilon = epsilon def forward(self, pred, target): error = (pred - target) / (target + self.epsilon) return torch.sigmoid(torch.abs(error)) def get_inputs()...
Position_wise_Feed_Forward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Position_wise_Feed_Forward(nn.Module): def __init__(self, dim_model, hidden, dropout=0.0): super(Position_wise_Feed_Forward, self).__init__() self.fc1 = nn.Linear(dim_model, hidden) self.fc2 = nn.Linear(hidden, dim_m...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Ergtou/TextWord
Position_wise_Feed_Forward
false
2,201
[ "MIT" ]
0
f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30
https://github.com/Ergtou/TextWord/tree/f05cc5a630fc8d05357b8a9bc0da3ec5cc255a30
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, dim_model, hidden, dropout=0.0): super().__init__() self.fc1 = nn.Linear(dim_model, hidden) self.fc2 = nn.Linear(hidden, dim_model) self.dropout = nn.Dropout(dropout) ...
TOP1_max
# 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 TOP1_max(nn.Module): def __init__(self): super(TOP1_max, self).__init__() def forward(self, logit): logit_softmax = F.softmax(logit, dim=1) diff = -(logit.diag().view(-1, 1).expand_as(logit) - logit) los...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
Ethan-Yys/GRU4REC-pytorch-master
TOP1_max
false
2,202
[ "Apache-2.0" ]
0
175ccb851f881d3506680c459491e76f50aa9898
https://github.com/Ethan-Yys/GRU4REC-pytorch-master/tree/175ccb851f881d3506680c459491e76f50aa9898
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, logit): logit_softmax = F.softmax(logit, dim=1) diff = -(logit.diag().view(-1, 1).expand_as(logit) - logit) loss = torch.mean(lo...
Sentence_Maxpool
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch as th import torch.nn.functional as F import torch.nn as nn class Sentence_Maxpool(nn.Module): def __init__(self, word_dimension, output_dim, relu=True): super(Sentence_Maxpool, self).__init__() self.fc = nn.Linear(word_dimension, output_dim) self.out_dim = 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_...
ErinZhang1998/howto100m-erin
Sentence_Maxpool
false
2,203
[ "Apache-2.0" ]
0
1152ea0fe328d20fcf2218a1d548644881632656
https://github.com/ErinZhang1998/howto100m-erin/tree/1152ea0fe328d20fcf2218a1d548644881632656
import torch import torch as th import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, word_dimension, output_dim, relu=True): super().__init__() self.fc = nn.Linear(word_dimension, output_dim) self.out_dim = output_dim self.relu = relu ...
Attention
# 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.functional as F import torch.utils.data def restricted_softmax(src, dim: 'int'=-1, margin: 'float'=0.0): src_max = torch.clamp(src.max(dim=dim, keepdim=True)[0], min=0.0) out = (src - src_max).exp() out = out / (out.sum(dim=dim, keepdim=True) + (margin - src_max).e...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
EricAlcaide/pytorch_geometric
Attention
false
2,204
[ "MIT" ]
0
31cef566cfe22602459155fdf91e9b6ce398bfe7
https://github.com/EricAlcaide/pytorch_geometric/tree/31cef566cfe22602459155fdf91e9b6ce398bfe7
import math import torch import torch.nn.functional as F import torch.utils.data def restricted_softmax(src, dim: 'int'=-1, margin: 'float'=0.0): src_max = torch.clamp(src.max(dim=dim, keepdim=True)[0], min=0.0) out = (src - src_max).exp() out = out / (out.sum(dim=dim, keepdim=True) + (margin - src_max).e...
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 from typing import Type from typing import Optional import torch.nn as nn class AdaptiveConcatPool2d(nn.Module): """Layer that concats `AdaptiveAvgPool2d` and `AdaptiveMaxPool2d`.""" def __init__(self, size: 'Optional[int]'=None): """Output will be 2*size or 2 if size is None""" ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from typing import Optional import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
Erlemar/kekas
AdaptiveConcatPool2d
false
2,205
[ "MIT" ]
0
6fd8413f15390bf079bdb57a38a7094a5c53ab0f
https://github.com/Erlemar/kekas/tree/6fd8413f15390bf079bdb57a38a7094a5c53ab0f
import torch from typing import Type from typing import Optional import torch.nn as nn class Model(nn.Module): """Layer that concats `AdaptiveAvgPool2d` and `AdaptiveMaxPool2d`.""" def __init__(self, size: 'Optional[int]'=None): """Output will be 2*size or 2 if size is None""" super().__init_...
CustomNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 CustomNet(nn.Module): """ A network with a fully connected layer followed by a sigmoid layer. This is used for testing customized operation handles. """ def __init__(self, input_dim: 'int', output_dim: 'int') ->None: super(CustomNet, self).__init__...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
DenXX/fvcore
CustomNet
false
2,206
[ "Apache-2.0" ]
0
4b91cf092f4f5d379b2c93398780a3b5755e7179
https://github.com/DenXX/fvcore/tree/4b91cf092f4f5d379b2c93398780a3b5755e7179
import torch import torch.nn as nn class Model(nn.Module): """ A network with a fully connected layer followed by a sigmoid layer. This is used for testing customized operation handles. """ def __init__(self, input_dim: 'int', output_dim: 'int') ->None: super().__init__() self.con...
BPRLoss
# 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 BPRLoss(nn.Module): def __init__(self): super(BPRLoss, self).__init__() def forward(self, logit): """ Args: logit (BxB): Variable that stores the logits for the items in the mini-batch ...
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...
Ethan-Yys/GRU4REC-pytorch-master
BPRLoss
false
2,207
[ "Apache-2.0" ]
0
175ccb851f881d3506680c459491e76f50aa9898
https://github.com/Ethan-Yys/GRU4REC-pytorch-master/tree/175ccb851f881d3506680c459491e76f50aa9898
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, logit): """ Args: logit (BxB): Variable that stores the logits for the items in the mini-batch The ...
ResBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 get_same_padding(kernel_size, dilation): kernel_size = kernel_size + (kernel_size - 1) * (dilation - 1) padding = (kernel_size - 1) // 2 return padding class ResBlock(nn.Module): def __init__(self, inplanes, planes, kernel_size=3, stride=1, dilation=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_...
Etienne66/CDVD-TSP
ResBlock
false
2,208
[ "MIT" ]
0
fccde88ff75832286612262613808eef7b1c3255
https://github.com/Etienne66/CDVD-TSP/tree/fccde88ff75832286612262613808eef7b1c3255
import torch import torch.nn as nn def get_same_padding(kernel_size, dilation): kernel_size = kernel_size + (kernel_size - 1) * (dilation - 1) padding = (kernel_size - 1) // 2 return padding class Model(nn.Module): def __init__(self, inplanes, planes, kernel_size=3, stride=1, dilation=1): s...
Copy
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.data import torch.nn.init class Copy(nn.Module): def __init__(self, hidden_size, copy_weight=1.0): super().__init__() self.Wcopy = nn.Linear(hidden_size, hidden_size) self.copy_weight = copy_weight def forward(self, enc_out_hs, de...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
ChrisGeishauser/ConvLab-2
Copy
false
2,209
[ "Apache-2.0" ]
0
8f55d033c6e2453fdc092c4f504be3973a55e7ea
https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea
import torch import torch.nn as nn import torch.utils.data import torch.nn.init class Model(nn.Module): def __init__(self, hidden_size, copy_weight=1.0): super().__init__() self.Wcopy = nn.Linear(hidden_size, hidden_size) self.copy_weight = copy_weight def forward(self, enc_out_hs, d...
BinaryNLLEntropy
# 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.utils.data import torch.nn.init from torch.nn.modules.loss import _Loss class BinaryNLLEntropy(_Loss): def __init__(self, size_average=True): super(BinaryNLLEntropy, self).__init__() self.size_average = size_average def forward(self, ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
ChrisGeishauser/ConvLab-2
BinaryNLLEntropy
false
2,210
[ "Apache-2.0" ]
0
8f55d033c6e2453fdc092c4f504be3973a55e7ea
https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea
import torch import torch.nn.functional as F import torch.utils.data import torch.nn.init from torch.nn.modules.loss import _Loss class Model(_Loss): def __init__(self, size_average=True): super().__init__() self.size_average = size_average def forward(self, net_output, label_output): ...
ClassHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 itertools import product as product import torch.nn as nn class ClassHead(nn.Module): def __init__(self, inchannels=512, num_anchors=3): super(ClassHead, self).__init__() self.num_anchors = num_anchors self.conv1x1 = nn.Conv2d(inchannels, self.num_anchors * 2, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from itertools import product as product import torch.nn as nn assert_size_strid...
Danil328/Pytorch_Retinaface
ClassHead
false
2,211
[ "MIT" ]
0
048a1d68217b2a99fbf83e2537ecc7e281ed6bd6
https://github.com/Danil328/Pytorch_Retinaface/tree/048a1d68217b2a99fbf83e2537ecc7e281ed6bd6
import torch from itertools import product as product import torch.nn as nn class Model(nn.Module): def __init__(self, inchannels=512, num_anchors=3): super().__init__() self.num_anchors = num_anchors self.conv1x1 = nn.Conv2d(inchannels, self.num_anchors * 2, kernel_size=(1, 1...
SmallConvNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from numpy import prod class SmallConvNet(nn.Module): """ A network with three conv layers. This is used for testing convolution layers for activation count. """ def __init__(self, input_dim: 'int') ->None: super(SmallConvNet, self).__init__() 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 torch.nn as nn from numpy import prod assert_size_stride = torch._C._dyna...
DenXX/fvcore
SmallConvNet
false
2,212
[ "Apache-2.0" ]
0
4b91cf092f4f5d379b2c93398780a3b5755e7179
https://github.com/DenXX/fvcore/tree/4b91cf092f4f5d379b2c93398780a3b5755e7179
import torch import torch.nn as nn from numpy import prod class Model(nn.Module): """ A network with three conv layers. This is used for testing convolution layers for activation count. """ def __init__(self, input_dim: 'int') ->None: super().__init__() conv_dim1 = 8 conv_...
DPSLTMAdapter
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch from torch import Tensor import torch.nn as nn from torch.nn.utils.rnn import pad_sequence import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Union from typing import List from typing import Tuple from typing import Optional from torch.nn.uti...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math from to...
EXAPPAI/opacus
DPSLTMAdapter
false
2,213
[ "Apache-2.0" ]
0
11e188a2f03a8a08be51fdf2367cc1387879312a
https://github.com/EXAPPAI/opacus/tree/11e188a2f03a8a08be51fdf2367cc1387879312a
import math import torch from torch import Tensor import torch.nn as nn from torch.nn.utils.rnn import pad_sequence import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel from typing import Union from typing import List from typing import Tuple from typing import Optional from torch.nn.uti...
LandmarkHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 itertools import product as product import torch.nn as nn class LandmarkHead(nn.Module): def __init__(self, inchannels=512, num_anchors=3): super(LandmarkHead, self).__init__() self.conv1x1 = nn.Conv2d(inchannels, num_anchors * 10, kernel_size= (1, 1), stride=1, padd...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from itertools import product as product import torch.nn as nn assert_size_strid...
Danil328/Pytorch_Retinaface
LandmarkHead
false
2,214
[ "MIT" ]
0
048a1d68217b2a99fbf83e2537ecc7e281ed6bd6
https://github.com/Danil328/Pytorch_Retinaface/tree/048a1d68217b2a99fbf83e2537ecc7e281ed6bd6
import torch from itertools import product as product import torch.nn as nn class Model(nn.Module): def __init__(self, inchannels=512, num_anchors=3): super().__init__() self.conv1x1 = nn.Conv2d(inchannels, num_anchors * 10, kernel_size= (1, 1), stride=1, padding=0) def forward(s...
Normalize
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 class Normalize(nn.Module): def __init__(self, n_channels, scale=1.0): super(Normalize, self).__init__() self.n_channels = n_channels self.scale = scale self.eps = 1e-10 self.weight = nn.Parameter(...
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 assert_size_stri...
DongChengdongHangZhou/caffe-to-pytorch
Normalize
false
2,215
[ "Apache-2.0" ]
0
5e3104f3aa77d35bad5d2de235b067460c136fd5
https://github.com/DongChengdongHangZhou/caffe-to-pytorch/tree/5e3104f3aa77d35bad5d2de235b067460c136fd5
import torch import torch.nn as nn from itertools import product as product 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...
BboxHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 itertools import product as product import torch.nn as nn class BboxHead(nn.Module): def __init__(self, inchannels=512, num_anchors=3): super(BboxHead, self).__init__() self.conv1x1 = nn.Conv2d(inchannels, num_anchors * 4, kernel_size=( 1, 1), stride=1, padding=0) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from itertools import product as product import torch.nn as nn assert_size_strid...
Danil328/Pytorch_Retinaface
BboxHead
false
2,216
[ "MIT" ]
0
048a1d68217b2a99fbf83e2537ecc7e281ed6bd6
https://github.com/Danil328/Pytorch_Retinaface/tree/048a1d68217b2a99fbf83e2537ecc7e281ed6bd6
import torch from itertools import product as product import torch.nn as nn class Model(nn.Module): def __init__(self, inchannels=512, num_anchors=3): super().__init__() self.conv1x1 = nn.Conv2d(inchannels, num_anchors * 4, kernel_size=( 1, 1), stride=1, padding=0) def forward(se...
ConvNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class ConvNet(nn.Module): """ A network with a single convolution layer. This is used for testing flop count for convolution layers. """ def __init__(self, conv_dim: 'int', input_dim: 'int', output_dim: 'int', kernel_size: 'int', spatial_dim: 'int', stri...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
DenXX/fvcore
ConvNet
false
2,217
[ "Apache-2.0" ]
0
4b91cf092f4f5d379b2c93398780a3b5755e7179
https://github.com/DenXX/fvcore/tree/4b91cf092f4f5d379b2c93398780a3b5755e7179
import torch import torch.nn as nn class Model(nn.Module): """ A network with a single convolution layer. This is used for testing flop count for convolution layers. """ def __init__(self, conv_dim: 'int', input_dim: 'int', output_dim: 'int', kernel_size: 'int', spatial_dim: 'int', stride...
TOP1Loss
# 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 TOP1Loss(nn.Module): def __init__(self): super(TOP1Loss, self).__init__() def forward(self, logit): """ Args: logit (BxB): Variable that stores the logits for the items in the mini-batch The first dimension...
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...
Ethan-Yys/GRU4REC-pytorch-master
TOP1Loss
false
2,218
[ "Apache-2.0" ]
0
175ccb851f881d3506680c459491e76f50aa9898
https://github.com/Ethan-Yys/GRU4REC-pytorch-master/tree/175ccb851f881d3506680c459491e76f50aa9898
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, logit): """ Args: logit (BxB): Variable that stores the logits for the items in the mini-batch The first dimension corresponds to t...
PNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 from collections import OrderedDict class PNet(nn.Module): def __init__(self): super(PNet, self).__init__() self.features = nn.Sequential(OrderedDict([('conv1', nn.Conv2d(3, 10, 3, 1)), ('prelu1', nn.PReLU(10)), ('poo...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Escaton615/mtcnn-pytorch
PNet
false
2,219
[ "MIT" ]
0
4a645c1bf8dca0b5410cc0454ee0a538ada2d241
https://github.com/Escaton615/mtcnn-pytorch/tree/4a645c1bf8dca0b5410cc0454ee0a538ada2d241
import torch import torch.nn.functional as F import torch.nn as nn from collections import OrderedDict class Model(nn.Module): def __init__(self): super().__init__() self.features = nn.Sequential(OrderedDict([('conv1', nn.Conv2d(3, 10, 3, 1)), ('prelu1', nn.PReLU(10)), ('pool1', nn.M...
Conv2d_GN_ReLU
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Conv2d_GN_ReLU(nn.Module): """ Implements a module that performs conv2d + groupnorm + ReLU + Assumes kernel size is odd """ def __init__(self, in_channels, out_channels, num_groups, ksize=3, stride=1 ): super(Conv2d_GN_ReLU, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
FANG-Xiaolin/uois
Conv2d_GN_ReLU
false
2,220
[ "MIT" ]
0
7489e69d1513faf2f3f030a441abdd33ca22304c
https://github.com/FANG-Xiaolin/uois/tree/7489e69d1513faf2f3f030a441abdd33ca22304c
import torch import torch.nn as nn class Model(nn.Module): """ Implements a module that performs conv2d + groupnorm + ReLU + Assumes kernel size is odd """ def __init__(self, in_channels, out_channels, num_groups, ksize=3, stride=1 ): super().__init__() padd...
mlp
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class mlp(nn.Module): def __init__(self, in_feature, **kwargs): super().__init__() self.in_feature = in_feature self.relu = nn.ReLU() self.linear1 = nn.Linear(in_feature, in_feature) self.dropout1 = nn.Dropout(p=0.3) self.linear2 =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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...
EuphoriaYan/sales_pred
mlp
false
2,221
[ "MIT" ]
0
cc39c32a3387285f3561aeeea7a133810069dc98
https://github.com/EuphoriaYan/sales_pred/tree/cc39c32a3387285f3561aeeea7a133810069dc98
import torch from torch import nn class Model(nn.Module): def __init__(self, in_feature, **kwargs): super().__init__() self.in_feature = in_feature self.relu = nn.ReLU() self.linear1 = nn.Linear(in_feature, in_feature) self.dropout1 = nn.Dropout(p=0.3) self.linear2...
ScaledDotProductAttention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import numpy as np import torch.nn as nn import torch.utils.data import torch.nn.init class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super(ScaledDotProductAttention, self).__init__() self.tempera...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ChrisGeishauser/ConvLab-2
ScaledDotProductAttention
false
2,222
[ "Apache-2.0" ]
0
8f55d033c6e2453fdc092c4f504be3973a55e7ea
https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea
import torch import numpy as np import torch.nn as nn import torch.utils.data import torch.nn.init class Model(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropou...
CELossWeighted
# 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 WeightedLoss(nn.Module): def __init__(self): super(WeightedLoss, self).__init__() self.weighted = False def generate_weight_mask(self, mask, to_ignore=None): """ Generates a weight mask where pixel weights are inversely proportional to ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
FANG-Xiaolin/uois
CELossWeighted
false
2,223
[ "MIT" ]
0
7489e69d1513faf2f3f030a441abdd33ca22304c
https://github.com/FANG-Xiaolin/uois/tree/7489e69d1513faf2f3f030a441abdd33ca22304c
import torch import torch.nn as nn class WeightedLoss(nn.Module): def __init__(self): super().__init__() self.weighted = False def generate_weight_mask(self, mask, to_ignore=None): """ Generates a weight mask where pixel weights are inversely proportional to how many pix...
SelfAttn
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.init import torch as th class SelfAttn(nn.Module): def __init__(self, hidden_size): super(SelfAttn, self).__init__() self.query = nn.Linear(hidden_size, 1) def forward(self, keys, value...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ChrisGeishauser/ConvLab-2
SelfAttn
false
2,224
[ "Apache-2.0" ]
0
8f55d033c6e2453fdc092c4f504be3973a55e7ea
https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.init import torch as th class Model(nn.Module): def __init__(self, hidden_size): super().__init__() self.query = nn.Linear(hidden_size, 1) def forward(self, keys, values, attn_mask=None...
BCEWithLogitsLossWeighted
# 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 WeightedLoss(nn.Module): def __init__(self): super(WeightedLoss, self).__init__() self.weighted = False def generate_weight_mask(self, mask, to_ignore=None): """ Generates a weight mask where pixel weights are inversely proportional to ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
FANG-Xiaolin/uois
BCEWithLogitsLossWeighted
false
2,225
[ "MIT" ]
0
7489e69d1513faf2f3f030a441abdd33ca22304c
https://github.com/FANG-Xiaolin/uois/tree/7489e69d1513faf2f3f030a441abdd33ca22304c
import torch import torch.nn as nn class WeightedLoss(nn.Module): def __init__(self): super().__init__() self.weighted = False def generate_weight_mask(self, mask, to_ignore=None): """ Generates a weight mask where pixel weights are inversely proportional to how many pix...
Attn
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.init class Attn(nn.Module): def __init__(self, method, hidden_size): super(Attn, self).__init__() self.method = method self.hidden_size = hidden_size self.attn = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ChrisGeishauser/ConvLab-2
Attn
false
2,226
[ "Apache-2.0" ]
0
8f55d033c6e2453fdc092c4f504be3973a55e7ea
https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.init class Model(nn.Module): def __init__(self, method, hidden_size): super().__init__() self.method = method self.hidden_size = hidden_size self.attn = nn.Linear...
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 from torch.nn.parameter import Parameter from itertools import product as product class Scale(nn.Module): def __init__(self, channels): super(Scale, self).__init__() self.weight = Parameter(torch.Tensor(channels)) self.bias = Parameter(torch.Tensor(chann...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.nn.parameter import Parameter from itertools import product as product assert_size_stride = torch._C._dynam...
DongChengdongHangZhou/caffe-to-pytorch
Scale
false
2,227
[ "Apache-2.0" ]
0
5e3104f3aa77d35bad5d2de235b067460c136fd5
https://github.com/DongChengdongHangZhou/caffe-to-pytorch/tree/5e3104f3aa77d35bad5d2de235b067460c136fd5
import torch import torch.nn as nn from torch.nn.parameter import Parameter from itertools import product as product class Model(nn.Module): def __init__(self, channels): super().__init__() self.weight = Parameter(torch.Tensor(channels)) self.bias = Parameter(torch.Tensor(channels)) ...
PositionwiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.init class PositionwiseFeedForward(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super(PositionwiseFeedForward, self).__init__() self....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ChrisGeishauser/ConvLab-2
PositionwiseFeedForward
false
2,228
[ "Apache-2.0" ]
0
8f55d033c6e2453fdc092c4f504be3973a55e7ea
https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.init class Model(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1 = nn.Conv1d(d_in, d_hid, 1) self.w_...
BPR_max
# 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 BPR_max(nn.Module): def __init__(self): super(BPR_max, self).__init__() def forward(self, logit): logit_softmax = F.softmax(logit, dim=1) diff = logit.diag().view(-1, 1).expand_as(logit) - logit loss = -...
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 ...
Ethan-Yys/GRU4REC-pytorch-master
BPR_max
false
2,229
[ "Apache-2.0" ]
0
175ccb851f881d3506680c459491e76f50aa9898
https://github.com/Ethan-Yys/GRU4REC-pytorch-master/tree/175ccb851f881d3506680c459491e76f50aa9898
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, logit): logit_softmax = F.softmax(logit, dim=1) diff = logit.diag().view(-1, 1).expand_as(logit) - logit loss = -torch.log(torch...
SilogLoss
# 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 SilogLoss(nn.Module): def __init__(self, ratio=10, ratio2=0.85): super().__init__() self.ratio = ratio self.ratio2 = ratio2 def forward(self, pred, gt): log_diff = torch.log(pred * self.ratio) - torch.log(gt * self.ratio) silog...
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...
Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-
SilogLoss
false
2,230
[ "MIT" ]
0
13fac05601efed16ae8b29989aad487e04cd90a7
https://github.com/Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-/tree/13fac05601efed16ae8b29989aad487e04cd90a7
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, ratio=10, ratio2=0.85): super().__init__() self.ratio = ratio self.ratio2 = ratio2 def forward(self, pred, gt): log_diff = torch.log(pred * self.ratio) - torch.log(gt * self.ratio) silog1 = ...
PatchEmbed
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from itertools import chain as chain import torch.utils.data import torch.nn as nn class PatchEmbed(nn.Module): """ PatchEmbed. """ def __init__(self, dim_in=3, dim_out=768, kernel=(1, 16, 16), stride=(1, 4, 4), padding=(1, 7, 7), conv_2d=False): super().__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from itertools import chain as chain import torch.utils.data import torch.nn as ...
Drill-D/SlowFast
PatchEmbed
false
2,231
[ "Apache-2.0" ]
0
d55ae1cf30a9415858a9bd5da983790a2b418653
https://github.com/Drill-D/SlowFast/tree/d55ae1cf30a9415858a9bd5da983790a2b418653
import torch from itertools import chain as chain import torch.utils.data import torch.nn as nn class Model(nn.Module): """ PatchEmbed. """ def __init__(self, dim_in=3, dim_out=768, kernel=(1, 16, 16), stride=(1, 4, 4), padding=(1, 7, 7), conv_2d=False): super().__init__() if ...
ThreeNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 ThreeNet(nn.Module): """ A network with three layers. This is used for testing a network with more than one operation. The network has a convolution layer followed by two fully connected layers. """ def __init__(self, input_dim: 'int', conv_dim: '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...
DenXX/fvcore
ThreeNet
false
2,232
[ "Apache-2.0" ]
0
4b91cf092f4f5d379b2c93398780a3b5755e7179
https://github.com/DenXX/fvcore/tree/4b91cf092f4f5d379b2c93398780a3b5755e7179
import torch import torch.nn as nn class Model(nn.Module): """ A network with three layers. This is used for testing a network with more than one operation. The network has a convolution layer followed by two fully connected layers. """ def __init__(self, input_dim: 'int', conv_dim: 'int', li...
Hidden2Discrete
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.init class Hidden2Discrete(nn.Module): def __init__(self, input_size, y_size, k_size, is_lstm=False, has_bias=True ): super(Hidden2Discrete, self).__init__() self.y_size = y_size ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ChrisGeishauser/ConvLab-2
Hidden2Discrete
false
2,233
[ "Apache-2.0" ]
0
8f55d033c6e2453fdc092c4f504be3973a55e7ea
https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.nn.init class Model(nn.Module): def __init__(self, input_size, y_size, k_size, is_lstm=False, has_bias=True ): super().__init__() self.y_size = y_size self.k_size = k_size ...
NormKLLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch.nn.init import torch as th from torch.nn.modules.loss import _Loss class NormKLLoss(_Loss): def __init__(self, unit_average=False): super(NormKLLoss, self).__init__() self.unit_average = unit_average def forward(self, recog_mu, recog_logvar, ...
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.utils.data import torch.nn.init from torch.nn.modules.loss i...
ChrisGeishauser/ConvLab-2
NormKLLoss
false
2,234
[ "Apache-2.0" ]
0
8f55d033c6e2453fdc092c4f504be3973a55e7ea
https://github.com/ChrisGeishauser/ConvLab-2/tree/8f55d033c6e2453fdc092c4f504be3973a55e7ea
import torch import torch.utils.data import torch.nn.init import torch as th from torch.nn.modules.loss import _Loss class Model(_Loss): def __init__(self, unit_average=False): super().__init__() self.unit_average = unit_average def forward(self, recog_mu, recog_logvar, prior_mu, prior_logva...
tofp16
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim class tofp16(nn.Module): """ Model wrapper that implements:: def forward(self, input): return input.half() """ def __init__(self): su...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim assert_size_st...
FDecaYed/apex
tofp16
false
2,235
[ "BSD-3-Clause" ]
0
789afd89fe2c5a3e772f557055a9cf0f5e9d1241
https://github.com/FDecaYed/apex/tree/789afd89fe2c5a3e772f557055a9cf0f5e9d1241
import torch import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim class Model(nn.Module): """ Model wrapper that implements:: def forward(self, input): return input.half() """ def __init__(self): sup...
ConvBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class Conv3x3(nn.Module): """Layer to pad and convolve input """ def __init__(self, in_channels, out_channels, use_refl=True): super(Conv3x3, self).__init__() if use_refl: self.pad = nn.ReflectionPad2d(1) else: self.pad = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-
ConvBlock
false
2,236
[ "MIT" ]
0
13fac05601efed16ae8b29989aad487e04cd90a7
https://github.com/Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-/tree/13fac05601efed16ae8b29989aad487e04cd90a7
import torch import torch.nn as nn class Conv3x3(nn.Module): """Layer to pad and convolve input """ def __init__(self, in_channels, out_channels, use_refl=True): super().__init__() if use_refl: self.pad = nn.ReflectionPad2d(1) else: self.pad = nn.ZeroPad2d(...
PairwiseBCELoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from abc import abstractmethod import torch.utils.data.dataloader import torch.nn.functional as F import torch.nn as nn import torch.nn class SimilarityLoss(nn.Module): def __init__(self): super(SimilarityLoss, self).__init__() @abstractmethod def forward(self, inputs, targets): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from abc im...
FranziskaKuhls/flair
PairwiseBCELoss
false
2,237
[ "MIT" ]
0
2bd9e72c961651c7c020076cb8fd80cbbb36da7c
https://github.com/FranziskaKuhls/flair/tree/2bd9e72c961651c7c020076cb8fd80cbbb36da7c
import torch from abc import abstractmethod import torch.utils.data.dataloader import torch.nn.functional as F import torch.nn as nn import torch.nn class SimilarityLoss(nn.Module): def __init__(self): super().__init__() @abstractmethod def forward(self, inputs, targets): pass class Mo...
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): """ A wrapper for PyTorch sine function. """ def __init__(self, w0=1.0): super().__init__() self.w0 = w0 @staticmethod def forward(x): return torch.sin(x) 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 from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
FinbarArgus/phynn
Sine
false
2,238
[ "Apache-2.0" ]
0
436bfd6fa4ad86692bf12b4f76c92bc177626c40
https://github.com/FinbarArgus/phynn/tree/436bfd6fa4ad86692bf12b4f76c92bc177626c40
import torch import torch.nn as nn class Model(nn.Module): """ A wrapper for PyTorch sine function. """ def __init__(self, w0=1.0): super().__init__() self.w0 = w0 @staticmethod def forward(x): return torch.sin(x) def get_inputs(): return [torch.rand([4, 4, 4, 4...
InvDepth
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 InvDepth(nn.Module): """Inverse depth layer""" def __init__(self, in_channels, out_channels=1, min_depth=0.5): """ Initializes an InvDepth object. Parameters ---------- in_channels : int Number of input channels ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-
InvDepth
false
2,239
[ "MIT" ]
0
13fac05601efed16ae8b29989aad487e04cd90a7
https://github.com/Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-/tree/13fac05601efed16ae8b29989aad487e04cd90a7
import torch import torch.nn as nn class Model(nn.Module): """Inverse depth layer""" def __init__(self, in_channels, out_channels=1, min_depth=0.5): """ Initializes an InvDepth object. Parameters ---------- in_channels : int Number of input channels ...
FeatNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 class FeatNet(nn.Module): def __init__(self): super(FeatNet, self).__init__() self.conv1 = nn.Conv2d(in_channels=1, out_channels=16, kernel_size= (3, 7), stride=1, padding=(1, 3), bias=False) self.tanh...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
DongChengdongHangZhou/caffe-to-pytorch
FeatNet
false
2,240
[ "Apache-2.0" ]
0
5e3104f3aa77d35bad5d2de235b067460c136fd5
https://github.com/DongChengdongHangZhou/caffe-to-pytorch/tree/5e3104f3aa77d35bad5d2de235b067460c136fd5
import torch import torch.nn as nn from itertools import product as product class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(in_channels=1, out_channels=16, kernel_size= (3, 7), stride=1, padding=(1, 3), bias=False) self.tanh1 = nn.Tanh() ...
PaddedMaxPool2d
# 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 PaddedMaxPool2d(nn.Module): """ Maxpool layer with a replicating padding. Args: kernel_size (int or tuple): Kernel size for maxpooling stride (int or tuple, optional): The stride of the window; Default ``kernel_size`` ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
FenryrMKIII/objectDetection-lightnet
PaddedMaxPool2d
false
2,241
[ "MIT" ]
0
3a1fa7b77227210060714a9e22d7d241888b36b4
https://github.com/FenryrMKIII/objectDetection-lightnet/tree/3a1fa7b77227210060714a9e22d7d241888b36b4
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Maxpool layer with a replicating padding. Args: kernel_size (int or tuple): Kernel size for maxpooling stride (int or tuple, optional): The stride of the window; Default ``kernel_size`` padd...
Residual
# 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 Residual(nn.Sequential): """ Residual block that runs like a Sequential, but then adds the original input to the output tensor. See :class:`torch.nn.Sequential` for more information. Warning: The dimension between the input and output of the mo...
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...
FenryrMKIII/objectDetection-lightnet
Residual
false
2,242
[ "MIT" ]
0
3a1fa7b77227210060714a9e22d7d241888b36b4
https://github.com/FenryrMKIII/objectDetection-lightnet/tree/3a1fa7b77227210060714a9e22d7d241888b36b4
import torch import torch.nn as nn class Model(nn.Sequential): """ Residual block that runs like a Sequential, but then adds the original input to the output tensor. See :class:`torch.nn.Sequential` for more information. Warning: The dimension between the input and output of the modul...
CELossWeightedMasked
# 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 WeightedLoss(nn.Module): def __init__(self): super(WeightedLoss, self).__init__() self.weighted = False def generate_weight_mask(self, mask, to_ignore=None): """ Generates a weight mask where pixel weights are inversely proportional to ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
FANG-Xiaolin/uois
CELossWeightedMasked
false
2,243
[ "MIT" ]
0
7489e69d1513faf2f3f030a441abdd33ca22304c
https://github.com/FANG-Xiaolin/uois/tree/7489e69d1513faf2f3f030a441abdd33ca22304c
import torch import torch.nn as nn class WeightedLoss(nn.Module): def __init__(self): super().__init__() self.weighted = False def generate_weight_mask(self, mask, to_ignore=None): """ Generates a weight mask where pixel weights are inversely proportional to how many pix...
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 class upsample(nn.Module): def __init__(self, scale_factor): super(upsample, self).__init__() self.scale_factor = scale_factor def forward(self, x): return nn.functional.interpolate(x, scale_factor=self.scale_factor) def get_inputs(): return [...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
FMsunyh/CornerNet-Lite
upsample
false
2,244
[ "BSD-3-Clause" ]
0
85770fa6682646d572a5bd2277a0075d6dd22b93
https://github.com/FMsunyh/CornerNet-Lite/tree/85770fa6682646d572a5bd2277a0075d6dd22b93
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, scale_factor): super().__init__() self.scale_factor = scale_factor def forward(self, x): return nn.functional.interpolate(x, scale_factor=self.scale_factor) def get_inputs(): return [torch.rand([4, 4,...
Conv3x3
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Conv3x3(nn.Module): """Layer to pad and convolve input """ def __init__(self, in_channels, out_channels, use_refl=True): super(Conv3x3, self).__init__() if use_refl: self.pad = nn.ReflectionPad2d(1) else: self.pad = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-
Conv3x3
false
2,245
[ "MIT" ]
0
13fac05601efed16ae8b29989aad487e04cd90a7
https://github.com/Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-/tree/13fac05601efed16ae8b29989aad487e04cd90a7
import torch import torch.nn as nn class Model(nn.Module): """Layer to pad and convolve input """ def __init__(self, in_channels, out_channels, use_refl=True): super().__init__() if use_refl: self.pad = nn.ReflectionPad2d(1) else: self.pad = nn.ZeroPad2d(1)...
Conv2d_GN_ReLUx2
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Conv2d_GN_ReLU(nn.Module): """ Implements a module that performs conv2d + groupnorm + ReLU + Assumes kernel size is odd """ def __init__(self, in_channels, out_channels, num_groups, ksize=3, stride=1 ): super(Conv2d_GN_ReLU, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
FANG-Xiaolin/uois
Conv2d_GN_ReLUx2
false
2,246
[ "MIT" ]
0
7489e69d1513faf2f3f030a441abdd33ca22304c
https://github.com/FANG-Xiaolin/uois/tree/7489e69d1513faf2f3f030a441abdd33ca22304c
import torch import torch.nn as nn class Conv2d_GN_ReLU(nn.Module): """ Implements a module that performs conv2d + groupnorm + ReLU + Assumes kernel size is odd """ def __init__(self, in_channels, out_channels, num_groups, ksize=3, stride=1 ): super().__init__() ...
Reorg
# 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 Reorg(nn.Module): """ This layer reorganizes a tensor according to a stride. The dimensions 2,3 will be sliced by the stride and then stacked in dimension 1. (input must have 4 dimensions) Args: stride (int): stride to divide the input tensor """ ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
FenryrMKIII/objectDetection-lightnet
Reorg
false
2,247
[ "MIT" ]
0
3a1fa7b77227210060714a9e22d7d241888b36b4
https://github.com/FenryrMKIII/objectDetection-lightnet/tree/3a1fa7b77227210060714a9e22d7d241888b36b4
import torch import torch.nn as nn class Model(nn.Module): """ This layer reorganizes a tensor according to a stride. The dimensions 2,3 will be sliced by the stride and then stacked in dimension 1. (input must have 4 dimensions) Args: stride (int): stride to divide the input tensor """ ...
LayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.parallel class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-05, affine=True): super(LayerNorm, self).__init__() self.num_features = num_features self.affine = affine self.eps = eps if self.affine: ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.nn.parallel assert_size_stride = torch._C._d...
FUTUREEEEEE/S2R-DepthNet
LayerNorm
false
2,248
[ "MIT" ]
0
415cc40aef10f9540026ff435d14a9ba9e30ad74
https://github.com/FUTUREEEEEE/S2R-DepthNet/tree/415cc40aef10f9540026ff435d14a9ba9e30ad74
import torch import torch.nn as nn import torch.nn.parallel class Model(nn.Module): def __init__(self, num_features, eps=1e-05, affine=True): super().__init__() self.num_features = num_features self.affine = affine self.eps = eps if self.affine: self.gamma = nn...
Conv2dBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super(AdaptiveInstanceNorm2d, self).__init__() self.num_features = num_features self.eps = eps ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
FUTUREEEEEE/S2R-DepthNet
Conv2dBlock
false
2,249
[ "MIT" ]
0
415cc40aef10f9540026ff435d14a9ba9e30ad74
https://github.com/FUTUREEEEEE/S2R-DepthNet/tree/415cc40aef10f9540026ff435d14a9ba9e30ad74
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super().__init__() self.num_features = num_features self.eps = eps self.momentum = moment...
Siren
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F class Sine(nn.Module): """ A wrapper for PyTorch sine function. """ def __init__(self, w0=1.0): super().__init__() self.w0 = w0 @staticmethod def forward(x): return torch.sin(x) class Sir...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 math i...
FinbarArgus/phynn
Siren
false
2,250
[ "Apache-2.0" ]
0
436bfd6fa4ad86692bf12b4f76c92bc177626c40
https://github.com/FinbarArgus/phynn/tree/436bfd6fa4ad86692bf12b4f76c92bc177626c40
import math import torch import torch.nn as nn import torch.nn.functional as F class Sine(nn.Module): """ A wrapper for PyTorch sine function. """ def __init__(self, w0=1.0): super().__init__() self.w0 = w0 @staticmethod def forward(x): return torch.sin(x) class Mod...
ResBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super(AdaptiveInstanceNorm2d, self).__init__() self.num_features = num_features self.eps = eps ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
FUTUREEEEEE/S2R-DepthNet
ResBlock
false
2,251
[ "MIT" ]
0
415cc40aef10f9540026ff435d14a9ba9e30ad74
https://github.com/FUTUREEEEEE/S2R-DepthNet/tree/415cc40aef10f9540026ff435d14a9ba9e30ad74
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super().__init__() self.num_features = num_features self.eps = eps self.momentum = moment...
UnpackLayerConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Conv2D(nn.Module): """ 2D convolution with GroupNorm and ELU Parameters ---------- in_channels : int Number of input channels out_channels : int Number of output channels kernel_size : int Kernel size stride : int ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-
UnpackLayerConv2d
false
2,252
[ "MIT" ]
0
13fac05601efed16ae8b29989aad487e04cd90a7
https://github.com/Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-/tree/13fac05601efed16ae8b29989aad487e04cd90a7
import torch import torch.nn as nn class Conv2D(nn.Module): """ 2D convolution with GroupNorm and ELU Parameters ---------- in_channels : int Number of input channels out_channels : int Number of output channels kernel_size : int Kernel size stride : int ...
DAInsHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils.data import torch.nn.functional as F from torch import nn class DAInsHead(nn.Module): """ Adds a simple Instance-level Domain Classifier head """ def __init__(self, in_channels): """ Arguments: in_channels (int): number of channels of the in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.utils.data from ...
Feobi1999/unbiased-teacher
DAInsHead
false
2,254
[ "MIT" ]
0
9baacec16833bdff0dc089057e50903a92c700cb
https://github.com/Feobi1999/unbiased-teacher/tree/9baacec16833bdff0dc089057e50903a92c700cb
import torch import torch.utils.data import torch.nn.functional as F from torch import nn class Model(nn.Module): """ Adds a simple Instance-level Domain Classifier head """ def __init__(self, in_channels): """ Arguments: in_channels (int): number of channels of the input ...
Network
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Network(nn.Module): def __init__(self, input_size, nb_action): super(Network, self).__init__() self.input_size = input_size self.nb_action = nb_action self.fc1 = nn.Linear(input_size, 30) self.fc2 = 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_...
Flames-LLC/GX-V1NLPModule
Network
false
2,255
[ "MIT" ]
0
85e656c02269e57384b6e67ab4e4bceef4feb92e
https://github.com/Flames-LLC/GX-V1NLPModule/tree/85e656c02269e57384b6e67ab4e4bceef4feb92e
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_size, nb_action): super().__init__() self.input_size = input_size self.nb_action = nb_action self.fc1 = nn.Linear(input_size, 30) self.fc2 = nn.Linear(30, nb...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch.nn.functional as F from torch import nn class FocalLoss(nn.Module): def __init__(self, weight=None, gamma=1.0, num_classes=80): super(FocalLoss, self).__init__() assert gamma >= 0 self.gamma = gamma self.weight = weight sel...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.utils.dat...
Feobi1999/unbiased-teacher
FocalLoss
false
2,256
[ "MIT" ]
0
9baacec16833bdff0dc089057e50903a92c700cb
https://github.com/Feobi1999/unbiased-teacher/tree/9baacec16833bdff0dc089057e50903a92c700cb
import torch import torch.utils.data import torch.nn.functional as F from torch import nn class Model(nn.Module): def __init__(self, weight=None, gamma=1.0, num_classes=80): super().__init__() assert gamma >= 0 self.gamma = gamma self.weight = weight self.num_classes = num...
RankingLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from abc import abstractmethod import torch.utils.data.dataloader import torch.nn.functional as F import torch.nn as nn import torch.nn class SimilarityLoss(nn.Module): def __init__(self): super(SimilarityLoss, self).__init__() @abstractmethod def forward(self, inputs, targets): ...
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 abc import abstractmethod import torch.utils.data.dataloader import torch.nn as nn i...
FranziskaKuhls/flair
RankingLoss
false
2,257
[ "MIT" ]
0
2bd9e72c961651c7c020076cb8fd80cbbb36da7c
https://github.com/FranziskaKuhls/flair/tree/2bd9e72c961651c7c020076cb8fd80cbbb36da7c
import torch from abc import abstractmethod import torch.utils.data.dataloader import torch.nn.functional as F import torch.nn as nn import torch.nn class SimilarityLoss(nn.Module): def __init__(self): super().__init__() @abstractmethod def forward(self, inputs, targets): pass class Mo...