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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
FM | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from sklearn.metrics import *
class FM(nn.Module):
"""Factorization Machine models pairwise (order-2) feature interactions
without linear term and bias.
Input shape
- 3D tensor with shape: ``(batch_size,field_size,embedding_size)``.
Output shape
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = tor... | chenkkkk/DeepCTR-PyTorch | FM | false | 6,427 | [
"Apache-2.0"
] | 1 | a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | https://github.com/chenkkkk/DeepCTR-PyTorch/tree/a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | import torch
import torch.nn as nn
from sklearn.metrics import *
class Model(nn.Module):
"""Factorization Machine models pairwise (order-2) feature interactions
without linear term and bias.
Input shape
- 3D tensor with shape: ``(batch_size,field_size,embedding_size)``.
Output shape
... |
USConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 USConv2d(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, bias=True, us=[False, False]):
super(USConv2d, self).__init__(in_channels, out_channels,
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | chenbong/torchsummaryDynamic | USConv2d | false | 6,428 | [
"MIT"
] | 1 | 48ad7e46c4c762dda335b496313ed63b76507b59 | https://github.com/chenbong/torchsummaryDynamic/tree/48ad7e46c4c762dda335b496313ed63b76507b59 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, bias=True, us=[False, False]):
super().__init__(in_channels, out_channels,
kernel_size, stri... |
DenseModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 DenseModel(nn.Module):
def __init__(self, input_dim, num_classes=2):
super(DenseModel, self).__init__()
self.fc1 = nn.Linear(input_dim, 400)
self.relu1 = nn.ReLU(inplace=True)
self.fc2 = nn.Linear(400, 400)
self.relu2 = nn.ReLU(inpl... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | chawins/adv-exp | DenseModel | false | 6,429 | [
"MIT"
] | 1 | 5423e135c5599e4ec2bf90372916d8d05c89f285 | https://github.com/chawins/adv-exp/tree/5423e135c5599e4ec2bf90372916d8d05c89f285 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, num_classes=2):
super().__init__()
self.fc1 = nn.Linear(input_dim, 400)
self.relu1 = nn.ReLU(inplace=True)
self.fc2 = nn.Linear(400, 400)
self.relu2 = nn.ReLU(inplace=True)
if ... |
PredictionLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 sklearn.metrics import *
class PredictionLayer(nn.Module):
"""
Arguments
- **task**: str, ``"binary"`` for binary logloss or ``"regression"`` for regression loss
- **use_bias**: bool.Whether add bias term or not.
"""
def __init__(self, tas... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = tor... | chenkkkk/DeepCTR-PyTorch | PredictionLayer | false | 6,430 | [
"Apache-2.0"
] | 1 | a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | https://github.com/chenkkkk/DeepCTR-PyTorch/tree/a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | import torch
import torch.nn as nn
from sklearn.metrics import *
class Model(nn.Module):
"""
Arguments
- **task**: str, ``"binary"`` for binary logloss or ``"regression"`` for regression loss
- **use_bias**: bool.Whether add bias term or not.
"""
def __init__(self, task='binary'... |
NPairLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class NPairLoss(torch.nn.Module):
def __init__(self, l2=0.05):
"""
Basic N-Pair Loss as proposed in 'Improved Deep Metric Learning with Multi-class N-pair Loss Objective'
Args:
l2: float, weighting parameter for weight penality due to embeddings not being normaliz... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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
assert_size_s... | bm2-lab/scPrivacy | NPairLoss | false | 6,431 | [
"MIT"
] | 1 | 444c8f3a5e7b890c299cd823359e5414f73d6205 | https://github.com/bm2-lab/scPrivacy/tree/444c8f3a5e7b890c299cd823359e5414f73d6205 | import torch
class Model(torch.nn.Module):
def __init__(self, l2=0.05):
"""
Basic N-Pair Loss as proposed in 'Improved Deep Metric Learning with Multi-class N-pair Loss Objective'
Args:
l2: float, weighting parameter for weight penality due to embeddings not being normalized.
... |
InnerProductLayer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from sklearn.metrics import *
class InnerProductLayer(nn.Module):
"""InnerProduct Layer used in PNN that compute the element-wise
product or inner product between feature vectors.
Input shape
- a list of 3D tensor with shape: ``(batch_size,1,embedding_size)``.
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = tor... | chenkkkk/DeepCTR-PyTorch | InnerProductLayer | false | 6,432 | [
"Apache-2.0"
] | 1 | a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | https://github.com/chenkkkk/DeepCTR-PyTorch/tree/a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | import torch
import torch.nn as nn
from sklearn.metrics import *
class Model(nn.Module):
"""InnerProduct Layer used in PNN that compute the element-wise
product or inner product between feature vectors.
Input shape
- a list of 3D tensor with shape: ``(batch_size,1,embedding_size)``.
Output... |
DilateContourLoss | # 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.nn.functional as F
class DilateContourLoss(nn.Module):
def __init__(self):
super(DilateContourLoss, self).__init__()
self.kernel = np.ones((3, 3), np.uint8)
def forward(self, y_pred, y_true):
assert y_pred.size() == y... | 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.nn as nn
assert_size_stride = torch._C._dynamo.guards.ass... | chexqi/Tube_Contour_Detection | DilateContourLoss | false | 6,433 | [
"MIT"
] | 1 | d629c992022f22fb3338b6436fcaadab438f8bfb | https://github.com/chexqi/Tube_Contour_Detection/tree/d629c992022f22fb3338b6436fcaadab438f8bfb | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.kernel = np.ones((3, 3), np.uint8)
def forward(self, y_pred, y_true):
assert y_pred.size() == y_true.size()
Dilate_y_pred ... |
DenseModelV2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 DenseModelV2(nn.Module):
def __init__(self, input_dim, num_classes=2):
super(DenseModelV2, self).__init__()
self.fc1 = nn.Linear(input_dim, 2000)
self.relu1 = nn.ReLU(inplace=True)
self.fc2 = nn.Linear(2000, 2000)
self.relu2 = nn.Re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | chawins/adv-exp | DenseModelV2 | false | 6,434 | [
"MIT"
] | 1 | 5423e135c5599e4ec2bf90372916d8d05c89f285 | https://github.com/chawins/adv-exp/tree/5423e135c5599e4ec2bf90372916d8d05c89f285 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, num_classes=2):
super().__init__()
self.fc1 = nn.Linear(input_dim, 2000)
self.relu1 = nn.ReLU(inplace=True)
self.fc2 = nn.Linear(2000, 2000)
self.relu2 = nn.ReLU(inplace=True)
... |
FC | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 FC(nn.Module):
"""FC baseline implementation"""
def __init__(self):
super(FC, self).__init__()
self.fc1 = nn.Linear(45 * 45, 1024)
self.fc2 = nn.Linear(1024, 256)
self.fc3 = nn.Linear(256, 64)
sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | chenxi-wang/cs420-codes | FC | false | 6,435 | [
"MIT"
] | 1 | 756b71ea4f4d8c4694c8c3f32ed9d1c6e89fad15 | https://github.com/chenxi-wang/cs420-codes/tree/756b71ea4f4d8c4694c8c3f32ed9d1c6e89fad15 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""FC baseline implementation"""
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(45 * 45, 1024)
self.fc2 = nn.Linear(1024, 256)
self.fc3 = nn.Linear(256, 64)
self.fc4... |
FocalLossV2 | # 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 FocalSigmoidLossFunc(torch.autograd.Function):
"""
compute backward directly for better numeric stability
"""
@staticmethod
def forward(ctx, logits, label, alpha, gamma, reduction):
logits = logits.float()
co... | 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... | chizhu/pytorch-loss | FocalLossV2 | false | 6,436 | [
"MIT"
] | 1 | c8fbd78771f11a910b0b51ae3697c09761dd9696 | https://github.com/chizhu/pytorch-loss/tree/c8fbd78771f11a910b0b51ae3697c09761dd9696 | import torch
import torch.nn as nn
import torch.nn.functional as F
class FocalSigmoidLossFunc(torch.autograd.Function):
"""
compute backward directly for better numeric stability
"""
@staticmethod
def forward(ctx, logits, label, alpha, gamma, reduction):
logits = logits.float()
co... |
SwishV2 | # 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 SwishFunction(torch.autograd.Function):
@staticmethod
def forward(ctx, feat):
sig = torch.sigmoid(feat)
out = feat * torch.sigmoid(feat)
grad = sig * (1 + feat * (1 - sig))
ctx.grad = grad
return out
@staticmethod
def b... | 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... | chizhu/pytorch-loss | SwishV2 | false | 6,437 | [
"MIT"
] | 1 | c8fbd78771f11a910b0b51ae3697c09761dd9696 | https://github.com/chizhu/pytorch-loss/tree/c8fbd78771f11a910b0b51ae3697c09761dd9696 | import torch
import torch.nn as nn
class SwishFunction(torch.autograd.Function):
@staticmethod
def forward(ctx, feat):
sig = torch.sigmoid(feat)
out = feat * torch.sigmoid(feat)
grad = sig * (1 + feat * (1 - sig))
ctx.grad = grad
return out
@staticmethod
def b... |
PositionEmbedding | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
from torch import nn
class PositionEmbedding(nn.Module):
"""
adpated from transformers package by huggingface.
"""
def __init__(self, config):
super(PositionEmbedding, self).__init__()
self.config = config
self.pos_emb... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | choumartin1234/Music-Eye | PositionEmbedding | false | 6,438 | [
"MIT"
] | 1 | 059b43fd21f7e7bf6c84cb35a03fd936e64b59a5 | https://github.com/choumartin1234/Music-Eye/tree/059b43fd21f7e7bf6c84cb35a03fd936e64b59a5 | from _paritybench_helpers import _mock_config
import torch
from torch import nn
class Model(nn.Module):
"""
adpated from transformers package by huggingface.
"""
def __init__(self, config):
super().__init__()
self.config = config
self.pos_embs = nn.Embedding(config['trans_max_... |
FocalLossV1 | # 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 FocalLossV1(nn.Module):
def __init__(self, alpha=0.25, gamma=2, reduction='mean'):
super(FocalLossV1, self).__init__()
self.alpha = alpha
self.gamma = gamma
self.reduction = reduction
self.crit = nn.BCEWithLogitsLoss(reduction='none... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | chizhu/pytorch-loss | FocalLossV1 | false | 6,439 | [
"MIT"
] | 1 | c8fbd78771f11a910b0b51ae3697c09761dd9696 | https://github.com/chizhu/pytorch-loss/tree/c8fbd78771f11a910b0b51ae3697c09761dd9696 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, alpha=0.25, gamma=2, reduction='mean'):
super().__init__()
self.alpha = alpha
self.gamma = gamma
self.reduction = reduction
self.crit = nn.BCEWithLogitsLoss(reduction='none')
def forward(sel... |
InteractingLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import *
class InteractingLayer(nn.Module):
"""A Layer used in AutoInt that model the correlations between different feature fields by multi-head self-attention mechanism.
Input shape
- A 3D tensor with shape... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | chenkkkk/DeepCTR-PyTorch | InteractingLayer | false | 6,440 | [
"Apache-2.0"
] | 1 | a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | https://github.com/chenkkkk/DeepCTR-PyTorch/tree/a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import *
class Model(nn.Module):
"""A Layer used in AutoInt that model the correlations between different feature fields by multi-head self-attention mechanism.
Input shape
- A 3D tensor with shape: ``(batch_... |
ScaleNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ScaleNetwork(nn.Module):
"""Network for parameterizing a scaling function"""
def __init__(self, input_dim):
super(ScaleNetwork, self).__init__()
self.fc1 = nn.Linear(input_dim, 2000)
self.relu1 = nn.ReLU(inplace=True)
self.fc2 = 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 import triton_helpers
from torch._inductor.runtime.... | chawins/adv-exp | ScaleNetwork | false | 6,441 | [
"MIT"
] | 1 | 5423e135c5599e4ec2bf90372916d8d05c89f285 | https://github.com/chawins/adv-exp/tree/5423e135c5599e4ec2bf90372916d8d05c89f285 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Network for parameterizing a scaling function"""
def __init__(self, input_dim):
super().__init__()
self.fc1 = nn.Linear(input_dim, 2000)
self.relu1 = nn.ReLU(inplace=True)
self.fc2 = nn.Linear(2000, 2000)
se... |
CauchyLoss | # 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 *
import torch.nn as nn
class CauchyLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, y):
err = torch.sum(torch.pow(x - y, 2), dim=-1)
return torch.mean(torch.log(1 + err), dim=-1)
def get_inputs():
return [torch.rand([... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from typing import *
import torch.nn as nn
assert_size_stride = torch._C.... | ciwanceylan/gated-gradient-flow | CauchyLoss | false | 6,442 | [
"Apache-2.0"
] | 1 | c4f6c0c987f428697336e4514099aa7ef2351388 | https://github.com/ciwanceylan/gated-gradient-flow/tree/c4f6c0c987f428697336e4514099aa7ef2351388 | import torch
from typing import *
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, y):
err = torch.sum(torch.pow(x - y, 2), dim=-1)
return torch.mean(torch.log(1 + err), dim=-1)
def get_inputs():
return [torch.rand([4, 4,... |
LabelSmoothSoftmaxCEV1 | # 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 LabelSmoothSoftmaxCEV1(nn.Module):
"""
This is the autograd version, you can also try the LabelSmoothSoftmaxCEV2 that uses derived gradients
"""
def __init__(self, lb_smooth=0.1, reduction='mean', ignore_index=-100):
super(LabelSmoothSoftmaxCEV1, 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 math as tl_math
import torch.nn as nn
... | chizhu/pytorch-loss | LabelSmoothSoftmaxCEV1 | false | 6,443 | [
"MIT"
] | 1 | c8fbd78771f11a910b0b51ae3697c09761dd9696 | https://github.com/chizhu/pytorch-loss/tree/c8fbd78771f11a910b0b51ae3697c09761dd9696 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
This is the autograd version, you can also try the LabelSmoothSoftmaxCEV2 that uses derived gradients
"""
def __init__(self, lb_smooth=0.1, reduction='mean', ignore_index=-100):
super().__init__()
self.lb_smooth = lb_smoot... |
EncoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Norm(nn.Module):
def __init__(self, emb_dim, eps=1e-06):
super().__init__()
self.size = emb_dim
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.ze... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | chandar-lab/CriticalGradientOptimization | EncoderLayer | false | 6,444 | [
"MIT"
] | 1 | 1af4b1df40489991289bb50bb69859a00b2c97c6 | https://github.com/chandar-lab/CriticalGradientOptimization/tree/1af4b1df40489991289bb50bb69859a00b2c97c6 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Norm(nn.Module):
def __init__(self, emb_dim, eps=1e-06):
super().__init__()
self.size = emb_dim
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.ze... |
co_peak_loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
class co_peak_loss(nn.Module):
def __init__(self):
super(co_peak_loss, self).__init__()
def forward(self, co_peak_value):
a = -1 * co_peak_value
b = torch.max(torch.zeros_like(co_peak_value), a)
t = b + torch.log(torch.exp(-b) + torch.exp(a -... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | cj4L/DeepCO3-python | co_peak_loss | false | 6,445 | [
"MIT"
] | 1 | fa28ed7b43a3a236d0cc7bf31ce9fd68c01b5888 | https://github.com/cj4L/DeepCO3-python/tree/fa28ed7b43a3a236d0cc7bf31ce9fd68c01b5888 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, co_peak_value):
a = -1 * co_peak_value
b = torch.max(torch.zeros_like(co_peak_value), a)
t = b + torch.log(torch.exp(-b) + torch.exp(a - b))
loss = torch... |
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):
""" Applies attention mechanism on the `context` using the `query`.
**Thank you** to IBM for their initial implementation of :class:`Attention`. Here is
their `License
<https://github.com/IBM/pytorch-seq2seq/blob/master/LICENSE>`__.
Args:
di... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | choderalab/pisco | Attention | false | 6,446 | [
"MIT"
] | 1 | dccb36edf49960929cfb823f885d38cb84d444d1 | https://github.com/choderalab/pisco/tree/dccb36edf49960929cfb823f885d38cb84d444d1 | import torch
class Model(torch.nn.Module):
""" Applies attention mechanism on the `context` using the `query`.
**Thank you** to IBM for their initial implementation of :class:`Attention`. Here is
their `License
<https://github.com/IBM/pytorch-seq2seq/blob/master/LICENSE>`__.
Args:
dimens... |
DenseModelV3 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 DenseModelV3(nn.Module):
def __init__(self, input_dim, num_classes=2):
super(DenseModelV3, self).__init__()
self.fc1 = nn.Linear(input_dim, 2000)
self.relu1 = nn.ReLU(inplace=True)
self.fc2 = nn.Linear(2000, 2000)
self.relu2 = nn.Re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | chawins/adv-exp | DenseModelV3 | false | 6,447 | [
"MIT"
] | 1 | 5423e135c5599e4ec2bf90372916d8d05c89f285 | https://github.com/chawins/adv-exp/tree/5423e135c5599e4ec2bf90372916d8d05c89f285 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, num_classes=2):
super().__init__()
self.fc1 = nn.Linear(input_dim, 2000)
self.relu1 = nn.ReLU(inplace=True)
self.fc2 = nn.Linear(2000, 2000)
self.relu2 = nn.ReLU(inplace=True)
... |
Classifier | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
from torch import nn
class Classifier(nn.Module):
def __init__(self, dims):
"""
Single hidden layer classifier
with softmax output.
"""
super(Classifier, self).__init__()
[x_dim, h_dim, y_dim] = dims
self.dense =... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | chunglabmit/phathom | Classifier | false | 6,448 | [
"MIT"
] | 1 | 304db7a95e898e9b03d6b2640172752d21a7e3ed | https://github.com/chunglabmit/phathom/tree/304db7a95e898e9b03d6b2640172752d21a7e3ed | import torch
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
def __init__(self, dims):
"""
Single hidden layer classifier
with softmax output.
"""
super().__init__()
[x_dim, h_dim, y_dim] = dims
self.dense = nn.Linear(x_dim, h_d... |
Length | # 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 Length(nn.Module):
def __init__(self, dim=1, keepdim=True, p='fro'):
super(Length, self).__init__()
self.dim = dim
self.keepdim = keepdim
self.p = p
def forward(self, inputs):
return inputs.norm(dim=self.dim, keepdim=self.keepdi... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | clementpoiret/3D-AGSCaps | Length | false | 6,449 | [
"MIT"
] | 1 | 475eb1915bc1425cebbd0bec36e9096c9c2cb53c | https://github.com/clementpoiret/3D-AGSCaps/tree/475eb1915bc1425cebbd0bec36e9096c9c2cb53c | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim=1, keepdim=True, p='fro'):
super().__init__()
self.dim = dim
self.keepdim = keepdim
self.p = p
def forward(self, inputs):
return inputs.norm(dim=self.dim, keepdim=self.keepdim, p=self.p)
... |
ElemAffineNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ElemAffineNetwork(nn.Module):
"""Network for parameterizing affine transformation"""
def __init__(self, input_dim):
super(ElemAffineNetwork, self).__init__()
self.input_dim = input_dim
self.fc1 = nn.Linear(input_dim, 2000)
self.relu1 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | chawins/adv-exp | ElemAffineNetwork | false | 6,450 | [
"MIT"
] | 1 | 5423e135c5599e4ec2bf90372916d8d05c89f285 | https://github.com/chawins/adv-exp/tree/5423e135c5599e4ec2bf90372916d8d05c89f285 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Network for parameterizing affine transformation"""
def __init__(self, input_dim):
super().__init__()
self.input_dim = input_dim
self.fc1 = nn.Linear(input_dim, 2000)
self.relu1 = nn.ReLU(inplace=True)
self.... |
DecoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Norm(nn.Module):
def __init__(self, emb_dim, eps=1e-06):
super().__init__()
self.size = emb_dim
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.ze... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | chandar-lab/CriticalGradientOptimization | DecoderLayer | false | 6,451 | [
"MIT"
] | 1 | 1af4b1df40489991289bb50bb69859a00b2c97c6 | https://github.com/chandar-lab/CriticalGradientOptimization/tree/1af4b1df40489991289bb50bb69859a00b2c97c6 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Norm(nn.Module):
def __init__(self, emb_dim, eps=1e-06):
super().__init__()
self.size = emb_dim
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.ze... |
logreg | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
from torch.nn.utils import weight_norm
class logreg(nn.Module):
def __init__(self, input_size, classes):
super(logreg, self).__init__()
linear = nn.Linear(input_size, classes)
self.logistic_reg = weight_norm(linear, name='weight')... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | cjbumgardner/HE_for_Medical_Data | logreg | false | 6,452 | [
"MIT"
] | 1 | 248dcd8b48924fe1f6edbeee4e16282d4a31069a | https://github.com/cjbumgardner/HE_for_Medical_Data/tree/248dcd8b48924fe1f6edbeee4e16282d4a31069a | import torch
import torch.nn as nn
import torch.utils.data
from torch.nn.utils import weight_norm
class Model(nn.Module):
def __init__(self, input_size, classes):
super().__init__()
linear = nn.Linear(input_size, classes)
self.logistic_reg = weight_norm(linear, name='weight')
def for... |
affinity_loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
class affinity_loss(nn.Module):
def __init__(self):
super(affinity_loss, self).__init__()
def forward(self, pixel_affinity, sal_affinity, sal_diff):
loss = torch.mean(pixel_affinity * (1 - sal_affinity)
) + 4 * torch.mean(sal_diff * sal_affinity)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | cj4L/DeepCO3-python | affinity_loss | false | 6,453 | [
"MIT"
] | 1 | fa28ed7b43a3a236d0cc7bf31ce9fd68c01b5888 | https://github.com/cj4L/DeepCO3-python/tree/fa28ed7b43a3a236d0cc7bf31ce9fd68c01b5888 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, pixel_affinity, sal_affinity, sal_diff):
loss = torch.mean(pixel_affinity * (1 - sal_affinity)
) + 4 * torch.mean(sal_diff * sal_affinity)
return loss
def ... |
MulScalarNegative | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
class MulScalarNegative(nn.Module):
def __init__(self):
super().__init__()
self.float_op = nn.quantized.FloatFunctional()
self.quant = QuantStub()
self.dequant = ... | 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.quantization import QuantStub
from torch.quantization import DeQuantStub
assert_size_stride = torch._C._dyn... | cli99/tvm | MulScalarNegative | false | 6,454 | [
"Apache-2.0"
] | 1 | 6c6e873a1325a32418108daad6e38f3df8c37660 | https://github.com/cli99/tvm/tree/6c6e873a1325a32418108daad6e38f3df8c37660 | import torch
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
class Model(nn.Module):
def __init__(self):
super().__init__()
self.float_op = nn.quantized.FloatFunctional()
self.quant = QuantStub()
self.dequant = DeQuantStub(... |
GramMatrix | # 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
import torch.nn as nn
class GramMatrix(nn.Module):
def forward(self, input):
b, c, h, w = input.size()
F = input.view(b, c, h * w)
G = torch.bmm(F, F.transpose(1, 2))
G.div_(h * w)
return G
def get_inputs():
return [t... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch
import torch.nn as nn
assert_size_stride = ... | ckxy/1d_expan | GramMatrix | false | 6,455 | [
"MIT"
] | 1 | 29cc294e0314d738e8e041f34c995fd22f9f980b | https://github.com/ckxy/1d_expan/tree/29cc294e0314d738e8e041f34c995fd22f9f980b | import torch
import torch.utils.data
import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, input):
b, c, h, w = input.size()
F = input.view(b, c, h * w)
G = torch.bmm(F, F.transpose(1, 2))
G.div_(h * w)
return G
def get_inputs():
return [torch.... |
GramMSELoss | # 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
import torch.nn as nn
class GramMatrix(nn.Module):
def forward(self, input):
b, c, h, w = input.size()
F = input.view(b, c, h * w)
G = torch.bmm(F, F.transpose(1, 2))
G.div_(h * w)
return G
class GramMSELoss(nn.Module):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | ckxy/1d_expan | GramMSELoss | false | 6,456 | [
"MIT"
] | 1 | 29cc294e0314d738e8e041f34c995fd22f9f980b | https://github.com/ckxy/1d_expan/tree/29cc294e0314d738e8e041f34c995fd22f9f980b | import torch
import torch.utils.data
import torch
import torch.nn as nn
class GramMatrix(nn.Module):
def forward(self, input):
b, c, h, w = input.size()
F = input.view(b, c, h * w)
G = torch.bmm(F, F.transpose(1, 2))
G.div_(h * w)
return G
class Model(nn.Module):
de... |
PlanarNormalizingFlow | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
from torch import nn
class PlanarNormalizingFlow(nn.Module):
"""
Planar normalizing flow [Rezende & Mohamed 2015].
Provides a tighter bound on the ELBO by giving more expressive
power to the approximate distribution, such as by introducing
covariance be... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch import nn
assert_size_stride = torch._C._dynamo.gua... | chunglabmit/phathom | PlanarNormalizingFlow | false | 6,457 | [
"MIT"
] | 1 | 304db7a95e898e9b03d6b2640172752d21a7e3ed | https://github.com/chunglabmit/phathom/tree/304db7a95e898e9b03d6b2640172752d21a7e3ed | import torch
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
"""
Planar normalizing flow [Rezende & Mohamed 2015].
Provides a tighter bound on the ELBO by giving more expressive
power to the approximate distribution, such as by introducing
covariance between terms.
... |
poly | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
import torch.utils.data
class poly(nn.Module):
"""Polynomial activation function.
degreelist: list of powers of the polynomial.
"""
def __init__(self, degreelist):
super(poly, self).__init__()
self.degreelist = degreelist
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strid... | cjbumgardner/HE_for_Medical_Data | poly | false | 6,458 | [
"MIT"
] | 1 | 248dcd8b48924fe1f6edbeee4e16282d4a31069a | https://github.com/cjbumgardner/HE_for_Medical_Data/tree/248dcd8b48924fe1f6edbeee4e16282d4a31069a | import torch
import numpy as np
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""Polynomial activation function.
degreelist: list of powers of the polynomial.
"""
def __init__(self, degreelist):
super().__init__()
self.degreelist = degreelist
p = len(d... |
GCN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, 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
import numpy as np
import torch.nn as nn
from torch.nn.modules.module import Module
class GraphConvolution(Module):
def __init__(self, in_features, out_features, bias=True):
super(GraphConvolution, self).__init__()
self.in_features = in_feature... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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
import numpy as np
import torch.nn as nn... | cjx96/CDRIB | GCN | false | 6,459 | [
"MIT"
] | 1 | e0d2d2b70ec195a76b479b94fb7758d286350c39 | https://github.com/cjx96/CDRIB/tree/e0d2d2b70ec195a76b479b94fb7758d286350c39 | from torch.nn import Module
import math
import torch
import numpy as np
import torch.nn as nn
from torch.nn.modules.module import Module
class GraphConvolution(Module):
def __init__(self, in_features, out_features, bias=True):
super().__init__()
self.in_features = in_features
self.out_fea... |
SafeLength | # 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 SafeLength(nn.Module):
def __init__(self, dim=2, keepdim=False, eps=1e-07):
super(SafeLength, self).__init__()
self.dim = dim
self.keepdim = keepdim
self.eps = eps
def forward(self, x):
squared_norm = torch.sum(torch.square(x), ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | clementpoiret/3D-AGSCaps | SafeLength | false | 6,460 | [
"MIT"
] | 1 | 475eb1915bc1425cebbd0bec36e9096c9c2cb53c | https://github.com/clementpoiret/3D-AGSCaps/tree/475eb1915bc1425cebbd0bec36e9096c9c2cb53c | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, dim=2, keepdim=False, eps=1e-07):
super().__init__()
self.dim = dim
self.keepdim = keepdim
self.eps = eps
def forward(self, x):
squared_norm = torch.sum(torch.square(x), axis=self.dim, keepdi... |
StatsPool | # 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 warnings
import torch.nn as nn
from typing import Optional
import torch.optim
import torch.nn.functional as F
class StatsPool(nn.Module):
"""Statistics pooling
Compute temporal mean and (unbiased) standard deviation
and returns their concatenation.
Reference
---------
htt... | 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.optim
assert_size_stride = torch._C._dynamo.... | clmpt/pyannote-audio | StatsPool | false | 6,461 | [
"MIT"
] | 1 | 7d1b7959ca5f817e08176e44d52a7499bbd3149c | https://github.com/clmpt/pyannote-audio/tree/7d1b7959ca5f817e08176e44d52a7499bbd3149c | import torch
import warnings
import torch.nn as nn
from typing import Optional
import torch.optim
import torch.nn.functional as F
class Model(nn.Module):
"""Statistics pooling
Compute temporal mean and (unbiased) standard deviation
and returns their concatenation.
Reference
---------
https:/... |
UpsamplingBilinear | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
class UpsamplingBilinear(nn.Module):
def __init__(self):
super().__init__()
self.quant = QuantStub()
self.dequant = DeQuantStub()
def forward(self, x):
x = s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization im... | cli99/tvm | UpsamplingBilinear | false | 6,462 | [
"Apache-2.0"
] | 1 | 6c6e873a1325a32418108daad6e38f3df8c37660 | https://github.com/cli99/tvm/tree/6c6e873a1325a32418108daad6e38f3df8c37660 | import torch
import torch.nn as nn
from torch.quantization import QuantStub
from torch.quantization import DeQuantStub
class Model(nn.Module):
def __init__(self):
super().__init__()
self.quant = QuantStub()
self.dequant = DeQuantStub()
def forward(self, x):
x = self.quant(x)
... |
BinaryDiceLoss | # 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 BinaryDiceLoss(nn.Module):
"""Dice loss of binary class
Args:
smooth: A float number to smooth loss, and avoid NaN error, default: 1
p: Denominator value: \\sum{x^p} + \\sum{y^p}, default: 2
predict: A tensor of shape [N, *]
target: A te... | 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... | cnuzh/CSNet | BinaryDiceLoss | false | 6,463 | [
"MIT"
] | 1 | a6c3163624f55dc294ec2e5a6de020d77bd4ff91 | https://github.com/cnuzh/CSNet/tree/a6c3163624f55dc294ec2e5a6de020d77bd4ff91 | import torch
import torch.nn as nn
class Model(nn.Module):
"""Dice loss of binary class
Args:
smooth: A float number to smooth loss, and avoid NaN error, default: 1
p: Denominator value: \\sum{x^p} + \\sum{y^p}, default: 2
predict: A tensor of shape [N, *]
target: A tensor of s... |
BERTMultSelfOutput | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class BERTLayerNorm(nn.Module):
def __init__(self, config, multi_params=None, variance_epsilon=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(BERTLayerNorm... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | DAQuestionAnswering/Bert-n-Pals | BERTMultSelfOutput | false | 6,464 | [
"MIT"
] | 1 | d5a288b9ac62259e70c249635108ba3906e19f00 | https://github.com/DAQuestionAnswering/Bert-n-Pals/tree/d5a288b9ac62259e70c249635108ba3906e19f00 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class BERTLayerNorm(nn.Module):
def __init__(self, config, multi_params=None, variance_epsilon=1e-12):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super().__init__()
... |
AsymmetricLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | colinski/mmclassification | AsymmetricLoss | false | 6,465 | [
"Apache-2.0"
] | 1 | 447c8291bc2e2abda6f3eafe2e6d0f13d65843cb | https://github.com/colinski/mmclassification/tree/447c8291bc2e2abda6f3eafe2e6d0f13d65843cb | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
... |
ChannelAttentionBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ChannelAttentionBlock(nn.Module):
def __init__(self, in_channels):
super(ChannelAttentionBlock, self).__init__()
self.gamma = nn.Parameter(torch.zeros(1))
self.softmax = nn.Softmax(dim=-1)
def forward(self, x):
"""
:param x: 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
from torch._inductor.runtime.... | cnuzh/CSNet | ChannelAttentionBlock | false | 6,466 | [
"MIT"
] | 1 | a6c3163624f55dc294ec2e5a6de020d77bd4ff91 | https://github.com/cnuzh/CSNet/tree/a6c3163624f55dc294ec2e5a6de020d77bd4ff91 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels):
super().__init__()
self.gamma = nn.Parameter(torch.zeros(1))
self.softmax = nn.Softmax(dim=-1)
def forward(self, x):
"""
:param x: input( BxCxHxW )
:return: affinity va... |
DGCNLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
from torch.nn import Module
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.module import Module
class GraphConvolution(Module):
def __init__(self, in_features, out_features, bias=True):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
i... | cjx96/CDRIB | DGCNLayer | false | 6,467 | [
"MIT"
] | 1 | e0d2d2b70ec195a76b479b94fb7758d286350c39 | https://github.com/cjx96/CDRIB/tree/e0d2d2b70ec195a76b479b94fb7758d286350c39 | from _paritybench_helpers import _mock_config
from torch.nn import Module
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.module import Module
class GraphConvolution(Module):
def __init__(self, in_features, out_features, bias=True):
... |
GeneralizedMeanPooling | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import Tensor
import torch.nn as nn
from torch.functional import Tensor
import torch.nn.functional as F
from torch import Tensor
from torch.nn.parameter import Parameter
def gem(x: 'Tensor', p: 'Parameter', eps: 'float'=1e-06, clamp=True) ->Tensor:
if clamp:
x = x.clamp(min=eps)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | colinski/mmclassification | GeneralizedMeanPooling | false | 6,468 | [
"Apache-2.0"
] | 1 | 447c8291bc2e2abda6f3eafe2e6d0f13d65843cb | https://github.com/colinski/mmclassification/tree/447c8291bc2e2abda6f3eafe2e6d0f13d65843cb | import torch
from torch import Tensor
import torch.nn as nn
from torch.functional import Tensor
import torch.nn.functional as F
from torch import Tensor
from torch.nn.parameter import Parameter
def gem(x: 'Tensor', p: 'Parameter', eps: 'float'=1e-06, clamp=True) ->Tensor:
if clamp:
x = x.clamp(min=eps)
... |
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
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=dilation, groups=groups, bias=True, dilation=dilation)
class BasicBlock(nn.Module):
expansion = 1
def __init__(sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | columbia-robovision/SSCNav | BasicBlock | false | 6,469 | [
"MIT"
] | 1 | 0e781a350cddb68c499402d6468ad1adcfb1759d | https://github.com/columbia-robovision/SSCNav/tree/0e781a350cddb68c499402d6468ad1adcfb1759d | import torch
import torch.nn as nn
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=dilation, groups=groups, bias=True, dilation=dilation)
class Model(nn.Module):
expansion = 1
def __init__(self, in... |
InnerProductDecoder | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.nn.modules.loss
class InnerProductDecoder(nn.Module):
"""Decoder for using inner product for prediction."""
def __init__(self, dropout, act=torch.sigmoid):
super(InnerProductDecoder, self).__init__()
self.dropout ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.modules.loss
assert_size_stride = torch._C... | conf20/Egg | InnerProductDecoder | false | 6,470 | [
"MIT"
] | 1 | 6bd35903d1d7a7430b336545a9ee2b0a7f0e10f3 | https://github.com/conf20/Egg/tree/6bd35903d1d7a7430b336545a9ee2b0a7f0e10f3 | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.nn.modules.loss
class Model(nn.Module):
"""Decoder for using inner product for prediction."""
def __init__(self, dropout, act=torch.sigmoid):
super().__init__()
self.dropout = dropout
self.act = act
d... |
GCNModelVAE | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
import torch.nn.modules.loss
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
i... | conf20/Egg | GCNModelVAE | false | 6,471 | [
"MIT"
] | 1 | 6bd35903d1d7a7430b336545a9ee2b0a7f0e10f3 | https://github.com/conf20/Egg/tree/6bd35903d1d7a7430b336545a9ee2b0a7f0e10f3 | from torch.nn import Module
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
import torch.nn.modules.loss
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
... |
PSNRLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from torch.nn.functional import mse_loss
def psnr_loss(input: 'torch.Tensor', target: 'torch.Tensor', max_val: 'float'
) ->torch.Tensor:
"""Function that computes PSNR
See :class:`~kornia.losses.PSNRLoss` for details.
"""
if not torch.is_tensor(input) or not tor... | 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
from t... | connorlee77/kornia | PSNRLoss | false | 6,472 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | import torch
import torch.nn as nn
from torch.nn.functional import mse_loss
def psnr_loss(input: 'torch.Tensor', target: 'torch.Tensor', max_val: 'float'
) ->torch.Tensor:
"""Function that computes PSNR
See :class:`~kornia.losses.PSNRLoss` for details.
"""
if not torch.is_tensor(input) or not tor... |
RgbaToRgb | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def rgba_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert image from RGBA to RGB.
See :class:`~kornia.color.RgbaToRgb` for details.
Args:
image (torch.Tensor): RGBA Image to be converted to RGB.
Returns:
torch.Tensor: RGB version of the ima... | 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... | connorlee77/kornia | RgbaToRgb | false | 6,473 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | import torch
import torch.nn as nn
def rgba_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert image from RGBA to RGB.
See :class:`~kornia.color.RgbaToRgb` for details.
Args:
image (torch.Tensor): RGBA Image to be converted to RGB.
Returns:
torch.Tensor: RGB version of the ima... |
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class Conv1D(nn.Module):
def __init__(self, nf, nx):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | ExamDay/NeuralGREWT | MLP | false | 6,474 | [
"MIT"
] | 1 | 2256eb8c88f410bf5a229911f299b216153c96ba | https://github.com/ExamDay/NeuralGREWT/tree/2256eb8c88f410bf5a229911f299b216153c96ba | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class Conv1D(nn.Module):
def __init__(self, nf, nx):
... |
AFMLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import itertools
import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import *
class AFMLayer(nn.Module):
"""Attentonal Factorization Machine models pairwise (order-2) feature
interactions without linear term and bias.
Input shape
- A list of 3D tensor with sha... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | chenkkkk/DeepCTR-PyTorch | AFMLayer | false | 6,475 | [
"Apache-2.0"
] | 1 | a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | https://github.com/chenkkkk/DeepCTR-PyTorch/tree/a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | import itertools
import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import *
class Model(nn.Module):
"""Attentonal Factorization Machine models pairwise (order-2) feature
interactions without linear term and bias.
Input shape
- A list of 3D tensor with shape:... |
Rot180 | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def rot180(input: 'torch.Tensor') ->torch.Tensor:
"""Rotate a tensor image or a batch of tensor images
180 degrees. Input must be a tensor of shape (C, H, W)
or a batch of tensors :math:`(*, C, H, W)`.
Args:
input (torch.Tensor): input tensor
Returns:
... | 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... | connorlee77/kornia | Rot180 | false | 6,476 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | import torch
import torch.nn as nn
def rot180(input: 'torch.Tensor') ->torch.Tensor:
"""Rotate a tensor image or a batch of tensor images
180 degrees. Input must be a tensor of shape (C, H, W)
or a batch of tensors :math:`(*, C, H, W)`.
Args:
input (torch.Tensor): input tensor
Returns:
... |
AbsModel | # 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... | from torch.nn import Module
import torch
from torch import Tensor
from torch.nn import Identity
from torch.nn.modules import Module
import torch.optim.lr_scheduler
class AbsLayer(Module):
def forward(self, x: 'Tensor') ->Tensor:
return torch.abs(x).reshape((-1, 1))
class AbsModel(Module):
"""Fake m... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch.nn import Module
from torch import Tensor
from torch.nn import... | coreylowman/avalanche | AbsModel | false | 6,477 | [
"MIT"
] | 1 | 9c1e7765f1577c400ec0c57260221bcffd9566a2 | https://github.com/coreylowman/avalanche/tree/9c1e7765f1577c400ec0c57260221bcffd9566a2 | from torch.nn import Module
import torch
from torch import Tensor
from torch.nn import Identity
from torch.nn.modules import Module
import torch.optim.lr_scheduler
class AbsLayer(Module):
def forward(self, x: 'Tensor') ->Tensor:
return torch.abs(x).reshape((-1, 1))
class Model(Module):
"""Fake mode... |
RgbaToBgr | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def bgr_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert a BGR image to RGB.
See :class:`~kornia.color.BgrToRgb` for details.
Args:
image (torch.Tensor): BGR Image to be converted to RGB.
Returns:
torch.Tensor: RGB version of the image.
... | 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... | connorlee77/kornia | RgbaToBgr | false | 6,478 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | import torch
import torch.nn as nn
def bgr_to_rgb(image: 'torch.Tensor') ->torch.Tensor:
"""Convert a BGR image to RGB.
See :class:`~kornia.color.BgrToRgb` for details.
Args:
image (torch.Tensor): BGR Image to be converted to RGB.
Returns:
torch.Tensor: RGB version of the image.
... |
Vflip | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def vflip(input: 'torch.Tensor') ->torch.Tensor:
"""Vertically flip a tensor image or a batch of tensor images. Input must
be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`.
Args:
input (torch.Tensor): input tensor
Returns:
t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | connorlee77/kornia | Vflip | false | 6,479 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | import torch
import torch.nn as nn
def vflip(input: 'torch.Tensor') ->torch.Tensor:
"""Vertically flip a tensor image or a batch of tensor images. Input must
be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`.
Args:
input (torch.Tensor): input tensor
Returns:
t... |
ResNetDownsampleA | # 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 ResNetDownsampleA(nn.Module):
def __init__(self, planes):
super(ResNetDownsampleA, self).__init__()
self._planes = planes
def forward(self, x):
return F.pad(input=x[:, :, ::2, ::2], pad=(0, 0, 0, 0, self._planes... | 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... | corypaik/pytorch-lightning-pbt | ResNetDownsampleA | false | 6,480 | [
"Apache-2.0"
] | 1 | ad25e472fe59ca22bc400023d2589f4bedd37e30 | https://github.com/corypaik/pytorch-lightning-pbt/tree/ad25e472fe59ca22bc400023d2589f4bedd37e30 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, planes):
super().__init__()
self._planes = planes
def forward(self, x):
return F.pad(input=x[:, :, ::2, ::2], pad=(0, 0, 0, 0, self._planes //
4, self._planes // ... |
TotalVariation | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def total_variation(img: 'torch.Tensor') ->torch.Tensor:
"""Function that computes Total Variation.
See :class:`~kornia.losses.TotalVariation` for details.
"""
if not torch.is_tensor(img):
raise TypeError(f'Input type is not a torch.Tensor. Got {type(img)}')... | 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... | connorlee77/kornia | TotalVariation | false | 6,481 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | import torch
import torch.nn as nn
def total_variation(img: 'torch.Tensor') ->torch.Tensor:
"""Function that computes Total Variation.
See :class:`~kornia.losses.TotalVariation` for details.
"""
if not torch.is_tensor(img):
raise TypeError(f'Input type is not a torch.Tensor. Got {type(img)}')... |
CNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils.data
class CNN(nn.Module):
def __init__(self):
super(CNN, self).__init__()
self.Conv1 = nn.Conv2d(1, 15, 9, 1, 0)
self.Relu1 = nn.ReLU()
self.MaxPool1 = nn.MaxPool2d(2)
self.Conv2 = nn.Conv2d(15, 20, 5, 1, 0)
se... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | clapmyhands/cz4042 | CNN | false | 6,482 | [
"MIT"
] | 1 | 8869bacfb5a49566ae9fcce464187035093ed22d | https://github.com/clapmyhands/cz4042/tree/8869bacfb5a49566ae9fcce464187035093ed22d | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self):
super().__init__()
self.Conv1 = nn.Conv2d(1, 15, 9, 1, 0)
self.Relu1 = nn.ReLU()
self.MaxPool1 = nn.MaxPool2d(2)
self.Conv2 = nn.Conv2d(15, 20, 5, 1, 0)
self.Relu... |
L2Normalization | # 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... | from torch.nn import Module
import torch
from torch import Tensor
from torch.nn.modules import Module
import torch.optim.lr_scheduler
class L2Normalization(Module):
"""Module to L2-normalize the input. Typically used in last layer to
normalize the embedding."""
def __init__(self):
super().__init_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn import Module
... | coreylowman/avalanche | L2Normalization | false | 6,483 | [
"MIT"
] | 1 | 9c1e7765f1577c400ec0c57260221bcffd9566a2 | https://github.com/coreylowman/avalanche/tree/9c1e7765f1577c400ec0c57260221bcffd9566a2 | from torch.nn import Module
import torch
from torch import Tensor
from torch.nn.modules import Module
import torch.optim.lr_scheduler
class Model(Module):
"""Module to L2-normalize the input. Typically used in last layer to
normalize the embedding."""
def __init__(self):
super().__init__()
d... |
CatImgs | # 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 CatImgs(nn.Module):
def forward(self, img1, img2, img3):
return torch.cat((img1, img2, img3), 3)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand(
[4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | crisdeodates/AI-depthai-experiments | CatImgs | false | 6,484 | [
"MIT"
] | 1 | 74b8b84a03cb637d20a7fcd091cce11add78bd2c | https://github.com/crisdeodates/AI-depthai-experiments/tree/74b8b84a03cb637d20a7fcd091cce11add78bd2c | import torch
from torch import nn
class Model(nn.Module):
def forward(self, img1, img2, img3):
return torch.cat((img1, img2, img3), 3)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand(
[4, 4, 4, 4])]
def get_init_inputs():
return []
|
Quadratic | # 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 Quadratic(nn.Module):
def __init__(self):
super(Quadratic, self).__init__()
def forward(self, x):
return x ** 2
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | craigxchen/Reinforcement-Learning-Function-Approximation | Quadratic | false | 6,485 | [
"MIT"
] | 1 | 09c4df1dd44c6a76a3f574bebc959a19b141f3fe | https://github.com/craigxchen/Reinforcement-Learning-Function-Approximation/tree/09c4df1dd44c6a76a3f574bebc959a19b141f3fe | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x ** 2
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
PLU | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 PLU(nn.Module):
def __init__(self):
super(PLU, self).__init__()
self.w1 = torch.nn.Parameter(torch.ones(1))
self.w2 = torch.nn.Parameter(torch.ones(1))
def forward(self, x):
return self.w1 * torch.max(x, torch.zeros_like(x)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | craigxchen/Reinforcement-Learning-Function-Approximation | PLU | false | 6,486 | [
"MIT"
] | 1 | 09c4df1dd44c6a76a3f574bebc959a19b141f3fe | https://github.com/craigxchen/Reinforcement-Learning-Function-Approximation/tree/09c4df1dd44c6a76a3f574bebc959a19b141f3fe | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.w1 = torch.nn.Parameter(torch.ones(1))
self.w2 = torch.nn.Parameter(torch.ones(1))
def forward(self, x):
return self.w1 * torch.max(x, torch.zeros_like(x)
) + se... |
Spike | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 Spike(nn.Module):
def __init__(self, center=1, width=1):
super(Spike, self).__init__()
self.c = center
self.w = width
self.alpha = torch.nn.Parameter(torch.ones(1))
self.beta = torch.nn.Parameter(torch.ones(1))
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | craigxchen/Reinforcement-Learning-Function-Approximation | Spike | false | 6,487 | [
"MIT"
] | 1 | 09c4df1dd44c6a76a3f574bebc959a19b141f3fe | https://github.com/craigxchen/Reinforcement-Learning-Function-Approximation/tree/09c4df1dd44c6a76a3f574bebc959a19b141f3fe | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, center=1, width=1):
super().__init__()
self.c = center
self.w = width
self.alpha = torch.nn.Parameter(torch.ones(1))
self.beta = torch.nn.Parameter(torch.ones(1))
def forward(self, x):
... |
XOR | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.distributed
import torch.nn as nn
import torch.utils.data
class XOR(nn.Module):
def __init__(self, input_dim, output_dim):
super(XOR, self).__init__()
self.lin1 = nn.Linear(input_dim, 8)
self.lin2 = nn.Linear(8, output_dim)
def forward(self, featu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.... | csh-tech/horovod | XOR | false | 6,488 | [
"Apache-2.0"
] | 1 | 2a3f43f35c840d7e8cfa9674a051ffa53be9918d | https://github.com/csh-tech/horovod/tree/2a3f43f35c840d7e8cfa9674a051ffa53be9918d | import torch
import torch.utils.data.distributed
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, input_dim, output_dim):
super().__init__()
self.lin1 = nn.Linear(input_dim, 8)
self.lin2 = nn.Linear(8, output_dim)
def forward(self, features):
... |
Model | # 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
def depth_to_3d(depth: 'torch.Tensor', xyz: 'torch.Tensor') ->torch.Tensor:
points_depth: 'torch.Tensor' = depth.permute(0, 2, 3, 1)
points_3d: 'torch.Tensor' = xyz * points_depth
return points_3d.permute(0, 3, 1, 2)
class Model(nn.Module):
def forward(self, xyz, d... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | crisdeodates/AI-depthai-experiments | Model | false | 6,489 | [
"MIT"
] | 1 | 74b8b84a03cb637d20a7fcd091cce11add78bd2c | https://github.com/crisdeodates/AI-depthai-experiments/tree/74b8b84a03cb637d20a7fcd091cce11add78bd2c | import torch
from torch import nn
def depth_to_3d(depth: 'torch.Tensor', xyz: 'torch.Tensor') ->torch.Tensor:
points_depth: 'torch.Tensor' = depth.permute(0, 2, 3, 1)
points_3d: 'torch.Tensor' = xyz * points_depth
return points_3d.permute(0, 3, 1, 2)
class Model(nn.Module):
def forward(self, xyz, d... |
DrugDrugAttentionLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
import torch.cuda
class DrugDrugAttentionLayer(torch.nn.Module):
"""Co-attention layer for drug pairs."""
def __init__(self, feature_number: 'int'):
"""Initialize the co-attention layer.
:param feature_number: Number of input features.
"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.fun... | cthoyt/chemicalx | DrugDrugAttentionLayer | false | 6,490 | [
"Apache-2.0"
] | 1 | f48d70bc88e89e9605a5b1c2f006fb8d37b42922 | https://github.com/cthoyt/chemicalx/tree/f48d70bc88e89e9605a5b1c2f006fb8d37b42922 | import torch
import torch.nn.functional
import torch.cuda
class Model(torch.nn.Module):
"""Co-attention layer for drug pairs."""
def __init__(self, feature_number: 'int'):
"""Initialize the co-attention layer.
:param feature_number: Number of input features.
"""
super().__ini... |
NetModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 NetModel(nn.Module):
def __init__(self, n1, n2):
super(NetModel, self).__init__()
self.layer1 = nn.Conv2d(1, n1, kernel_size=9, stride=1, padding=4,
bias=True)
self.relu1 = nn.ReLU(inplace=True)
self.laye... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | crazywiden/SRCNN | NetModel | false | 6,491 | [
"MIT"
] | 1 | 872e495397101222f6732ee0129587b6f893aea2 | https://github.com/crazywiden/SRCNN/tree/872e495397101222f6732ee0129587b6f893aea2 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, n1, n2):
super().__init__()
self.layer1 = nn.Conv2d(1, n1, kernel_size=9, stride=1, padding=4,
bias=True)
self.relu1 = nn.ReLU(inplace=True)
self.layer2 = nn.Conv2d(n1... |
CriticNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 CriticNet(nn.Module):
def __init__(self, num_state, num_action):
super(CriticNet, self).__init__()
self.num_state = num_state
self.num_action = num_action
self.fc1 = nn.Linear(num_state, 100)
self.fc2... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | cugzj/Adaptive-B | CriticNet | false | 6,492 | [
"Apache-2.0"
] | 1 | cebc965b1dbad93332ae371bfef8640259d940c4 | https://github.com/cugzj/Adaptive-B/tree/cebc965b1dbad93332ae371bfef8640259d940c4 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_state, num_action):
super().__init__()
self.num_state = num_state
self.num_action = num_action
self.fc1 = nn.Linear(num_state, 100)
self.fc2 = nn.Linear(100, 1... |
Projection | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class TimeDistributed(nn.Module):
def __init__(self, layer, activation='relu'):
super().__init__()
self.layer = layer
self.activation = self.select_activation(activation)
def forward(self, x):
x_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | crystal-k7/chatspace | Projection | false | 6,493 | [
"Apache-2.0"
] | 1 | b63861eab74e1b85f0233f689cf97a13dff873e4 | https://github.com/crystal-k7/chatspace/tree/b63861eab74e1b85f0233f689cf97a13dff873e4 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class TimeDistributed(nn.Module):
def __init__(self, layer, activation='relu'):
super().__init__()
self.layer = layer
self.activation = self.select_activation(activation)
def forward(self, x):
x_... |
CCAMDec | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torchvision.datasets import *
from torch.nn import Parameter
from torch.nn import Softmax
from torchvision.transforms import *
class CCAMDec(Module):
"""
CCAM decoding module
"""
def __init__(self):
super(CCAMDec, self).__init__()
self.sof... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | coolgrasshopper/amodal_road_segmentation | CCAMDec | false | 6,494 | [
"MIT"
] | 1 | 462209242973815055f085ada99772af32082f5c | https://github.com/coolgrasshopper/amodal_road_segmentation/tree/462209242973815055f085ada99772af32082f5c | from torch.nn import Module
import torch
from torchvision.datasets import *
from torch.nn import Parameter
from torch.nn import Softmax
from torchvision.transforms import *
class Model(Module):
"""
CCAM decoding module
"""
def __init__(self):
super().__init__()
self.softmax = Softmax(... |
Highway | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.nn.functional
import torch.cuda
class Highway(nn.Module):
"""The Highway update layer from [srivastava2015]_.
.. [srivastava2015] Srivastava, R. K., *et al.* (2015).
`Highway Networks <http://arxiv.org/abs/1505.00387>`... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | cthoyt/chemicalx | Highway | false | 6,495 | [
"Apache-2.0"
] | 1 | f48d70bc88e89e9605a5b1c2f006fb8d37b42922 | https://github.com/cthoyt/chemicalx/tree/f48d70bc88e89e9605a5b1c2f006fb8d37b42922 | import torch
from torch import nn
from torch.nn import functional as F
import torch.nn.functional
import torch.cuda
class Model(nn.Module):
"""The Highway update layer from [srivastava2015]_.
.. [srivastava2015] Srivastava, R. K., *et al.* (2015).
`Highway Networks <http://arxiv.org/abs/1505.00387>`_.... |
EmbeddingLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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
import torch.cuda
class EmbeddingLayer(torch.nn.Module):
"""Attention layer."""
def __init__(self, feature_number: 'int'):
"""Initialize the relational embedding layer.
:param feature_number: Number of features.
"""
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 torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | cthoyt/chemicalx | EmbeddingLayer | false | 6,496 | [
"Apache-2.0"
] | 1 | f48d70bc88e89e9605a5b1c2f006fb8d37b42922 | https://github.com/cthoyt/chemicalx/tree/f48d70bc88e89e9605a5b1c2f006fb8d37b42922 | import torch
import torch.nn.functional
import torch.cuda
class Model(torch.nn.Module):
"""Attention layer."""
def __init__(self, feature_number: 'int'):
"""Initialize the relational embedding layer.
:param feature_number: Number of features.
"""
super().__init__()
se... |
ActorNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 ActorNet(nn.Module):
def __init__(self, num_state, num_action):
super(ActorNet, self).__init__()
self.num_state = num_state
self.num_action = num_action
self.fc1 = nn.Linear(self.num_state, 100)
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.... | cugzj/Adaptive-B | ActorNet | false | 6,497 | [
"Apache-2.0"
] | 1 | cebc965b1dbad93332ae371bfef8640259d940c4 | https://github.com/cugzj/Adaptive-B/tree/cebc965b1dbad93332ae371bfef8640259d940c4 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_state, num_action):
super().__init__()
self.num_state = num_state
self.num_action = num_action
self.fc1 = nn.Linear(self.num_state, 100)
self.fc2 = nn.Linear(1... |
InverseDepthSmoothnessLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def _gradient_x(img: 'torch.Tensor') ->torch.Tensor:
assert len(img.shape) == 4, img.shape
return img[:, :, :, :-1] - img[:, :, :, 1:]
def _gradient_y(img: 'torch.Tensor') ->torch.Tensor:
assert len(img.shape) == 4, img.shape
return img[:, :, :-1, :] - img[:, :, 1:... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | connorlee77/kornia | InverseDepthSmoothnessLoss | false | 6,498 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | https://github.com/connorlee77/kornia/tree/af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | import torch
import torch.nn as nn
def _gradient_x(img: 'torch.Tensor') ->torch.Tensor:
assert len(img.shape) == 4, img.shape
return img[:, :, :, :-1] - img[:, :, :, 1:]
def _gradient_y(img: 'torch.Tensor') ->torch.Tensor:
assert len(img.shape) == 4, img.shape
return img[:, :, :-1, :] - img[:, :, 1:... |
Critic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
def __init__(self, num_state, num_action):
super(Critic, self).__init__()
self.num_state = num_state
self.num_action = num_action
self.fc1 = nn.Linear(self.num_state, 512)
self.stat... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | cugzj/Adaptive-B | Critic | false | 6,499 | [
"Apache-2.0"
] | 1 | cebc965b1dbad93332ae371bfef8640259d940c4 | https://github.com/cugzj/Adaptive-B/tree/cebc965b1dbad93332ae371bfef8640259d940c4 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_state, num_action):
super().__init__()
self.num_state = num_state
self.num_action = num_action
self.fc1 = nn.Linear(self.num_state, 512)
self.state_value = nn.... |
RMSELoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class RMSELoss(torch.nn.Module):
def __init__(self, eps=1e-08):
super(RMSELoss, self).__init__()
self.eps = eps
self.criterion = torch.nn.MSELoss()
def forward(self, y_hat, y):
return torch.sqrt(self.criterion(y_hat, y) + self.eps)
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._... | cvpr22sub7201/SpeechDrivenTongueAnimation | RMSELoss | false | 6,500 | [
"MIT"
] | 1 | 82caf9d7f4331e039e3b2f0d31df6393d24ccb1c | https://github.com/cvpr22sub7201/SpeechDrivenTongueAnimation/tree/82caf9d7f4331e039e3b2f0d31df6393d24ccb1c | import torch
class Model(torch.nn.Module):
def __init__(self, eps=1e-08):
super().__init__()
self.eps = eps
self.criterion = torch.nn.MSELoss()
def forward(self, y_hat, y):
return torch.sqrt(self.criterion(y_hat, y) + self.eps)
def get_inputs():
return [torch.rand([4, 4... |
ShrinkageLoss | # 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 ShrinkageLoss(nn.Module):
""" ShrinkageLoss class.
Modified version of shrinkage loss tailored to images:
http://openaccess.thecvf.com/content_ECCV_2018/papers/Xiankai_Lu_Deep_Regression_Tracking_ECCV_2018_paper.pdf
It basically computes a point-wis... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.gu... | cvpr22sub7201/SpeechDrivenTongueAnimation | ShrinkageLoss | false | 6,501 | [
"MIT"
] | 1 | 82caf9d7f4331e039e3b2f0d31df6393d24ccb1c | https://github.com/cvpr22sub7201/SpeechDrivenTongueAnimation/tree/82caf9d7f4331e039e3b2f0d31df6393d24ccb1c | import torch
import torch.nn as nn
class Model(nn.Module):
""" ShrinkageLoss class.
Modified version of shrinkage loss tailored to images:
http://openaccess.thecvf.com/content_ECCV_2018/papers/Xiankai_Lu_Deep_Regression_Tracking_ECCV_2018_paper.pdf
It basically computes a point-wise shrink... |
HuberLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
class HuberLoss(torch.nn.Module):
def __init__(self, delta=1.0):
super(HuberLoss, self).__init__()
self.l2_criterion = torch.nn.MSELoss()
self.l1_criterion = torch.nn.L1Loss()
self.delta = delta
def forward(self, y_hat, y):
l2_loss = self.l2_criterion(y_h... | 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
assert_size_stride = t... | cvpr22sub7201/SpeechDrivenTongueAnimation | HuberLoss | false | 6,502 | [
"MIT"
] | 1 | 82caf9d7f4331e039e3b2f0d31df6393d24ccb1c | https://github.com/cvpr22sub7201/SpeechDrivenTongueAnimation/tree/82caf9d7f4331e039e3b2f0d31df6393d24ccb1c | import torch
class Model(torch.nn.Module):
def __init__(self, delta=1.0):
super().__init__()
self.l2_criterion = torch.nn.MSELoss()
self.l1_criterion = torch.nn.L1Loss()
self.delta = delta
def forward(self, y_hat, y):
l2_loss = self.l2_criterion(y_hat, y)
l1_l... |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.backends.cudnn
class DiceLoss(nn.Module):
def __init__(self, smooth=0, eps=1e-07):
super(DiceLoss, self).__init__()
self.smooth = smooth
self.eps = eps
def forward(self, output, target):
return 1 - (2 * torch.sum(output * target)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import torch.backends.cudnn
assert_size_stride = torch._C._dynamo.gu... | cxz/tgs-salt-identification-challenge | DiceLoss | false | 6,503 | [
"MIT"
] | 1 | 859f3d7f2d3184532c42c34444500eec3b03b1c8 | https://github.com/cxz/tgs-salt-identification-challenge/tree/859f3d7f2d3184532c42c34444500eec3b03b1c8 | import torch
from torch import nn
import torch.backends.cudnn
class Model(nn.Module):
def __init__(self, smooth=0, eps=1e-07):
super().__init__()
self.smooth = smooth
self.eps = eps
def forward(self, output, target):
return 1 - (2 * torch.sum(output * target) + self.smooth) /... |
ShiftedSoftplus | # 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
from torch import nn
class ShiftedSoftplus(nn.Module):
__constants__ = ['beta', 'threshold']
beta: 'int'
threshold: 'int'
def __init__(self, beta: 'int'=1, threshold: 'int'=20) ->None:
super(ShiftedSoftplus, self).__init__()
self.beta = bet... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch import nn
assert_size_stride = torch._C._dynamo.gua... | cuulee/mega-nerf | ShiftedSoftplus | false | 6,504 | [
"MIT"
] | 1 | b38ea40b6ca53ae4423fcfb354ac13cd794827a4 | https://github.com/cuulee/mega-nerf/tree/b38ea40b6ca53ae4423fcfb354ac13cd794827a4 | import torch
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
__constants__ = ['beta', 'threshold']
beta: 'int'
threshold: 'int'
def __init__(self, beta: 'int'=1, threshold: 'int'=20) ->None:
super().__init__()
self.beta = beta
self.threshold = thre... |
BiInteractionPooling | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from sklearn.metrics import *
class BiInteractionPooling(nn.Module):
"""Bi-Interaction Layer used in Neural FM,compress the
pairwise element-wise product of features into one single vector.
Input shape
- A 3D tensor with shape:``(batch_size,field_size,embeddi... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from sklearn.metrics import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = tor... | chenkkkk/DeepCTR-PyTorch | BiInteractionPooling | false | 6,505 | [
"Apache-2.0"
] | 1 | a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | https://github.com/chenkkkk/DeepCTR-PyTorch/tree/a10a3ace4ad79171e7fb182407b3e4d22bf753e7 | import torch
import torch.nn as nn
from sklearn.metrics import *
class Model(nn.Module):
"""Bi-Interaction Layer used in Neural FM,compress the
pairwise element-wise product of features into one single vector.
Input shape
- A 3D tensor with shape:``(batch_size,field_size,embedding_size)``.
... |
ArgMax | # 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.sparse
import torch.nn as nn
class ArgMax(nn.Module):
def __init__(self, dim=None):
super().__init__()
self.dim = dim
def forward(self, x):
return torch.argmax(x, dim=self.dim)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs()... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.sparse
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.as... | cwerner/deadtrees | ArgMax | false | 6,506 | [
"Apache-2.0"
] | 1 | 15ddfec58c4a40f22f9c1e2424fb535df4d29b03 | https://github.com/cwerner/deadtrees/tree/15ddfec58c4a40f22f9c1e2424fb535df4d29b03 | import torch
import torch.sparse
import torch.nn as nn
class Model(nn.Module):
def __init__(self, dim=None):
super().__init__()
self.dim = dim
def forward(self, x):
return torch.argmax(x, dim=self.dim)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():... |
HGCN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 HGCN(nn.Module):
def __init__(self, n_edges, in_feature, out_feature, n_agents):
super(HGCN, self).__init__()
None
self.W_line = nn.Parameter(torch.ones(n_edges))
self.W = None
def forward(self, node_features, hyper_graph):
sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | cugbbaiyun/HGCN-MIX | HGCN | false | 6,507 | [
"Apache-2.0"
] | 1 | 82b5c22a3cb2dabc2b86c54f23fa314477d92b63 | https://github.com/cugbbaiyun/HGCN-MIX/tree/82b5c22a3cb2dabc2b86c54f23fa314477d92b63 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, n_edges, in_feature, out_feature, n_agents):
super().__init__()
None
self.W_line = nn.Parameter(torch.ones(n_edges))
self.W = None
def forward(self, node_features, hyper_graph):
self.W = tor... |
UpBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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 UpBlock(nn.Module):
""" Encoder - From pyramid bottom to op
"""
def __init__(self, in_channels, out_channels, sz=1):
super(UpBlock, self).__init__()
self.c1 = nn.Conv3d(in_channels, out_channels, kernel_size=3,
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | cwood1967/Seg3D | UpBlock | false | 6,508 | [
"Apache-2.0"
] | 1 | dd3ae11fbd89fcfb98d3c00089515a336f2a24e9 | https://github.com/cwood1967/Seg3D/tree/dd3ae11fbd89fcfb98d3c00089515a336f2a24e9 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
""" Encoder - From pyramid bottom to op
"""
def __init__(self, in_channels, out_channels, sz=1):
super().__init__()
self.c1 = nn.Conv3d(in_channels, out_channels, kernel_size=3,
stride=... |
Generator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
def __init__(self):
super(Decoder, self).__init__()
self.conv6_1 = nn.Conv2d(512, 512, kernel_size=3, stride=1, padding=1)
self.conv6_2 = nn.Conv2d(512, 512, kernel_size=3, stride=1, 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 ... | bigabig/saliency | Generator | false | 6,509 | [
"Apache-2.0"
] | 1 | 83618c90ea419ee05fbed116e8ad7bb2b331ecf5 | https://github.com/bigabig/saliency/tree/83618c90ea419ee05fbed116e8ad7bb2b331ecf5 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
def __init__(self):
super().__init__()
self.conv6_1 = nn.Conv2d(512, 512, kernel_size=3, stride=1, padding=1)
self.conv6_2 = nn.Conv2d(512, 512, kernel_size=3, stride=1, padding=1)
self.co... |
MultiHeadAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | csyhhu/attention-is-all-you-need-pytorch | MultiHeadAttention | false | 6,510 | [
"MIT"
] | 1 | 5792c9714295b1a33d1ca074206ec223f436b954 | https://github.com/csyhhu/attention-is-all-you-need-pytorch/tree/5792c9714295b1a33d1ca074206ec223f436b954 | import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropo... |
MS_Block | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.multiprocessing
import torch.onnx
class MS_Block(nn.Module):
def __init__(self, input_feature, out_feature, d=[1, 2, 4], group=1):
super(MS_Block, self).__init__()
self.l1 = nn.Conv2d(input_feature, out_feature, 3, padding=d[0],
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
import torch.nn as nn
import torch.multiprocessing
import torch.onnx
assert_size... | cvmlarun/RANet | MS_Block | false | 6,511 | [
"Apache-2.0"
] | 1 | 3f67a3f36aaacd9cc7fb98ec79f77db8f1ebdc60 | https://github.com/cvmlarun/RANet/tree/3f67a3f36aaacd9cc7fb98ec79f77db8f1ebdc60 | import torch
import torch.nn as nn
import torch.multiprocessing
import torch.onnx
class Model(nn.Module):
def __init__(self, input_feature, out_feature, d=[1, 2, 4], group=1):
super().__init__()
self.l1 = nn.Conv2d(input_feature, out_feature, 3, padding=d[0],
dilation=d[0], bias=False... |
EqualLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.autograd import Function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5):
return FusedL... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.autograd import Function
import math
import torch.nn as nn
from torch... | cyysc1998/EDVRDarts | EqualLinear | false | 6,512 | [
"MIT"
] | 1 | 201badbc8c6469b519647a8869c3782ebe1176cf | https://github.com/cyysc1998/EDVRDarts/tree/201badbc8c6469b519647a8869c3782ebe1176cf | from torch.autograd import Function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5):
return FusedL... |
CharbonnierLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import functools
import torc... | cyysc1998/EDVRDarts | CharbonnierLoss | false | 6,513 | [
"MIT"
] | 1 | 201badbc8c6469b519647a8869c3782ebe1176cf | https://github.com/cyysc1998/EDVRDarts/tree/201badbc8c6469b519647a8869c3782ebe1176cf | import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss t... |
ResBlock2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.multiprocessing
import torch.onnx
class ResBlock2(nn.Module):
def __init__(self, input_feature, planes, dilated=1, group=1):
super(ResBlock2, self).__init__()
self.conv1 = nn.Conv2d(input_feature, planes, kernel_size=1, bias=
False, grou... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | cvmlarun/RANet | ResBlock2 | false | 6,514 | [
"Apache-2.0"
] | 1 | 3f67a3f36aaacd9cc7fb98ec79f77db8f1ebdc60 | https://github.com/cvmlarun/RANet/tree/3f67a3f36aaacd9cc7fb98ec79f77db8f1ebdc60 | import torch
import torch.nn as nn
import torch.multiprocessing
import torch.onnx
class Model(nn.Module):
def __init__(self, input_feature, planes, dilated=1, group=1):
super().__init__()
self.conv1 = nn.Conv2d(input_feature, planes, kernel_size=1, bias=
False, groups=group)
s... |
JaccardLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.backends.cudnn
def jaccard(preds, trues, weight=None, is_average=True, eps=1e-06):
num = preds.size(0)
preds = preds.view(num, -1)
trues = trues.view(num, -1)
if weight is not None:
w = torch.autograd.Variable(weight).view(num, -1)
preds =... | 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.backends.cudnn
assert_size_stride = torch._C._dynamo.gu... | cxz/tgs-salt-identification-challenge | JaccardLoss | false | 6,515 | [
"MIT"
] | 1 | 859f3d7f2d3184532c42c34444500eec3b03b1c8 | https://github.com/cxz/tgs-salt-identification-challenge/tree/859f3d7f2d3184532c42c34444500eec3b03b1c8 | import torch
from torch import nn
import torch.backends.cudnn
def jaccard(preds, trues, weight=None, is_average=True, eps=1e-06):
num = preds.size(0)
preds = preds.view(num, -1)
trues = trues.view(num, -1)
if weight is not None:
w = torch.autograd.Variable(weight).view(num, -1)
preds =... |
FocalLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch.nn import functional as F
from torch import nn
import torch.backends.cudnn
class FocalLoss(nn.Module):
def __init__(self, gamma):
super().__init__()
self.gamma = gamma
def forward(self, input, target):
if not target.size() == input.size():
raise Va... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | cxz/tgs-salt-identification-challenge | FocalLoss | false | 6,516 | [
"MIT"
] | 1 | 859f3d7f2d3184532c42c34444500eec3b03b1c8 | https://github.com/cxz/tgs-salt-identification-challenge/tree/859f3d7f2d3184532c42c34444500eec3b03b1c8 | import torch
from torch.nn import functional as F
from torch import nn
import torch.backends.cudnn
class Model(nn.Module):
def __init__(self, gamma):
super().__init__()
self.gamma = gamma
def forward(self, input, target):
if not target.size() == input.size():
raise ValueE... |
BasicBlock_ins | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from 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.multiprocessing
import torch.onnx
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class BasicBlock_ins(nn.Module):
expansi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | cvmlarun/RANet | BasicBlock_ins | false | 6,517 | [
"Apache-2.0"
] | 1 | 3f67a3f36aaacd9cc7fb98ec79f77db8f1ebdc60 | https://github.com/cvmlarun/RANet/tree/3f67a3f36aaacd9cc7fb98ec79f77db8f1ebdc60 | import torch
import torch.nn as nn
import torch.multiprocessing
import torch.onnx
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class Model(nn.Module):
expansion = 1
... |
UNetModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.backends.cudnn
def conv3x3(num_in, num_out):
"""Creates a 3x3 convolution building block module.
Args:
num_in: number of input feature maps
num_out: number of output feature maps
Returns:
The 3x3 convolution module.
"""
return nn.C... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | cxz/tgs-salt-identification-challenge | UNetModule | false | 6,518 | [
"MIT"
] | 1 | 859f3d7f2d3184532c42c34444500eec3b03b1c8 | https://github.com/cxz/tgs-salt-identification-challenge/tree/859f3d7f2d3184532c42c34444500eec3b03b1c8 | import torch
from torch import nn
import torch.backends.cudnn
def conv3x3(num_in, num_out):
"""Creates a 3x3 convolution building block module.
Args:
num_in: number of input feature maps
num_out: number of output feature maps
Returns:
The 3x3 convolution module.
"""
return nn.C... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, num_state, num_action):
super(Actor, self).__init__()
self.num_state = num_state
self.num_action = num_action
self.fc1 = nn.Linear(self.num_state, 512)
self.action... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | cugzj/Adaptive-B | Actor | false | 6,519 | [
"Apache-2.0"
] | 1 | cebc965b1dbad93332ae371bfef8640259d940c4 | https://github.com/cugzj/Adaptive-B/tree/cebc965b1dbad93332ae371bfef8640259d940c4 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, num_state, num_action):
super().__init__()
self.num_state = num_state
self.num_action = num_action
self.fc1 = nn.Linear(self.num_state, 512)
self.action_head = nn.... |
EncoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | csyhhu/attention-is-all-you-need-pytorch | EncoderLayer | false | 6,520 | [
"MIT"
] | 1 | 5792c9714295b1a33d1ca074206ec223f436b954 | https://github.com/csyhhu/attention-is-all-you-need-pytorch/tree/5792c9714295b1a33d1ca074206ec223f436b954 | import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropo... |
ModulatedConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.autograd import Function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
def make_resample_kernel(k):
"""Make resampling kernel for UpFirDn.
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
from torch.autograd... | cyysc1998/EDVRDarts | ModulatedConv2d | false | 6,521 | [
"MIT"
] | 1 | 201badbc8c6469b519647a8869c3782ebe1176cf | https://github.com/cyysc1998/EDVRDarts/tree/201badbc8c6469b519647a8869c3782ebe1176cf | from torch.autograd import Function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
def make_resample_kernel(k):
"""Make resampling kernel for UpFirDn.
Args:
... |
OneMinusCosThetaByThetaSq | # 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 cos
from torch import sin
def get_small_and_large_angle_inds(theta: 'torch.Tensor', eps: 'float'=0.001):
"""Returns the indices of small and non-small (large) angles, given
a tensor of angles, and the threshold below (exclusive) which angles
are considered 'small'.
Args... | 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 cos
from torch import sin
assert_size_stride = torch._C... | darkmatter08/dfa-scales-to-modern-deep-learning | OneMinusCosThetaByThetaSq | false | 6,522 | [
"MIT"
] | 1 | 72bf8a045b4bb7eb81736d8ec1d671c4949fb01e | https://github.com/darkmatter08/dfa-scales-to-modern-deep-learning/tree/72bf8a045b4bb7eb81736d8ec1d671c4949fb01e | import torch
from torch import cos
from torch import sin
def get_small_and_large_angle_inds(theta: 'torch.Tensor', eps: 'float'=0.001):
"""Returns the indices of small and non-small (large) angles, given
a tensor of angles, and the threshold below (exclusive) which angles
are considered 'small'.
Args... |
ToRGB | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.autograd import Function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
def make_resample_kernel(k):
"""Make resampling kernel for UpFirDn.
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.autograd import Function
import math
import torch.nn as nn
import tor... | cyysc1998/EDVRDarts | ToRGB | false | 6,523 | [
"MIT"
] | 1 | 201badbc8c6469b519647a8869c3782ebe1176cf | https://github.com/cyysc1998/EDVRDarts/tree/201badbc8c6469b519647a8869c3782ebe1176cf | from torch.autograd import Function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init as init
from torchvision.models import vgg as vgg
from torch import autograd as autograd
def make_resample_kernel(k):
"""Make resampling kernel for UpFirDn.
Args:
... |
TotalVariationLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from typing import Optional
class TotalVariationLoss(torch.nn.Module):
"""
Calculates the total variation loss of a tensor.
"""
loss: 'Optional[torch.Tensor]'
def __init__(self):
super().__init__()
self.loss = None
def forward(self, x):
b, _c, h, w = x.sh... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from typing import Optional
assert_size_stride = torch._C._dynamo.guards.assert... | daniilgaltsev/Neural-Style-Transfer | TotalVariationLoss | false | 6,524 | [
"MIT"
] | 1 | c781c34a591973afae1a6b7a40c7b31c43af63f7 | https://github.com/daniilgaltsev/Neural-Style-Transfer/tree/c781c34a591973afae1a6b7a40c7b31c43af63f7 | import torch
from typing import Optional
class Model(torch.nn.Module):
"""
Calculates the total variation loss of a tensor.
"""
loss: 'Optional[torch.Tensor]'
def __init__(self):
super().__init__()
self.loss = None
def forward(self, x):
b, _c, h, w = x.shape
a... |
DecoderLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | csyhhu/attention-is-all-you-need-pytorch | DecoderLayer | false | 6,525 | [
"MIT"
] | 1 | 5792c9714295b1a33d1ca074206ec223f436b954 | https://github.com/csyhhu/attention-is-all-you-need-pytorch/tree/5792c9714295b1a33d1ca074206ec223f436b954 | import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.dropout = nn.Dropout(attn_dropo... |
SEModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.nn
class SEModule(nn.Module):
def __init__(self, planes, compress_rate):
super(SEModule, self).__init__()
self.conv1 = nn.Conv2d(planes, planes // compress_rate, kernel_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
import torch.utils.data
impor... | dakotahawkins/impersonator | SEModule | false | 6,526 | [
"MIT"
] | 1 | 87d59167a10fd70aaa95be4fafbf4c8a32eb1a37 | https://github.com/dakotahawkins/impersonator/tree/87d59167a10fd70aaa95be4fafbf4c8a32eb1a37 | import torch
import torch.utils.data
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.nn
class Model(nn.Module):
def __init__(self, planes, compress_rate):
super().__init__()
self.conv1 = nn.Conv2d(planes, planes // compress_rate, kernel_size
=1, stride=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.