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
ContrastiveDistanceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from torch.nn.modules.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class ContrastiveDistanceLoss(nn.Module): """ Contrastive distance loss """ def __init__(self, margin=1.0, re...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn from torch.nn.modules.loss import * from torch.nn.modules import * ...
asmekal/catalyst
ContrastiveDistanceLoss
false
12,117
[ "MIT" ]
0
e11365c0a9812649ceaef14e53061cd5117d8684
https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684
import torch import torch.nn as nn from torch.nn.modules.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class Model(nn.Module): """ Contrastive distance loss """ def __init__(self, margin=1.0, reduction='mean'): ...
ContrastivePairwiseEmbeddingLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class ContrastivePairwiseEmbeddingLoss(nn.Module): """ ContrastivePairwiseEmbeddingLos...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
asmekal/catalyst
ContrastivePairwiseEmbeddingLoss
false
12,118
[ "MIT" ]
0
e11365c0a9812649ceaef14e53061cd5117d8684
https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class Model(nn.Module): """ ContrastivePairwiseEmbeddingLoss – proof of concept criter...
BasicBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.utils.weight_norm as weightNorm def conv3x3(in_planes, out_planes, stride=1): return weightNorm(nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True)) class TReLU(nn.Module): def __init...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
archiroid003/ICCV2019-LearningToPaint
BasicBlock
false
12,119
[ "MIT" ]
0
4b5fc263e4843c159a61e5956956b3f7812693f8
https://github.com/archiroid003/ICCV2019-LearningToPaint/tree/4b5fc263e4843c159a61e5956956b3f7812693f8
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.utils.weight_norm as weightNorm def conv3x3(in_planes, out_planes, stride=1): return weightNorm(nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True)) class TReLU(nn.Module): def __init...
DecoderBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class ConvRelu(nn.Module): """3x3 convolution followed by ReLU activation building block. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
asmekal/catalyst
DecoderBlock
false
12,120
[ "MIT" ]
0
e11365c0a9812649ceaef14e53061cd5117d8684
https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class ConvRelu(nn.Module): """3x3 convolution followed by ReLU activation building block. ...
Actor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Actor(nn.Module): def __init__(self, state_size, action_size, seed, fc1_units=512, fc2_units=...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
asiliskender/deep-reinforcement-learning
Actor
false
12,121
[ "MIT" ]
0
dbf96d67477aa9242128b78b081474193e1e4538
https://github.com/asiliskender/deep-reinforcement-learning/tree/dbf96d67477aa9242128b78b081474193e1e4538
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Model(nn.Module): def __init__(self, state_size, action_size, seed, fc1_units=512, fc2_units=...
ConvRelu
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class ConvRelu(nn.Module): """3x3 convolution followed by ReLU activation building block. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn from to...
asmekal/catalyst
ConvRelu
false
12,122
[ "MIT" ]
0
e11365c0a9812649ceaef14e53061cd5117d8684
https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class Model(nn.Module): """3x3 convolution followed by ReLU activation building block. ...
ContrastiveEmbeddingLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from torch.nn.modules.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class ContrastiveEmbeddingLoss(nn.Module): """ Contrastive embedding loss paper: http://yann.lecun.com/exdb/publi...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn from t...
asmekal/catalyst
ContrastiveEmbeddingLoss
false
12,123
[ "MIT" ]
0
e11365c0a9812649ceaef14e53061cd5117d8684
https://github.com/asmekal/catalyst/tree/e11365c0a9812649ceaef14e53061cd5117d8684
import torch import torch.nn as nn from torch.nn.modules.loss import * from torch.nn.modules import * from torch.optim import * from torch.optim.lr_scheduler import * import torch.distributed class Model(nn.Module): """ Contrastive embedding loss paper: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopr...
SingleHiddenLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SingleHiddenLayer(torch.nn.Module): def __init__(self, input_channels, hidden_channels): super(SingleHiddenLayer, self).__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.linear1 = torch.nn.Linear(hidden_channels, 128) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
athon-millane/NeuralCDE
SingleHiddenLayer
false
12,124
[ "Apache-2.0" ]
0
4196890fe5bf7a69925a12ff35e86f212963be71
https://github.com/athon-millane/NeuralCDE/tree/4196890fe5bf7a69925a12ff35e86f212963be71
import torch class Model(torch.nn.Module): def __init__(self, input_channels, hidden_channels): super().__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.linear1 = torch.nn.Linear(hidden_channels, 128) self.linear2 = torch.nn.Linea...
FinalTanh
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 FinalTanh(torch.nn.Module): def __init__(self, input_channels, hidden_channels, hidden_hidden_channels, num_hidden_layers): super(FinalTanh, self).__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.hidden_hidden_c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
athon-millane/NeuralCDE
FinalTanh
false
12,125
[ "Apache-2.0" ]
0
4196890fe5bf7a69925a12ff35e86f212963be71
https://github.com/athon-millane/NeuralCDE/tree/4196890fe5bf7a69925a12ff35e86f212963be71
import torch class Model(torch.nn.Module): def __init__(self, input_channels, hidden_channels, hidden_hidden_channels, num_hidden_layers): super().__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.hidden_hidden_channels = hidden_hi...
_GRU_ODE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 _GRU_ODE(torch.nn.Module): def __init__(self, input_channels, hidden_channels): super(_GRU_ODE, self).__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.W_r = torch.nn.Linear(input_channels, hidden_channels, bias=False) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride ...
athon-millane/NeuralCDE
_GRU_ODE
false
12,126
[ "Apache-2.0" ]
0
4196890fe5bf7a69925a12ff35e86f212963be71
https://github.com/athon-millane/NeuralCDE/tree/4196890fe5bf7a69925a12ff35e86f212963be71
import torch class Model(torch.nn.Module): def __init__(self, input_channels, hidden_channels): super().__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.W_r = torch.nn.Linear(input_channels, hidden_channels, bias=False) self.W_z =...
CDEFunc
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 CDEFunc(torch.nn.Module): def __init__(self, input_channels, hidden_channels): super(CDEFunc, self).__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.linear1 = torch.nn.Linear(hidden_channels, 128) self.linear2 =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
athon-millane/NeuralCDE
CDEFunc
false
12,127
[ "Apache-2.0" ]
0
4196890fe5bf7a69925a12ff35e86f212963be71
https://github.com/athon-millane/NeuralCDE/tree/4196890fe5bf7a69925a12ff35e86f212963be71
import torch class Model(torch.nn.Module): def __init__(self, input_channels, hidden_channels): super().__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.linear1 = torch.nn.Linear(hidden_channels, 128) self.linear2 = torch.nn.Linea...
Critic
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Critic(nn.Module): """Critic (Value) Model.""" def __init__(self, state_size, action_size, seed, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import numpy as np import torch.nn.functional as F import torch.nn as nn assert_...
arpradha/deep-reinforcement-learning
Critic
false
12,128
[ "MIT" ]
0
01cfc7ab19453285886900d9c6332c8cb435df51
https://github.com/arpradha/deep-reinforcement-learning/tree/01cfc7ab19453285886900d9c6332c8cb435df51
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Model(nn.Module): """Critic (Value) Model.""" def __init__(self, state_size, action_size, seed, f...
SilogLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class SilogLoss(nn.Module): def __init__(self, ratio=10, ratio2=0.85): super().__init__() self.ratio = ratio self.ratio2 = ratio2 def forward(self, pred, gt): log_diff = torch.log(pred * self.ratio) - torch.log(gt * self.ratio) silog...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
aycatakmaz/packnet-sfm
SilogLoss
false
12,130
[ "MIT" ]
0
d89cae81290133f136f6a1d1e288affc67eed1f7
https://github.com/aycatakmaz/packnet-sfm/tree/d89cae81290133f136f6a1d1e288affc67eed1f7
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, ratio=10, ratio2=0.85): super().__init__() self.ratio = ratio self.ratio2 = ratio2 def forward(self, pred, gt): log_diff = torch.log(pred * self.ratio) - torch.log(gt * self.ratio) silog1 = ...
MatrixTree
# 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.cuda import torch.distributed class MatrixTree(nn.Module): """Implementation of the matrix-tree theorem for computing marginals of non-projective dependency parsing. This attention layer is used in the paper "Learning Structured Text Representations" :ci...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn import torch.cuda import torch.distributed assert_s...
Zer0-dev115/OpenNMT-py
MatrixTree
false
12,131
[ "MIT" ]
0
028c76b34779223ee6b3eb224b99617552987100
https://github.com/Zer0-dev115/OpenNMT-py/tree/028c76b34779223ee6b3eb224b99617552987100
import torch import torch.nn as nn import torch.cuda import torch.distributed class Model(nn.Module): """Implementation of the matrix-tree theorem for computing marginals of non-projective dependency parsing. This attention layer is used in the paper "Learning Structured Text Representations" :cite:`D...
Critic
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Critic(nn.Module): def __init__(self, state_size, action_size, seed, fcs1_units=512, fc2_unit...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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...
asiliskender/deep-reinforcement-learning
Critic
false
12,132
[ "MIT" ]
0
dbf96d67477aa9242128b78b081474193e1e4538
https://github.com/asiliskender/deep-reinforcement-learning/tree/dbf96d67477aa9242128b78b081474193e1e4538
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Model(nn.Module): def __init__(self, state_size, action_size, seed, fcs1_units=512, fc2_units...
CNNCifar
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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.nn.functional as F class CNNCifar(nn.Module): def __init__(self, args): super(CNNCifar, self).__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ataML/Federated-Learning-PyTorch
CNNCifar
false
12,133
[ "MIT" ]
0
1c28f3e4a2ce2fd4e56d249e358a69408f76e34b
https://github.com/ataML/Federated-Learning-PyTorch/tree/1c28f3e4a2ce2fd4e56d249e358a69408f76e34b
from _paritybench_helpers import _mock_config import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, args): super().__init__() self.conv1 = nn.Conv2d(3, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) ...
Discriminator
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.utils.weight_norm as weightNorm class TReLU(nn.Module): def __init__(self): super(TReLU, self).__init__() self.alpha = nn.Parameter(torch.FloatTensor(1), requires_grad=True) self.alpha.data.fill_(0) de...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
archiroid003/ICCV2019-LearningToPaint
Discriminator
false
12,134
[ "MIT" ]
0
4b5fc263e4843c159a61e5956956b3f7812693f8
https://github.com/archiroid003/ICCV2019-LearningToPaint/tree/4b5fc263e4843c159a61e5956956b3f7812693f8
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.utils.weight_norm as weightNorm class TReLU(nn.Module): def __init__(self): super().__init__() self.alpha = nn.Parameter(torch.FloatTensor(1), requires_grad=True) self.alpha.data.fill_(0) def forward(s...
LayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import Parameter class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_features = num_features self.affine = affine self.eps = eps if self.affine: ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn from torch.nn import Parameter assert_size_stride = torch...
autocomic/deepfillv2
LayerNorm
false
12,135
[ "MIT" ]
0
4b0f565accbf20ee90093a4504b1cff0099d9cb9
https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9
import torch import torch.nn as nn from torch.nn import Parameter class Model(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_features self.affine = affine self.eps = eps if self.affine: self.gamm...
GatedConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_features = num_features 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, math as tl_math im...
autocomic/deepfillv2
GatedConv2d
false
12,136
[ "MIT" ]
0
4b0f565accbf20ee90093a4504b1cff0099d9cb9
https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9
import torch import torch.nn as nn from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_features self.affine = affine...
Conv2dLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_features = num_features self....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
autocomic/deepfillv2
Conv2dLayer
false
12,137
[ "MIT" ]
0
4b0f565accbf20ee90093a4504b1cff0099d9cb9
https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9
import torch import torch.nn as nn from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_features self.affine = affine...
InvDepth
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class InvDepth(nn.Module): """Inverse depth layer""" def __init__(self, in_channels, out_channels=1, min_depth=0.5): """ Initializes an InvDepth object. Parameters ---------- in_channels : int Number of input channels ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
aycatakmaz/packnet-sfm
InvDepth
false
12,138
[ "MIT" ]
0
d89cae81290133f136f6a1d1e288affc67eed1f7
https://github.com/aycatakmaz/packnet-sfm/tree/d89cae81290133f136f6a1d1e288affc67eed1f7
import torch import torch.nn as nn class Model(nn.Module): """Inverse depth layer""" def __init__(self, in_channels, out_channels=1, min_depth=0.5): """ Initializes an InvDepth object. Parameters ---------- in_channels : int Number of input channels ...
BBoxTransform
# 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 BBoxTransform(nn.Module): def forward(self, anchors, regression): """ decode_box_outputs adapted from https://github.com/google/automl/blob/master/efficientdet/anchors.py Args: anchors: [batchsize, boxes, (y1, x1, y2, x2)] r...
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_...
awesome-amy/efficientmask
BBoxTransform
false
12,139
[ "MIT" ]
0
2456d52af92f765de771fbb6bd27fe2b9f19533b
https://github.com/awesome-amy/efficientmask/tree/2456d52af92f765de771fbb6bd27fe2b9f19533b
import torch from torch import nn class Model(nn.Module): def forward(self, anchors, regression): """ decode_box_outputs adapted from https://github.com/google/automl/blob/master/efficientdet/anchors.py Args: anchors: [batchsize, boxes, (y1, x1, y2, x2)] regressio...
TransposeConv2dLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import functional as F from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.nn import Parameter assert_size_stride = torch....
autocomic/deepfillv2
TransposeConv2dLayer
false
12,140
[ "MIT" ]
0
4b0f565accbf20ee90093a4504b1cff0099d9cb9
https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9
import torch import torch.nn as nn from torch.nn import functional as F from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_...
AverageRC
# 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 AverageRC(nn.Module): def __init__(self): super(AverageRC, self).__init__() def forward(self, input): input = input[:int(input.shape[0] / 2)] / 2 + input[int(input.shape [0] / 2):] / 2 return input def get_inputs(): return [t...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
banwang27/models
AverageRC
false
12,141
[ "MIT" ]
0
59db29e46f76b630b78c864fb607388dd927b93c
https://github.com/banwang27/models/tree/59db29e46f76b630b78c864fb607388dd927b93c
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, input): input = input[:int(input.shape[0] / 2)] / 2 + input[int(input.shape [0] / 2):] / 2 return input def get_inputs(): return [torch.rand([4, 4, 4,...
OscBase
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 init(module, weight_init, bias_init, gain=1): weight_init(module.weight.data, gain=gain) bias_init(module.bias.data) return module class NNBase(nn.Module): def __init__(self, recurrent, recurrent_input_size, hidden_size): super(NNBas...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
aupilot/a2c
OscBase
false
12,142
[ "MIT" ]
0
cd7e8892f91ce0c8b4c221eb6be31ebbee81d663
https://github.com/aupilot/a2c/tree/cd7e8892f91ce0c8b4c221eb6be31ebbee81d663
import torch import numpy as np import torch.nn as nn def init(module, weight_init, bias_init, gain=1): weight_init(module.weight.data, gain=gain) bias_init(module.bias.data) return module class NNBase(nn.Module): def __init__(self, recurrent, recurrent_input_size, hidden_size): super().__i...
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(torch.nn.Module): """Basic CNN architecture.""" def __init__(self, in_channels=1): super(CNN, self).__init__() self.conv1 = nn.Conv2d(in_channels, 64, 8, 1) self.conv2 = nn.Conv2d(64, 128, 6, 2) self.c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
austereantelope/cleverhans
CNN
false
12,143
[ "MIT" ]
0
5d68d538c89257693f9a7491994bb5586d3ec310
https://github.com/austereantelope/cleverhans/tree/5d68d538c89257693f9a7491994bb5586d3ec310
import torch from torch import nn import torch.nn.functional as F class Model(torch.nn.Module): """Basic CNN architecture.""" def __init__(self, in_channels=1): super().__init__() self.conv1 = nn.Conv2d(in_channels, 64, 8, 1) self.conv2 = nn.Conv2d(64, 128, 6, 2) self.conv3 = ...
UnpackLayerConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn class Conv2D(nn.Module): """ 2D convolution with GroupNorm and ELU Parameters ---------- in_channels : int Number of input channels out_channels : int Number of output channels kernel_size : int Kernel size stride : int ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
aycatakmaz/packnet-sfm
UnpackLayerConv2d
false
12,144
[ "MIT" ]
0
d89cae81290133f136f6a1d1e288affc67eed1f7
https://github.com/aycatakmaz/packnet-sfm/tree/d89cae81290133f136f6a1d1e288affc67eed1f7
import torch import torch.nn as nn class Conv2D(nn.Module): """ 2D convolution with GroupNorm and ELU Parameters ---------- in_channels : int Number of input channels out_channels : int Number of output channels kernel_size : int Kernel size stride : int ...
ReCodeAlphabet
# 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 ReCodeAlphabet(nn.Module): def __init__(self): super(ReCodeAlphabet, self).__init__() def forward(self, input): input_reordered = [input[:, i, ...] for i in [0, 2, 1, 3]] input = torch.stack(input_reordered, dim=1) return input def g...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
banwang27/models
ReCodeAlphabet
false
12,145
[ "MIT" ]
0
59db29e46f76b630b78c864fb607388dd927b93c
https://github.com/banwang27/models/tree/59db29e46f76b630b78c864fb607388dd927b93c
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, input): input_reordered = [input[:, i, ...] for i in [0, 2, 1, 3]] input = torch.stack(input_reordered, dim=1) return input def get_inputs(): return [torc...
SuperSimpleSemSegNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SuperSimpleSemSegNet(nn.Module): def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, out_channel, kernel_size=3, padding=1, stride=1) self.ReLU = torch.nn.ReLU() self.softmax ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
benkoger/kasanka
SuperSimpleSemSegNet
false
12,146
[ "Apache-2.0" ]
0
d5b1d32b7abf54845af0832da577137397089001
https://github.com/benkoger/kasanka/tree/d5b1d32b7abf54845af0832da577137397089001
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, out_channel, kernel_size=3, padding=1, stride=1) self.ReLU = torch.nn.ReLU() self.softmax = torch.nn.LogS...
TransposeGatedConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn import functional as F from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super(LayerNorm, self).__init__() self.num_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
autocomic/deepfillv2
TransposeGatedConv2d
false
12,147
[ "MIT" ]
0
4b0f565accbf20ee90093a4504b1cff0099d9cb9
https://github.com/autocomic/deepfillv2/tree/4b0f565accbf20ee90093a4504b1cff0099d9cb9
import torch import torch.nn as nn from torch.nn import functional as F from torch.nn import Parameter def l2normalize(v, eps=1e-12): return v / (v.norm() + eps) class LayerNorm(nn.Module): def __init__(self, num_features, eps=1e-08, affine=True): super().__init__() self.num_features = num_...
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 math import torch from torch.nn import functional as F import torch.nn as nn class Attention(nn.Module): def __init__(self, hidden_size): super(Attention, self).__init__() self.hidden_size = hidden_size self.attn = nn.Linear(self.hidden_size * 2, hidden_size) self.v = nn.Pa...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
baduncan/Pytorch-seq2seq-Beam-Search
Attention
false
12,148
[ "MIT" ]
0
82e2f12563d4db520a9a9089e7205f398ca53699
https://github.com/baduncan/Pytorch-seq2seq-Beam-Search/tree/82e2f12563d4db520a9a9089e7205f398ca53699
import math import torch from torch.nn import functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, hidden_size): super().__init__() self.hidden_size = hidden_size self.attn = nn.Linear(self.hidden_size * 2, hidden_size) self.v = nn.Parameter(torch.rand(...
L1Norm
# 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 L1Norm(nn.Module): def __init__(self): super(L1Norm, self).__init__() self.eps = 1e-10 def forward(self, x): norm = torch.sum(torch.abs(x), dim=1) + self.eps x = x / norm.expand_as(x) return x def get_inputs(): return [to...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
bankbiz/Key.Net
L1Norm
false
12,149
[ "BSD-3-Clause-Clear" ]
0
5ba46614821e94be1b36d97721bd6c2e5fff9e20
https://github.com/bankbiz/Key.Net/tree/5ba46614821e94be1b36d97721bd6c2e5fff9e20
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.eps = 1e-10 def forward(self, x): norm = torch.sum(torch.abs(x), dim=1) + self.eps x = x / norm.expand_as(x) return x def get_inputs(): return [torch.rand([4, ...
L2Norm
# 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 L2Norm(nn.Module): def __init__(self): super(L2Norm, self).__init__() self.eps = 1e-10 def forward(self, x): norm = torch.sqrt(torch.sum(x * x, dim=1) + self.eps) x = x / norm.unsqueeze(-1).expand_as(x) return x 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.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
bankbiz/Key.Net
L2Norm
false
12,150
[ "BSD-3-Clause-Clear" ]
0
5ba46614821e94be1b36d97721bd6c2e5fff9e20
https://github.com/bankbiz/Key.Net/tree/5ba46614821e94be1b36d97721bd6c2e5fff9e20
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.eps = 1e-10 def forward(self, x): norm = torch.sqrt(torch.sum(x * x, dim=1) + self.eps) x = x / norm.unsqueeze(-1).expand_as(x) return x def get_inputs(): retu...
Swish
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch.functional import F class Swish(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): return F.sigmoid(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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
bglick13/multi-agent-emergence-environments
Swish
false
12,151
[ "MIT" ]
0
e02d66f0734d95470d15a4508ff369a75fa093a4
https://github.com/bglick13/multi-agent-emergence-environments/tree/e02d66f0734d95470d15a4508ff369a75fa093a4
import torch from torch.functional import F class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): return F.sigmoid(x) * x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
LinearLR
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint class LinearLR(nn.Module): """[u * v + res] version of torch.nn.Linear""" def __init__(self, in_features, out_features, rank_ratio=0.25, bias= True, device=None, dtype=None): super().__init__() sliced_rank = int(min(in_f...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.checkpoint assert_size_stride = torch._...
bahducoup/factorized_training
LinearLR
false
12,152
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint class Model(nn.Module): """[u * v + res] version of torch.nn.Linear""" def __init__(self, in_features, out_features, rank_ratio=0.25, bias= True, device=None, dtype=None): super().__init__() sliced_rank = int(min(in_feat...
LowRankResidualPositionwiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class LowRankResidualPositionwiseFeedForward(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
bahducoup/factorized_training
LowRankResidualPositionwiseFeedForward
false
12,153
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class Model(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1_u = nn.Linear(int(d_in...
PyramidModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 torchvision.transforms import * class ConvBlock(nn.Module): def __init__(self, input_size, output_size, kernel_size=3, stride=1, padding=1, bias=True, activation='prelu', norm=None): super(ConvBlock, self).__init__() self.conv = nn.Conv2d(input_size...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torchvision.transforms import * assert_size_stride = ...
arnon-weinberg/Upscale-interpolate-STARnet
PyramidModule
false
12,154
[ "MIT" ]
0
d898d38364a36f4633cfba8f914db20d9b900217
https://github.com/arnon-weinberg/Upscale-interpolate-STARnet/tree/d898d38364a36f4633cfba8f914db20d9b900217
import torch import torch.nn as nn from torchvision.transforms import * class ConvBlock(nn.Module): def __init__(self, input_size, output_size, kernel_size=3, stride=1, padding=1, bias=True, activation='prelu', norm=None): super().__init__() self.conv = nn.Conv2d(input_size, output_size, ...
LowRankPositionwiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class LowRankPositionwiseFeedForward(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
LowRankPositionwiseFeedForward
false
12,155
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class Model(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1_u = nn.Linear(d_in, in...
PositionwiseFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class PositionwiseFeedForward(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1 = nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
bahducoup/factorized_training
PositionwiseFeedForward
false
12,156
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class Model(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.w_1 = nn.Linear(d_in, d_hi...
MultiHeadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
MultiHeadAttention
false
12,157
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
ThreeLayerSemSegNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 ThreeLayerSemSegNet(nn.Module): def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, 8, kernel_size=3, padding= 1, stride=1) self.conv2d1 = torch.nn.Conv2d(8, 4, kernel_size=3, padding...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
benkoger/kasanka
ThreeLayerSemSegNet
false
12,158
[ "Apache-2.0" ]
0
d5b1d32b7abf54845af0832da577137397089001
https://github.com/benkoger/kasanka/tree/d5b1d32b7abf54845af0832da577137397089001
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, 8, kernel_size=3, padding= 1, stride=1) self.conv2d1 = torch.nn.Conv2d(8, 4, kernel_size=3, padding=2, ...
ThreeLayerSemSegNetWideViewHighDim
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 ThreeLayerSemSegNetWideViewHighDim(nn.Module): """Each layer has more channels than the standard model""" def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, 12, kernel_size=3, padding =1...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
benkoger/kasanka
ThreeLayerSemSegNetWideViewHighDim
false
12,159
[ "Apache-2.0" ]
0
d5b1d32b7abf54845af0832da577137397089001
https://github.com/benkoger/kasanka/tree/d5b1d32b7abf54845af0832da577137397089001
import torch import torch.nn as nn class Model(nn.Module): """Each layer has more channels than the standard model""" def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, 12, kernel_size=3, padding =1, stride=1) self.conv...
LowRankMultiHeadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
LowRankMultiHeadAttention
false
12,160
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
ThreeLayerSemSegNetWideView
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 ThreeLayerSemSegNetWideView(nn.Module): def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, 6, kernel_size=3, padding= 1, stride=1) self.conv1d100 = torch.nn.Conv2d(in_channel, 2, 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 from torch._inductor.runtime....
benkoger/kasanka
ThreeLayerSemSegNetWideView
false
12,161
[ "Apache-2.0" ]
0
d5b1d32b7abf54845af0832da577137397089001
https://github.com/benkoger/kasanka/tree/d5b1d32b7abf54845af0832da577137397089001
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, 6, kernel_size=3, padding= 1, stride=1) self.conv1d100 = torch.nn.Conv2d(in_channel, 2, kernel_size=3, ...
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 class Block(torch.nn.Module): def __init__(self, in_channels, mid_channel, out_channels, batch_norm=False ): super().__init__() self.conv1 = torch.nn.Conv2d(in_channels=in_channels, out_channels= mid_channel, kernel_size=3, padding=1) self.conv2 = torch.nn...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C...
amrane99/lung-segmentation
UNet
false
12,162
[ "MIT" ]
0
ab29db75ac78918da5cbf66b830acaf36cf7b44a
https://github.com/amrane99/lung-segmentation/tree/ab29db75ac78918da5cbf66b830acaf36cf7b44a
import torch class Block(torch.nn.Module): def __init__(self, in_channels, mid_channel, out_channels, batch_norm=False ): super().__init__() self.conv1 = torch.nn.Conv2d(in_channels=in_channels, out_channels= mid_channel, kernel_size=3, padding=1) self.conv2 = torch.nn...
LowRankResidualMultiHeadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
LowRankResidualMultiHeadAttention
false
12,163
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
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 import torch.utils.data class Encoder(nn.Module): """ VAE encoder """ def __init__(self, img_channels, latent_size): super(Encoder, self).__init__() self.latent_size = latent_size self.img_channels = img_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 import ...
benedictquartey/softgym_wm
Encoder
false
12,164
[ "BSD-3-Clause" ]
0
0aef75fed207b11029f6052c656a679c105b4677
https://github.com/benedictquartey/softgym_wm/tree/0aef75fed207b11029f6052c656a679c105b4677
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): """ VAE encoder """ def __init__(self, img_channels, latent_size): super().__init__() self.latent_size = latent_size self.img_channels = img_channels self.conv1 =...
FourLayerSemSegNetWideView
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 FourLayerSemSegNetWideView(nn.Module): def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, 6, kernel_size=3, padding= 1, stride=1) self.conv1d100 = torch.nn.Conv2d(in_channel, 2, kern...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
benkoger/kasanka
FourLayerSemSegNetWideView
false
12,165
[ "Apache-2.0" ]
0
d5b1d32b7abf54845af0832da577137397089001
https://github.com/benkoger/kasanka/tree/d5b1d32b7abf54845af0832da577137397089001
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, in_channel, out_channel): super().__init__() self.conv1 = torch.nn.Conv2d(in_channel, 6, kernel_size=3, padding= 1, stride=1) self.conv1d100 = torch.nn.Conv2d(in_channel, 2, kernel_size=3, ...
ScaledDotProductAttention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
ScaledDotProductAttention
false
12,166
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class Model(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperatur...
LowRankResidualEncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
LowRankResidualEncoderLayer
false
12,167
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
GlobalAvgPool
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch as th from torch import nn class GlobalAvgPool(nn.Module): def __init__(self): super(GlobalAvgPool, self).__init__() def forward(self, x): return th.mean(x, dim=[-2, -1]) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
bjuncek/video_feature_extractor
GlobalAvgPool
false
12,168
[ "Apache-2.0" ]
0
cac06b450d1164beb3f3710d5018c19091bce348
https://github.com/bjuncek/video_feature_extractor/tree/cac06b450d1164beb3f3710d5018c19091bce348
import torch import torch as th from torch import nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): return th.mean(x, dim=[-2, -1]) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
EncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F class AffineLayer(nn.Module): def __init__(self, dropout, d_model, d_ff): super(AffineLayer, self).__init__() self.w_1 = nn.Linear(d_model, d_ff) self.w_2 = nn.Linear(d_ff, d_model) self.dropout = nn.Dr...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bekirufuk/pointer_summarizer
EncoderLayer
false
12,169
[ "Apache-2.0" ]
0
8fc9726f9337b26339848d896a09e7e8f9456bcc
https://github.com/bekirufuk/pointer_summarizer/tree/8fc9726f9337b26339848d896a09e7e8f9456bcc
import math import torch import torch.nn as nn import torch.nn.functional as F class AffineLayer(nn.Module): def __init__(self, dropout, d_model, d_ff): super().__init__() self.w_1 = nn.Linear(d_model, d_ff) self.w_2 = nn.Linear(d_ff, d_model) self.dropout = nn.Dropout(dropout) ...
Decoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Decoder(nn.Module): """ VAE decoder """ def __init__(self, img_channels, latent_size): super(Decoder, self).__init__() self.latent_size = latent_size self.img_channels = img_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 import ...
benedictquartey/softgym_wm
Decoder
false
12,170
[ "BSD-3-Clause" ]
0
0aef75fed207b11029f6052c656a679c105b4677
https://github.com/benedictquartey/softgym_wm/tree/0aef75fed207b11029f6052c656a679c105b4677
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): """ VAE decoder """ def __init__(self, img_channels, latent_size): super().__init__() self.latent_size = latent_size self.img_channels = img_channels self.fc1 = n...
BehlerAngular
# 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 as nn class BehlerAngular(nn.Module): """ Compute Behler type angular contribution of the angle spanned by three atoms: :math:`2^{(1-\\zeta)} (1 + \\lambda \\cos( {\\theta}_{ijk} ) )^\\zeta` Sets of zetas with lambdas of -1 and +1 are generated automatically. A...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._emp...
blindcharzard/AttnSchNet
BehlerAngular
false
12,171
[ "MIT" ]
0
297bd130086459be6b732d68377193e244536bfc
https://github.com/blindcharzard/AttnSchNet/tree/297bd130086459be6b732d68377193e244536bfc
import torch from torch import nn as nn class Model(nn.Module): """ Compute Behler type angular contribution of the angle spanned by three atoms: :math:`2^{(1-\\zeta)} (1 + \\lambda \\cos( {\\theta}_{ijk} ) )^\\zeta` Sets of zetas with lambdas of -1 and +1 are generated automatically. Args: ...
MHSA
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 class MHSA(nn.Module): def __init__(self, n_dims, width=14, height=14, heads=4): super(MHSA, self).__init__() self.heads = heads self.query = nn.Conv2d(n_dims, n_dims, kernel_size=1) self.key = nn.Conv2d(n_dims, n_dims, ke...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
binghuiwu98/discriminatory-yolov5
MHSA
false
12,172
[ "Apache-2.0" ]
0
831bfdb8e0df38e247a72ca029ee3301fc14a311
https://github.com/binghuiwu98/discriminatory-yolov5/tree/831bfdb8e0df38e247a72ca029ee3301fc14a311
import torch import torch.utils.data import torch.nn as nn class Model(nn.Module): def __init__(self, n_dims, width=14, height=14, heads=4): super().__init__() self.heads = heads self.query = nn.Conv2d(n_dims, n_dims, kernel_size=1) self.key = nn.Conv2d(n_dims, n_dims, kernel_size...
LowRankEncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
LowRankEncoderLayer
false
12,173
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
MultiHeadedAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn import torch.nn.functional as F class MultiHeadedAttention(nn.Module): def __init__(self, num_head, d_model, dropout=0.1): super(MultiHeadedAttention, self).__init__() assert d_model % num_head == 0 self.d_k = d_model // num_head 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....
bekirufuk/pointer_summarizer
MultiHeadedAttention
false
12,174
[ "Apache-2.0" ]
0
8fc9726f9337b26339848d896a09e7e8f9456bcc
https://github.com/bekirufuk/pointer_summarizer/tree/8fc9726f9337b26339848d896a09e7e8f9456bcc
import math import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, num_head, d_model, dropout=0.1): super().__init__() assert d_model % num_head == 0 self.d_k = d_model // num_head self.h = num_head self.linear_key = n...
Aggregate
# 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 as nn class Aggregate(nn.Module): """Pooling layer based on sum or average with optional masking. Args: axis (int): axis along which pooling is done. mean (bool, optional): if True, use average instead for sum pooling. keepdim (bool, optional): whethe...
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 as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._emp...
blindcharzard/AttnSchNet
Aggregate
false
12,175
[ "MIT" ]
0
297bd130086459be6b732d68377193e244536bfc
https://github.com/blindcharzard/AttnSchNet/tree/297bd130086459be6b732d68377193e244536bfc
import torch from torch import nn as nn class Model(nn.Module): """Pooling layer based on sum or average with optional masking. Args: axis (int): axis along which pooling is done. mean (bool, optional): if True, use average instead for sum pooling. keepdim (bool, optional): whether th...
GVPDropout
# 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 GVPDropout(nn.Module): """ Separate dropout for scalars and vectors. """ def __init__(self, rate): super().__init__() self.vector_dropout = nn.Dropout2d(rate) self.feat_dropout = nn.Dropout(rate) def forward(self, feats, vectors): r...
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...
blazingsiyan/geometric-vector-perceptron
GVPDropout
false
12,176
[ "MIT" ]
0
eee1ee8e71148cfdb3e02b660d80f12cf1cecd0a
https://github.com/blazingsiyan/geometric-vector-perceptron/tree/eee1ee8e71148cfdb3e02b660d80f12cf1cecd0a
import torch from torch import nn class Model(nn.Module): """ Separate dropout for scalars and vectors. """ def __init__(self, rate): super().__init__() self.vector_dropout = nn.Dropout2d(rate) self.feat_dropout = nn.Dropout(rate) def forward(self, feats, vectors): return...
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.nn as nn def conv3x3(in_ch, out_ch, stride=1): """3x3 convolution with padding.""" return nn.Conv2d(in_ch, out_ch, kernel_size=3, stride=stride, padding=1) class ResidualBlock(nn.Module): """Simple residual block with two 3x3 convolutions. Args: in_ch (int): number...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
blakecheng/CompressAI
ResidualBlock
false
12,177
[ "Apache-2.0" ]
0
7a919e509bafacc99055dd88fc20315f3b9fc1fc
https://github.com/blakecheng/CompressAI/tree/7a919e509bafacc99055dd88fc20315f3b9fc1fc
import torch import torch.nn as nn def conv3x3(in_ch, out_ch, stride=1): """3x3 convolution with padding.""" return nn.Conv2d(in_ch, out_ch, kernel_size=3, stride=stride, padding=1) class Model(nn.Module): """Simple residual block with two 3x3 convolutions. Args: in_ch (int): number of inpu...
GVPLayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 GVPLayerNorm(nn.Module): """ Normal layer norm for scalars, nontrainable norm for vectors. """ def __init__(self, feats_h_size, eps=1e-08): super().__init__() self.eps = eps self.feat_norm = nn.LayerNorm(feats_h_size) def forward(self, feat...
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...
blazingsiyan/geometric-vector-perceptron
GVPLayerNorm
false
12,178
[ "MIT" ]
0
eee1ee8e71148cfdb3e02b660d80f12cf1cecd0a
https://github.com/blazingsiyan/geometric-vector-perceptron/tree/eee1ee8e71148cfdb3e02b660d80f12cf1cecd0a
import torch from torch import nn class Model(nn.Module): """ Normal layer norm for scalars, nontrainable norm for vectors. """ def __init__(self, feats_h_size, eps=1e-08): super().__init__() self.eps = eps self.feat_norm = nn.LayerNorm(feats_h_size) def forward(self, feats, vect...
LowRankDecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
LowRankDecoderLayer
false
12,179
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
GroupedChannelNorm
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch import torch.nn as nn class GroupedChannelNorm(nn.Module): def __init__(self, num_groups): super().__init__() self.num_groups = num_groups def forward(self, x): shape = list(x.shape) new_shape = [shape[0], self.num_groups, sha...
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.utils.data import torch import torch.nn as nn assert_size_stride =...
bomtorazek/contrastive-unpaired-translation
GroupedChannelNorm
false
12,180
[ "BSD-3-Clause" ]
0
07c048038375e1b9a4e464154b8dbc49f5e16ede
https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede
import torch import torch.utils.data import torch import torch.nn as nn class Model(nn.Module): def __init__(self, num_groups): super().__init__() self.num_groups = num_groups def forward(self, x): shape = list(x.shape) new_shape = [shape[0], self.num_groups, shape[1] // self...
MLPNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 MLPNet(nn.Module): def __init__(self): super(MLPNet, self).__init__() self.fc1 = nn.Linear(28 * 28, 500) self.fc2 = nn.Linear(500, 256) self.fc3 = nn.Linear(256, 10) def forward(self, x): x = x.v...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bluebibi/flask_rest
MLPNet
false
12,181
[ "MIT" ]
0
9b1ee876060bca5d97459bb894c73530f66c4c15
https://github.com/bluebibi/flask_rest/tree/9b1ee876060bca5d97459bb894c73530f66c4c15
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(28 * 28, 500) self.fc2 = nn.Linear(500, 256) self.fc3 = nn.Linear(256, 10) def forward(self, x): x = x.view(-1, 28 * ...
FusedLeakyReLU
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5): return F.leaky_relu(input + bias, negative_slope) * scale class FusedLeakyReLU(nn.Module): def __init__(self, channel, negative_slop...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F assert_size_stride = torch._C._dynamo.guards.asse...
bomtorazek/contrastive-unpaired-translation
FusedLeakyReLU
false
12,182
[ "BSD-3-Clause" ]
0
07c048038375e1b9a4e464154b8dbc49f5e16ede
https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede
import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5): return F.leaky_relu(input + bias, negative_slope) * scale class Model(nn.Module): def __init__(self, channel, negative_slope=0.2, sc...
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 numpy as np import torch.nn.functional as F import torch.nn as nn class net(nn.Module): def __init__(self, input_size, output_size): super(net, self).__init__() self.fc1 = nn.Linear(in_features=input_size, out_features=64) self.fc2 = nn.Linear(in_features=64, out_featu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
brabeem/deep-reinforcement-learning
net
false
12,183
[ "MIT" ]
0
aff919545a1b6d9d44f5aaaa13b9981c888e7169
https://github.com/brabeem/deep-reinforcement-learning/tree/aff919545a1b6d9d44f5aaaa13b9981c888e7169
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, input_size, output_size): super().__init__() self.fc1 = nn.Linear(in_features=input_size, out_features=64) self.fc2 = nn.Linear(in_features=64, out_features=64)...
DecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
bahducoup/factorized_training
DecoderLayer
false
12,184
[ "MIT" ]
0
0af38f16338a9bcfcc11091b1a6b75befd67f234
https://github.com/bahducoup/factorized_training/tree/0af38f16338a9bcfcc11091b1a6b75befd67f234
import torch import torch.nn as nn import torch.utils.checkpoint import torch.nn.functional as F from torch.cuda.amp import autocast class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temp...
Normalize
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch import torch.nn as nn class Normalize(nn.Module): def __init__(self, power=2): super(Normalize, self).__init__() self.power = power def forward(self, x): norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power) out ...
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.utils.data import torch import torch.nn as nn assert_size_stride =...
bomtorazek/contrastive-unpaired-translation
Normalize
false
12,185
[ "BSD-3-Clause" ]
0
07c048038375e1b9a4e464154b8dbc49f5e16ede
https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede
import torch import torch.utils.data import torch import torch.nn as nn class Model(nn.Module): def __init__(self, power=2): super().__init__() self.power = power def forward(self, x): norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power) out = x.div(norm + 1e-0...
PoolingF
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch import torch.nn as nn class Normalize(nn.Module): def __init__(self, power=2): super(Normalize, self).__init__() self.power = power def forward(self, x): norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power) out ...
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.utils.data impo...
bomtorazek/contrastive-unpaired-translation
PoolingF
false
12,186
[ "BSD-3-Clause" ]
0
07c048038375e1b9a4e464154b8dbc49f5e16ede
https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede
import torch import torch.utils.data import torch import torch.nn as nn class Normalize(nn.Module): def __init__(self, power=2): super().__init__() self.power = power def forward(self, x): norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power) out = x.div(norm + ...
Critic
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Critic(nn.Module): """Critic (Value) Model.""" def __init__(self, state_size, action_size, seed, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np import tor...
brabeem/deep-reinforcement-learning
Critic
false
12,187
[ "MIT" ]
0
aff919545a1b6d9d44f5aaaa13b9981c888e7169
https://github.com/brabeem/deep-reinforcement-learning/tree/aff919545a1b6d9d44f5aaaa13b9981c888e7169
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Model(nn.Module): """Critic (Value) Model.""" def __init__(self, state_size, action_size, seed, f...
Actor
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Actor(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, seed, f...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
brabeem/deep-reinforcement-learning
Actor
false
12,188
[ "MIT" ]
0
aff919545a1b6d9d44f5aaaa13b9981c888e7169
https://github.com/brabeem/deep-reinforcement-learning/tree/aff919545a1b6d9d44f5aaaa13b9981c888e7169
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class Model(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, seed, f...
ContextPooler
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 def get_mask(input, local_context): if not isinstance(local_context, DropoutContext): dropout = local_context mask = None else: dropout = local_context.dropout dropout *= local_context.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.triton_helpers import libdevice import math from to...
c370300679/ClinicalTransformerNER
ContextPooler
false
12,189
[ "MIT" ]
0
4a4a796775f75f6d5adc053e956ec6a0ae6fe2f3
https://github.com/c370300679/ClinicalTransformerNER/tree/4a4a796775f75f6d5adc053e956ec6a0ae6fe2f3
from _paritybench_helpers import _mock_config import math import torch from torch import nn def get_mask(input, local_context): if not isinstance(local_context, DropoutContext): dropout = local_context mask = None else: dropout = local_context.dropout dropout *= local_context.s...
QNetwork
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn class QNetwork(nn.Module): def __init__(self, state_size, action_size, seed=0, fc1_units=64, fc2_units=32): super(QNetwork, self).__init__() self.seed = torch.manual_seed(seed) self.fc1 = nn.Linear(state_size, fc1_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
bwosh/DRL_Navigation
QNetwork
false
12,190
[ "MIT" ]
0
ec33a657f826a7f3681cefe2d984690afad4abb8
https://github.com/bwosh/DRL_Navigation/tree/ec33a657f826a7f3681cefe2d984690afad4abb8
import torch import torch.nn.functional as F import torch.nn as nn class Model(nn.Module): def __init__(self, state_size, action_size, seed=0, fc1_units=64, fc2_units=32): super().__init__() self.seed = torch.manual_seed(seed) self.fc1 = nn.Linear(state_size, fc1_units) se...
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 from torch import nn class MultiHeadAttention(nn.Module): def __init__(self, dim_self, dim_ref, num_heads, bias=True, dropout=0.0): super().__init__() self.num_heads = num_heads head_dim = dim_self // num_heads self.scale = head_dim ** -0.5 self.to_queries = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
bpiyush/CLIP_prefix_caption-video
MultiHeadAttention
false
12,192
[ "MIT" ]
0
3f6a4b8c841189e20b82fd4de127681424311599
https://github.com/bpiyush/CLIP_prefix_caption-video/tree/3f6a4b8c841189e20b82fd4de127681424311599
import torch from torch import nn class Model(nn.Module): def __init__(self, dim_self, dim_ref, num_heads, bias=True, dropout=0.0): super().__init__() self.num_heads = num_heads head_dim = dim_self // num_heads self.scale = head_dim ** -0.5 self.to_queries = nn.Linear(dim_...
TransformerBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init class TransformerBlock(nn.Module): def __init__(self, input_size, d_k=16, d_v=16, n_heads=8, is_layer_norm =False, attn_dropout=0.1): super(TransformerBlock, self).__init__() self.n_heads = n_h...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
bopopescu/covid-19-visualization
TransformerBlock
false
12,193
[ "MIT" ]
0
8a9325b52f007dd5e3ee5bbd323b71bbf19b9640
https://github.com/bopopescu/covid-19-visualization/tree/8a9325b52f007dd5e3ee5bbd323b71bbf19b9640
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init class Model(nn.Module): def __init__(self, input_size, d_k=16, d_v=16, n_heads=8, is_layer_norm =False, attn_dropout=0.1): super().__init__() self.n_heads = n_heads self.d_k = d_k if d_...
EltwiseProdScoring
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 EltwiseProdScoring(nn.Module): """ Linearly mapping h and v to the same dimension, and do a elementwise multiplication and a linear scoring """ def __init__(self, h_dim, a_dim, dot_dim=256): """Initialize layer.""" super(EltwiseProdScoring,...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
cacosandon/speaker_follower_with_objects
EltwiseProdScoring
false
12,194
[ "BSD-2-Clause", "MIT" ]
0
f3d454fdbd1c8129887cf4ecc4743d231c7b9555
https://github.com/cacosandon/speaker_follower_with_objects/tree/f3d454fdbd1c8129887cf4ecc4743d231c7b9555
import torch import torch.nn as nn class Model(nn.Module): """ Linearly mapping h and v to the same dimension, and do a elementwise multiplication and a linear scoring """ def __init__(self, h_dim, a_dim, dot_dim=256): """Initialize layer.""" super().__init__() self.linear...
EuclideanMean
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor import torch.utils.data.dataloader from torch import nn import torch.nn class EuclideanMean(nn.Module): """Implement a EuclideanMean object.""" def forward(self, data: 'Tensor') ->Tensor: """Performs a forward pass through the network. Parameters ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data.dataloader from torch import nn import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
chen-yuxuan/flair
EuclideanMean
false
12,195
[ "MIT" ]
0
480d2c9afd66ab8d3bf40a676917e84dba3c4cee
https://github.com/chen-yuxuan/flair/tree/480d2c9afd66ab8d3bf40a676917e84dba3c4cee
import torch from torch import Tensor import torch.utils.data.dataloader from torch import nn import torch.nn class Model(nn.Module): """Implement a EuclideanMean object.""" def forward(self, data: 'Tensor') ->Tensor: """Performs a forward pass through the network. Parameters -------...
BertSelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class BertSelfAttention(nn.Module): def __init__(self, config): super().__init__() self.num_attention_heads = config.num_attention_heads self.attention_head_size = int(config.hidden_size / config....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
brendon-boldt/minbert-assignment
BertSelfAttention
false
12,196
[ "Apache-2.0" ]
0
0b562d791d34a40fd3c0383a0a32b4eeb2171cb5
https://github.com/brendon-boldt/minbert-assignment/tree/0b562d791d34a40fd3c0383a0a32b4eeb2171cb5
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn class Model(nn.Module): def __init__(self, config): super().__init__() self.num_attention_heads = config.num_attention_heads self.attention_head_size = int(config.hidden_size / config. ...
PyTorchFeedForward
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.autograd import torch.nn as nn import torch.nn.functional as F import torch.optim import torch.cuda class PyTorchFeedForward(nn.Module): def __init__(self, depth, width, input_size, output_size): super(PyTorchFeedForward, self).__init__() self.linears = [...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ccoulombe/thinc
PyTorchFeedForward
false
12,197
[ "MIT" ]
0
8d891b61ddef3ca00266ca0ec7c47e2d063a3a83
https://github.com/ccoulombe/thinc/tree/8d891b61ddef3ca00266ca0ec7c47e2d063a3a83
import torch import torch.nn import torch.autograd import torch.nn as nn import torch.nn.functional as F import torch.optim import torch.cuda class Model(nn.Module): def __init__(self, depth, width, input_size, output_size): super().__init__() self.linears = [nn.Linear(input_size, width)] ...
Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.a1 = nn.Conv2d(5, 16, kernel_size=3, padding=1) self.a2 = nn.Conv2d(16, 16, kernel_size=3, padding=1) self.a3 = nn.Conv2d(16, 32, kernel_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
blockide/Chess-ML
Net
false
12,198
[ "MIT" ]
0
3b1572f715ed710f5ce240c76bb79ae8f186f32a
https://github.com/blockide/Chess-ML/tree/3b1572f715ed710f5ce240c76bb79ae8f186f32a
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.a1 = nn.Conv2d(5, 16, kernel_size=3, padding=1) self.a2 = nn.Conv2d(16, 16, kernel_size=3, padding=1) self.a3 = nn.Conv2d(16, 32, kernel_size=3, s...
FC_Q
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class FC_Q(nn.Module): def __init__(self, state_dim, num_actions): super(FC_Q, self).__init__() self.q1 = nn.Linear(state_dim, 256) self.q2 = nn.Linear(256, 256) self.q3 = nn.Linear(256, num_actions) self.i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
cedesu/BCQ
FC_Q
false
12,199
[ "MIT" ]
0
424548510349a85c31809431494dcc6f64b611ba
https://github.com/cedesu/BCQ/tree/424548510349a85c31809431494dcc6f64b611ba
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, num_actions): super().__init__() self.q1 = nn.Linear(state_dim, 256) self.q2 = nn.Linear(256, 256) self.q3 = nn.Linear(256, num_actions) self.i1 = nn.Li...
VAE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Decoder(nn.Module): """ VAE decoder """ def __init__(self, img_channels, latent_size): super(Decoder, self).__init__() self.latent_size = latent_size self.img_channels = img_channels ...
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._inductor.runtime import triton_helpers from...
benedictquartey/softgym_wm
VAE
false
12,200
[ "BSD-3-Clause" ]
0
0aef75fed207b11029f6052c656a679c105b4677
https://github.com/benedictquartey/softgym_wm/tree/0aef75fed207b11029f6052c656a679c105b4677
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Decoder(nn.Module): """ VAE decoder """ def __init__(self, img_channels, latent_size): super().__init__() self.latent_size = latent_size self.img_channels = img_channels self.fc1 =...
GramMatrix
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn class GramMatrix(nn.Module): def forward(self, x): b, c, h, w = x.shape F = x.view(-1, c, b * w) G = torch.bmm(F, F.transpose(1, 2)) / (h * w) return G def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
choiking10/Image-Style-Transfer
GramMatrix
false
12,201
[ "MIT" ]
0
cc4a6c22975e16343a0fecfdfd3e707c34905e93
https://github.com/choiking10/Image-Style-Transfer/tree/cc4a6c22975e16343a0fecfdfd3e707c34905e93
import torch from torch import nn class Model(nn.Module): def forward(self, x): b, c, h, w = x.shape F = x.view(-1, c, b * w) G = torch.bmm(F, F.transpose(1, 2)) / (h * w) return G def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
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 from torch._inductor.runtime....
chethanpk/onnxruntime
NeuralNetMultiplePositionalArgumentsMultiOutputsWithoutDependency
false
12,202
[ "MIT" ]
0
c2435d24ecbeededf1dc50187ab3bd11ad4a6994
https://github.com/chethanpk/onnxruntime/tree/c2435d24ecbeededf1dc50187ab3bd11ad4a6994
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.softmax1 = to...
ToRGB
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F def make_kernel(k): k = torch.tensor(k, dtype=torch.float32) if len(k.shape) == 1: k = k[None, :] * k[:, None] k /= k.sum() return k def upfirdn2d_native(input, kernel, up_x, u...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.utils.data import torch import torch.nn as nn import to...
bomtorazek/contrastive-unpaired-translation
ToRGB
false
12,203
[ "BSD-3-Clause" ]
0
07c048038375e1b9a4e464154b8dbc49f5e16ede
https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede
import math import torch import torch.utils.data import torch import torch.nn as nn import torch.nn.functional as F def make_kernel(k): k = torch.tensor(k, dtype=torch.float32) if len(k.shape) == 1: k = k[None, :] * k[:, None] k /= k.sum() return k def upfirdn2d_native(input, kernel, up_x, u...
TransformerLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.nn.functional as nnf from typing import Optional class MlpTransformer(nn.Module): def __init__(self, in_dim, h_dim, out_d: 'Optional[int]'=None, act=nnf. relu, dropout=0.0): super().__init__() out_d = out_d if out_d is not None else in_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....
bpiyush/CLIP_prefix_caption-video
TransformerLayer
false
12,204
[ "MIT" ]
0
3f6a4b8c841189e20b82fd4de127681424311599
https://github.com/bpiyush/CLIP_prefix_caption-video/tree/3f6a4b8c841189e20b82fd4de127681424311599
import torch from torch import nn import torch.nn.functional as nnf from typing import Optional class MlpTransformer(nn.Module): def __init__(self, in_dim, h_dim, out_d: 'Optional[int]'=None, act=nnf. relu, dropout=0.0): super().__init__() out_d = out_d if out_d is not None else in_dim ...
LogitCosineDistance
# 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.dataloader import torch.nn def dot_product(a: 'torch.Tensor', b: 'torch.Tensor', normalize=False): """ Computes dot product for pairs of vectors. :param normalize: Vectors are normalized (leads to cosine similarity) :return: Matrix with res[i][j] = dot_product(a[i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
chen-yuxuan/flair
LogitCosineDistance
false
12,205
[ "MIT" ]
0
480d2c9afd66ab8d3bf40a676917e84dba3c4cee
https://github.com/chen-yuxuan/flair/tree/480d2c9afd66ab8d3bf40a676917e84dba3c4cee
import torch import torch.utils.data.dataloader import torch.nn def dot_product(a: 'torch.Tensor', b: 'torch.Tensor', normalize=False): """ Computes dot product for pairs of vectors. :param normalize: Vectors are normalized (leads to cosine similarity) :return: Matrix with res[i][j] = dot_product(a[i...
EuclideanDistance
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor import torch.utils.data.dataloader from torch import nn import torch.nn def arccosh(x): """Compute the arcosh, numerically stable.""" x = torch.clamp(x, min=1 + EPSILON) a = torch.log(x) b = torch.log1p(torch.sqrt(x * x - 1) / x) return a + b def mdot(x, y):...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data.dataloader from torch import nn import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
chen-yuxuan/flair
EuclideanDistance
false
12,206
[ "MIT" ]
0
480d2c9afd66ab8d3bf40a676917e84dba3c4cee
https://github.com/chen-yuxuan/flair/tree/480d2c9afd66ab8d3bf40a676917e84dba3c4cee
import torch from torch import Tensor import torch.utils.data.dataloader from torch import nn import torch.nn def arccosh(x): """Compute the arcosh, numerically stable.""" x = torch.clamp(x, min=1 + EPSILON) a = torch.log(x) b = torch.log1p(torch.sqrt(x * x - 1) / x) return a + b def mdot(x, y):...
NetworkExtension
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 class NetworkExtension(nn.Module): def __init__(self, orig_num_classes, num_classes, auxiliary): super(NetworkExtension, self).__init__() self._auxiliary = auxiliary self.classifier = nn.Linear(orig_num_classes, num_classe...
import torch from torch._inductor.select_algorithm import extern_kernels import 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 import torch import torch.nn as nn assert_size_stride = torch...
amelieEmily/RobustDARTS
NetworkExtension
false
12,207
[ "Apache-2.0" ]
0
b26e127c6e9c330258786f5eb77b17d367f546ff
https://github.com/amelieEmily/RobustDARTS/tree/b26e127c6e9c330258786f5eb77b17d367f546ff
import torch import torch.utils import torch import torch.nn as nn class Model(nn.Module): def __init__(self, orig_num_classes, num_classes, auxiliary): super().__init__() self._auxiliary = auxiliary self.classifier = nn.Linear(orig_num_classes, num_classes) def forward(self, logits_...
SelfAttn
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import functional as F class SelfAttn(nn.Module): """ self-attention with learnable parameters """ def __init__(self, dhid): super().__init__() self.scorer = nn.Linear(dhid, 1) def forward(self, inp): scores = F.softmax(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....
caisarl76/alfred
SelfAttn
false
12,208
[ "MIT" ]
0
b73bdc1651e14c02440938b639fa3c7f3ab3d321
https://github.com/caisarl76/alfred/tree/b73bdc1651e14c02440938b639fa3c7f3ab3d321
import torch from torch import nn from torch.nn import functional as F class Model(nn.Module): """ self-attention with learnable parameters """ def __init__(self, dhid): super().__init__() self.scorer = nn.Linear(dhid, 1) def forward(self, inp): scores = F.softmax(self.sc...
BinaryDiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class BinaryDiceLoss(nn.Module): def __init__(self): super(BinaryDiceLoss, self).__init__() def forward(self, input, targets): N = targets.size()[0] smooth = 1 input_flat = input.view(N, -1) targets_flat = targets.view(N, -1) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
chenkarl/kits19
BinaryDiceLoss
false
12,209
[ "MIT" ]
0
7fa912320a23c6bf649566a1509aa493656b24c1
https://github.com/chenkarl/kits19/tree/7fa912320a23c6bf649566a1509aa493656b24c1
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, input, targets): N = targets.size()[0] smooth = 1 input_flat = input.view(N, -1) targets_flat = targets.view(N, -1) intersection = input_flat * ...
ReshapeF
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.utils.data import torch import torch.nn as nn class Normalize(nn.Module): def __init__(self, power=2): super(Normalize, self).__init__() self.power = power def forward(self, x): norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power) out ...
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.utils.data import torch import torch.nn as nn assert_size_stride =...
bomtorazek/contrastive-unpaired-translation
ReshapeF
false
12,210
[ "BSD-3-Clause" ]
0
07c048038375e1b9a4e464154b8dbc49f5e16ede
https://github.com/bomtorazek/contrastive-unpaired-translation/tree/07c048038375e1b9a4e464154b8dbc49f5e16ede
import torch import torch.utils.data import torch import torch.nn as nn class Normalize(nn.Module): def __init__(self, power=2): super().__init__() self.power = power def forward(self, x): norm = x.pow(self.power).sum(1, keepdim=True).pow(1.0 / self.power) out = x.div(norm + ...
VAE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 VAE(nn.Module): def __init__(self, state_dim, action_dim, latent_dim, max_action, device): super(VAE, self).__init__() self.e1 = nn.Linear(state_dim + action_dim, 750) self.e2 = nn.Linear(750, 750) self.mean ...
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._inductor.runtime import triton_helpers from...
cedesu/BCQ
VAE
false
12,211
[ "MIT" ]
0
424548510349a85c31809431494dcc6f64b611ba
https://github.com/cedesu/BCQ/tree/424548510349a85c31809431494dcc6f64b611ba
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_dim, action_dim, latent_dim, max_action, device): super().__init__() self.e1 = nn.Linear(state_dim + action_dim, 750) self.e2 = nn.Linear(750, 750) self.mean = nn.Li...
Conv_Q
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 Conv_Q(nn.Module): def __init__(self, frames, num_actions): super(Conv_Q, self).__init__() self.c1 = nn.Conv2d(frames, 32, kernel_size=8, stride=4) self.c2 = nn.Conv2d(32, 64, kernel_size=4, stride=2) self.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 import torch.nn as nn assert_...
cedesu/BCQ
Conv_Q
false
12,212
[ "MIT" ]
0
424548510349a85c31809431494dcc6f64b611ba
https://github.com/cedesu/BCQ/tree/424548510349a85c31809431494dcc6f64b611ba
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, frames, num_actions): super().__init__() self.c1 = nn.Conv2d(frames, 32, kernel_size=8, stride=4) self.c2 = nn.Conv2d(32, 64, kernel_size=4, stride=2) self.c3 = nn.Conv2d(...
OutputTransition
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 OutputTransition(nn.Module): def __init__(self, out_ch): super(OutputTransition, self).__init__() self.up_conv = nn.Conv2d(64, out_ch, 1) def forward(self, x): out = self.up_conv(x) return out def get_inputs(): return [torch.rand...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
chenkarl/kits19
OutputTransition
false
12,213
[ "MIT" ]
0
7fa912320a23c6bf649566a1509aa493656b24c1
https://github.com/chenkarl/kits19/tree/7fa912320a23c6bf649566a1509aa493656b24c1
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, out_ch): super().__init__() self.up_conv = nn.Conv2d(64, out_ch, 1) def forward(self, x): out = self.up_conv(x) return out def get_inputs(): return [torch.rand([4, 64, 64, 64])] def get_init...
RNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 class RNN(nn.Module): def __init__(self, input_size, hidden_size, output_size): super(RNN, self).__init__() self.hidden_size = hidden_size self.i2h = nn.Linear(input_size + hidden_size, hidden_size) self.i2o = ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chenyuntc/practical-pytorch
RNN
false
12,214
[ "MIT" ]
0
42cbde5275d37bf3f3623a85fd71f13069d95089
https://github.com/chenyuntc/practical-pytorch/tree/42cbde5275d37bf3f3623a85fd71f13069d95089
import torch import torch.nn as nn from torch.autograd import Variable class Model(nn.Module): def __init__(self, input_size, hidden_size, output_size): super().__init__() self.hidden_size = hidden_size self.i2h = nn.Linear(input_size + hidden_size, hidden_size) self.i2o = nn.Line...
TripletLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn import torch.nn.functional as F from torch.nn import * from torch.optim.lr_scheduler import * def _batch_hard(mat_distance, mat_similarity, indice=False): sorted_mat_distance, positive_indices = torch.sort(mat_distance + - 9999999.0 * (1 - mat_similarity), dim=1, descendi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
chrizandr/MMT
TripletLoss
false
12,215
[ "MIT" ]
0
e2bb5984efb165e7ea1ed6080610cfe176344ac0
https://github.com/chrizandr/MMT/tree/e2bb5984efb165e7ea1ed6080610cfe176344ac0
import torch from torch import nn import torch.nn.functional as F from torch.nn import * from torch.optim.lr_scheduler import * def _batch_hard(mat_distance, mat_similarity, indice=False): sorted_mat_distance, positive_indices = torch.sort(mat_distance + - 9999999.0 * (1 - mat_similarity), dim=1, descendi...
SmallMnistNoDropout
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn import torch.utils.data import torch.utils.tensorboard._pytorch_graph import torch.onnx.symbolic_caffe2 class SmallMnistNoDropout(nn.Module): def __init__(self): super(SmallMnistNoDropout, self).__init__() self.conv1 = nn.Conv2d(1, 10, kernel_siz...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
arjunsuresh/aimet
SmallMnistNoDropout
false
12,216
[ "BSD-3-Clause" ]
0
f6e09cb07a91eed3a5e6b8e19e6b065303af5a39
https://github.com/arjunsuresh/aimet/tree/f6e09cb07a91eed3a5e6b8e19e6b065303af5a39
import torch import torch.nn as nn import torch.nn import torch.utils.data import torch.utils.tensorboard._pytorch_graph import torch.onnx.symbolic_caffe2 class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 10, kernel_size=5) self.relu1 = nn.ReLU() ...
CosineDistance
# 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.dataloader import torch.nn def dot_product(a: 'torch.Tensor', b: 'torch.Tensor', normalize=False): """ Computes dot product for pairs of vectors. :param normalize: Vectors are normalized (leads to cosine similarity) :return: Matrix with res[i][j] = dot_product(a[i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
chen-yuxuan/flair
CosineDistance
false
12,217
[ "MIT" ]
0
480d2c9afd66ab8d3bf40a676917e84dba3c4cee
https://github.com/chen-yuxuan/flair/tree/480d2c9afd66ab8d3bf40a676917e84dba3c4cee
import torch import torch.utils.data.dataloader import torch.nn def dot_product(a: 'torch.Tensor', b: 'torch.Tensor', normalize=False): """ Computes dot product for pairs of vectors. :param normalize: Vectors are normalized (leads to cosine similarity) :return: Matrix with res[i][j] = dot_product(a[i...
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 import torch.nn as nn import torch.utils.checkpoint class BertSelfOutput(nn.Module): def __init__(self, config, twin=False, merge=False): super().__init__() self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config. layer_n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
christophschuhmann/BLIP
BertSelfOutput
false
12,218
[ "BSD-3-Clause" ]
0
498f963762db65e7290eea02573e1749f955b3d0
https://github.com/christophschuhmann/BLIP/tree/498f963762db65e7290eea02573e1749f955b3d0
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.utils.checkpoint class Model(nn.Module): def __init__(self, config, twin=False, merge=False): super().__init__() self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config. layer_norm_eps) ...