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
SequenceClassifier
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F def transformer_weights_init(module, std_init_range=0.02, xavier=True): """ Initialize different weights in Transformer model. Args: module: torch.nn.Module to be initialized std_init_range: standard deviation of normal ini...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ngxingyu/Domain-Transfer-for-Punctuation-Retrieval
SequenceClassifier
false
7,340
[ "Apache-2.0" ]
1
f5aa0ea0946c68aaf7fcf49a5085e6c823766a2f
https://github.com/ngxingyu/Domain-Transfer-for-Punctuation-Retrieval/tree/f5aa0ea0946c68aaf7fcf49a5085e6c823766a2f
import torch import torch.nn as nn import torch.nn.functional as F def transformer_weights_init(module, std_init_range=0.02, xavier=True): """ Initialize different weights in Transformer model. Args: module: torch.nn.Module to be initialized std_init_range: standard deviation of normal ini...
ScaleNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.nn as nn class ScaleNorm(nn.Module): """ScaleNorm""" """All g’s in SCALE NORM are initialized to sqrt(d)""" def __init__(self, scale, eps=1e-05): super(ScaleNorm, self).__init__() self.scale = nn.Parameter(torch.tensor(math.sqrt(scale))) self....
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import math import torch.nn ...
nigelnnk/MATCh-sensitivity
ScaleNorm
false
7,341
[ "MIT" ]
1
aaf2b924ac98c8c5925bbf431481724d11a102f8
https://github.com/nigelnnk/MATCh-sensitivity/tree/aaf2b924ac98c8c5925bbf431481724d11a102f8
import math import torch import torch.nn as nn class Model(nn.Module): """ScaleNorm""" """All g’s in SCALE NORM are initialized to sqrt(d)""" def __init__(self, scale, eps=1e-05): super().__init__() self.scale = nn.Parameter(torch.tensor(math.sqrt(scale))) self.eps = eps def ...
StyleResidual
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.utils.data import torch.optim class StyleResidual(nn.Module): """Styling.""" def __init__(self, d_channel: 'int', d_style: 'int', kernel_size: 'int'=1): super().__init__() self.rs = nn.Conv1d(in_channels=d_style, out_channels=d_channel, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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 import torch.utils.data import torch.optim assert_size_stri...
niklub/NeMo
StyleResidual
false
7,342
[ "Apache-2.0" ]
1
4bcb2321cd16835f63afe3dfe993e6d56bcf2c0c
https://github.com/niklub/NeMo/tree/4bcb2321cd16835f63afe3dfe993e6d56bcf2c0c
import torch from torch import nn import torch.utils.data import torch.optim class Model(nn.Module): """Styling.""" def __init__(self, d_channel: 'int', d_style: 'int', kernel_size: 'int'=1): super().__init__() self.rs = nn.Conv1d(in_channels=d_style, out_channels=d_channel, kerne...
CQLAgent
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 as th import torch.nn as nn import torch.nn.functional as F from scipy import optimize class CQLAgent(nn.Module): def __init__(self, input_shape, n_actions, n_opponent_actions, hidden_dim=64): super(CQLAgent, self).__init__() self.fc1 = nn.Line...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np import tor...
netlab-lcy/CMIX
CQLAgent
false
7,343
[ "MIT" ]
1
53e2d8794af2b380295efe06dcb05235089953c1
https://github.com/netlab-lcy/CMIX/tree/53e2d8794af2b380295efe06dcb05235089953c1
import torch import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F from scipy import optimize class Model(nn.Module): def __init__(self, input_shape, n_actions, n_opponent_actions, hidden_dim=64): super().__init__() self.fc1 = nn.Linear(input_shape, h...
MultiHeadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class MultiHeadAttention(nn.Module): """ Applies an multi-head attention mechanism on the output features from the decoder. Refer to 「State-of-the-art Speech Recognition With Sequence-to-Sequence Models」 Paper https://arxiv.org/abs/17...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ngbsLab/Korean-Speech-Recognition
MultiHeadAttention
false
7,344
[ "Apache-2.0" ]
1
3867bf7d23222da6812c9b98a93d3c6f7b3c80fc
https://github.com/ngbsLab/Korean-Speech-Recognition/tree/3867bf7d23222da6812c9b98a93d3c6f7b3c80fc
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Applies an multi-head attention mechanism on the output features from the decoder. Refer to 「State-of-the-art Speech Recognition With Sequence-to-Sequence Models」 Paper https://arxiv.org/abs/1712.01769 ...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.optim import torch.utils.data import torch.autograd class FocalLoss(nn.Module): def __init__(self, gamma=0, eps=1e-07): super(FocalLoss, self).__init__() self.gamma = gamma self.eps = eps self.ce = torch.nn.CrossEntropyLoss() de...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
nikitajz/google-landmarks
FocalLoss
false
7,345
[ "MIT" ]
1
2051462be4450c193c98b237fc7ebdae783e2b28
https://github.com/nikitajz/google-landmarks/tree/2051462be4450c193c98b237fc7ebdae783e2b28
import torch import torch.nn as nn import torch.optim import torch.utils.data import torch.autograd class Model(nn.Module): def __init__(self, gamma=0, eps=1e-07): super().__init__() self.gamma = gamma self.eps = eps self.ce = torch.nn.CrossEntropyLoss() def forward(self, inp...
ClassWisePool
# 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 sys from torch.autograd import Function import torch from torch import nn class ClassWisePoolFunction(Function): @staticmethod def forward(ctx, input, args): ctx.num_maps = args batch_size, num_channels, h, w = input.size() if num_channels % ctx.num_maps != 0: None ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import sys from torch.autograd import Function from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_st...
nishanthta/wsl
ClassWisePool
false
7,346
[ "MIT" ]
1
5fda3b909a314b7f88ffa9ab27a6a142de6b0159
https://github.com/nishanthta/wsl/tree/5fda3b909a314b7f88ffa9ab27a6a142de6b0159
import sys from torch.autograd import Function import torch from torch import nn class ClassWisePoolFunction(Function): @staticmethod def forward(ctx, input, args): ctx.num_maps = args batch_size, num_channels, h, w = input.size() if num_channels % ctx.num_maps != 0: None ...
WassersteinLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch def torch_cdf_loss(tensor_a, tensor_b, p=1): tensor_a = tensor_a / (torch.sum(tensor_a, dim=-1, keepdim=True) + 1e-14) tensor_b = tensor_b / (torch.sum(tensor_b, dim=-1, keepdim=True) + 1e-14) cdf_tensor_a = torch.cumsum(tensor_a, dim=-1) cdf_tensor_b = torch.cumsum(tensor_b, dim=-1) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_str...
nikitadhawan/SimCLR
WassersteinLoss
false
7,347
[ "MIT" ]
1
7d87b384b1edb68e7ba86601b26f76e6da214718
https://github.com/nikitadhawan/SimCLR/tree/7d87b384b1edb68e7ba86601b26f76e6da214718
import torch def torch_cdf_loss(tensor_a, tensor_b, p=1): tensor_a = tensor_a / (torch.sum(tensor_a, dim=-1, keepdim=True) + 1e-14) tensor_b = tensor_b / (torch.sum(tensor_b, dim=-1, keepdim=True) + 1e-14) cdf_tensor_a = torch.cumsum(tensor_a, dim=-1) cdf_tensor_b = torch.cumsum(tensor_b, dim=-1) ...
CoxPHLossSorted
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch def cox_ph_loss_sorted(log_h, event, eps=1e-07): """Requires the input to be sorted by descending duration time. See DatasetDurationSorted. We calculate the negative log of $( rac{h_i}{\\sum_{j \\in R_i} h_j})^d$, where h = exp(log_h) are the hazards and R is the risk set, and d is event...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math assert_size_stride = t...
nikolase90/pycox
CoxPHLossSorted
false
7,348
[ "BSD-2-Clause" ]
1
1c780253da7bab7eba0dc02e1436a68a9b812a66
https://github.com/nikolase90/pycox/tree/1c780253da7bab7eba0dc02e1436a68a9b812a66
import torch def cox_ph_loss_sorted(log_h, event, eps=1e-07): """Requires the input to be sorted by descending duration time. See DatasetDurationSorted. We calculate the negative log of $( rac{h_i}{\\sum_{j \\in R_i} h_j})^d$, where h = exp(log_h) are the hazards and R is the risk set, and d is event...
leaky_hardtanh
# 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 leaky_hardtanh(nn.Module): def __init__(self, min=-1, max=1, slope=0.01): super(leaky_hardtanh, self).__init__() self.min = min self.max = max self.slope = slope def forward(self, x): x = torch.where(x < self.min, self.min + x ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
nikolasmorshuis/gadolinium_prediction
leaky_hardtanh
false
7,349
[ "Apache-2.0" ]
1
7d6640df5b62ce578a947d3a9b9c701c3d1ccd79
https://github.com/nikolasmorshuis/gadolinium_prediction/tree/7d6640df5b62ce578a947d3a9b9c701c3d1ccd79
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, min=-1, max=1, slope=0.01): super().__init__() self.min = min self.max = max self.slope = slope def forward(self, x): x = torch.where(x < self.min, self.min + x * self.slope, x) x = ...
GlobalAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.cuda def aeq(*args): base = args[0] for a in args[1:]: assert a == base, str(args) class Bottle(nn.Module): def forward(self, input): if len(input.size()) <= 2: return super(Bottle, self).forward(input) size = input.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....
nikhilweee/syntactic-seq2seq
GlobalAttention
false
7,350
[ "MIT" ]
1
807e524167b064fc85c91e5e2fa994de6b739455
https://github.com/nikhilweee/syntactic-seq2seq/tree/807e524167b064fc85c91e5e2fa994de6b739455
import torch import torch.nn as nn import torch.cuda def aeq(*args): base = args[0] for a in args[1:]: assert a == base, str(args) class Bottle(nn.Module): def forward(self, input): if len(input.size()) <= 2: return super(Bottle, self).forward(input) size = input.siz...
NetVLAD
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from sklearn.neighbors import NearestNeighbors class NetVLAD(nn.Module): """NetVLAD layer implementation""" def __init__(self, num_clusters=64, dim=128, normalize_input=True, vladv2=False, use_faiss=True): "...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
leochien1110/Patch-NetVLAD
NetVLAD
false
7,351
[ "MIT" ]
1
9282217dd2c9bcf0446a05400fd277e651cecf4e
https://github.com/leochien1110/Patch-NetVLAD/tree/9282217dd2c9bcf0446a05400fd277e651cecf4e
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from sklearn.neighbors import NearestNeighbors class Model(nn.Module): """NetVLAD layer implementation""" def __init__(self, num_clusters=64, dim=128, normalize_input=True, vladv2=False, use_faiss=True): """...
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.functional as F from torch import nn import torch.utils.data class Net(nn.Module): def __init__(self, in_dim): super().__init__() self.fc1 = nn.Linear(in_dim, 120, bias=False) nn.init.normal_(self.fc1.weight, mean=0, std=1) self.fc2 = nn.Linear(120, 1,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
nmichlo/msc-research
Net
false
7,352
[ "MIT" ]
1
625e57eca77bbfbc4728ccebdb0733e1613bd258
https://github.com/nmichlo/msc-research/tree/625e57eca77bbfbc4728ccebdb0733e1613bd258
import torch import torch.nn.functional as F from torch import nn import torch.utils.data class Model(nn.Module): def __init__(self, in_dim): super().__init__() self.fc1 = nn.Linear(in_dim, 120, bias=False) nn.init.normal_(self.fc1.weight, mean=0, std=1) self.fc2 = nn.Linear(120, ...
StdConv3d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.jit import torch.nn.functional as F import torch.nn.functional class StdConv3d(nn.Conv3d): def forward(self, x): w = self.weight v, m = torch.var_mean(w, dim=[1, 2, 3, 4], keepdim=True, unbiased=False ) w = (w - m) / torch.sqrt(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....
nntrongnghia/TDSI21-Shoulder-Muscle-Segmentation
StdConv3d
false
7,353
[ "Apache-2.0" ]
1
29f0f83d93e4fdd8127261283dcf9242d9914ba6
https://github.com/nntrongnghia/TDSI21-Shoulder-Muscle-Segmentation/tree/29f0f83d93e4fdd8127261283dcf9242d9914ba6
import torch from torch import nn import torch.jit import torch.nn.functional as F import torch.nn.functional class Model(nn.Conv3d): def forward(self, x): w = self.weight v, m = torch.var_mean(w, dim=[1, 2, 3, 4], keepdim=True, unbiased=False ) w = (w - m) / torch.sqrt(v + 1e...
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().__init__() self.conv1 = nn.Conv2d(1, 4, (3, 3), 1) self.dropout2d_1 = nn.Dropout2d(p=0.5) self.conv2 = nn.Conv2d(4, 32, (3, 3), 1) self.dropout2d_2 = nn.Dro...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
nathantau/BigBrain
Net
false
7,354
[ "MIT" ]
1
b9e81ee3ca91fadeccd59043dcc0062af1e6d365
https://github.com/nathantau/BigBrain/tree/b9e81ee3ca91fadeccd59043dcc0062af1e6d365
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 4, (3, 3), 1) self.dropout2d_1 = nn.Dropout2d(p=0.5) self.conv2 = nn.Conv2d(4, 32, (3, 3), 1) self.dropout2d_2 = nn.D...
FF
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 conv(in_channels, out_channels, kernel_size, bias=False, stride=1): return nn.Conv2d(in_channels, out_channels, kernel_size, padding= kernel_size // 2, bias=bias, stride=stride) class FF(nn.Module): def __init__(self, n_feat, kernel_size=3, bias=True): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
noxsine/WTSDNet
FF
false
7,355
[ "MIT" ]
1
7f25fb62c705c730c4d2fab6c86f9cf3535e6d80
https://github.com/noxsine/WTSDNet/tree/7f25fb62c705c730c4d2fab6c86f9cf3535e6d80
import torch import torch.nn as nn def conv(in_channels, out_channels, kernel_size, bias=False, stride=1): return nn.Conv2d(in_channels, out_channels, kernel_size, padding= kernel_size // 2, bias=bias, stride=stride) class Model(nn.Module): def __init__(self, n_feat, kernel_size=3, bias=True): ...
PSNRLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn class PSNRLoss(nn.Module): def __init__(self): super(PSNRLoss, self).__init__() self.criterion = nn.MSELoss(size_average=True) def __repr__(self): return 'PSNR' def forward(self, output, target): mse = self.criterion(output, target) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_...
nthuy190991/geoseg
PSNRLoss
false
7,356
[ "MIT" ]
1
b679af5dc558720df36dddc7abfd4e6ecb46d7de
https://github.com/nthuy190991/geoseg/tree/b679af5dc558720df36dddc7abfd4e6ecb46d7de
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() self.criterion = nn.MSELoss(size_average=True) def __repr__(self): return 'PSNR' def forward(self, output, target): mse = self.criterion(output, target) loss = 10 * t...
CELoss
# 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 CELoss(nn.Module): def __init__(self): super(CELoss, self).__init__() self.criterionBinary = nn.BCELoss(size_average=True) self.criterionMulti = nn.NLLLoss(size_average=True) def __repr__(self): return 'CE' def forward(self, output...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_...
nthuy190991/geoseg
CELoss
false
7,357
[ "MIT" ]
1
b679af5dc558720df36dddc7abfd4e6ecb46d7de
https://github.com/nthuy190991/geoseg/tree/b679af5dc558720df36dddc7abfd4e6ecb46d7de
import torch from torch import nn class Model(nn.Module): def __init__(self): super().__init__() self.criterionBinary = nn.BCELoss(size_average=True) self.criterionMulti = nn.NLLLoss(size_average=True) def __repr__(self): return 'CE' def forward(self, output, target): ...
RatioModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 class RatioModel(torch.nn.Module): def __init__(self, D_in, hidden_unit_num): super().__init__() None self.l1 = torch.nn.Linear(D_in, hidden_unit_num) self.l2 = torch.nn.Linear(hidden_unit_num, hidden_unit_num) self.l3 = torch.n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math as...
numahha/wmopo
RatioModel
false
7,358
[ "MIT" ]
1
1557dab2e8168c1f2e53ffbc435b4000680f1d28
https://github.com/numahha/wmopo/tree/1557dab2e8168c1f2e53ffbc435b4000680f1d28
import torch import torch.nn.functional as F class Model(torch.nn.Module): def __init__(self, D_in, hidden_unit_num): super().__init__() None self.l1 = torch.nn.Linear(D_in, hidden_unit_num) self.l2 = torch.nn.Linear(hidden_unit_num, hidden_unit_num) self.l3 = torch.nn.Lin...
SchedulerTestNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 as nn from torch.nn import functional as F from torch import optim as optim class SchedulerTestNet(torch.nn.Module): """ adapted from: https://github.com/pytorch/pytorch/blob/master/test/test_optim.py """ def __init__(self): super(SchedulerTestNet, self).__in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn as nn fr...
oke-aditya/pytorch-lightning-bolts
SchedulerTestNet
false
7,359
[ "Apache-2.0" ]
1
268df20bb442e7385b709b1488d37fd2767aba3c
https://github.com/oke-aditya/pytorch-lightning-bolts/tree/268df20bb442e7385b709b1488d37fd2767aba3c
import torch from torch import nn as nn from torch.nn import functional as F from torch import optim as optim class Model(torch.nn.Module): """ adapted from: https://github.com/pytorch/pytorch/blob/master/test/test_optim.py """ def __init__(self): super().__init__() self.conv1 = torch...
DynamicsModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 DynamicsModel(torch.nn.Module): def __init__(self, D_in, D_out, hidden_unit_num): None super(DynamicsModel, self).__init__() self.l1 = torch.nn.Linear(D_in, hidden_unit_num) self.l2 = torch.nn.Linear(hidden_unit_num, D_out) self.logvar = torch.nn.Paramet...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
numahha/wmopo
DynamicsModel
false
7,360
[ "MIT" ]
1
1557dab2e8168c1f2e53ffbc435b4000680f1d28
https://github.com/numahha/wmopo/tree/1557dab2e8168c1f2e53ffbc435b4000680f1d28
import torch class Model(torch.nn.Module): def __init__(self, D_in, D_out, hidden_unit_num): None super().__init__() self.l1 = torch.nn.Linear(D_in, hidden_unit_num) self.l2 = torch.nn.Linear(hidden_unit_num, D_out) self.logvar = torch.nn.Parameter(torch.zeros(D_out), requ...
MultipleInputModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 as nn from torch import optim as optim class TemplateModel(nn.Module): def __init__(self, mix_data=False): """ Base model for testing. The setting ``mix_data=True`` simulates a wrong implementation. """ super().__init__() self.mix_data = mix_data ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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 from torch import optim as optim assert_size_stride =...
oke-aditya/pytorch-lightning-bolts
MultipleInputModel
false
7,361
[ "Apache-2.0" ]
1
268df20bb442e7385b709b1488d37fd2767aba3c
https://github.com/oke-aditya/pytorch-lightning-bolts/tree/268df20bb442e7385b709b1488d37fd2767aba3c
import torch from torch import nn as nn from torch import optim as optim class TemplateModel(nn.Module): def __init__(self, mix_data=False): """ Base model for testing. The setting ``mix_data=True`` simulates a wrong implementation. """ super().__init__() self.mix_data = mix_data ...
FakeRKHSConvNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 numpy as np from torch import nn as nn from torch import optim as optim class MaybeBatchNorm2d(nn.Module): def __init__(self, n_ftr, affine, use_bn): super(MaybeBatchNorm2d, self).__init__() self.bn = nn.BatchNorm2d(n_ftr, affine=affine) self.use_bn = use_b...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
oke-aditya/pytorch-lightning-bolts
FakeRKHSConvNet
false
7,362
[ "Apache-2.0" ]
1
268df20bb442e7385b709b1488d37fd2767aba3c
https://github.com/oke-aditya/pytorch-lightning-bolts/tree/268df20bb442e7385b709b1488d37fd2767aba3c
import math import torch import numpy as np from torch import nn as nn from torch import optim as optim class MaybeBatchNorm2d(nn.Module): def __init__(self, n_ftr, affine, use_bn): super().__init__() self.bn = nn.BatchNorm2d(n_ftr, affine=affine) self.use_bn = use_bn def forward(sel...
AgentA2C
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 AgentA2C(nn.Module): def __init__(self, state_shape, n_actions): super().__init__() self.name = 'a2c' self.n_actions = n_actions self.state_shape = state_shape self.hidden1 = nn.Linear(self.state_shape, 100) self.act1 = nn.R...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
onimaru/Reinforcement_Learning
AgentA2C
false
7,363
[ "MIT" ]
1
4c45b51a095cb0cb3c18f6a1542befdcab8a58a4
https://github.com/onimaru/Reinforcement_Learning/tree/4c45b51a095cb0cb3c18f6a1542befdcab8a58a4
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, state_shape, n_actions): super().__init__() self.name = 'a2c' self.n_actions = n_actions self.state_shape = state_shape self.hidden1 = nn.Linear(self.state_shape, 100) self.act1 = nn.ReLU...
VishalNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 VishalNet(nn.Module): def __init__(self): super(VishalNet, self).__init__() self.cnn1 = nn.Conv1d(1, 60, 81, 1, 40) self.cnn2 = nn.Conv1d(60, 1, 301, 1, 150) def forward(self, input): out1 = nn.functional.relu(self.cnn1(input)) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
olivesgatech/Geophysics-2021-Joint-learning-for-spatial-context-based-inversion
VishalNet
false
7,364
[ "MIT" ]
1
56f506dfe62ac3557febb4c8e3c62542b1624a1b
https://github.com/olivesgatech/Geophysics-2021-Joint-learning-for-spatial-context-based-inversion/tree/56f506dfe62ac3557febb4c8e3c62542b1624a1b
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.cnn1 = nn.Conv1d(1, 60, 81, 1, 40) self.cnn2 = nn.Conv1d(60, 1, 301, 1, 150) def forward(self, input): out1 = nn.functional.relu(self.cnn1(input)) out2 = self.cnn2(o...
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 from torch import nn class L2Norm(nn.Module): def forward(self, x, eps=1e-06): norm = x.norm(dim=1, keepdim=True).clamp(min=eps) return x / norm def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_...
onlyrico/vit-pytorch
L2Norm
false
7,365
[ "MIT" ]
1
e52ac4195550faa9c3372533d325bf649f7354ad
https://github.com/onlyrico/vit-pytorch/tree/e52ac4195550faa9c3372533d325bf649f7354ad
import torch from torch import nn class Model(nn.Module): def forward(self, x, eps=1e-06): norm = x.norm(dim=1, keepdim=True).clamp(min=eps) return x / norm def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
AgentReinforce
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 AgentReinforce(nn.Module): def __init__(self, state_shape, n_actions): super().__init__() self.name = 'reinforce' self.n_actions = n_actions self.state_shape = state_shape self.hidden1 = nn.Linear(self.state_shape, 100) self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
onimaru/Reinforcement_Learning
AgentReinforce
false
7,366
[ "MIT" ]
1
4c45b51a095cb0cb3c18f6a1542befdcab8a58a4
https://github.com/onimaru/Reinforcement_Learning/tree/4c45b51a095cb0cb3c18f6a1542befdcab8a58a4
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, state_shape, n_actions): super().__init__() self.name = 'reinforce' self.n_actions = n_actions self.state_shape = state_shape self.hidden1 = nn.Linear(self.state_shape, 100) self.act1 = n...
AmdimNCELoss
# 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 from torch import optim as optim def tanh_clip(x, clip_val=10.0): """ soft clip values to the range [-clip_val, +clip_val] """ if clip_val is not None: x_clip = clip_val * torch.tanh(1.0 / clip_val * x) else: x_clip = x return x_clip cl...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
oke-aditya/pytorch-lightning-bolts
AmdimNCELoss
false
7,367
[ "Apache-2.0" ]
1
268df20bb442e7385b709b1488d37fd2767aba3c
https://github.com/oke-aditya/pytorch-lightning-bolts/tree/268df20bb442e7385b709b1488d37fd2767aba3c
import torch from torch import nn as nn from torch import optim as optim def tanh_clip(x, clip_val=10.0): """ soft clip values to the range [-clip_val, +clip_val] """ if clip_val is not None: x_clip = clip_val * torch.tanh(1.0 / clip_val * x) else: x_clip = x return x_clip cl...
ConditionTime
# 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 def condition_time(x, i=0, size=(12, 16), seq_len=15): """create one hot encoded time image-layers, i in [1, seq_len]""" assert i < seq_len times = torch.eye(seq_len, dtype=x.dtype, device=x.device)[i].unsqueeze(-1 ).unsqueeze(-1) ones = torch.ones(1, *s...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._emp...
openclimatefix/MetNet
ConditionTime
false
7,368
[ "MIT" ]
1
06eed550e93da6325641958b0d36c15adde1d928
https://github.com/openclimatefix/MetNet/tree/06eed550e93da6325641958b0d36c15adde1d928
import torch from torch import nn as nn def condition_time(x, i=0, size=(12, 16), seq_len=15): """create one hot encoded time image-layers, i in [1, seq_len]""" assert i < seq_len times = torch.eye(seq_len, dtype=x.dtype, device=x.device)[i].unsqueeze(-1 ).unsqueeze(-1) ones = torch.ones(1, *s...
_ImpalaBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 _ImpalaResBlock(nn.Module): def __init__(self, n_channels: 'int'): super().__init__() self.n_channels = n_channels kernel_size = 3 padding = 1 self.relu = nn.ReLU() self.relu_inplace = nn.ReLU() self.conv1 = nn.Conv2d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
nrfulton/vsrl-framework
_ImpalaBlock
false
7,369
[ "MIT" ]
1
c778824b3285e3e994a4c5846c7b1c2ac03c669b
https://github.com/nrfulton/vsrl-framework/tree/c778824b3285e3e994a4c5846c7b1c2ac03c669b
import torch from torch import nn class _ImpalaResBlock(nn.Module): def __init__(self, n_channels: 'int'): super().__init__() self.n_channels = n_channels kernel_size = 3 padding = 1 self.relu = nn.ReLU() self.relu_inplace = nn.ReLU() self.conv1 = nn.Conv2d...
MILLR
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np from torch import nn import torch as tc from sklearn.metrics import * from torch.utils.data import DataLoader from torch.utils.data import WeightedRandomSampler class myDataset(torch.utils.data.Dataset): def __init__(self, x, y): self.x = x self.y = y def __le...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np from torch...
mhbl3/PrecursorAnalysis
MILLR
false
7,370
[ "MIT" ]
1
aaa2fe0219ad579b9126fef9cc8594a59ae66815
https://github.com/mhbl3/PrecursorAnalysis/tree/aaa2fe0219ad579b9126fef9cc8594a59ae66815
import torch import numpy as np from torch import nn import torch as tc from sklearn.metrics import * from torch.utils.data import DataLoader from torch.utils.data import WeightedRandomSampler class myDataset(torch.utils.data.Dataset): def __init__(self, x, y): self.x = x self.y = y def __le...
PEG
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 Residual(nn.Module): def __init__(self, fn): super().__init__() self.fn = fn def forward(self, x, **kwargs): return self.fn(x, **kwargs) + x class PEG(nn.Module): def __init__(self, dim, kernel_size=3): 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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
onlyrico/vit-pytorch
PEG
false
7,371
[ "MIT" ]
1
e52ac4195550faa9c3372533d325bf649f7354ad
https://github.com/onlyrico/vit-pytorch/tree/e52ac4195550faa9c3372533d325bf649f7354ad
import torch from torch import nn class Residual(nn.Module): def __init__(self, fn): super().__init__() self.fn = fn def forward(self, x, **kwargs): return self.fn(x, **kwargs) + x class Model(nn.Module): def __init__(self, dim, kernel_size=3): super().__init__() ...
SpatialGather_Module
# 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 torchvision.transforms import functional as F import torch.nn as nn import torch.nn.functional as F class SpatialGather_Module(nn.Module): """ Aggregate the context features according to the initial predicted probability distribution. Employ the soft-weighted method to aggregate ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
openseg-group/panoptic-deeplab
SpatialGather_Module
false
7,372
[ "Apache-2.0" ]
1
818887597e75af77ba32185eb67d8aeac47b54fe
https://github.com/openseg-group/panoptic-deeplab/tree/818887597e75af77ba32185eb67d8aeac47b54fe
import torch from torchvision.transforms import functional as F import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Aggregate the context features according to the initial predicted probability distribution. Employ the soft-weighted method to aggregate the context. ...
Qux
# 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.jit import torch.onnx import torch.nn class Qux(torch.nn.Module): def __init__(self, x): super(Qux, self).__init__() self.x = x def forward(self, a, b): return a - b - self.x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
Qux
false
7,373
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, x): super().__init__() self.x = x def forward(self, a, b): return a - b - self.x def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def ...
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 numpy as np from torch import nn as nn from torch.nn import functional as F from torch import optim as optim class Discriminator(nn.Module): def __init__(self, img_shape, hidden_dim=1024): super().__init__() in_dim = int(np.prod(img_shape)) self.fc1 = nn.Linear(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 import numpy as np from torch import nn as nn from torch import optim as optim a...
oke-aditya/pytorch-lightning-bolts
Discriminator
false
7,374
[ "Apache-2.0" ]
1
268df20bb442e7385b709b1488d37fd2767aba3c
https://github.com/oke-aditya/pytorch-lightning-bolts/tree/268df20bb442e7385b709b1488d37fd2767aba3c
import torch import numpy as np from torch import nn as nn from torch.nn import functional as F from torch import optim as optim class Model(nn.Module): def __init__(self, img_shape, hidden_dim=1024): super().__init__() in_dim = int(np.prod(img_shape)) self.fc1 = nn.Linear(in_dim, hidden_...
ResBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class CausalConv1d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, dilation=1, bias=False): super(CausalConv1d, self).__init__() self.padding = padding = (kernel_size - 1) * dilation self.conv = nn.Conv1d(in_channels, out_ch...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
oleges1/TTS
ResBlock
false
7,375
[ "MIT" ]
1
19b389714078729fae29faf9c23112bdbe4c8dec
https://github.com/oleges1/TTS/tree/19b389714078729fae29faf9c23112bdbe4c8dec
import torch from torch import nn class CausalConv1d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, dilation=1, bias=False): super().__init__() self.padding = padding = (kernel_size - 1) * dilation self.conv = nn.Conv1d(in_channels, out_channels, kernel_siz...
RepeatModule
# 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.jit import torch.onnx import torch.nn class RepeatModule(torch.nn.Module): def __init__(self, repeats): super(RepeatModule, self).__init__() self.repeats = repeats def forward(self, tensor): tensor = tensor + tensor return tensor.repeat(self.repeats)...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
RepeatModule
false
7,376
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, repeats): super().__init__() self.repeats = repeats def forward(self, tensor): tensor = tensor + tensor return tensor.repeat(self.repeats) def get_inputs(): ...
Grounding
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch as th from torchvision.ops.boxes import * from torchvision.transforms.functional import * class Grounding(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 import torch.nn as nn import torch.nn.parallel import torch.optim import torch.u...
necla-ml/ML-Vision
Grounding
false
7,377
[ "BSD-3-Clause" ]
1
66229b29fc0f67c75dbe6304cdb8c5e93fe0bacf
https://github.com/necla-ml/ML-Vision/tree/66229b29fc0f67c75dbe6304cdb8c5e93fe0bacf
from _paritybench_helpers import _mock_config import math import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch as th from torchvision.ops.boxes import * from torchvision.transforms.functional import * class Model(nn.Mod...
SimpleASinModule
# 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.jit import torch.onnx import torch.nn class SimpleASinModule(torch.nn.Module): def __init__(self): super(SimpleASinModule, self).__init__() def forward(self, a): return torch.asin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
opti-mix/glow
SimpleASinModule
false
7,378
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.asin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleAvgPool1dModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleAvgPool1dModule(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0): super(SimpleAvgPool1dModule, self).__init__() self.kernel_size = kernel_size self.padding ...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleAvgPool1dModule
false
7,379
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0): super().__init__() self.kernel_size = kernel_size self.padding = padding self.stride = stride ...
MixtureDensityHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 from torch.autograd import Variable from torch.distributions import Categorical class MixtureDensityHead(nn.Module): def __init__(self, config: 'DictConfig', **kwargs): self.hparams = config 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.triton_helpers import libdevice import torch.nn as ...
Actis92/pytorch_tabular
MixtureDensityHead
false
7,380
[ "MIT" ]
1
78dabf5e7b97d8ff24db4bc83d9d0a2273941bbe
https://github.com/Actis92/pytorch_tabular/tree/78dabf5e7b97d8ff24db4bc83d9d0a2273941bbe
from _paritybench_helpers import _mock_config import torch import torch.nn as nn from torch.autograd import Variable from torch.distributions import Categorical class Model(nn.Module): def __init__(self, config: 'DictConfig', **kwargs): self.hparams = config super().__init__() self._build...
SimpleACosModule
# 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.jit import torch.onnx import torch.nn class SimpleACosModule(torch.nn.Module): def __init__(self): super(SimpleACosModule, self).__init__() def forward(self, a): return torch.acos(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
opti-mix/glow
SimpleACosModule
false
7,381
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.acos(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleATanModule
# 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.jit import torch.onnx import torch.nn class SimpleATanModule(torch.nn.Module): def __init__(self): super(SimpleATanModule, self).__init__() def forward(self, a): return torch.atan(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
opti-mix/glow
SimpleATanModule
false
7,382
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.atan(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleAddMmModule
# 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.jit import torch.onnx import torch.nn class SimpleAddMmModule(torch.nn.Module): def __init__(self, alpha=1, beta=1): super(SimpleAddMmModule, self).__init__() self.alpha = alpha self.beta = beta def forward(self, a, b, c): return (a + a).addmm(b, c) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
opti-mix/glow
SimpleAddMmModule
false
7,383
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, alpha=1, beta=1): super().__init__() self.alpha = alpha self.beta = beta def forward(self, a, b, c): return (a + a).addmm(b, c) def get_inputs(): return [tor...
SimpleAbsModule
# 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.jit import torch.onnx import torch.nn class SimpleAbsModule(torch.nn.Module): def __init__(self): super(SimpleAbsModule, self).__init__() def forward(self, a): return torch.abs(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
opti-mix/glow
SimpleAbsModule
false
7,384
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.abs(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleCeilModule
# 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.jit import torch.onnx import torch.nn class SimpleCeilModule(torch.nn.Module): def forward(self, a, b): c = a + b return torch.ceil(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
opti-mix/glow
SimpleCeilModule
false
7,385
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, a, b): c = a + b return torch.ceil(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
OneTupleModule
# 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.jit import torch.onnx import torch.nn class OneTupleModule(torch.nn.Module): def __init__(self): super(OneTupleModule, self).__init__() def forward(self, x): y = 2 * x return y, def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
OneTupleModule
false
7,386
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): y = 2 * x return y, def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleBmmModule
# 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.jit import torch.onnx import torch.nn class SimpleBmmModule(torch.nn.Module): def forward(self, a, b): return (a + a).bmm(b) def get_inputs(): return [torch.rand([4, 4, 4]), torch.rand([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 import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
opti-mix/glow
SimpleBmmModule
false
7,387
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, a, b): return (a + a).bmm(b) def get_inputs(): return [torch.rand([4, 4, 4]), torch.rand([4, 4, 4])] def get_init_inputs(): return []
ConvGRUCell
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 as nn import torch.nn.functional as F def one_param(m): """First parameter in `m`""" return next(m.parameters()) class ConvGRUCell(nn.Module): def __init__(self, input_dim, hidden_dim, kernel_size=(3, 3), bias=True, activation=F.tanh, batchnorm=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 from torch import n...
openclimatefix/MetNet
ConvGRUCell
false
7,388
[ "MIT" ]
1
06eed550e93da6325641958b0d36c15adde1d928
https://github.com/openclimatefix/MetNet/tree/06eed550e93da6325641958b0d36c15adde1d928
import torch from torch import nn as nn import torch.nn.functional as F def one_param(m): """First parameter in `m`""" return next(m.parameters()) class Model(nn.Module): def __init__(self, input_dim, hidden_dim, kernel_size=(3, 3), bias=True, activation=F.tanh, batchnorm=False): """ ...
SimpleAndModule
# 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.jit import torch.onnx import torch.nn class SimpleAndModule(torch.nn.Module): def __init__(self): super(SimpleAndModule, self).__init__() def forward(self, a, b): c = torch.logical_and(a, b) return torch.logical_and(c, c) def get_inputs(): return [torc...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleAndModule
false
7,389
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): c = torch.logical_and(a, b) return torch.logical_and(c, c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.ran...
SimpleClampMinModel
# 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.jit import torch.onnx import torch.nn class SimpleClampMinModel(torch.nn.Module): def __init__(self, min): super(SimpleClampMinModel, self).__init__() self.min = min def forward(self, input): return torch.clamp_min(input, self.min) def get_inputs(): 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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
opti-mix/glow
SimpleClampMinModel
false
7,390
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, min): super().__init__() self.min = min def forward(self, input): return torch.clamp_min(input, self.min) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def g...
EnsembleModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 numpy as np import torch.nn.functional as F def truncated_standardized_normal(shape, a=-2.0, b=2.0): a = torch.Tensor([a]) b = torch.Tensor([b]) U = torch.distributions.uniform.Uniform(0, 1) u = U.sample(shape) Fa = 0.5 * (1 + torch.erf(a / math.sqrt(2))) Fb = 0...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math im...
numahha/wmopo
EnsembleModel
false
7,391
[ "MIT" ]
1
1557dab2e8168c1f2e53ffbc435b4000680f1d28
https://github.com/numahha/wmopo/tree/1557dab2e8168c1f2e53ffbc435b4000680f1d28
import math import torch import numpy as np import torch.nn.functional as F def truncated_standardized_normal(shape, a=-2.0, b=2.0): a = torch.Tensor([a]) b = torch.Tensor([b]) U = torch.distributions.uniform.Uniform(0, 1) u = U.sample(shape) Fa = 0.5 * (1 + torch.erf(a / math.sqrt(2))) Fb = 0...
SimpleClampModel
# 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.jit import torch.onnx import torch.nn class SimpleClampModel(torch.nn.Module): def __init__(self, min, max): super(SimpleClampModel, self).__init__() self.min = min self.max = max def forward(self, input): return torch.clamp(input, self.min, self.max...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
opti-mix/glow
SimpleClampModel
false
7,392
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, min, max): super().__init__() self.min = min self.max = max def forward(self, input): return torch.clamp(input, self.min, self.max) def get_inputs(): return ...
SimpleExpModule
# 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.jit import torch.onnx import torch.nn class SimpleExpModule(torch.nn.Module): def forward(self, input): other = torch.exp(input) return torch.exp(other) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
opti-mix/glow
SimpleExpModule
false
7,393
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, input): other = torch.exp(input) return torch.exp(other) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleGeluModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleGeluModule(torch.nn.Module): def forward(self, tensor): return F.gelu(tensor + tensor) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
opti-mix/glow
SimpleGeluModule
false
7,394
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, tensor): return F.gelu(tensor + tensor) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleCosModule
# 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.jit import torch.onnx import torch.nn class SimpleCosModule(torch.nn.Module): def __init__(self): super(SimpleCosModule, self).__init__() def forward(self, a): return torch.cos(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
opti-mix/glow
SimpleCosModule
false
7,395
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.cos(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleMaxModule
# 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.jit import torch.onnx import torch.nn class SimpleMaxModule(torch.nn.Module): def __init__(self): super(SimpleMaxModule, self).__init__() def forward(self, a, b): return torch.max(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
opti-mix/glow
SimpleMaxModule
false
7,396
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): return torch.max(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inpu...
SimpleFloorModule
# 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.jit import torch.onnx import torch.nn class SimpleFloorModule(torch.nn.Module): def forward(self, a, b): c = a + b return torch.floor(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
opti-mix/glow
SimpleFloorModule
false
7,397
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, a, b): c = a + b return torch.floor(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleConv2dModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleConv2dModule(torch.nn.Module): def __init__(self, stride=1, padding=0, dilation=1, groups=1): super(SimpleConv2dModule, self).__init__() self.stride = stride self.padding = 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 import torch.jit import torch...
opti-mix/glow
SimpleConv2dModule
false
7,398
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, stride=1, padding=0, dilation=1, groups=1): super().__init__() self.stride = stride self.padding = padding self.dilation = dilation ...
SimpleConvTranspose2dModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleConvTranspose2dModule(torch.nn.Module): def __init__(self, stride=1, padding=0, output_padding=0, dilation=1, groups=1): super(SimpleConvTranspose2dModule, self).__init__() self.str...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch...
opti-mix/glow
SimpleConvTranspose2dModule
false
7,399
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, stride=1, padding=0, output_padding=0, dilation=1, groups=1): super().__init__() self.stride = stride self.padding = padding sel...
SimpleCumSumModule
# 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.jit import torch.onnx import torch.nn class SimpleCumSumModule(torch.nn.Module): def __init__(self, dim): super(SimpleCumSumModule, self).__init__() self.dim = dim def forward(self, tensor): return torch.cumsum(tensor, self.dim) def get_inputs(): retur...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleCumSumModule
false
7,400
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dim): super().__init__() self.dim = dim def forward(self, tensor): return torch.cumsum(tensor, self.dim) def get_inputs(): return [torch.rand([4, 4, 4, 4, 4])] def...
SimpleLogModule
# 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.jit import torch.onnx import torch.nn class SimpleLogModule(torch.nn.Module): def __init__(self, *dimensions): super(SimpleLogModule, self).__init__() def forward(self, a): b = torch.log(a) return torch.log(b) def get_inputs(): return [torch.rand([4, 4...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
opti-mix/glow
SimpleLogModule
false
7,401
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, *dimensions): super().__init__() def forward(self, a): b = torch.log(a) return torch.log(b) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
SimpleFmodModule
# 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.jit import torch.onnx import torch.nn class SimpleFmodModule(torch.nn.Module): def __init__(self): super(SimpleFmodModule, self).__init__() def forward(self, a, b): if b.size() == torch.Size([]): c = a.fmod(b.item()) else: c = a.fmod(...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._...
opti-mix/glow
SimpleFmodModule
false
7,402
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): if b.size() == torch.Size([]): c = a.fmod(b.item()) else: c = a.fmod(b) return c.fmod(1.0) d...
Foo
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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.jit import torch.onnx import torch.nn class Foo(torch.nn.Module): def __init__(self): super(Foo, self).__init__() self.conv1 = torch.nn.Conv2d(3, 6, 3) self.relu = torch.nn.ReLU() self.conv2 = torch.nn.Conv2d(6, 16, 3) def forward(self, x): x...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch...
opti-mix/glow
Foo
false
7,403
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = torch.nn.Conv2d(3, 6, 3) self.relu = torch.nn.ReLU() self.conv2 = torch.nn.Conv2d(6, 16, 3) def forward(self, x): x = self...
SimpleNotModule
# 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.jit import torch.onnx import torch.nn class SimpleNotModule(torch.nn.Module): def __init__(self): super(SimpleNotModule, self).__init__() def forward(self, a): b = torch.logical_not(a) return torch.logical_not(b) def get_inputs(): return [torch.rand([4...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleNotModule
false
7,404
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): b = torch.logical_not(a) return torch.logical_not(b) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inp...
SimpleMatmulModule
# 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.jit import torch.onnx import torch.nn class SimpleMatmulModule(torch.nn.Module): def __init__(self): super(SimpleMatmulModule, self).__init__() def forward(self, a, b): return a.matmul(b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4...
import torch from torch._inductor.select_algorithm import extern_kernels import 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.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
opti-mix/glow
SimpleMatmulModule
false
7,405
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): return a.matmul(b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): ...
SimpleLinearModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleLinearModule(torch.nn.Module): def __init__(self): super(SimpleLinearModule, self).__init__() def forward(self, input, weight, bias=None): return F.linear(input + input, weight, bias) ...
import torch from torch._inductor.select_algorithm import extern_kernels import 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.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
opti-mix/glow
SimpleLinearModule
false
7,406
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, input, weight, bias=None): return F.linear(input + input, weight, bias) def get_inputs(): return [torch...
SimpleOrModule
# 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.jit import torch.onnx import torch.nn class SimpleOrModule(torch.nn.Module): def __init__(self): super(SimpleOrModule, self).__init__() def forward(self, a, b): c = torch.logical_or(a, b) return torch.logical_or(c, c) def get_inputs(): return [torch.ra...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleOrModule
false
7,407
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): c = torch.logical_or(a, b) return torch.logical_or(c, c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand(...
SimpleMulModule
# 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.jit import torch.onnx import torch.nn class SimpleMulModule(torch.nn.Module): def __init__(self): super(SimpleMulModule, self).__init__() def forward(self, left, right): other = left.mul(right.item() if right.size() == torch.Size([]) else right) ...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleMulModule
false
7,408
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, left, right): other = left.mul(right.item() if right.size() == torch.Size([]) else right) return other.mul(other) def g...
SimpleMinModule
# 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.jit import torch.onnx import torch.nn class SimpleMinModule(torch.nn.Module): def __init__(self): super(SimpleMinModule, self).__init__() def forward(self, a, b): return torch.min(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
opti-mix/glow
SimpleMinModule
false
7,409
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): return torch.min(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inpu...
SimpleReciprocalModel
# 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.jit import torch.onnx import torch.nn class SimpleReciprocalModel(torch.nn.Module): def __init__(self, inplace=False): super(SimpleReciprocalModel, self).__init__() self.inplace = inplace def forward(self, tensor): other = tensor + tensor return othe...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleReciprocalModel
false
7,410
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, inplace=False): super().__init__() self.inplace = inplace def forward(self, tensor): other = tensor + tensor return other.reciprocal_() if self.inplace else torch....
SimpleReluModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleReluModel(torch.nn.Module): def __init__(self, inplace=False): super(SimpleReluModel, self).__init__() self.inplace = inplace def forward(self, tensor): other = F.relu(tensor, ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
opti-mix/glow
SimpleReluModel
false
7,411
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, inplace=False): super().__init__() self.inplace = inplace def forward(self, tensor): other = F.relu(tensor, inplace=self.inplace) r...
SimpleTypeasModel
# 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.jit import torch.onnx import torch.nn class SimpleTypeasModel(torch.nn.Module): def __init__(self): super(SimpleTypeasModel, self).__init__() def forward(self, tensor, other=None): other = tensor if other is None else other if tensor.dtype != torch.bool: ...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleTypeasModel
false
7,412
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, tensor, other=None): other = tensor if other is None else other if tensor.dtype != torch.bool: tensor = tensor + tensor ...
SimpleLogSoftmaxModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleLogSoftmaxModel(torch.nn.Module): def __init__(self, dimension): super(SimpleLogSoftmaxModel, self).__init__() self.dimension = dimension def forward(self, tensor): return F.lo...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit impor...
opti-mix/glow
SimpleLogSoftmaxModel
false
7,413
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dimension): super().__init__() self.dimension = dimension def forward(self, tensor): return F.log_softmax(tensor, self.dimension) def get...
SimpleReshapeModel
# 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.jit import torch.onnx import torch.nn class SimpleReshapeModel(torch.nn.Module): def __init__(self, shape): super(SimpleReshapeModel, self).__init__() self.shape = shape def forward(self, tensor): combined = tensor + tensor return combined.reshape(se...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleReshapeModel
false
7,414
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, shape): super().__init__() self.shape = shape def forward(self, tensor): combined = tensor + tensor return combined.reshape(self.shape) def get_inputs(): ret...
SimpleSumModule
# 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.jit import torch.onnx import torch.nn class SimpleSumModule(torch.nn.Module): def __init__(self, dtype=None): super(SimpleSumModule, self).__init__() self.dtype = dtype def forward(self, a): b = a + a return torch.sum(b, dtype=self.dtype) def get_i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
opti-mix/glow
SimpleSumModule
false
7,415
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dtype=None): super().__init__() self.dtype = dtype def forward(self, a): b = a + a return torch.sum(b, dtype=self.dtype) def get_inputs(): return [torch.rand...
SimpleXorModule
# 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.jit import torch.onnx import torch.nn class SimpleXorModule(torch.nn.Module): def __init__(self): super(SimpleXorModule, self).__init__() def forward(self, a, b): c = torch.logical_xor(a, b) return torch.logical_xor(c, c) def get_inputs(): return [torc...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleXorModule
false
7,416
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): c = torch.logical_xor(a, b) return torch.logical_xor(c, c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.ran...
SimplePowModule
# 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.jit import torch.onnx import torch.nn class SimplePowModule(torch.nn.Module): def __init__(self, power): super(SimplePowModule, self).__init__() self.power = power def forward(self, tensor): return torch.pow(tensor, self.power) def get_inputs(): return...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimplePowModule
false
7,417
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, power): super().__init__() self.power = power def forward(self, tensor): return torch.pow(tensor, self.power) def get_inputs(): return [torch.rand([4, 4, 4, 4])] d...
SimpleSinModule
# 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.jit import torch.onnx import torch.nn class SimpleSinModule(torch.nn.Module): def __init__(self): super(SimpleSinModule, self).__init__() def forward(self, a): return torch.sin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
opti-mix/glow
SimpleSinModule
false
7,418
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.sin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleStackModel
# 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.jit import torch.onnx import torch.nn class SimpleStackModel(torch.nn.Module): def __init__(self, dim): super(SimpleStackModel, self).__init__() self.dim = dim def forward(self, a, b): c = b + b return torch.stack((a, c), dim=self.dim) def get_inpu...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
opti-mix/glow
SimpleStackModel
false
7,419
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dim): super().__init__() self.dim = dim def forward(self, a, b): c = b + b return torch.stack((a, c), dim=self.dim) def get_inputs(): return [torch.rand([4, ...
SimpleTanhModel
# 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.jit import torch.onnx import torch.nn class SimpleTanhModel(torch.nn.Module): def __init__(self, inplace=False): super(SimpleTanhModel, self).__init__() self.inplace = inplace def forward(self, tensor): tensor = tensor + tensor return tensor.tanh_() ...
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.jit import torch.onnx import torch.nn assert_size_stride = torch._...
opti-mix/glow
SimpleTanhModel
false
7,420
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, inplace=False): super().__init__() self.inplace = inplace def forward(self, tensor): tensor = tensor + tensor return tensor.tanh_() if self.inplace else tensor.tan...
SimpleSoftmaxModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class SimpleSoftmaxModel(torch.nn.Module): def __init__(self, dimension): super(SimpleSoftmaxModel, self).__init__() self.dimension = dimension def forward(self, tensor): return F.softmax(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit impor...
opti-mix/glow
SimpleSoftmaxModel
false
7,421
[ "Apache-2.0" ]
1
4ba074df5da9822986a23a6679ab592c22660f6d
https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d
import torch import torch.nn.functional as F import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dimension): super().__init__() self.dimension = dimension def forward(self, tensor): return F.softmax(tensor, self.dimension) def get_inp...
HardKumaBinarizer
# 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.optim def kuma_reparametrization(a, b): u = torch.rand_like(a) k = (1 - (1 - u) ** (1 / (b + 1e-08))) ** (1 / (a + 1e-08)) return k class Rectifier(nn.Module): def __init__(self, l=-0.1, r=1.1): super().__init__() self.l = l se...
import torch from torch import device import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, ma...
ovechkinVT/SkipRNN
HardKumaBinarizer
false
7,422
[ "MIT" ]
1
7c1f37349d464b1b6bf8835520abad22b199f1ad
https://github.com/ovechkinVT/SkipRNN/tree/7c1f37349d464b1b6bf8835520abad22b199f1ad
import torch import torch.nn as nn import torch.optim def kuma_reparametrization(a, b): u = torch.rand_like(a) k = (1 - (1 - u) ** (1 / (b + 1e-08))) ** (1 / (a + 1e-08)) return k class Rectifier(nn.Module): def __init__(self, l=-0.1, r=1.1): super().__init__() self.l = l se...
L1Loss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn from torch import torch class L1Loss(nn.Module): def __init__(self): super().__init__() def forward(self, Yp, Yt): num = Yt.size(0) Yp = Yp.view(num, -1) Yt = Yt.view(num, -1) loss = nn.functional.l1_loss(Yp, Yt) return loss ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn f...
oskarnatan/RGBDVS-fusion
L1Loss
false
7,423
[ "MIT" ]
1
5e560f54442d387a86e3a469107cf65859693987
https://github.com/oskarnatan/RGBDVS-fusion/tree/5e560f54442d387a86e3a469107cf65859693987
import torch from torch import nn from torch import torch class Model(nn.Module): def __init__(self): super().__init__() def forward(self, Yp, Yt): num = Yt.size(0) Yp = Yp.view(num, -1) Yt = Yt.view(num, -1) loss = nn.functional.l1_loss(Yp, Yt) return loss ...
HuberLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn from torch import torch class HuberLoss(nn.Module): def __init__(self): super().__init__() def forward(self, Yp, Yt): num = Yt.size(0) Yp = Yp.view(num, -1) Yt = Yt.view(num, -1) loss = nn.functional.smooth_l1_loss(Yp, Yt, beta=0.5) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn f...
oskarnatan/RGBDVS-fusion
HuberLoss
false
7,424
[ "MIT" ]
1
5e560f54442d387a86e3a469107cf65859693987
https://github.com/oskarnatan/RGBDVS-fusion/tree/5e560f54442d387a86e3a469107cf65859693987
import torch from torch import nn from torch import torch class Model(nn.Module): def __init__(self): super().__init__() def forward(self, Yp, Yt): num = Yt.size(0) Yp = Yp.view(num, -1) Yt = Yt.view(num, -1) loss = nn.functional.smooth_l1_loss(Yp, Yt, beta=0.5) ...
BCEDiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn from torch import torch class BCEDiceLoss(nn.Module): def __init__(self): super().__init__() def forward(self, Yp, Yt, smooth=1e-07): num = Yt.size(0) Yp = Yp.view(num, -1) Yt = Yt.view(num, -1) bce = nn.functional.binary_cross_entrop...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
oskarnatan/RGBDVS-fusion
BCEDiceLoss
false
7,425
[ "MIT" ]
1
5e560f54442d387a86e3a469107cf65859693987
https://github.com/oskarnatan/RGBDVS-fusion/tree/5e560f54442d387a86e3a469107cf65859693987
import torch from torch import nn from torch import torch class Model(nn.Module): def __init__(self): super().__init__() def forward(self, Yp, Yt, smooth=1e-07): num = Yt.size(0) Yp = Yp.view(num, -1) Yt = Yt.view(num, -1) bce = nn.functional.binary_cross_entropy(Yp, ...
UnpoolAvgEquiangular
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch.nn import functional as F def equiangular_dimension_unpack(nodes, ratio): """Calculate the two underlying dimensions from the total number of nodes Args: nodes (int): combined dimensions ratio (float): ratio between the two dimensions Returns: int, int: ...
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 reinterpret...
ownzonefeng/weather_prediction
UnpoolAvgEquiangular
false
7,426
[ "MIT" ]
1
723c02b6b3c0a40751d87572b66c7a4e040dec92
https://github.com/ownzonefeng/weather_prediction/tree/723c02b6b3c0a40751d87572b66c7a4e040dec92
import torch from torch.nn import functional as F def equiangular_dimension_unpack(nodes, ratio): """Calculate the two underlying dimensions from the total number of nodes Args: nodes (int): combined dimensions ratio (float): ratio between the two dimensions Returns: int, int: ...
UnpoolAvgHealpix
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class UnpoolAvgHealpix(torch.nn.Module): """Healpix Average Unpooling module Parameters ---------- kernel_size : int Pooling kernel width """ def __init__(self, kernel_size, *args, **kwargs): """kernel_size should be 4, 16, 64, etc.""" super().__init_...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda reinterpret...
ownzonefeng/weather_prediction
UnpoolAvgHealpix
false
7,427
[ "MIT" ]
1
723c02b6b3c0a40751d87572b66c7a4e040dec92
https://github.com/ownzonefeng/weather_prediction/tree/723c02b6b3c0a40751d87572b66c7a4e040dec92
import torch class Model(torch.nn.Module): """Healpix Average Unpooling module Parameters ---------- kernel_size : int Pooling kernel width """ def __init__(self, kernel_size, *args, **kwargs): """kernel_size should be 4, 16, 64, etc.""" super().__init__() ...
IOUScore
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn from torch import torch class IOUScore(nn.Module): def __init__(self): super().__init__() def forward(self, Yp, Yt): output_ = Yp > 0.5 target_ = Yt > 0.5 intersection = (output_ & target_).sum() union = (output_ | target_).sum() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn from torch import torch assert_size_stride = torch._C._dynamo.guards...
oskarnatan/RGBDVS-fusion
IOUScore
false
7,428
[ "MIT" ]
1
5e560f54442d387a86e3a469107cf65859693987
https://github.com/oskarnatan/RGBDVS-fusion/tree/5e560f54442d387a86e3a469107cf65859693987
import torch from torch import nn from torch import torch class Model(nn.Module): def __init__(self): super().__init__() def forward(self, Yp, Yt): output_ = Yp > 0.5 target_ = Yt > 0.5 intersection = (output_ & target_).sum() union = (output_ | target_).sum() ...
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 from torch import nn import torch.autograd def fanin_(size): fan_in = size[0] weight = 1.0 / np.sqrt(fan_in) return torch.Tensor(size).uniform_(-weight, weight) class Critic(nn.Module): def __init__(self, state_dim, action_dim, h1=64, h2=32, init_w=0.003): su...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np from torch...
ori-goals/lfd-min-human-effort
Critic
false
7,429
[ "MIT" ]
1
f9fd70cdeb661151e5f81ac538ceb865531146b9
https://github.com/ori-goals/lfd-min-human-effort/tree/f9fd70cdeb661151e5f81ac538ceb865531146b9
import torch import numpy as np from torch import nn import torch.autograd def fanin_(size): fan_in = size[0] weight = 1.0 / np.sqrt(fan_in) return torch.Tensor(size).uniform_(-weight, weight) class Model(nn.Module): def __init__(self, state_dim, action_dim, h1=64, h2=32, init_w=0.003): sup...
HintonBinarizer
# 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.optim class hinton_binarize(torch.autograd.Function): """ Binarize function from the paper 'SKIP RNN: LEARNING TO SKIP STATE UPDATES IN RECURRENT NEURAL NETWORKS' https://openreview.net/forum?id=HkwVAXyCW Works as round function but has a unit gradie...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.optim assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dyna...
ovechkinVT/SkipRNN
HintonBinarizer
false
7,430
[ "MIT" ]
1
7c1f37349d464b1b6bf8835520abad22b199f1ad
https://github.com/ovechkinVT/SkipRNN/tree/7c1f37349d464b1b6bf8835520abad22b199f1ad
import torch import torch.nn as nn import torch.optim class hinton_binarize(torch.autograd.Function): """ Binarize function from the paper 'SKIP RNN: LEARNING TO SKIP STATE UPDATES IN RECURRENT NEURAL NETWORKS' https://openreview.net/forum?id=HkwVAXyCW Works as round function but has a unit gradie...
torch_return_int8_argmax
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class torch_return_int8_argmax(torch.nn.Module): def __init__(self): super(torch_return_int8_argmax, self).__init__() def forward(self, x): x0 = x.squeeze(0) _, x1 = torch.max(x0, 0) return x1 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_in...
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...
ozendelait/pytorch-semseg
torch_return_int8_argmax
false
7,431
[ "MIT" ]
1
200491febd653bd26befcd5b3d52c614aa832b7e
https://github.com/ozendelait/pytorch-semseg/tree/200491febd653bd26befcd5b3d52c614aa832b7e
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): x0 = x.squeeze(0) _, x1 = torch.max(x0, 0) return x1 def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
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 from torch import nn import torch.autograd def fanin_(size): fan_in = size[0] weight = 1.0 / np.sqrt(fan_in) return torch.Tensor(size).uniform_(-weight, weight) class Actor(nn.Module): def __init__(self, state_dim, action_dim, h1=64, h2=32, init_w=0.003): sup...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ori-goals/lfd-min-human-effort
Actor
false
7,432
[ "MIT" ]
1
f9fd70cdeb661151e5f81ac538ceb865531146b9
https://github.com/ori-goals/lfd-min-human-effort/tree/f9fd70cdeb661151e5f81ac538ceb865531146b9
import torch import numpy as np from torch import nn import torch.autograd def fanin_(size): fan_in = size[0] weight = 1.0 / np.sqrt(fan_in) return torch.Tensor(size).uniform_(-weight, weight) class Model(nn.Module): def __init__(self, state_dim, action_dim, h1=64, h2=32, init_w=0.003): sup...
Rectifier
# 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.optim class Rectifier(nn.Module): def __init__(self, l=-0.1, r=1.1): super().__init__() self.l = l self.r = r self.eps = 1e-07 def forward(self, x, l=None, r=None): l = l if l is not None else self.l r = r if r i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.optim assert_size_stride = torch._C._dynamo.guards.ass...
ovechkinVT/SkipRNN
Rectifier
false
7,433
[ "MIT" ]
1
7c1f37349d464b1b6bf8835520abad22b199f1ad
https://github.com/ovechkinVT/SkipRNN/tree/7c1f37349d464b1b6bf8835520abad22b199f1ad
import torch import torch.nn as nn import torch.optim class Model(nn.Module): def __init__(self, l=-0.1, r=1.1): super().__init__() self.l = l self.r = r self.eps = 1e-07 def forward(self, x, l=None, r=None): l = l if l is not None else self.l r = r if r is no...
torch_fakeint8_to_float
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class torch_fakeint8_to_float(torch.nn.Module): def __init__(self): super(torch_fakeint8_to_float, self).__init__() def forward(self, x): x0 = x.permute(2, 0, 1) x0 += torch.clamp(x0, -1, 0) * -256.0 return x0.unsqueeze(0).contiguous() def get_inputs(): ret...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
ozendelait/pytorch-semseg
torch_fakeint8_to_float
false
7,434
[ "MIT" ]
1
200491febd653bd26befcd5b3d52c614aa832b7e
https://github.com/ozendelait/pytorch-semseg/tree/200491febd653bd26befcd5b3d52c614aa832b7e
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): x0 = x.permute(2, 0, 1) x0 += torch.clamp(x0, -1, 0) * -256.0 return x0.unsqueeze(0).contiguous() def get_inputs(): return [torch.rand([4, 4, 4])] def get_init_inpu...
torch_uint8_to_float_normed
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch class torch_uint8_to_float_normed(torch.nn.Module): def __init__(self): super(torch_uint8_to_float_normed, self).__init__() def forward(self, x): return (x.permute(2, 0, 1) / 255.0).unsqueeze(0).contiguous() def get_inputs(): return [torch.rand([4, 4, 4])] def get_init_i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
ozendelait/pytorch-semseg
torch_uint8_to_float_normed
false
7,435
[ "MIT" ]
1
200491febd653bd26befcd5b3d52c614aa832b7e
https://github.com/ozendelait/pytorch-semseg/tree/200491febd653bd26befcd5b3d52c614aa832b7e
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): return (x.permute(2, 0, 1) / 255.0).unsqueeze(0).contiguous() def get_inputs(): return [torch.rand([4, 4, 4])] def get_init_inputs(): return []
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 import torch.nn as nn import torch.optim import torch.nn.functional as F class Attention(nn.Module): """Attention layer - Custom layer to perform weighted average over the second axis (axis=1) Transforming a tensor of size [N, W, H] to [N, 1, H]. N: batch size W: 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....
ovechkinVT/SkipRNN
Attention
false
7,436
[ "MIT" ]
1
7c1f37349d464b1b6bf8835520abad22b199f1ad
https://github.com/ovechkinVT/SkipRNN/tree/7c1f37349d464b1b6bf8835520abad22b199f1ad
import math import torch import torch.nn as nn import torch.optim import torch.nn.functional as F class Model(nn.Module): """Attention layer - Custom layer to perform weighted average over the second axis (axis=1) Transforming a tensor of size [N, W, H] to [N, 1, H]. N: batch size W: numbe...
AvgLayer
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class AvgLayer(nn.Module): def forward(self, input): return input.mean(3, keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
pYtoner/EasyOCR
AvgLayer
false
7,437
[ "Apache-2.0" ]
1
cbb2df77ae789dd4c7807541e0357d9a698ba801
https://github.com/pYtoner/EasyOCR/tree/cbb2df77ae789dd4c7807541e0357d9a698ba801
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def forward(self, input): return input.mean(3, keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
LearnedUtility
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 LearnedUtility(nn.Module): def __init__(self, slope=0): super().__init__() self.theta_tt = torch.nn.Parameter(slope * torch.ones(1)) self.theta_tt.requiresGrad = True def forward(self, x): return torch.multiply(self.theta_tt, x) def ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
pabloguarda/NeuralTransportationNetworks
LearnedUtility
false
7,438
[ "MIT" ]
1
0461c26128b09488aff237b760068b43d131f8a9
https://github.com/pabloguarda/NeuralTransportationNetworks/tree/0461c26128b09488aff237b760068b43d131f8a9
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, slope=0): super().__init__() self.theta_tt = torch.nn.Parameter(slope * torch.ones(1)) self.theta_tt.requiresGrad = True def forward(self, x): return torch.multiply(self.theta_tt, x) def get_input...
PreNet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from 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 PreNet(nn.Module): def __init__(self, in_dims, fc1_dims=256, fc2_dims=128, dropout=0.5): super().__init__() self.fc1 = nn.Linear(in_dims, fc1_dims) self.fc2 = nn.Linear(fc1_dims, fc2_dims) self.p = dropout ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
padmalcom/AISpeechAssistant
PreNet
false
7,439
[ "Apache-2.0" ]
1
b7501a23a8f513acb5043f3c7bb06df129bdc2cc
https://github.com/padmalcom/AISpeechAssistant/tree/b7501a23a8f513acb5043f3c7bb06df129bdc2cc
import torch from torch import nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, in_dims, fc1_dims=256, fc2_dims=128, dropout=0.5): super().__init__() self.fc1 = nn.Linear(in_dims, fc1_dims) self.fc2 = nn.Linear(fc1_dims, fc2_dims) self.p = dropout ...