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
FromRGB
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 FromRGB(nn.Module): """Some Information about FromRGB""" def __init__(self, channels): super(FromRGB, self).__init__() self.conv = nn.Conv2d(3, channels, kernel_size=1, stride=1, padding =0, bias=True) def forward(self, x): ret...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
uthree/gan-image-generator
FromRGB
false
11,001
[ "MIT" ]
0
85585e389b5a494393da0789d82824f8c811e263
https://github.com/uthree/gan-image-generator/tree/85585e389b5a494393da0789d82824f8c811e263
import torch import torch.nn as nn class Model(nn.Module): """Some Information about FromRGB""" def __init__(self, channels): super().__init__() self.conv = nn.Conv2d(3, channels, kernel_size=1, stride=1, padding =0, bias=True) def forward(self, x): return self.conv(x...
GatedResidualNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models import torch.onnx import torch.nn class GatedLinearUnit(nn.Module): def __init__(self, input_size, output_size, dropout=0): super().__init__() self.dropout = nn.Dropout(dropout) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
krodyush/training_extensions
GatedResidualNetwork
false
11,002
[ "Apache-2.0" ]
0
542f4004dfbc6fc62a622065367ba4f85a703dd3
https://github.com/krodyush/training_extensions/tree/542f4004dfbc6fc62a622065367ba4f85a703dd3
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models import torch.onnx import torch.nn class GatedLinearUnit(nn.Module): def __init__(self, input_size, output_size, dropout=0): super().__init__() self.dropout = nn.Dropout(dropout) ...
LearnableBias
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 LearnableBias(nn.Module): def __init__(self, out_chn): super(LearnableBias, self).__init__() self.bias = nn.Parameter(torch.zeros(out_chn), requires_grad=True) def forward(self, x): out = x + self.bias.expand_as(x) return out def get...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
uzair789/pytorch-retinanet
LearnableBias
false
11,003
[ "Apache-2.0" ]
0
cabac159a9877825ef04ab06d3b9a63bdfa4f306
https://github.com/uzair789/pytorch-retinanet/tree/cabac159a9877825ef04ab06d3b9a63bdfa4f306
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, out_chn): super().__init__() self.bias = nn.Parameter(torch.zeros(out_chn), requires_grad=True) def forward(self, x): out = x + self.bias.expand_as(x) return out def get_inputs(): return [torc...
DirichletPolicySingleLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn.functional as F import torch.distributions as td import torch.nn as nn class PolicyNetwork(nn.Module): """Base class for stochastic policy networks.""" def __init__(self): super().__init__() def forward(self, state): """Take state as input,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np import tor...
wessle/costaware
DirichletPolicySingleLayer
false
11,004
[ "MIT" ]
0
151502308411528eaa703d353d138fc809e59d8e
https://github.com/wessle/costaware/tree/151502308411528eaa703d353d138fc809e59d8e
import torch import numpy as np import torch.nn.functional as F import torch.distributions as td import torch.nn as nn class PolicyNetwork(nn.Module): """Base class for stochastic policy networks.""" def __init__(self): super().__init__() def forward(self, state): """Take state as input,...
PinballLoss
# 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 PinballLoss(nn.Module): """ Pinball Loss Computes the pinball loss between y and y_hat. Parameters ---------- y: tensor actual values in torch tensor. y_hat: tensor (same shape as y) predicted values in torch tensor. tau: float, between 0 and 1 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
venkatkorapaty/esrnn
PinballLoss
false
11,005
[ "MIT" ]
0
411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c
https://github.com/venkatkorapaty/esrnn/tree/411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c
import torch import torch.nn as nn class Model(nn.Module): """ Pinball Loss Computes the pinball loss between y and y_hat. Parameters ---------- y: tensor actual values in torch tensor. y_hat: tensor (same shape as y) predicted values in torch tensor. tau: float, between 0 and 1 the slo...
AdaptiveInstanceNormalization
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 AdaptiveInstanceNormalization(nn.Module): """Some Information about AdaptiveInstanceNormalization""" def __init__(self, channels, style_dim): super(AdaptiveInstanceNormalization, self).__init__() self.affine = nn.Linear(style_dim, channels * 2) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
uthree/gan-image-generator
AdaptiveInstanceNormalization
false
11,006
[ "MIT" ]
0
85585e389b5a494393da0789d82824f8c811e263
https://github.com/uthree/gan-image-generator/tree/85585e389b5a494393da0789d82824f8c811e263
import torch import torch.nn as nn class Model(nn.Module): """Some Information about AdaptiveInstanceNormalization""" def __init__(self, channels, style_dim): super().__init__() self.affine = nn.Linear(style_dim, channels * 2) self.norm = nn.InstanceNorm2d(channels) def forward(s...
upsampleBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data def swish(x): return x * F.sigmoid(x) class upsampleBlock(nn.Module): def __init__(self, in_channels, out_channels): super(upsampleBlock, self).__init__() self.conv = nn.Conv2d(in_channels, out_channe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.functional as F import torch.utils.data as...
tomron27/srganus
upsampleBlock
false
11,007
[ "Apache-2.0" ]
0
5dab73540535138375203bf31e31246cd203f3c0
https://github.com/tomron27/srganus/tree/5dab73540535138375203bf31e31246cd203f3c0
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data def swish(x): return x * F.sigmoid(x) class Model(nn.Module): def __init__(self, in_channels, out_channels): super().__init__() self.conv = nn.Conv2d(in_channels, out_channels, 3, stride=1, padding=1 ...
DisaggregatedPinballLoss
# 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 DisaggregatedPinballLoss(nn.Module): """ Pinball Loss Computes the pinball loss between y and y_hat. Parameters ---------- y: tensor actual values in torch tensor. y_hat: tensor (same shape as y) predicted values in torch tensor. tau: float, between 0 ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
venkatkorapaty/esrnn
DisaggregatedPinballLoss
false
11,008
[ "MIT" ]
0
411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c
https://github.com/venkatkorapaty/esrnn/tree/411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c
import torch import torch.nn as nn class Model(nn.Module): """ Pinball Loss Computes the pinball loss between y and y_hat. Parameters ---------- y: tensor actual values in torch tensor. y_hat: tensor (same shape as y) predicted values in torch tensor. tau: float, between 0 and 1 the slope...
MegatronGelu
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn import torch.onnx class MegatronGelu(torch.nn.Module): def forward(self, x): return x * 0.5 * (torch.erf(x / 1.41421) + 1.0) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn import torch.onnx assert_size_stride = torch._C._dynamo.guards....
thilow/onnxruntime
MegatronGelu
false
11,009
[ "MIT" ]
0
1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
https://github.com/thilow/onnxruntime/tree/1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
import torch import torch.nn import torch.onnx class Model(torch.nn.Module): def forward(self, x): return x * 0.5 * (torch.erf(x / 1.41421) + 1.0) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
InteractiveKLLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class InteractiveKLLoss(nn.Module): def __init__(self, temperature): super().__init__() self.temperature = temperature self.kl_loss = nn.KLDivLoss() def forward(self, student, teacher): ...
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...
pkuyym/nni
InteractiveKLLoss
false
11,010
[ "MIT" ]
0
fe533e3bc65ea27997e16250adb503638548d500
https://github.com/pkuyym/nni/tree/fe533e3bc65ea27997e16250adb503638548d500
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): def __init__(self, temperature): super().__init__() self.temperature = temperature self.kl_loss = nn.KLDivLoss() def forward(self, student, teacher): return self...
LevelVariabilityLoss
# 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 LevelVariabilityLoss(nn.Module): """ Level Variability Loss Computes the variability penalty for the level. Parameters ---------- levels: tensor with shape (batch, n_time) levels obtained from exponential smoothing component of ESRNN level_variability_penalt...
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...
venkatkorapaty/esrnn
LevelVariabilityLoss
false
11,011
[ "MIT" ]
0
411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c
https://github.com/venkatkorapaty/esrnn/tree/411d3191e7e12f29e521e06bc18f9b9b0fdf0f0c
import torch import torch.nn as nn class Model(nn.Module): """ Level Variability Loss Computes the variability penalty for the level. Parameters ---------- levels: tensor with shape (batch, n_time) levels obtained from exponential smoothing component of ESRNN level_variability_penalty: float th...
L1ExactPenaltyConstraintLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn from torch.nn import functional as F class L1ExactPenaltyConstraintLoss(nn.Module): def __init__(self): super(L1ExactPenaltyConstraintLoss, self).__init__() def forward(self, x): gap_constraint = F.relu(x) return torch.norm(gap_constraint, p=1) def...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn a...
ykt345/fairtorch
L1ExactPenaltyConstraintLoss
false
11,012
[ "MIT" ]
0
fe7e0cfaec3de0fc2b9c92943bb02639acd46bb4
https://github.com/ykt345/fairtorch/tree/fe7e0cfaec3de0fc2b9c92943bb02639acd46bb4
import torch from torch import nn from torch.nn import functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): gap_constraint = F.relu(x) return torch.norm(gap_constraint, p=1) def get_inputs(): return [torch.rand([4, 4, 4, 4])] de...
L2PenaltyConstraintLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn from torch.nn import functional as F class L2PenaltyConstraintLoss(nn.Module): def __init__(self): super(L2PenaltyConstraintLoss, self).__init__() def forward(self, x): gap_constraint = F.relu(x) return torch.norm(gap_constraint, p=2) def get_input...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_...
ykt345/fairtorch
L2PenaltyConstraintLoss
false
11,013
[ "MIT" ]
0
fe7e0cfaec3de0fc2b9c92943bb02639acd46bb4
https://github.com/ykt345/fairtorch/tree/fe7e0cfaec3de0fc2b9c92943bb02639acd46bb4
import torch from torch import nn from torch.nn import functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): gap_constraint = F.relu(x) return torch.norm(gap_constraint, p=2) def get_inputs(): return [torch.rand([4, 4, 4, 4])] de...
MegatronFastGelu
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn import torch.onnx class MegatronFastGelu(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn import torch.onnx assert_size_stride = torch._C._dynamo.guards....
thilow/onnxruntime
MegatronFastGelu
false
11,014
[ "MIT" ]
0
1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
https://github.com/thilow/onnxruntime/tree/1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
import torch import torch.nn import torch.onnx class Model(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
UpsampleBLock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 UpsampleBLock(nn.Module): def __init__(self, in_channels): super(UpsampleBLock, self).__init__() self.conv = nn.Conv2d(in_channels, in_channels * 2 ** 2, kernel_size=3, padding=1) self.pixel_shuffle = nn.PixelShu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dyn...
tomron27/srganus
UpsampleBLock
false
11,015
[ "Apache-2.0" ]
0
5dab73540535138375203bf31e31246cd203f3c0
https://github.com/tomron27/srganus/tree/5dab73540535138375203bf31e31246cd203f3c0
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, in_channels): super().__init__() self.conv = nn.Conv2d(in_channels, in_channels * 2 ** 2, kernel_size=3, padding=1) self.pixel_shuffle = nn.PixelShuffle(2) self.prelu ...
HuggingfaceFastGelu
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn import torch.onnx class HuggingfaceFastGelu(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(x * 0.7978845608 * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[],...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn import torch.onnx assert_size_stride = torch._C._dynamo.guards....
thilow/onnxruntime
HuggingfaceFastGelu
false
11,016
[ "MIT" ]
0
1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
https://github.com/thilow/onnxruntime/tree/1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
import torch import torch.nn import torch.onnx class Model(torch.nn.Module): def forward(self, x): return 0.5 * x * (1.0 + torch.tanh(x * 0.7978845608 * (1.0 + 0.044715 * x * x))) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
NeuralNetNonDifferentiableOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 import torch.onnx class NeuralNetNonDifferentiableOutput(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetNonDifferentiableOutput, self).__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size) self.relu = torch....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
thilow/onnxruntime
NeuralNetNonDifferentiableOutput
false
11,017
[ "MIT" ]
0
1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
https://github.com/thilow/onnxruntime/tree/1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
import torch import torch.nn import torch.onnx class Model(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super().__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size) self.relu = torch.nn.ReLU() self.fc2 = torch.nn.Linear(hidden_size, num_cla...
TemperatureHolder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class TemperatureHolder(nn.Module): """Module that holds a temperature as a learnable value. Args: initial_log_temperature (float): Initial value of log(temperature). """ def __init__(self, initial_log_temperature=0): super().__init__() self....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_...
tarokiritani/pfrl
TemperatureHolder
false
11,018
[ "MIT" ]
0
284ed1f43b32654a2ec1569b16a0f6b9acbd5e79
https://github.com/tarokiritani/pfrl/tree/284ed1f43b32654a2ec1569b16a0f6b9acbd5e79
import torch from torch import nn class Model(nn.Module): """Module that holds a temperature as a learnable value. Args: initial_log_temperature (float): Initial value of log(temperature). """ def __init__(self, initial_log_temperature=0): super().__init__() self.log_temperat...
NeuralNetMultiplePositionalArguments
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 import torch.onnx class NeuralNetMultiplePositionalArguments(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArguments, self).__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size) self.relu ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
thilow/onnxruntime
NeuralNetMultiplePositionalArguments
false
11,019
[ "MIT" ]
0
1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
https://github.com/thilow/onnxruntime/tree/1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
import torch import torch.nn import torch.onnx class Model(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super().__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size) self.relu = torch.nn.ReLU() self.fc2 = torch.nn.Linear(hidden_size, num_cla...
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 import torch.onnx class NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency(torch .nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency , self).__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
thilow/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
false
11,020
[ "MIT" ]
0
1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
https://github.com/thilow/onnxruntime/tree/1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
import torch import torch.nn import torch.onnx class Model(torch .nn.Module): def __init__(self, input_size, hidden_size, num_classes): super().__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size) self.fc2 = torch.nn.Linear(input_size, hidden_size) self.relu1 = torch...
FeedForwardLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class FeedForwardLayer(nn.Module): def __init__(self, hidden_size): super(FeedForwardLayer, self).__init__() self.linear_1 = nn.Linear(hidden_size, 4 * hidden_size) self.linear_2 = nn.Linear(4 * hidden_size, hidden_size) self.relu = nn.ReLU() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
yongho94/Transformers_NMT
FeedForwardLayer
false
11,021
[ "MIT" ]
0
14fb08a6b1391da4d49f199dc16d7beb37620c98
https://github.com/yongho94/Transformers_NMT/tree/14fb08a6b1391da4d49f199dc16d7beb37620c98
import torch from torch import nn class Model(nn.Module): def __init__(self, hidden_size): super().__init__() self.linear_1 = nn.Linear(hidden_size, 4 * hidden_size) self.linear_2 = nn.Linear(4 * hidden_size, hidden_size) self.relu = nn.ReLU() def forward(self, hidden_states)...
NeuralNetPartialNoGradModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 import torch.onnx class NeuralNetPartialNoGradModel(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetPartialNoGradModel, self).__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size).requires_grad_( False) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
thilow/onnxruntime
NeuralNetPartialNoGradModel
false
11,022
[ "MIT" ]
0
1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
https://github.com/thilow/onnxruntime/tree/1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
import torch import torch.nn import torch.onnx class Model(torch.nn.Module): def __init__(self, input_size, hidden_size, num_classes): super().__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size).requires_grad_( False) self.relu = torch.nn.ReLU() self.fc2 = t...
ModMSELoss
# 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 ModMSELoss(torch.nn.Module): def __init__(self, shape_r_gt, shape_c_gt): super(ModMSELoss, self).__init__() self.shape_r_gt = shape_r_gt self.shape_c_gt = shape_c_gt def forward(self, output, label, prior): prior_size = prior.shape output_max = torc...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
yyuting/learning_from_program_trace
ModMSELoss
false
11,023
[ "MIT" ]
0
e0e4ac9bc2d4069eef64bdc2de64a87a735fa508
https://github.com/yyuting/learning_from_program_trace/tree/e0e4ac9bc2d4069eef64bdc2de64a87a735fa508
import torch class Model(torch.nn.Module): def __init__(self, shape_r_gt, shape_c_gt): super().__init__() self.shape_r_gt = shape_r_gt self.shape_c_gt = shape_c_gt def forward(self, output, label, prior): prior_size = prior.shape output_max = torch.max(torch.max(outpu...
PositionWiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models import torch.onnx import torch.nn class GatedLinearUnit(nn.Module): def __init__(self, input_size, output_size, dropout=0): super().__init__() self.dropout = nn.Dropout(dropout) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn impor...
krodyush/training_extensions
PositionWiseFeedForward
false
11,024
[ "Apache-2.0" ]
0
542f4004dfbc6fc62a622065367ba4f85a703dd3
https://github.com/krodyush/training_extensions/tree/542f4004dfbc6fc62a622065367ba4f85a703dd3
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models import torch.onnx import torch.nn class GatedLinearUnit(nn.Module): def __init__(self, input_size, output_size, dropout=0): super().__init__() self.dropout = nn.Dropout(dropout) ...
NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 import torch.onnx class NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency(torch. nn.Module): def __init__(self, input_size, hidden_size, num_classes): super(NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency, self).__init__() s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn import torch....
thilow/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithDependency
false
11,025
[ "MIT" ]
0
1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
https://github.com/thilow/onnxruntime/tree/1a3ddf0714e1bdf9b807a342eee5f6e160ad1ec9
import torch import torch.nn import torch.onnx class Model(torch. nn.Module): def __init__(self, input_size, hidden_size, num_classes): super().__init__() self.fc1 = torch.nn.Linear(input_size, hidden_size) self.relu = torch.nn.ReLU() self.fc2 = torch.nn.Linear(hidden_size, nu...
BertOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-12): """LayerNormalization層です。 学習済みモデルをそのままロードするため、学習済みモデルの変数名に変えています。 オリジナルのGitHubの実装から変数名を変えています。 weight→gamma、bias→beta ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Cyndi-Tokyotech/Fin_Text_Analysis_ML
BertOutput
false
11,026
[ "MIT" ]
0
7f9b6c1ea78f8e6f32c003b2de32809722df88d4
https://github.com/Cyndi-Tokyotech/Fin_Text_Analysis_ML/tree/7f9b6c1ea78f8e6f32c003b2de32809722df88d4
from _paritybench_helpers import _mock_config import torch from torch import nn class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-12): """LayerNormalization層です。 学習済みモデルをそのままロードするため、学習済みモデルの変数名に変えています。 オリジナルのGitHubの実装から変数名を変えています。 weight→gamma、bias→beta ...
MultiHeadAttentionLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn class MultiHeadAttentionLayer(nn.Module): def __init__(self, hidden_dim, n_heads, dropout=0.1): super().__init__() assert hidden_dim % n_heads == 0 self.hidden_dim = hidden_dim self.n_heads = n_heads self.head_dim = hidden_dim...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
wenjunyoung/PAN_PLUS
MultiHeadAttentionLayer
false
11,027
[ "Apache-2.0" ]
0
c893ff4775c8ff137a21c15d34fb93b9394dbfe5
https://github.com/wenjunyoung/PAN_PLUS/tree/c893ff4775c8ff137a21c15d34fb93b9394dbfe5
import math import torch import torch.nn as nn class Model(nn.Module): def __init__(self, hidden_dim, n_heads, dropout=0.1): super().__init__() assert hidden_dim % n_heads == 0 self.hidden_dim = hidden_dim self.n_heads = n_heads self.head_dim = hidden_dim // n_heads ...
UpsampleConvLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 UpsampleConvLayer(torch.nn.Module): """UpsampleConvLayer Upsamples the input and then does a convolution. This method gives better results compared to ConvTranspose2d. ref: http://distill.pub/2016/deconv-checkerboard/ """ def __init__(self, in_channels, out_channels, kernel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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...
yuweiliandrew/openrtist
UpsampleConvLayer
false
11,028
[ "Apache-2.0" ]
0
4b6b17e77587751593d5e529b154e60513de3236
https://github.com/yuweiliandrew/openrtist/tree/4b6b17e77587751593d5e529b154e60513de3236
import torch class Model(torch.nn.Module): """UpsampleConvLayer Upsamples the input and then does a convolution. This method gives better results compared to ConvTranspose2d. ref: http://distill.pub/2016/deconv-checkerboard/ """ def __init__(self, in_channels, out_channels, kernel_size, strid...
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 def activation_func(name): name = name.lower() if name == 'sigmoid': return torch.nn.Sigmoid() elif name == 'tanh': return torch.nn.Tanh() elif name == 'relu': return torch.nn.ReLU() elif name == 'softmax': return torch.nn.Softmax() elif name == 'le...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
xu94-nlp/Code-for-MAMO
Attention
false
11,029
[ "Apache-2.0" ]
0
d9c6655e0660976c90c07fa096a1f5dc8328a60b
https://github.com/xu94-nlp/Code-for-MAMO/tree/d9c6655e0660976c90c07fa096a1f5dc8328a60b
import torch def activation_func(name): name = name.lower() if name == 'sigmoid': return torch.nn.Sigmoid() elif name == 'tanh': return torch.nn.Tanh() elif name == 'relu': return torch.nn.ReLU() elif name == 'softmax': return torch.nn.Softmax() elif name == 'le...
AngleSimpleLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models from torch.nn import Parameter from torch.nn.parameter import Parameter import torch.onnx import torch.nn class AngleSimpleLinear(nn.Module): """Computes cos of angles between input vectors and weights ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
krodyush/training_extensions
AngleSimpleLinear
false
11,030
[ "Apache-2.0" ]
0
542f4004dfbc6fc62a622065367ba4f85a703dd3
https://github.com/krodyush/training_extensions/tree/542f4004dfbc6fc62a622065367ba4f85a703dd3
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models from torch.nn import Parameter from torch.nn.parameter import Parameter import torch.onnx import torch.nn class Model(nn.Module): """Computes cos of angles between input vectors and weights vectors""" ...
FCLateActionSAQFunction
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np from torch import nn from abc import ABCMeta from abc import abstractmethod import torch.nn.functional as F def init_lecun_normal(tensor, scale=1.0): """Initializes the tensor with LeCunNormal.""" fan_in = torch.nn.init._calculate_correct_fan(tensor, 'fan_in') std = scale *...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 from torch...
tarokiritani/pfrl
FCLateActionSAQFunction
false
11,031
[ "MIT" ]
0
284ed1f43b32654a2ec1569b16a0f6b9acbd5e79
https://github.com/tarokiritani/pfrl/tree/284ed1f43b32654a2ec1569b16a0f6b9acbd5e79
import torch import numpy as np from torch import nn from abc import ABCMeta from abc import abstractmethod import torch.nn.functional as F def init_lecun_normal(tensor, scale=1.0): """Initializes the tensor with LeCunNormal.""" fan_in = torch.nn.init._calculate_correct_fan(tensor, 'fan_in') std = scale *...
conv_head_pooling
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 conv_head_pooling(nn.Module): def __init__(self, in_feature, out_feature, stride, conv_type, padding_mode='zeros', dilation=1): super(conv_head_pooling, self).__init__() if conv_type == 'depthwise': _groups = in_feature else: ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
yasarniyazoglu/d2go
conv_head_pooling
false
11,032
[ "Apache-2.0" ]
0
308c2700c51c70a7a928d99a477b64e856d1ed5e
https://github.com/yasarniyazoglu/d2go/tree/308c2700c51c70a7a928d99a477b64e856d1ed5e
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_feature, out_feature, stride, conv_type, padding_mode='zeros', dilation=1): super().__init__() if conv_type == 'depthwise': _groups = in_feature else: _groups = 1 None ...
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 torchvision.transforms.functional as F 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 = temperatur...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
yshen47/mvsnerf
MultiHeadAttention
false
11,033
[ "MIT" ]
0
38ab4cf4fc5d025a9ad04e4a801b501ea9a78fb4
https://github.com/yshen47/mvsnerf/tree/38ab4cf4fc5d025a9ad04e4a801b501ea9a78fb4
import torch import torchvision.transforms.functional as F 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 = temperatur...
topk_PAM_Module
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 def mask_softmax(input, mask=None, dim=-1): """Applies a softmax function. Softmax is defined as: :math:`\\text{Softmax}(x_{i}) = \\frac{exp(x_i)}{\\sum_j exp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
yougoforward/OCNet1931
topk_PAM_Module
false
11,034
[ "MIT" ]
0
e679e9f248aff2f06e1d983e4e30230e5fc5174f
https://github.com/yougoforward/OCNet1931/tree/e679e9f248aff2f06e1d983e4e30230e5fc5174f
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 def mask_softmax(input, mask=None, dim=-1): """Applies a softmax function. Softmax is defined as: :math:`\\text{Softmax}(x_{i}) = \\frac{exp(x_i)}{\\sum_j exp...
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 as nn import torch.nn.functional as F class Classifier(nn.Module): def __init__(self, inputs, hidden_units): super().__init__() self.hidden = nn.Linear(inputs, hidden_units) self.output = nn.Linear(hidden_units, 102) self.dropout = nn.Dropout(p=0.2) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
zamerman/Udacity-AI-Programming
Classifier
false
11,035
[ "MIT" ]
0
6537f273fb00531d448330c1c85886d86e1161d2
https://github.com/zamerman/Udacity-AI-Programming/tree/6537f273fb00531d448330c1c85886d86e1161d2
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, inputs, hidden_units): super().__init__() self.hidden = nn.Linear(inputs, hidden_units) self.output = nn.Linear(hidden_units, 102) self.dropout = nn.Dropout(p=0.2) de...
UnaryBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils.data import torch.nn as nn from torch.nn.parameter import Parameter class BatchNormBlock(nn.Module): def __init__(self, in_dim, use_bn, bn_momentum): """ Initialize a batch normalization block. If network does not use batch normalization, replace with biases. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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....
wuxingzhe/OverPredactor
UnaryBlock
false
11,036
[ "MIT" ]
0
3a0965f4c3fc84ec0dcba555ec7c460f265d9143
https://github.com/wuxingzhe/OverPredactor/tree/3a0965f4c3fc84ec0dcba555ec7c460f265d9143
import torch import torch.utils.data import torch.nn as nn from torch.nn.parameter import Parameter class BatchNormBlock(nn.Module): def __init__(self, in_dim, use_bn, bn_momentum): """ Initialize a batch normalization block. If network does not use batch normalization, replace with biases. ...
Encoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Encoder(nn.Module): """Estimation of the nonnegative mixture weight by a 1-D conv layer. """ def __init__(self, L, N): super(Encoder, self).__init__() self.L, self.N = L, N self.conv1d_U = nn.Conv1d(1, N, ker...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
zhangxinaaaa/Conv-TasNet
Encoder
false
11,037
[ "MIT" ]
0
4622d93d0b9dbe23584addd4f4b9463255651652
https://github.com/zhangxinaaaa/Conv-TasNet/tree/4622d93d0b9dbe23584addd4f4b9463255651652
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """Estimation of the nonnegative mixture weight by a 1-D conv layer. """ def __init__(self, L, N): super().__init__() self.L, self.N = L, N self.conv1d_U = nn.Conv1d(1, N, kernel_size=L, str...
Conv2d_dilated
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.conv import _ConvNd from torch.nn.modules.utils import _pair def same_padding_length(input_length, filter_size, stride, dilation=1): dilated_filter_size = filter_size + (filter_size - 1) * (dilation - 1) output_length = (...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
xwjBupt/Counting-ICCV-DSSINet
Conv2d_dilated
false
11,038
[ "MIT" ]
0
92e4c56c93572fb2b026d573c3e711ce85a4af8f
https://github.com/xwjBupt/Counting-ICCV-DSSINet/tree/92e4c56c93572fb2b026d573c3e711ce85a4af8f
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.conv import _ConvNd from torch.nn.modules.utils import _pair def same_padding_length(input_length, filter_size, stride, dilation=1): dilated_filter_size = filter_size + (filter_size - 1) * (dilation - 1) output_length = (...
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 from torch.autograd import Variable def flatten(tensor): """Flattens a given tensor such that the channel axis is first. The shapes are transformed as follows: (N, C, D, H, W) -> (C, N * D * H * W) """ C = tensor.size(1) axis_order = (1, 0) + tuple(range(2,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
zzz123xyz/pytorch-3dunet
DiceLoss
false
11,039
[ "MIT" ]
0
5bab6968b23cff5c6ae456b343285bfa9b104294
https://github.com/zzz123xyz/pytorch-3dunet/tree/5bab6968b23cff5c6ae456b343285bfa9b104294
import torch from torch import nn from torch.autograd import Variable def flatten(tensor): """Flattens a given tensor such that the channel axis is first. The shapes are transformed as follows: (N, C, D, H, W) -> (C, N * D * H * W) """ C = tensor.size(1) axis_order = (1, 0) + tuple(range(2,...
RPN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models import torch.onnx def conv(in_channels, out_channels, kernel_size=3, padding=1, bn=True, dilation=1, stride=1, relu=True, bias=True): modules = [nn.Conv2d(in_channels, out_channels, kernel_size, str...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
vadimadr/openvino_training_extensions
RPN
false
11,040
[ "Apache-2.0" ]
0
5d64b8423c8eb7b374ed629fad938359d34a07d2
https://github.com/vadimadr/openvino_training_extensions/tree/5d64b8423c8eb7b374ed629fad938359d34a07d2
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models import torch.onnx def conv(in_channels, out_channels, kernel_size=3, padding=1, bn=True, dilation=1, stride=1, relu=True, bias=True): modules = [nn.Conv2d(in_channels, out_channels, kernel_size, str...
CGRU_cell
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as f from math import sqrt as sqrt from itertools import product as product class CGRU_cell(nn.Module): """Initialize a basic Conv GRU cell. Args: filter_size: int that is the height and width of the filter...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
zhujiagang/realtime-refined-random
CGRU_cell
false
11,041
[ "MIT" ]
0
3aa8169049ab8be8b1ea5a78bbe9b89ac6c15593
https://github.com/zhujiagang/realtime-refined-random/tree/3aa8169049ab8be8b1ea5a78bbe9b89ac6c15593
import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as f from math import sqrt as sqrt from itertools import product as product class Model(nn.Module): """Initialize a basic Conv GRU cell. Args: filter_size: int that is the height and width of the filters ...
ResBlockWithFusedBN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 torchvision import models as models import torch.onnx class ResBlockWithFusedBN(nn.Module): """ Bottleneck Residual Block """ def __init__(self, inplanes, outplanes, innerplanes, stride=1, dilation =1, group=1, stride_1x1=True): 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 import nn from tor...
vadimadr/openvino_training_extensions
ResBlockWithFusedBN
false
11,042
[ "Apache-2.0" ]
0
5d64b8423c8eb7b374ed629fad938359d34a07d2
https://github.com/vadimadr/openvino_training_extensions/tree/5d64b8423c8eb7b374ed629fad938359d34a07d2
import torch from torch import nn from torchvision import models as models import torch.onnx class Model(nn.Module): """ Bottleneck Residual Block """ def __init__(self, inplanes, outplanes, innerplanes, stride=1, dilation =1, group=1, stride_1x1=True): super().__init__() str1x1, str3...
BertSelfOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.onnx class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-12): """Construct a layernorm module in the TF style (epsilon inside the square root). """ super(BertLayerNorm, self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
xerothermic/examples
BertSelfOutput
false
11,043
[ "MIT" ]
0
d9d0ad02bac27fc483079d27c86b54145e45f81b
https://github.com/xerothermic/examples/tree/d9d0ad02bac27fc483079d27c86b54145e45f81b
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.onnx class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-12): """Construct a layernorm module in the TF style (epsilon inside the square root). """ super().__init__() ...
CenterLoss
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models import torch.onnx class CenterLoss(nn.Module): """Implements the Center loss from https://ydwen.github.io/papers/WenECCV16.pdf""" def __init__(self, num_classes, embed_size, cos_dist=True): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn from to...
vadimadr/openvino_training_extensions
CenterLoss
false
11,044
[ "Apache-2.0" ]
0
5d64b8423c8eb7b374ed629fad938359d34a07d2
https://github.com/vadimadr/openvino_training_extensions/tree/5d64b8423c8eb7b374ed629fad938359d34a07d2
import torch from torch.nn import functional as F from torch import nn from torchvision import models as models import torch.onnx class Model(nn.Module): """Implements the Center loss from https://ydwen.github.io/papers/WenECCV16.pdf""" def __init__(self, num_classes, embed_size, cos_dist=True): supe...
spatial_attn_layer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data class BasicConv(nn.Module): def __init__(self, in_planes, out_planes, kernel_size, stride=1, padding=0, dilation=1, groups=1, relu=True, bn=False, bias=False): super(BasicConv, self).__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
zhanzhibingshang/deblurganv2_mirnet
spatial_attn_layer
false
11,045
[ "BSD-3-Clause" ]
0
12fcc94ee0ff33335c557cf46a776a13cae3804b
https://github.com/zhanzhibingshang/deblurganv2_mirnet/tree/12fcc94ee0ff33335c557cf46a776a13cae3804b
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data class BasicConv(nn.Module): def __init__(self, in_planes, out_planes, kernel_size, stride=1, padding=0, dilation=1, groups=1, relu=True, bn=False, bias=False): super().__init__() self.ou...
FocalDiceLoss
# 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 FocalDiceLoss(nn.Module): def __init__(self, gamma=2.0): super().__init__() self.gamma = gamma def forward(self, score, target): target = target.float() smooth = 1e-06 intersect = torch.sum(score * target) y_sum = torch...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
xuyangcao/AttD2UNet
FocalDiceLoss
false
11,046
[ "MIT" ]
0
b76ed8104a4183140b3cbd7f9671ca99d36e3b3e
https://github.com/xuyangcao/AttD2UNet/tree/b76ed8104a4183140b3cbd7f9671ca99d36e3b3e
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, gamma=2.0): super().__init__() self.gamma = gamma def forward(self, score, target): target = target.float() smooth = 1e-06 intersect = torch.sum(score * target) y_sum = torch.sum(tar...
FocalTiLoss
# 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 FocalTiLoss(nn.Module): def __init__(self, alpha=0.7, beta=0.4, gamma=0.75): super().__init__() self.alpha = alpha self.beta = beta self.gamma = gamma self.eps = 1e-06 def forward(self, output, target): output = output....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
xuyangcao/AttD2UNet
FocalTiLoss
false
11,047
[ "MIT" ]
0
b76ed8104a4183140b3cbd7f9671ca99d36e3b3e
https://github.com/xuyangcao/AttD2UNet/tree/b76ed8104a4183140b3cbd7f9671ca99d36e3b3e
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, alpha=0.7, beta=0.4, gamma=0.75): super().__init__() self.alpha = alpha self.beta = beta self.gamma = gamma self.eps = 1e-06 def forward(self, output, target): output = output.float(...
attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.nn.functional as F class attention(nn.Module): def __init__(self, input_channels, map_size): super(attention, self).__init__() self.pool = nn.AvgPool...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 import tor...
yaowenlong/clique
attention
false
11,048
[ "MIT" ]
0
a9814ef643f7dac6080cebf76ab804d942c9cd8e
https://github.com/yaowenlong/clique/tree/a9814ef643f7dac6080cebf76ab804d942c9cd8e
import torch import torch.utils import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.nn.functional as F class Model(nn.Module): def __init__(self, input_channels, map_size): super().__init__() self.pool = nn.AvgPool2d(kernel_size=map_...
Attention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import math import torch from torch import nn import torch.nn.functional as F import torch.utils.data.distributed def matmul(x, y): if x.dim() == y.dim(): return x @ y if x.dim() == y.dim() - 1: return (x.unsqueeze(-2) @ y).squeeze(-2) return (x @ y.unsqueeze(-2)).squeeze(-2) class Atten...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
xurantju/densecap
Attention
false
11,049
[ "BSD-3-Clause" ]
0
2e58501e453bf98b9cc892e5b64997f5c1dfc808
https://github.com/xurantju/densecap/tree/2e58501e453bf98b9cc892e5b64997f5c1dfc808
import math import torch from torch import nn import torch.nn.functional as F import torch.utils.data.distributed def matmul(x, y): if x.dim() == y.dim(): return x @ y if x.dim() == y.dim() - 1: return (x.unsqueeze(-2) @ y).squeeze(-2) return (x @ y.unsqueeze(-2)).squeeze(-2) class Model...
MultiHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch from torch import nn import torch.nn.functional as F import torch.utils.data.distributed def matmul(x, y): if x.dim() == y.dim(): return x @ y if x.dim() == y.dim() - 1: return (x.unsqueeze(-2) @ y).squeeze(-2) return (x @ y.unsqueeze(-2)).squeeze(-2) class Atten...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
xurantju/densecap
MultiHead
false
11,050
[ "BSD-3-Clause" ]
0
2e58501e453bf98b9cc892e5b64997f5c1dfc808
https://github.com/xurantju/densecap/tree/2e58501e453bf98b9cc892e5b64997f5c1dfc808
import math import torch from torch import nn import torch.nn.functional as F import torch.utils.data.distributed def matmul(x, y): if x.dim() == y.dim(): return x @ y if x.dim() == y.dim() - 1: return (x.unsqueeze(-2) @ y).squeeze(-2) return (x @ y.unsqueeze(-2)).squeeze(-2) class Atten...
CosineBasisLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np from torch import nn def cosine_basis_functions(x, n_basis_functions=64): """Cosine basis functions used to embed quantile thresholds. Args: x (torch.Tensor): Input. n_basis_functions (int): Number of cosine basis functions. Returns: ndarray: Embed...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy ...
tarokiritani/pfrl
CosineBasisLinear
false
11,051
[ "MIT" ]
0
284ed1f43b32654a2ec1569b16a0f6b9acbd5e79
https://github.com/tarokiritani/pfrl/tree/284ed1f43b32654a2ec1569b16a0f6b9acbd5e79
import torch import numpy as np from torch import nn def cosine_basis_functions(x, n_basis_functions=64): """Cosine basis functions used to embed quantile thresholds. Args: x (torch.Tensor): Input. n_basis_functions (int): Number of cosine basis functions. Returns: ndarray: Embed...
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 from torch import nn import torch.nn.functional as F import torch.utils.data.distributed def matmul(x, y): if x.dim() == y.dim(): return x @ y if x.dim() == y.dim() - 1: return (x.unsqueeze(-2) @ y).squeeze(-2) return (x @ y.unsqueeze(-2)).squeeze(-2) class FeedF...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
xurantju/densecap
EncoderLayer
false
11,052
[ "BSD-3-Clause" ]
0
2e58501e453bf98b9cc892e5b64997f5c1dfc808
https://github.com/xurantju/densecap/tree/2e58501e453bf98b9cc892e5b64997f5c1dfc808
import math import torch from torch import nn import torch.nn.functional as F import torch.utils.data.distributed def matmul(x, y): if x.dim() == y.dim(): return x @ y if x.dim() == y.dim() - 1: return (x.unsqueeze(-2) @ y).squeeze(-2) return (x @ y.unsqueeze(-2)).squeeze(-2) class FeedF...
BertOutput
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.data class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-05): """Construct a layernorm module in the TF style (epsilon inside the square root).""" super(BertLayerNorm, self).__ini...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
zdxdsw/WebQA_VLP
BertOutput
false
11,053
[ "Apache-2.0" ]
0
443bcd7e9b36db47e2ab4502abaaa3724800f394
https://github.com/zdxdsw/WebQA_VLP/tree/443bcd7e9b36db47e2ab4502abaaa3724800f394
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.utils.data class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-05): """Construct a layernorm module in the TF style (epsilon inside the square root).""" super().__init__() self....
CNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.nn.functional as F class CNN(nn.Module): def __init__(self, last_layer_channels): super().__init__() self.conv1 = nn.Conv2d(1, 32, (3, 3), padding='same') self.conv2 = nn.Conv2d(32, 32, (3, 3), padding='same') self.pool1 = nn.MaxPool2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
zitkat/transformer-HTR
CNN
false
11,054
[ "Apache-2.0" ]
0
fa14dc99f1050c022cd54bc82abe9bc8dbfbc95a
https://github.com/zitkat/transformer-HTR/tree/fa14dc99f1050c022cd54bc82abe9bc8dbfbc95a
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, last_layer_channels): super().__init__() self.conv1 = nn.Conv2d(1, 32, (3, 3), padding='same') self.conv2 = nn.Conv2d(32, 32, (3, 3), padding='same') self.pool1 = nn.MaxPoo...
CCCLoss
# 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 CCCLoss(nn.Module): """CCC loss for VA regression """ def __init__(self, reduction='mean', loss_weight=1.0): super().__init__() self.reduction = reduction self.loss_weight = loss_weight def get_name(self): return 'CCC_loss' ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
youqingxiaozhua/ABAW3
CCCLoss
false
11,055
[ "Apache-2.0" ]
0
51ab58ab311ecd6603a8485a45af0dcc39880e69
https://github.com/youqingxiaozhua/ABAW3/tree/51ab58ab311ecd6603a8485a45af0dcc39880e69
import torch import torch.nn as nn class Model(nn.Module): """CCC loss for VA regression """ def __init__(self, reduction='mean', loss_weight=1.0): super().__init__() self.reduction = reduction self.loss_weight = loss_weight def get_name(self): return 'CCC_loss' ...
Unet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 ConvBlock(nn.Module): def __init__(self, in_channels, out_channels, dropout=False, norm= 'batch', residual=True, activation='leakyrelu', transpose=False): super(ConvBlock, self).__init__() self.dropout = dropout self.residual = residual ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
tim-vdl/noise2self
Unet
false
11,056
[ "MIT" ]
0
2cf10d20d988dc7b6c1278150f170aa3e3335b28
https://github.com/tim-vdl/noise2self/tree/2cf10d20d988dc7b6c1278150f170aa3e3335b28
import torch import torch.nn as nn class ConvBlock(nn.Module): def __init__(self, in_channels, out_channels, dropout=False, norm= 'batch', residual=True, activation='leakyrelu', transpose=False): super().__init__() self.dropout = dropout self.residual = residual self.activ...
MSELoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class MSELoss(nn.Module): """MSE loss. Args: reduction (str): The method used to reduce the loss. Options are "none", "mean" and "sum". Defaults to 'mean'. loss_weight (float): Weight of the loss. Defaults to 1.0. """ def __init__(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...
youqingxiaozhua/ABAW3
MSELoss
false
11,057
[ "Apache-2.0" ]
0
51ab58ab311ecd6603a8485a45af0dcc39880e69
https://github.com/youqingxiaozhua/ABAW3/tree/51ab58ab311ecd6603a8485a45af0dcc39880e69
import torch import torch.nn as nn class Model(nn.Module): """MSE loss. Args: reduction (str): The method used to reduce the loss. Options are "none", "mean" and "sum". Defaults to 'mean'. loss_weight (float): Weight of the loss. Defaults to 1.0. """ def __init__(self, r...
Net1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 def square(x): return x * x class Net1(torch.nn.Module): def __init__(self, hidden=64, output=10): super().__init__() self.conv1 = torch.nn.Conv2d(1, 4, kernel_size=7, padding=0, stride=3) self.fc1 = torch.nn.Linear(256, hidden) self.fc2 = torch.nn.Linear(hidden...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
yxtj/henn
Net1
false
11,058
[ "MIT" ]
0
5093f3e637ba0bb3e48c4f890b3b469c3617f2c5
https://github.com/yxtj/henn/tree/5093f3e637ba0bb3e48c4f890b3b469c3617f2c5
import torch def square(x): return x * x class Model(torch.nn.Module): def __init__(self, hidden=64, output=10): super().__init__() self.conv1 = torch.nn.Conv2d(1, 4, kernel_size=7, padding=0, stride=3) self.fc1 = torch.nn.Linear(256, hidden) self.fc2 = torch.nn.Linear(hidde...
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...
youqingxiaozhua/ABAW3
AsymmetricLoss
false
11,059
[ "Apache-2.0" ]
0
51ab58ab311ecd6603a8485a45af0dcc39880e69
https://github.com/youqingxiaozhua/ABAW3/tree/51ab58ab311ecd6603a8485a45af0dcc39880e69
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. """ ...
Net2
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 def square(x): return x * x class Net2(torch.nn.Module): def __init__(self, act=square, output=10): super().__init__() self.act = act self.conv1 = torch.nn.Conv2d(1, 8, kernel_size=5, stride=2, padding=0) self.conv2 = torch.nn.Conv2d(8, 64, kernel_size=3, stride...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
yxtj/henn
Net2
false
11,060
[ "MIT" ]
0
5093f3e637ba0bb3e48c4f890b3b469c3617f2c5
https://github.com/yxtj/henn/tree/5093f3e637ba0bb3e48c4f890b3b469c3617f2c5
import torch def square(x): return x * x class Model(torch.nn.Module): def __init__(self, act=square, output=10): super().__init__() self.act = act self.conv1 = torch.nn.Conv2d(1, 8, kernel_size=5, stride=2, padding=0) self.conv2 = torch.nn.Conv2d(8, 64, kernel_size=3, strid...
MutualInfoLoss
# 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 MutualInfoLoss(nn.Module): """ Mutual Information Loss derived from ss-with-RIM that also applied in this work. First term enforces to generate a sparse nSpixel dimension vector for each pixel; Second term indicates the cardinality of each sp...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_...
yueyu-stu/EdgeAwareSpixel
MutualInfoLoss
false
11,061
[ "MIT" ]
0
f7f9fcb15bfa8e31bd4ad9473f9058c44a8391d7
https://github.com/yueyu-stu/EdgeAwareSpixel/tree/f7f9fcb15bfa8e31bd4ad9473f9058c44a8391d7
import torch from torch import nn class Model(nn.Module): """ Mutual Information Loss derived from ss-with-RIM that also applied in this work. First term enforces to generate a sparse nSpixel dimension vector for each pixel; Second term indicates the cardinality of each spixel. ...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn 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...
youqingxiaozhua/ABAW3
FocalLoss
false
11,062
[ "Apache-2.0" ]
0
51ab58ab311ecd6603a8485a45af0dcc39880e69
https://github.com/youqingxiaozhua/ABAW3/tree/51ab58ab311ecd6603a8485a45af0dcc39880e69
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. """ ...
BertAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch from torch import nn import torch.utils.data class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-05): """Construct a layernorm module in the TF style (epsilon inside the square root).""" super(BertLayerNorm,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
zdxdsw/WebQA_VLP
BertAttention
false
11,063
[ "Apache-2.0" ]
0
443bcd7e9b36db47e2ab4502abaaa3724800f394
https://github.com/zdxdsw/WebQA_VLP/tree/443bcd7e9b36db47e2ab4502abaaa3724800f394
from _paritybench_helpers import _mock_config import math import torch from torch import nn import torch.utils.data class BertLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-05): """Construct a layernorm module in the TF style (epsilon inside the square root).""" super().__init__() ...
LearnedPositionalEmbeddings
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class LearnedPositionalEmbeddings(Module): """ <a id="LearnedPositionalEmbeddings"> ## Add parameterized positional encodings </a> This adds learned positional em...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd assert_size_stride...
ppvalluri09/annotated_deep_learning_paper_implementations
LearnedPositionalEmbeddings
false
11,064
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ <a id="LearnedPositionalEmbeddings"> ## Add parameterized positional encodings </a> This adds learned positional embeddings to patch embe...
ClippedValueFunctionLoss
# 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 import torch.utils.data import torch.nn.functional import torch.autograd class ClippedValueFunctionLoss(Module): """ ## Clipped Value Function Loss Similarly we clip the value function update also. egin{align} V^{\\pi_ heta}_{CLIP}(s_t) &= clip\\Big...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module import torch.utils.data import torch.nn.functional import tor...
ppvalluri09/annotated_deep_learning_paper_implementations
ClippedValueFunctionLoss
false
11,065
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ ## Clipped Value Function Loss Similarly we clip the value function update also. egin{align} V^{\\pi_ heta}_{CLIP}(s_t) &= clip\\Bigl(V^{\\pi_ heta}(s_...
DPFP
# 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 nn import torch.utils.data import torch.nn.functional import torch.autograd class DPFP(Module): """ ## Deterministic Parameter Free Project (DPFP) This is the new projection function $\\color{lightgreen}{\\phi}$ introduced in the paper. DPFP ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module from torch import nn import torch.utils.data import torch.nn....
ppvalluri09/annotated_deep_learning_paper_implementations
DPFP
false
11,066
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ ## Deterministic Parameter Free Project (DPFP) This is the new projection function $\\color{lightgreen}{\\phi}$ introduced in the paper. DPFP...
DiscriminatorLoss
# 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 import torch.nn.functional as F import torch.utils.data import torch.nn.functional import torch.autograd class DiscriminatorLoss(Module): """ ## Discriminator Loss We want to find $w$ to maximize $$\\mathbb{E}_{x \\sim \\mathbb{P}_r} [f_w(x)]- \\mathbb{E}_{z \...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module import torch.utils.data import torch.nn.functional import tor...
ppvalluri09/annotated_deep_learning_paper_implementations
DiscriminatorLoss
false
11,067
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch import torch.nn.functional as F import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ ## Discriminator Loss We want to find $w$ to maximize $$\\mathbb{E}_{x \\sim \\mathbb{P}_r} [f_w(x)]- \\mathbb{E}_{z \\sim p(z)} [...
PatchEmbeddings
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class PatchEmbeddings(Module): """ <a id="PatchEmbeddings"> ## Get patch embeddings </a> The paper splits the image into patches of equal size and do a linear tra...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module from torch import nn import torch.utils.data import ...
ppvalluri09/annotated_deep_learning_paper_implementations
PatchEmbeddings
false
11,068
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ <a id="PatchEmbeddings"> ## Get patch embeddings </a> The paper splits the image into patches of equal size and do a linear transformatio...
LSTMCell
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class LSTMCell(Module): """ ## Long Short-Term Memory Cell LSTM Cell computes $c$, and $h$. $c$ is like the long-term memory, and $h$ is like the short term memory. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn impor...
ppvalluri09/annotated_deep_learning_paper_implementations
LSTMCell
false
11,069
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ ## Long Short-Term Memory Cell LSTM Cell computes $c$, and $h$. $c$ is like the long-term memory, and $h$ is like the short term memory. ...
ChannelNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class ChannelNorm(Module): """ ## Channel Normalization This is similar to [Group Normalization](../group_norm/index.html) but affine transform is done group wise. ""...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn import Module from torch import nn import torch.utils.data import...
ppvalluri09/annotated_deep_learning_paper_implementations
ChannelNorm
false
11,070
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch from torch import nn import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ ## Channel Normalization This is similar to [Group Normalization](../group_norm/index.html) but affine transform is done group wise. """ ...
SmoothContourLoss
# 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 SmoothContourLoss(nn.Module): """ Loss function that contains smoothness loss derived from ss-with-RIM and contour-aware loss. Smoothness loss concerns about smoothness of local patterns, while contour-aware loss is interested in whether two ...
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...
yueyu-stu/EdgeAwareSpixel
SmoothContourLoss
false
11,071
[ "MIT" ]
0
f7f9fcb15bfa8e31bd4ad9473f9058c44a8391d7
https://github.com/yueyu-stu/EdgeAwareSpixel/tree/f7f9fcb15bfa8e31bd4ad9473f9058c44a8391d7
import torch from torch import nn class Model(nn.Module): """ Loss function that contains smoothness loss derived from ss-with-RIM and contour-aware loss. Smoothness loss concerns about smoothness of local patterns, while contour-aware loss is interested in whether two patches are ...
MaskedThing
# 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 MaskedThing(nn.Module): l1 = nn.L1Loss() mse = nn.MSELoss() def forward(self, pred, target, mask): pred = torch.log1p(F.relu(pred)) target = torch.log1p(F.relu(target)) pred = torch.mul(pred, mask) ta...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
vegetablejuiceftw/soft-pointer-networks
MaskedThing
false
11,072
[ "MIT" ]
0
9705d9688b6b69db3948172771df4c367165c948
https://github.com/vegetablejuiceftw/soft-pointer-networks/tree/9705d9688b6b69db3948172771df4c367165c948
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): l1 = nn.L1Loss() mse = nn.MSELoss() def forward(self, pred, target, mask): pred = torch.log1p(F.relu(pred)) target = torch.log1p(F.relu(target)) pred = torch.mul(pred, mask) target =...
PositionMSELoss
# 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 PositionMSELoss(nn.Module): mse = nn.MSELoss() def forward(self, pred, target, mask): pred = torch.mul(pred, mask.unsqueeze(2)) return self.mse(pred, target) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), 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 import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
vegetablejuiceftw/soft-pointer-networks
PositionMSELoss
false
11,073
[ "MIT" ]
0
9705d9688b6b69db3948172771df4c367165c948
https://github.com/vegetablejuiceftw/soft-pointer-networks/tree/9705d9688b6b69db3948172771df4c367165c948
import torch import torch.nn as nn class Model(nn.Module): mse = nn.MSELoss() def forward(self, pred, target, mask): pred = torch.mul(pred, mask.unsqueeze(2)) return self.mse(pred, target) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( ...
CosineLoss
# 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 CosineLoss(nn.Module): cos = nn.CosineSimilarity(dim=2, eps=1e-06) def forward(self, pred, target, mask): pred = torch.mul(pred, mask.unsqueeze(2)) return (1.0 - self.cos(pred, target)).mean() def get_inputs(): return [torch.rand([4, 4, 4, 4]), 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 torch.nn as nn assert...
vegetablejuiceftw/soft-pointer-networks
CosineLoss
false
11,074
[ "MIT" ]
0
9705d9688b6b69db3948172771df4c367165c948
https://github.com/vegetablejuiceftw/soft-pointer-networks/tree/9705d9688b6b69db3948172771df4c367165c948
import torch import torch.nn as nn class Model(nn.Module): cos = nn.CosineSimilarity(dim=2, eps=1e-06) def forward(self, pred, target, mask): pred = torch.mul(pred, mask.unsqueeze(2)) return (1.0 - self.cos(pred, target)).mean() def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch....
MaskedLoss
# 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 MaskedLoss(nn.Module): mse = nn.MSELoss() def forward(self, pred, target, mask): pred = torch.log1p(pred).contiguous().view(-1) target = torch.log1p(target).contiguous().view(-1) mask = mask.view(-1) pred = (mask * pred.T).T ret...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert...
vegetablejuiceftw/soft-pointer-networks
MaskedLoss
false
11,075
[ "MIT" ]
0
9705d9688b6b69db3948172771df4c367165c948
https://github.com/vegetablejuiceftw/soft-pointer-networks/tree/9705d9688b6b69db3948172771df4c367165c948
import torch import torch.nn as nn class Model(nn.Module): mse = nn.MSELoss() def forward(self, pred, target, mask): pred = torch.log1p(pred).contiguous().view(-1) target = torch.log1p(target).contiguous().view(-1) mask = mask.view(-1) pred = (mask * pred.T).T return s...
MaskedSoftL1
# 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 MaskedSoftL1(nn.Module): loss = nn.SmoothL1Loss() def __init__(self, factor=5): super().__init__() self.factor = factor def forward(self, pred, target, mask): pred = torch.mul(pred, mask) return self.loss(pred / self.factor, target...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
vegetablejuiceftw/soft-pointer-networks
MaskedSoftL1
false
11,076
[ "MIT" ]
0
9705d9688b6b69db3948172771df4c367165c948
https://github.com/vegetablejuiceftw/soft-pointer-networks/tree/9705d9688b6b69db3948172771df4c367165c948
import torch import torch.nn as nn class Model(nn.Module): loss = nn.SmoothL1Loss() def __init__(self, factor=5): super().__init__() self.factor = factor def forward(self, pred, target, mask): pred = torch.mul(pred, mask) return self.loss(pred / self.factor, target / self...
MaskedMSE
# 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 MaskedMSE(nn.Module): mse = nn.MSELoss() def forward(self, pred, target, mask): pred = torch.mul(pred, mask) return self.mse(pred, target) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( [4, 4, 4,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
vegetablejuiceftw/soft-pointer-networks
MaskedMSE
false
11,077
[ "MIT" ]
0
9705d9688b6b69db3948172771df4c367165c948
https://github.com/vegetablejuiceftw/soft-pointer-networks/tree/9705d9688b6b69db3948172771df4c367165c948
import torch import torch.nn as nn class Model(nn.Module): mse = nn.MSELoss() def forward(self, pred, target, mask): pred = torch.mul(pred, mask) return self.mse(pred, target) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( [4, 4, 4, 4])...
Squash
# 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 import torch.utils.data import torch.nn.functional import torch.autograd class Squash(Module): '\n ## Squash\n\n This is **squashing** function from paper, given by equation $(1)$.\n\n $$\\mathbf{v}_j = \x0crac{{\\lVert \\mathbf{s}_j \rVert}^2}{1 + {\\lVert \\math...
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.nn import Module import torch.utils.data import torch.nn.functional ...
ppvalluri09/annotated_deep_learning_paper_implementations
Squash
false
11,078
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): '\n ## Squash\n\n This is **squashing** function from paper, given by equation $(1)$.\n\n $$\\mathbf{v}_j = \x0crac{{\\lVert \\mathbf{s}_j \rVert}^2}{1 + {\\lVert \\mathb...
MarginLoss
# 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 import torch.nn.functional as F import torch.utils.data import torch.nn.functional import torch.autograd class MarginLoss(Module): '\n ## Margin loss for class existence\n\n A separate margin loss is used for each output capsule and the total loss is the sum of them....
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 ...
ppvalluri09/annotated_deep_learning_paper_implementations
MarginLoss
false
11,079
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch import torch.nn.functional as F import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): '\n ## Margin loss for class existence\n\n A separate margin loss is used for each output capsule and the total loss is the sum of them.\n ...
MaskedL1
# 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 MaskedL1(nn.Module): l1 = nn.L1Loss() def forward(self, pred, target, mask): pred = torch.mul(pred, mask) target = torch.mul(target, mask) return self.l1(pred, target) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
vegetablejuiceftw/soft-pointer-networks
MaskedL1
false
11,080
[ "MIT" ]
0
9705d9688b6b69db3948172771df4c367165c948
https://github.com/vegetablejuiceftw/soft-pointer-networks/tree/9705d9688b6b69db3948172771df4c367165c948
import torch import torch.nn as nn class Model(nn.Module): l1 = nn.L1Loss() def forward(self, pred, target, mask): pred = torch.mul(pred, mask) target = torch.mul(target, mask) return self.l1(pred, target) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, ...
tfAvgPool3D
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor from torch import nn class tfAvgPool3D(nn.Module): def __init__(self): super().__init__() self.avgf = nn.AvgPool3d((1, 3, 3), stride=(1, 2, 2)) def forward(self, x: 'Tensor') ->Tensor: if x.shape[-1] != x.shape[-2]: raise RuntimeError...
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...
zinzinhust96/MoViNet-pytorch
tfAvgPool3D
false
11,081
[ "MIT" ]
0
f16528a76516427a192524c512c7a7cd8e1ce2f0
https://github.com/zinzinhust96/MoViNet-pytorch/tree/f16528a76516427a192524c512c7a7cd8e1ce2f0
import torch from torch import Tensor from torch import nn class Model(nn.Module): def __init__(self): super().__init__() self.avgf = nn.AvgPool3d((1, 3, 3), stride=(1, 2, 2)) def forward(self, x: 'Tensor') ->Tensor: if x.shape[-1] != x.shape[-2]: raise RuntimeError( ...
LayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class LayerNorm(nn.Module): def __init__(self, num_channels, eps=1e-05): super().__init__() self.num_channels = num_channels self.eps = eps self.weight = nn.Parameter(torch.Tensor(num_channels)) self.bias = nn.Parameter(torch.Tensor(num_ch...
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...
yoshipon/spl2021_neural-fca
LayerNorm
false
11,082
[ "MIT" ]
0
a316026667dd6bd888547c8348cab8cd3d88e84c
https://github.com/yoshipon/spl2021_neural-fca/tree/a316026667dd6bd888547c8348cab8cd3d88e84c
import torch from torch import nn class Model(nn.Module): def __init__(self, num_channels, eps=1e-05): super().__init__() self.num_channels = num_channels self.eps = eps self.weight = nn.Parameter(torch.Tensor(num_channels)) self.bias = nn.Parameter(torch.Tensor(num_channe...
SqueezeExcitation
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.functional as F from typing import Optional from torch import nn def _make_divisible(v: 'float', divisor: 'int', min_value: 'Optional[int]'=None ) ->int: """ This function is taken from the original tf repo. It ensures that all layers have a channe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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 Tensor import torch.nn.functional as F from typing import Opti...
zinzinhust96/MoViNet-pytorch
SqueezeExcitation
false
11,083
[ "MIT" ]
0
f16528a76516427a192524c512c7a7cd8e1ce2f0
https://github.com/zinzinhust96/MoViNet-pytorch/tree/f16528a76516427a192524c512c7a7cd8e1ce2f0
import torch from torch import Tensor import torch.nn.functional as F from typing import Optional from torch import nn def _make_divisible(v: 'float', divisor: 'int', min_value: 'Optional[int]'=None ) ->int: """ This function is taken from the original tf repo. It ensures that all layers have a channe...
LayerScale
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class LayerScale(nn.Module): """Layer scale from [Touvron et al 2021] (https://arxiv.org/pdf/2103.17239.pdf). This rescales diagonaly residual outputs close to 0 initially, then learnt. """ def __init__(self, channels: 'int', init: 'float'=0): super().__init_...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
xvdp/demucs
LayerScale
false
11,084
[ "MIT" ]
0
0a5e3b72c6388801cf0086c2b84d09f6d73c389c
https://github.com/xvdp/demucs/tree/0a5e3b72c6388801cf0086c2b84d09f6d73c389c
import torch from torch import nn class Model(nn.Module): """Layer scale from [Touvron et al 2021] (https://arxiv.org/pdf/2103.17239.pdf). This rescales diagonaly residual outputs close to 0 initially, then learnt. """ def __init__(self, channels: 'int', init: 'float'=0): super().__init__() ...
Value
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import functional as F class Value(nn.Module): def __init__(self, state_size, fcs1_units=400, fc2_units=300): super(Value, self).__init__() self.conv1 = nn.Conv2d(1, 20, 5, 1) self.conv2 = nn.Conv2d(20, 50, 5, 1) self.fc1 = nn.Linear...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
zwc662/disentangling-vae
Value
false
11,085
[ "MIT" ]
0
7eeace2a30f8034e222be6a906f53748b3b2bb6e
https://github.com/zwc662/disentangling-vae/tree/7eeace2a30f8034e222be6a906f53748b3b2bb6e
import torch from torch import nn from torch.nn import functional as F class Model(nn.Module): def __init__(self, state_size, fcs1_units=400, fc2_units=300): super().__init__() self.conv1 = nn.Conv2d(1, 20, 5, 1) self.conv2 = nn.Conv2d(20, 50, 5, 1) self.fc1 = nn.Linear(5 * 5 * 50...
Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import functional as F class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(1, 20, 5, 1) self.conv2 = nn.Conv2d(20, 50, 5, 1) self.fc1 = nn.Linear(5 * 5 * 50, 500) self.fc2 = nn.Linear(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
zwc662/disentangling-vae
Net
false
11,086
[ "MIT" ]
0
7eeace2a30f8034e222be6a906f53748b3b2bb6e
https://github.com/zwc662/disentangling-vae/tree/7eeace2a30f8034e222be6a906f53748b3b2bb6e
import torch from torch import nn from torch.nn import functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 20, 5, 1) self.conv2 = nn.Conv2d(20, 50, 5, 1) self.fc1 = nn.Linear(5 * 5 * 50, 500) self.fc2 = nn.Linear(500, 10...
Auto_Encoder_Model
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Auto_Encoder_Model(nn.Module): def __init__(self): super(Auto_Encoder_Model, self).__init__() self.conv1 = nn.Conv2d(1, 64, padding=1, kernel_size=3) self.max_pool1 = nn.MaxPool2d(2) self.conv2 = nn.Conv2d(64...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
yutian-zhao/MICCAI19-MedVQA
Auto_Encoder_Model
false
11,087
[ "MIT" ]
0
7df92c529ed87d67281efb2f568fc6c57cebfef1
https://github.com/yutian-zhao/MICCAI19-MedVQA/tree/7df92c529ed87d67281efb2f568fc6c57cebfef1
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 64, padding=1, kernel_size=3) self.max_pool1 = nn.MaxPool2d(2) self.conv2 = nn.Conv2d(64, 32, padding=1, kernel_size=3) ...
Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self, c1=32, c2=64, c3=128, c4=256, l1=512, d1=0.0): super().__init__() self.conv1 = nn.Conv2d(9, c1, (5, 5)) self.conv2 = nn.Conv2d(c1, c2, (5, 5)) self.conv3 = nn.Conv2d(c2, c3,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
vtomi97/LHYP
Net
false
11,088
[ "MIT" ]
0
3db91f889c0f6b866b9537975f664f072e021ea9
https://github.com/vtomi97/LHYP/tree/3db91f889c0f6b866b9537975f664f072e021ea9
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, c1=32, c2=64, c3=128, c4=256, l1=512, d1=0.0): super().__init__() self.conv1 = nn.Conv2d(9, c1, (5, 5)) self.conv2 = nn.Conv2d(c1, c2, (5, 5)) self.conv3 = nn.Conv2d(c2, c...
LocalState
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch from torch import nn class LocalState(nn.Module): """Local state allows to have attention based only on data (no positional embedding), but while setting a constraint on the time window (e.g. decaying penalty term). Also a failed experiments with trying to provide some frequency ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
xvdp/demucs
LocalState
false
11,089
[ "MIT" ]
0
0a5e3b72c6388801cf0086c2b84d09f6d73c389c
https://github.com/xvdp/demucs/tree/0a5e3b72c6388801cf0086c2b84d09f6d73c389c
import math import torch from torch import nn class Model(nn.Module): """Local state allows to have attention based only on data (no positional embedding), but while setting a constraint on the time window (e.g. decaying penalty term). Also a failed experiments with trying to provide some frequency based...
Fcn8s
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn def _upsampling_weights(in_channels, out_channels, kernel_size): factor = (kernel_size + 1) // 2 if kernel_size % 2 == 1: center = factor - 1 else: center = factor - 0.5 og = np.ogrid[:kernel_size, :kernel_size] filt = (1 - abs(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np import tor...
lxxue/cil-road-segmentation-2019
Fcn8s
false
11,090
[ "MIT" ]
0
c6477556dc3d6d9c8ed2f2a3f185b4d986a03bb4
https://github.com/lxxue/cil-road-segmentation-2019/tree/c6477556dc3d6d9c8ed2f2a3f185b4d986a03bb4
import torch import numpy as np import torch.nn as nn def _upsampling_weights(in_channels, out_channels, kernel_size): factor = (kernel_size + 1) // 2 if kernel_size % 2 == 1: center = factor - 1 else: center = factor - 0.5 og = np.ogrid[:kernel_size, :kernel_size] filt = (1 - abs(...
Rescale
# 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 Rescale(nn.Module): def __init__(self, sign): super(Rescale, self).__init__() rgb_mean = 0.4488, 0.4371, 0.404 bias = sign * torch.Tensor(rgb_mean).reshape(1, 3, 1, 1) self.bias = nn.Parameter(bias, requires_grad=False) def forward(sel...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
zeta1999/torchSR
Rescale
false
11,091
[ "MIT" ]
0
8f8154486f6c0f09942ccf86cdcbf496e2309d4e
https://github.com/zeta1999/torchSR/tree/8f8154486f6c0f09942ccf86cdcbf496e2309d4e
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, sign): super().__init__() rgb_mean = 0.4488, 0.4371, 0.404 bias = sign * torch.Tensor(rgb_mean).reshape(1, 3, 1, 1) self.bias = nn.Parameter(bias, requires_grad=False) def forward(self, x): ...
TransformerEncoderLayer_MLP
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Linear from torch.nn import Dropout from torch.nn import LayerNorm from torch.nn import Identity def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) pe...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch.nn impor...
yifanc96/yifanc-DL
TransformerEncoderLayer_MLP
false
11,092
[ "MIT" ]
0
25d56cec776fb151c8f6bcbd997bca94f07f3597
https://github.com/yifanc96/yifanc-DL/tree/25d56cec776fb151c8f6bcbd997bca94f07f3597
from torch.nn import Module import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Linear from torch.nn import Dropout from torch.nn import LayerNorm from torch.nn import Identity def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) pe...
OneDilate
# 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 OneDilate(nn.Module): def __init__(self, kernel_size=10, channels=3, gpu=True): super(OneDilate, self).__init__() self.kernel_size = kernel_size self.channels = channels gaussian_kernel = torch.ones(1, 1, 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...
williamyang1991/DeepPS
OneDilate
false
11,093
[ "MIT" ]
0
f3eb6ba4b0f2ef068361a4bbbd3d6c2c2f6726b4
https://github.com/williamyang1991/DeepPS/tree/f3eb6ba4b0f2ef068361a4bbbd3d6c2c2f6726b4
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, kernel_size=10, channels=3, gpu=True): super().__init__() self.kernel_size = kernel_size self.channels = channels gaussian_kernel = torch.ones(1, 1, self.kernel_size, self...
BasicDeconv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 BasicDeconv(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, use_bn=False): super(BasicDeconv, self).__init__() self.use_bn = use_bn self.tconv = nn.ConvTranspose2d(in_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 from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
vghost2008/C-3-Framework
BasicDeconv
false
11,094
[ "MIT" ]
0
dc6f1f67e403aff4dbb60f8ed06461c843407501
https://github.com/vghost2008/C-3-Framework/tree/dc6f1f67e403aff4dbb60f8ed06461c843407501
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, use_bn=False): super().__init__() self.use_bn = use_bn self.tconv = nn.ConvTranspose2d(in_channels, out_channels, ...
Block_MLP
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). This is the same as the DropConnect impl I created for EfficientNet, etc networks, however, the original name is...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
yifanc96/yifanc-DL
Block_MLP
false
11,095
[ "MIT" ]
0
25d56cec776fb151c8f6bcbd997bca94f07f3597
https://github.com/yifanc96/yifanc-DL/tree/25d56cec776fb151c8f6bcbd997bca94f07f3597
import torch import torch.nn as nn def drop_path(x, drop_prob: 'float'=0.0, training: 'bool'=False): """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). This is the same as the DropConnect impl I created for EfficientNet, etc networks, however, the original name is...
ParityPonderGRU
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch import nn from typing import Tuple import torch.utils.data import torch.nn.functional import torch.autograd class ParityPonderGRU(Module): """ ## PonderNet with GRU for Parity Task This is a simple model that uses a [GRU Cell](https://pytorch.org/docs/s...
import torch from torch import device from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module from torch import nn import...
ppvalluri09/annotated_deep_learning_paper_implementations
ParityPonderGRU
false
11,096
[ "MIT" ]
0
387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
https://github.com/ppvalluri09/annotated_deep_learning_paper_implementations/tree/387b6dfd1ef1f6d295e9394c24b5798071d9a3e4
from torch.nn import Module import torch from torch import nn from typing import Tuple import torch.utils.data import torch.nn.functional import torch.autograd class Model(Module): """ ## PonderNet with GRU for Parity Task This is a simple model that uses a [GRU Cell](https://pytorch.org/docs/stable/gene...
GaussianFilter
# 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 from torch import nn class GaussianFilter(nn.Module): def __init__(self, kernel_size=13, stride=1, padding=6): super(GaussianFilter, self).__init__() mean = (kernel_size - 1) / 2.0 variance = ((kernel_size - 1) / 6.0) ** 2.0 x_coor...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 from torch import nn assert_size_stride = t...
zsameem/real-world-sr
GaussianFilter
false
11,097
[ "MIT" ]
0
ed108f3fd2fe4090c18c871c143f30f480de8fb6
https://github.com/zsameem/real-world-sr/tree/ed108f3fd2fe4090c18c871c143f30f480de8fb6
import torch import torch.utils.data import torch from torch import nn class Model(nn.Module): def __init__(self, kernel_size=13, stride=1, padding=6): super().__init__() mean = (kernel_size - 1) / 2.0 variance = ((kernel_size - 1) / 6.0) ** 2.0 x_coord = torch.arange(kernel_size)...
AdaptiveInstanceNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 AdaptiveInstanceNorm(nn.Module): def __init__(self, style_dim, in_channel): super(AdaptiveInstanceNorm, self).__init__() self.norm = nn.InstanceNorm2d(in_channel) self.style = nn.Linear(style_dim, in_channel * 2) self.style.bias.data[:in_ch...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
williamyang1991/DeepPS
AdaptiveInstanceNorm
false
11,098
[ "MIT" ]
0
f3eb6ba4b0f2ef068361a4bbbd3d6c2c2f6726b4
https://github.com/williamyang1991/DeepPS/tree/f3eb6ba4b0f2ef068361a4bbbd3d6c2c2f6726b4
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, style_dim, in_channel): super().__init__() self.norm = nn.InstanceNorm2d(in_channel) self.style = nn.Linear(style_dim, in_channel * 2) self.style.bias.data[:in_channel] = 1 self.style.bias.data[i...
ResidualBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 from torch import nn class ResidualBlock(nn.Module): def __init__(self, channels): super(ResidualBlock, self).__init__() self.conv1 = nn.Conv2d(channels, channels, kernel_size=3, padding=1) self.prelu = nn.PReLU() self.conv2 = 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 import torch.utils.data import torch from torch import nn assert_size_stride = t...
zsameem/real-world-sr
ResidualBlock
false
11,099
[ "MIT" ]
0
ed108f3fd2fe4090c18c871c143f30f480de8fb6
https://github.com/zsameem/real-world-sr/tree/ed108f3fd2fe4090c18c871c143f30f480de8fb6
import torch import torch.utils.data import torch from torch import nn class Model(nn.Module): def __init__(self, channels): super().__init__() self.conv1 = nn.Conv2d(channels, channels, kernel_size=3, padding=1) self.prelu = nn.PReLU() self.conv2 = nn.Conv2d(channels, channels, k...
SAModule_Head
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 BasicConv(nn.Module): def __init__(self, in_channels, out_channels, use_bn=False, **kwargs): super(BasicConv, self).__init__() self.use_bn = use_bn self.conv = nn.Conv2d(in_channels, out_channels, bias=not 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....
vghost2008/C-3-Framework
SAModule_Head
false
11,100
[ "MIT" ]
0
dc6f1f67e403aff4dbb60f8ed06461c843407501
https://github.com/vghost2008/C-3-Framework/tree/dc6f1f67e403aff4dbb60f8ed06461c843407501
import torch import torch.nn as nn import torch.nn.functional as F class BasicConv(nn.Module): def __init__(self, in_channels, out_channels, use_bn=False, **kwargs): super().__init__() self.use_bn = use_bn self.conv = nn.Conv2d(in_channels, out_channels, bias=not self. use_bn,...