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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
CRF | # 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 CRF(nn.Module):
"""
Implements Conditional Random Fields that can be trained via
backpropagation.
"""
def __init__(self, num_tags):
super(CRF, self).__init__()
self.num_tags = num_tags
self.transitions = nn.Parameter(torch.Tensor(nu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | Franck-Dernoncourt/meta_cross_nlu_qa | CRF | false | 8,146 | [
"MIT"
] | 14 | 98f0af07988f24d9c7827030765246c6f67a0f4d | https://github.com/Franck-Dernoncourt/meta_cross_nlu_qa/tree/98f0af07988f24d9c7827030765246c6f67a0f4d | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Implements Conditional Random Fields that can be trained via
backpropagation.
"""
def __init__(self, num_tags):
super().__init__()
self.num_tags = num_tags
self.transitions = nn.Parameter(torch.Tensor(num_tags,... |
Model | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from typing import Tuple
import torch.nn as nn
class LSTM(nn.Module):
"""Implementation of the standard LSTM.
TODO: Include ref and LaTeX equations
Parameters
----------
input_size : int
Number of input features
hidden_size : int
Number of hidden/memory cells.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from typing import ... | Flash-Of-Thunder/testing | Model | false | 8,147 | [
"Apache-2.0"
] | 18 | 36366e2cd32756fb07abc533ecbb7672a4738bc6 | https://github.com/Flash-Of-Thunder/testing/tree/36366e2cd32756fb07abc533ecbb7672a4738bc6 | import torch
from typing import Tuple
import torch.nn as nn
class LSTM(nn.Module):
"""Implementation of the standard LSTM.
TODO: Include ref and LaTeX equations
Parameters
----------
input_size : int
Number of input features
hidden_size : int
Number of hidden/memory cells.
... |
SmallDecoder3_16x | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 SmallDecoder3_16x(nn.Module):
def __init__(self, model=None, fixed=False):
super(SmallDecoder3_16x, self).__init__()
self.fixed = fixed
self.conv31 = nn.Conv2d(64, 32, 3, 1, 0)
self.conv22 = nn.Conv2d(32, 32, 3, 1, 0)
self.conv21 = ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | EndyWon/Texture-Reformer | SmallDecoder3_16x | false | 8,148 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv31 = nn.Conv2d(64, 32, 3, 1, 0)
self.conv22 = nn.Conv2d(32, 32, 3, 1, 0)
self.conv21 = nn.Conv2d(32, 16, 3, 1, 0)
... |
LayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class LayerNorm(nn.Module):
"""
Layer Normalization
(https://arxiv.org/abs/1607.06450)
"""
def __init__(self, normalized_shape, eps=1e-05):
super(LayerNorm, self).__init__()
self.gamma = nn.Parameter(torch.ones(normalized_shape))
self.bet... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | GMDennis/claf | LayerNorm | false | 8,149 | [
"MIT"
] | 10 | d1e064e593127e5d654f000f5506c5ae1caab5ce | https://github.com/GMDennis/claf/tree/d1e064e593127e5d654f000f5506c5ae1caab5ce | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Layer Normalization
(https://arxiv.org/abs/1607.06450)
"""
def __init__(self, normalized_shape, eps=1e-05):
super().__init__()
self.gamma = nn.Parameter(torch.ones(normalized_shape))
self.beta = nn.Parameter(to... |
GeLU | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.jit
import torch.nn.functional
import torch.nn
from torch.nn.functional import gelu
class GeLU(nn.Module):
def forward(self, x):
return gelu(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
import torch.jit
import torch.nn.functional
import torch.n... | Gitsamshi/nnUNet-1 | GeLU | false | 8,150 | [
"Apache-2.0"
] | 28 | 5341684211e6d91dab6ad76a7595a95addff23be | https://github.com/Gitsamshi/nnUNet-1/tree/5341684211e6d91dab6ad76a7595a95addff23be | import torch
from torch import nn
import torch.jit
import torch.nn.functional
import torch.nn
from torch.nn.functional import gelu
class Model(nn.Module):
def forward(self, x):
return gelu(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
PositionwiseFeedForward | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class PointwiseConv(nn.Module):
"""
Pointwise Convolution (1x1 Conv)
Convolution 1 Dimension (Faster version)
(cf. https://github.com/huggingface/pytorch-openai-transformer-lm/blob/ eafc28abdfadfa0732f03a0fc65805c5bfb2ffe7/mode... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 ... | GMDennis/claf | PositionwiseFeedForward | false | 8,151 | [
"MIT"
] | 10 | d1e064e593127e5d654f000f5506c5ae1caab5ce | https://github.com/GMDennis/claf/tree/d1e064e593127e5d654f000f5506c5ae1caab5ce | import torch
import torch.nn as nn
import torch.nn.functional as F
class PointwiseConv(nn.Module):
"""
Pointwise Convolution (1x1 Conv)
Convolution 1 Dimension (Faster version)
(cf. https://github.com/huggingface/pytorch-openai-transformer-lm/blob/ eafc28abdfadfa0732f03a0fc65805c5bfb2ffe7/mode... |
Decoder1 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Decoder1(nn.Module):
def __init__(self, model=None, fixed=False):
super(Decoder1, self).__init__()
self.fixed = fixed
self.conv11 = nn.Conv2d(64, 3, 3, 1, 0, dilation=1)
self.relu = nn.ReLU(inplace=True)
self.unpool = nn.UpsamplingN... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | EndyWon/Texture-Reformer | Decoder1 | false | 8,152 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv11 = nn.Conv2d(64, 3, 3, 1, 0, dilation=1)
self.relu = nn.ReLU(inplace=True)
self.unpool = nn.UpsamplingNearest2d(scale_fa... |
SeqAttnMatch | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 SeqAttnMatch(nn.Module):
"""
Given sequences X and Y, match sequence Y to each element in X.
* o_i = sum(alpha_j * y_j) for i in X
* alpha_j = softmax(y_j * x_i)
"""
def __init__(self, embed_dim, identity=False):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | GMDennis/claf | SeqAttnMatch | false | 8,153 | [
"MIT"
] | 10 | d1e064e593127e5d654f000f5506c5ae1caab5ce | https://github.com/GMDennis/claf/tree/d1e064e593127e5d654f000f5506c5ae1caab5ce | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Given sequences X and Y, match sequence Y to each element in X.
* o_i = sum(alpha_j * y_j) for i in X
* alpha_j = softmax(y_j * x_i)
"""
def __init__(self, embed_dim, identity=False):
super(... |
NonnegativeLinear | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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
class NonnegativeLinear(nn.Linear):
def reset_parameters(self):
nn.init.xavier_uniform_(self.weight)
self.weight.data.abs_()
if self.bias is not None:
fan_in, _ = nn.init._calculate_fan_in_an... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import numpy as np
import tor... | GlenHGHUANG/STRODE | NonnegativeLinear | false | 8,155 | [
"MIT"
] | 11 | 91565275dffd4f08738c8a0e5b6c9ad89344623e | https://github.com/GlenHGHUANG/STRODE/tree/91565275dffd4f08738c8a0e5b6c9ad89344623e | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Linear):
def reset_parameters(self):
nn.init.xavier_uniform_(self.weight)
self.weight.data.abs_()
if self.bias is not None:
fan_in, _ = nn.init._calculate_fan_in_and_fan_out(se... |
TimeEncoding | # 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 TimeEncoding(nn.Module):
def __init__(self, d_model, dropout=0.1, max_len=5000):
super(TimeEncoding, self).__init__()
self.dropout = nn.Dropout(p=dropout)
def forward(self, x, mask, lengths):
time = mask * 1 / (lengths[..., None] - 1)
t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | GuyTevet/MotionCLIP | TimeEncoding | false | 8,156 | [
"MIT"
] | 45 | c2b9f40b0e721e42981f3e8b58133a1c51fde715 | https://github.com/GuyTevet/MotionCLIP/tree/c2b9f40b0e721e42981f3e8b58133a1c51fde715 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, d_model, dropout=0.1, max_len=5000):
super().__init__()
self.dropout = nn.Dropout(p=dropout)
def forward(self, x, mask, lengths):
time = mask * 1 / (lengths[..., None] - 1)
time = time[:, None] * tor... |
Encoder3 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Encoder3(nn.Module):
def __init__(self, model=None, fixed=False):
super(Encoder3, self).__init__()
self.fixed = fixed
self.conv0 = nn.Conv2d(3, 3, 1, 1, 0)
self.conv11 = nn.Conv2d(3, 64, 3, 1, 0)
self.conv12 = nn.Conv2d(64, 64, 3, 1... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | EndyWon/Texture-Reformer | Encoder3 | false | 8,158 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv0 = nn.Conv2d(3, 3, 1, 1, 0)
self.conv11 = nn.Conv2d(3, 64, 3, 1, 0)
self.conv12 = nn.Conv2d(64, 64, 3, 1, 0)
self... |
LSTM | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 typing import Tuple
import torch.nn as nn
class LSTM(nn.Module):
"""Implementation of the standard LSTM.
TODO: Include ref and LaTeX equations
Parameters
----------
input_size : int
Number of input features
hidden_size : int
Number of hidden/memory cells.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Flash-Of-Thunder/testing | LSTM | false | 8,159 | [
"Apache-2.0"
] | 18 | 36366e2cd32756fb07abc533ecbb7672a4738bc6 | https://github.com/Flash-Of-Thunder/testing/tree/36366e2cd32756fb07abc533ecbb7672a4738bc6 | import torch
from typing import Tuple
import torch.nn as nn
class Model(nn.Module):
"""Implementation of the standard LSTM.
TODO: Include ref and LaTeX equations
Parameters
----------
input_size : int
Number of input features
hidden_size : int
Number of hidden/memory cells.
... |
TVLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torch.nn as nn
class TVLoss(nn.Module):
def __init__(self):
super(TVLoss, self).__init__()
def forward(self, x):
x.size()[0]
h_x = x.size()[2]
w_x = x.size()[3]
self._tensor_size(x[:, :, 1:, :])
self._tensor_size(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.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | GuoShi28/GCP-Net | TVLoss | false | 8,160 | [
"Apache-2.0"
] | 24 | cef7513fa242343055af64e612429e4384d3c1d7 | https://github.com/GuoShi28/GCP-Net/tree/cef7513fa242343055af64e612429e4384d3c1d7 | import torch
import torch.utils.data
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
x.size()[0]
h_x = x.size()[2]
w_x = x.size()[3]
self._tensor_size(x[:, :, 1:, :])
self._tensor_size(x[:, :, :, 1:])
... |
SmallDecoder4_16x | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 SmallDecoder4_16x(nn.Module):
def __init__(self, model=None, fixed=False):
super(SmallDecoder4_16x, self).__init__()
self.fixed = fixed
self.conv41 = nn.Conv2d(128, 64, 3, 1, 0)
self.conv34 = nn.Conv2d(64, 64, 3, 1, 0)
self.conv33 =... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | EndyWon/Texture-Reformer | SmallDecoder4_16x | false | 8,161 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv41 = nn.Conv2d(128, 64, 3, 1, 0)
self.conv34 = nn.Conv2d(64, 64, 3, 1, 0)
self.conv33 = nn.Conv2d(64, 64, 3, 1, 0)
... |
CharbonnierLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torch.nn as nn
class CharbonnierLoss(nn.Module):
"""Charbonnier Loss (L1)"""
def __init__(self, eps=1e-06):
super(CharbonnierLoss, self).__init__()
self.eps = eps
def forward(self, x, y):
diff = x - y
loss = torch.sum(torch.sqrt... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.data
impo... | GuoShi28/GCP-Net | CharbonnierLoss | false | 8,162 | [
"Apache-2.0"
] | 24 | cef7513fa242343055af64e612429e4384d3c1d7 | https://github.com/GuoShi28/GCP-Net/tree/cef7513fa242343055af64e612429e4384d3c1d7 | import torch
import torch.utils.data
import torch.nn as nn
class Model(nn.Module):
"""Charbonnier Loss (L1)"""
def __init__(self, eps=1e-06):
super().__init__()
self.eps = eps
def forward(self, x, y):
diff = x - y
loss = torch.sum(torch.sqrt(diff * diff + self.eps))
... |
SmallDecoder5_16x | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 SmallDecoder5_16x(nn.Module):
def __init__(self, model=None, fixed=False):
super(SmallDecoder5_16x, self).__init__()
self.fixed = fixed
self.conv51 = nn.Conv2d(128, 128, 3, 1, 0)
self.conv44 = nn.Conv2d(128, 128, 3, 1, 0)
self.conv4... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | EndyWon/Texture-Reformer | SmallDecoder5_16x | false | 8,163 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv51 = nn.Conv2d(128, 128, 3, 1, 0)
self.conv44 = nn.Conv2d(128, 128, 3, 1, 0)
self.conv43 = nn.Conv2d(128, 128, 3, 1, 0)
... |
SageLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 SageLayer(nn.Module):
"""
Encodes a node's using 'convolutional' GraphSage approach
"""
def __init__(self, input_size, out_size):
super(SageLayer, self).__init__()
self.input_size = input_size
self.out_si... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | HKUST-KnowComp/CSKB-Population | SageLayer | false | 8,164 | [
"MIT"
] | 13 | 7b1b2d25fbd0095b0cf009b933cfd5a62feadd58 | https://github.com/HKUST-KnowComp/CSKB-Population/tree/7b1b2d25fbd0095b0cf009b933cfd5a62feadd58 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
Encodes a node's using 'convolutional' GraphSage approach
"""
def __init__(self, input_size, out_size):
super().__init__()
self.input_size = input_size
self.out_size = out_size
... |
Decoder4 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Decoder4(nn.Module):
def __init__(self, model=None, fixed=False):
super(Decoder4, self).__init__()
self.fixed = fixed
self.conv41 = nn.Conv2d(512, 256, 3, 1, 0)
self.conv34 = nn.Conv2d(256, 256, 3, 1, 0)
self.conv33 = nn.Conv2d(256,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | EndyWon/Texture-Reformer | Decoder4 | false | 8,165 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv41 = nn.Conv2d(512, 256, 3, 1, 0)
self.conv34 = nn.Conv2d(256, 256, 3, 1, 0)
self.conv33 = nn.Conv2d(256, 256, 3, 1, 0)
... |
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.nn.functional as F
def aeq(*args):
"""
Assert all arguments have the same value
"""
arguments = (arg for arg in args)
first = next(arguments)
assert all(arg == first for arg in arguments
), 'Not all arguments have the same value: ' + str(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | GT-SALT/Disfluency-Generation-and-Detection | GlobalAttention | false | 8,166 | [
"MIT"
] | 11 | 72126172b466aa74277f3cf0f73b915e5dbeefbb | https://github.com/GT-SALT/Disfluency-Generation-and-Detection/tree/72126172b466aa74277f3cf0f73b915e5dbeefbb | import torch
import torch.nn as nn
import torch.nn.functional as F
def aeq(*args):
"""
Assert all arguments have the same value
"""
arguments = (arg for arg in args)
first = next(arguments)
assert all(arg == first for arg in arguments
), 'Not all arguments have the same value: ' + str(... |
MultiHeadedAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import Tensor
from torch import nn
class MultiHeadedAttention(nn.Module):
"""
Multi-Head Attention module from "Attention is All You Need"
Implementation modified from OpenNMT-py.
https://github.com/OpenNMT/OpenNMT-py
"""
def __init__(self, num_heads: 'int... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | GuyTevet/MotionCLIP | MultiHeadedAttention | false | 8,167 | [
"MIT"
] | 45 | c2b9f40b0e721e42981f3e8b58133a1c51fde715 | https://github.com/GuyTevet/MotionCLIP/tree/c2b9f40b0e721e42981f3e8b58133a1c51fde715 | import math
import torch
from torch import Tensor
from torch import nn
class Model(nn.Module):
"""
Multi-Head Attention module from "Attention is All You Need"
Implementation modified from OpenNMT-py.
https://github.com/OpenNMT/OpenNMT-py
"""
def __init__(self, num_heads: 'int', size: 'int',... |
AttenHead | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch.nn import functional as F
from torch import nn
class AttenHead(nn.Module):
def __init__(self, fdim, num_heads=1):
super().__init__()
self.num_heads = num_heads
self.fatt = fdim // num_heads
for i in range(num_heads):
setattr(self, f'... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | GT-RIPL/FeatMatch | AttenHead | false | 8,168 | [
"MIT"
] | 41 | 03e16af82d8c94f7bbbbf5eab1334dc1fc9b93cb | https://github.com/GT-RIPL/FeatMatch/tree/03e16af82d8c94f7bbbbf5eab1334dc1fc9b93cb | import math
import torch
from torch.nn import functional as F
from torch import nn
class Model(nn.Module):
def __init__(self, fdim, num_heads=1):
super().__init__()
self.num_heads = num_heads
self.fatt = fdim // num_heads
for i in range(num_heads):
setattr(self, f'embd... |
PartialBCELoss | # 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 PartialBCELoss(torch.nn.Module):
def __init__(self):
super(PartialBCELoss, self).__init__()
self.log_sigmoid = torch.nn.LogSigmoid()
def forward(self, logits, targets, targets_mask, weights=None):
pos_vals = -targets * self.log_sigmoid(logits)
neg_vals = -s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
assert_size... | HKUST-KnowComp/MLMET | PartialBCELoss | false | 8,169 | [
"MIT"
] | 10 | ae1188a929a5ca6a8e087bb091853b328ea2c7e7 | https://github.com/HKUST-KnowComp/MLMET/tree/ae1188a929a5ca6a8e087bb091853b328ea2c7e7 | import torch
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.log_sigmoid = torch.nn.LogSigmoid()
def forward(self, logits, targets, targets_mask, weights=None):
pos_vals = -targets * self.log_sigmoid(logits)
neg_vals = -self.log_sigmoid(-logits) * (1... |
Gaussian_Distance | # 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 Gaussian_Distance(nn.Module):
def __init__(self, kern=1):
super(Gaussian_Distance, self).__init__()
self.kern = kern
self.avgpool = nn.AvgPool2d(kernel_size=kern, stride=kern)
def forward(self, mu_a, logvar_a, mu_b, logvar_b):
mu_a = 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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | FupingWu90/VarDA | Gaussian_Distance | false | 8,170 | [
"MIT"
] | 14 | cfea269a4f608128bb5b13a778619b17d7123bfa | https://github.com/FupingWu90/VarDA/tree/cfea269a4f608128bb5b13a778619b17d7123bfa | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, kern=1):
super().__init__()
self.kern = kern
self.avgpool = nn.AvgPool2d(kernel_size=kern, stride=kern)
def forward(self, mu_a, logvar_a, mu_b, logvar_b):
mu_a = self.avgpool(mu_a)
mu_b = sel... |
EstimationLoss | # 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 EstimationLoss(nn.Module):
def __init__(self):
super(EstimationLoss, self).__init__()
self.gamma = 0
self.alpha = 0
def forward(self, pred, target):
temp1 = -torch.mul(pred ** self.gamma, torch.mul(1 - target, torch.
log(1 ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | Gorilla-Lab-SCUT/AffordanceNet | EstimationLoss | false | 8,171 | [
"MIT"
] | 37 | 47c0c55a12f7e1429fd3e4a4bb781c4eec12803d | https://github.com/Gorilla-Lab-SCUT/AffordanceNet/tree/47c0c55a12f7e1429fd3e4a4bb781c4eec12803d | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.gamma = 0
self.alpha = 0
def forward(self, pred, target):
temp1 = -torch.mul(pred ** self.gamma, torch.mul(1 - target, torch.
log(1 - pred + 1e-06)))
tem... |
RRDB | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
from torch.utils import data as data
import torch.nn as nn
from torch.nn import init as init
from torch.nn.modules.batchnorm import _BatchNorm
from torchvision.models import vgg as vgg
from torch import autograd as autograd
@torch.no_grad()
def default_init_weights(module_list, sc... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
from torch.utils import data as data
import torch.nn as ... | BCV-Uniandes/RSR | RRDB | false | 8,172 | [
"zlib-acknowledgement"
] | 14 | dad60eedd3560f2655e3d1ed444153ed2616af2e | https://github.com/BCV-Uniandes/RSR/tree/dad60eedd3560f2655e3d1ed444153ed2616af2e | import torch
import torch.utils.data
from torch.utils import data as data
import torch.nn as nn
from torch.nn import init as init
from torch.nn.modules.batchnorm import _BatchNorm
from torchvision.models import vgg as vgg
from torch import autograd as autograd
@torch.no_grad()
def default_init_weights(module_list, sc... |
SimpleLSTM | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch.nn as nn
class SimpleLSTM(nn.Module):
def __init__(self, input_dim, hidden_dim):
super(SimpleLSTM, self).__init__()
self.nf = input_dim
self.hf = hidden_dim
self.conv = nn.Conv2d(self.nf + self.hf, 4 * self.hf, 3, 1, 1, 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
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.... | GuoShi28/GCP-Net | SimpleLSTM | false | 8,173 | [
"Apache-2.0"
] | 24 | cef7513fa242343055af64e612429e4384d3c1d7 | https://github.com/GuoShi28/GCP-Net/tree/cef7513fa242343055af64e612429e4384d3c1d7 | import torch
import torch.utils.data
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, hidden_dim):
super().__init__()
self.nf = input_dim
self.hf = hidden_dim
self.conv = nn.Conv2d(self.nf + self.hf, 4 * self.hf, 3, 1, 1, bias
=True)
def... |
ShuffleConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 ShuffleConv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', upscale_factor=2, padding_mode='zeros'):
super(ShuffleConv, self).__init__()
self.upscale_factor = upscale_factor
self.conv = nn.Conv2d(in_ch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | GerbenBeintema/deepSI | ShuffleConv | false | 8,174 | [
"BSD-3-Clause"
] | 12 | 580711210398064bb7f01e41d08b7a248a88b35b | https://github.com/GerbenBeintema/deepSI/tree/580711210398064bb7f01e41d08b7a248a88b35b | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', upscale_factor=2, padding_mode='zeros'):
super().__init__()
self.upscale_factor = upscale_factor
self.conv = nn.Conv2d(in_channels, out_channels, k... |
h_sigmoid | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class h_sigmoid(nn.Module):
def __init__(self, inplace=True):
super(h_sigmoid, self).__init__()
self.relu = nn.ReLU6(inplace=inplace)
def forward(self, x):
return self.relu(x + 3) / 6
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def g... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | GewelsJI/VPS | h_sigmoid | false | 8,175 | [
"Apache-2.0"
] | 22 | 8cb7f584be3c5fc0941126860f2198cb1d88fc4e | https://github.com/GewelsJI/VPS/tree/8cb7f584be3c5fc0941126860f2198cb1d88fc4e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, inplace=True):
super().__init__()
self.relu = nn.ReLU6(inplace=inplace)
def forward(self, x):
return self.relu(x + 3) / 6
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
... |
Upscale_Conv_block | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class ConvShuffle(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', upscale_factor=2, padding_mode='zeros'):
super(ConvShuffle, self).__init__()
self.upscale_factor = upscale_factor
self.conv = nn.Conv2d(in_ch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | GerbenBeintema/deepSI | Upscale_Conv_block | false | 8,176 | [
"BSD-3-Clause"
] | 12 | 580711210398064bb7f01e41d08b7a248a88b35b | https://github.com/GerbenBeintema/deepSI/tree/580711210398064bb7f01e41d08b7a248a88b35b | import torch
from torch import nn
class ConvShuffle(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', upscale_factor=2, padding_mode='zeros'):
super().__init__()
self.upscale_factor = upscale_factor
self.conv = nn.Conv2d(in_channels, out_chann... |
LayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-05, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
self.affine = affine
self.eps = eps
if self.affine:
self.gamma = nn.Param... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | HAXRD/PIC | LayerNorm | false | 8,177 | [
"MIT"
] | 28 | 658b4dd6b01e64413d5f8f0107d9167f1bd78546 | https://github.com/HAXRD/PIC/tree/658b4dd6b01e64413d5f8f0107d9167f1bd78546 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, num_features, eps=1e-05, affine=True):
super().__init__()
self.num_features = num_features
self.affine = affine
self.eps = eps
if self.affine:
self.gamma = nn.Parameter(torch.Tensor(n... |
Conv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils.data
class Conv(nn.Module):
"""
Convenience class that does padding and convolution for inputs in the format
[batch_size, sequence length, hidden size]
"""
def __init__(self, input_size, output_size, kernel_size, pad_type):
"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | HLTCHKUST/emotion-dialogue | Conv | false | 8,178 | [
"MIT"
] | 40 | 0d58b339134dd9a2f386948ae474b270a77370f9 | https://github.com/HLTCHKUST/emotion-dialogue/tree/0d58b339134dd9a2f386948ae474b270a77370f9 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""
Convenience class that does padding and convolution for inputs in the format
[batch_size, sequence length, hidden size]
"""
def __init__(self, input_size, output_size, kernel_size, pad_type):
"""
... |
ClassicUpConv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 ClassicUpConv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', upscale_factor=2, padding_mode='zeros'):
super(ClassicUpConv, self).__init__()
self.upscale_factor = upscale_factor
self.conv = nn.Conv2d(i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | GerbenBeintema/deepSI | ClassicUpConv | false | 8,179 | [
"BSD-3-Clause"
] | 12 | 580711210398064bb7f01e41d08b7a248a88b35b | https://github.com/GerbenBeintema/deepSI/tree/580711210398064bb7f01e41d08b7a248a88b35b | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', upscale_factor=2, padding_mode='zeros'):
super().__init__()
self.upscale_factor = upscale_factor
self.conv = nn.Conv2d(in_channels, out_channels, k... |
ScalarFilter | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch as th
import torch.nn as nn
class ScalarFilter(nn.Module):
def __init__(self):
super(ScalarFilter, self).__init__()
def forward(self, p_x, g_x):
"""
input should be scalar: bsz x l1, bsz x l2
return bsz x l2
"""
matrix = g_x.unsqueeze... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | HKUST-KnowComp/DualMessagePassing | ScalarFilter | false | 8,180 | [
"MIT"
] | 12 | d29d627be2a8c8f24b52e3db2c383e33a059aaa7 | https://github.com/HKUST-KnowComp/DualMessagePassing/tree/d29d627be2a8c8f24b52e3db2c383e33a059aaa7 | import torch
import torch as th
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, p_x, g_x):
"""
input should be scalar: bsz x l1, bsz x l2
return bsz x l2
"""
matrix = g_x.unsqueeze(2) - p_x.unsqueeze(1)
... |
WeightedBCELoss | # 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 WeightedBCELoss(torch.nn.Module):
def __init__(self, neg_scale=-1, bce_sum=False):
super(WeightedBCELoss, self).__init__()
self.log_sigmoid = torch.nn.LogSigmoid()
self.neg_scale = neg_scale
self.bce_sum = bce_sum
def forward(self, logits, targets, target_w... | 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
assert_size... | HKUST-KnowComp/MLMET | WeightedBCELoss | false | 8,181 | [
"MIT"
] | 10 | ae1188a929a5ca6a8e087bb091853b328ea2c7e7 | https://github.com/HKUST-KnowComp/MLMET/tree/ae1188a929a5ca6a8e087bb091853b328ea2c7e7 | import torch
class Model(torch.nn.Module):
def __init__(self, neg_scale=-1, bce_sum=False):
super().__init__()
self.log_sigmoid = torch.nn.LogSigmoid()
self.neg_scale = neg_scale
self.bce_sum = bce_sum
def forward(self, logits, targets, target_weights):
neg_vals = sel... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, hidden_size, num_inputs, num_outputs):
super(Actor, self).__init__()
self.linear1 = nn.Linear(num_inputs, hidden_size)
self.linear2 = nn.Linear(hidden_size, hidden_size)
s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | HAXRD/PIC | Actor | false | 8,182 | [
"MIT"
] | 28 | 658b4dd6b01e64413d5f8f0107d9167f1bd78546 | https://github.com/HAXRD/PIC/tree/658b4dd6b01e64413d5f8f0107d9167f1bd78546 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, hidden_size, num_inputs, num_outputs):
super().__init__()
self.linear1 = nn.Linear(num_inputs, hidden_size)
self.linear2 = nn.Linear(hidden_size, hidden_size)
self.mu = nn... |
Sparsemax | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch as th
import torch.nn as nn
class Sparsemax(nn.Module):
"""Sparsemax function."""
def __init__(self, dim=-1):
"""Initialize sparsemax activation
Args:
dim (int, optional): The dimension over which to apply the sparsemax function.
"""
supe... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch as th
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.ass... | HKUST-KnowComp/DualMessagePassing | Sparsemax | false | 8,183 | [
"MIT"
] | 12 | d29d627be2a8c8f24b52e3db2c383e33a059aaa7 | https://github.com/HKUST-KnowComp/DualMessagePassing/tree/d29d627be2a8c8f24b52e3db2c383e33a059aaa7 | import torch
import torch as th
import torch.nn as nn
class Model(nn.Module):
"""Sparsemax function."""
def __init__(self, dim=-1):
"""Initialize sparsemax activation
Args:
dim (int, optional): The dimension over which to apply the sparsemax function.
"""
super().... |
Minimum | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch as th
import torch.nn as nn
def minimum(x, dim=-1, scale_up=False, inplace=False):
if inplace:
x_ = x.clone()
min_x = th.min(x_, dim=dim, keepdim=True)[0]
min_mask = x_ == min_x
x.masked_fill_(min_mask == 0, 0.0)
if scale_up:
x_sum = th... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch as th
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.ass... | HKUST-KnowComp/DualMessagePassing | Minimum | false | 8,184 | [
"MIT"
] | 12 | d29d627be2a8c8f24b52e3db2c383e33a059aaa7 | https://github.com/HKUST-KnowComp/DualMessagePassing/tree/d29d627be2a8c8f24b52e3db2c383e33a059aaa7 | import torch
import torch as th
import torch.nn as nn
def minimum(x, dim=-1, scale_up=False, inplace=False):
if inplace:
x_ = x.clone()
min_x = th.min(x_, dim=dim, keepdim=True)[0]
min_mask = x_ == min_x
x.masked_fill_(min_mask == 0, 0.0)
if scale_up:
x_sum = th... |
MeanPooling | # 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 MeanPooling(nn.Module):
def __init__(self):
super(MeanPooling, self).__init__()
def forward(self, doc_state, entity_mapping, entity_lens):
entity_states = entity_mapping.unsqueeze(3) * doc_state.unsqueeze(1)
mean_pooled = torch.sum(entity_state... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | HLTCHKUST/MulQG | MeanPooling | false | 8,185 | [
"MIT"
] | 19 | 8e257f2d6c0f03c07ea8a0bf0e8f55b0cde60605 | https://github.com/HLTCHKUST/MulQG/tree/8e257f2d6c0f03c07ea8a0bf0e8f55b0cde60605 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, doc_state, entity_mapping, entity_lens):
entity_states = entity_mapping.unsqueeze(3) * doc_state.unsqueeze(1)
mean_pooled = torch.sum(entity_states, dim=2) / entity_lens... |
SFT_torch | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.transforms import *
class SFT_torch(nn.Module):
def __init__(self, sigma=0.1, *args, **kwargs):
super(SFT_torch, self).__init__(*args, **kwargs)
self.sigma = sigma
def forward(self, emb_org):
emb_org_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | CoinCheung/SFT-ReID | SFT_torch | false | 8,186 | [
"MIT"
] | 22 | 2df67554732393df5a231b7281e12fc3435f1e8c | https://github.com/CoinCheung/SFT-ReID/tree/2df67554732393df5a231b7281e12fc3435f1e8c | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.transforms import *
class Model(nn.Module):
def __init__(self, sigma=0.1, *args, **kwargs):
super().__init__(*args, **kwargs)
self.sigma = sigma
def forward(self, emb_org):
emb_org_norm = torch.norm(e... |
ConvShuffle | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 ConvShuffle(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', upscale_factor=2, padding_mode='zeros'):
super(ConvShuffle, self).__init__()
self.upscale_factor = upscale_factor
self.conv = nn.Conv2d(in_ch... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | GerbenBeintema/deepSI | ConvShuffle | false | 8,187 | [
"BSD-3-Clause"
] | 12 | 580711210398064bb7f01e41d08b7a248a88b35b | https://github.com/GerbenBeintema/deepSI/tree/580711210398064bb7f01e41d08b7a248a88b35b | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding=
'same', upscale_factor=2, padding_mode='zeros'):
super().__init__()
self.upscale_factor = upscale_factor
self.conv = nn.Conv2d(in_channels, out_channels * ... |
MlpNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class MlpNet(nn.Module):
"""Implements a simple fully connected mlp network."""
def __init__(self, sa_dim, n_agents, hidden_size, agent_id=0,
agent_shuffle='none'):
super(MlpNet, self).__init__()
sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | HAXRD/PIC | MlpNet | false | 8,188 | [
"MIT"
] | 28 | 658b4dd6b01e64413d5f8f0107d9167f1bd78546 | https://github.com/HAXRD/PIC/tree/658b4dd6b01e64413d5f8f0107d9167f1bd78546 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""Implements a simple fully connected mlp network."""
def __init__(self, sa_dim, n_agents, hidden_size, agent_id=0,
agent_shuffle='none'):
super().__init__()
self.linear1 = n... |
MeanMaxPooling | # 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 MeanMaxPooling(nn.Module):
def __init__(self):
super(MeanMaxPooling, self).__init__()
def forward(self, doc_state, entity_mapping, entity_lens):
"""
:param doc_state: N x L x d
:param entity_mapping: N x E x L
:param entity_le... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | HLTCHKUST/MulQG | MeanMaxPooling | false | 8,189 | [
"MIT"
] | 19 | 8e257f2d6c0f03c07ea8a0bf0e8f55b0cde60605 | https://github.com/HLTCHKUST/MulQG/tree/8e257f2d6c0f03c07ea8a0bf0e8f55b0cde60605 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, doc_state, entity_mapping, entity_lens):
"""
:param doc_state: N x L x d
:param entity_mapping: N x E x L
:param entity_lens: N x E
:return: N... |
DownsampleA | # 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.distributed
class DownsampleA(nn.Module):
def __init__(self, nIn, nOut, stride):
super(DownsampleA, self).__init__()
assert stride == 2
self.avg = nn.AvgPool2d(kernel_size=1, stride=stride)
def forward(self, x):
x = s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data.distributed
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda... | HKBU-HPML/gtopkssgd | DownsampleA | false | 8,190 | [
"Apache-2.0"
] | 33 | 6f57343f3749939b0345d36fcb2c24470942aefd | https://github.com/HKBU-HPML/gtopkssgd/tree/6f57343f3749939b0345d36fcb2c24470942aefd | import torch
import torch.nn as nn
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, nIn, nOut, stride):
super().__init__()
assert stride == 2
self.avg = nn.AvgPool2d(kernel_size=1, stride=stride)
def forward(self, x):
x = self.avg(x)
retu... |
ResidualBlock_noBN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
def initialize_weights(net_l, scale=1):
if not isinstance(net_l, list):
net_l = [net_l]
for net in net_l:
for m in net.modules():
if isinstance(m, 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
import torch.utils.data
impor... | GuoShi28/GCP-Net | ResidualBlock_noBN | false | 8,191 | [
"Apache-2.0"
] | 24 | cef7513fa242343055af64e612429e4384d3c1d7 | https://github.com/GuoShi28/GCP-Net/tree/cef7513fa242343055af64e612429e4384d3c1d7 | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
def initialize_weights(net_l, scale=1):
if not isinstance(net_l, list):
net_l = [net_l]
for net in net_l:
for m in net.modules():
if isinstance(m, nn.Conv2d):
... |
ANN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 ANN(nn.Module):
def __init__(self, input_size, hidden_size, output_size):
super(ANN, self).__init__()
self.i2h = nn.Linear(input_size, hidden_size)
self.h2o = nn.Linear(hidden_size, output_size)
self.softmax = nn.LogSoftmax()
def forwa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | GopikrishnanSasikumar/Rita | ANN | false | 8,192 | [
"BSD-3-Clause"
] | 17 | a9537c863140fc8c212f82b51f3d556e683e5f5a | https://github.com/GopikrishnanSasikumar/Rita/tree/a9537c863140fc8c212f82b51f3d556e683e5f5a | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_size, hidden_size, output_size):
super().__init__()
self.i2h = nn.Linear(input_size, hidden_size)
self.h2o = nn.Linear(hidden_size, output_size)
self.softmax = nn.LogSoftmax()
def forward(self... |
TripletSemihardLoss | # 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 torchvision.transforms.functional as F
import torch.nn.functional as F
import torch.utils.model_zoo
def pdist(A, squared=False, eps=0.0001):
prod = torch.mm(A, A.t())
norm = prod.diag().unsqueeze(1).expand_as(prod)
res = (norm + norm.t() - 2 * prod).clamp(min=0)
if squared:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | CompVis/metric-learning-divide-and-conquer-improved | TripletSemihardLoss | false | 8,193 | [
"MIT"
] | 11 | 33fe768a54376a090e2d7139898177b06e8903d2 | https://github.com/CompVis/metric-learning-divide-and-conquer-improved/tree/33fe768a54376a090e2d7139898177b06e8903d2 | import torch
import torchvision.transforms.functional as F
import torch.nn.functional as F
import torch.utils.model_zoo
def pdist(A, squared=False, eps=0.0001):
prod = torch.mm(A, A.t())
norm = prod.diag().unsqueeze(1).expand_as(prod)
res = (norm + norm.t() - 2 * prod).clamp(min=0)
if squared:
... |
FocalLossBinary | # 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.nn.functional as F
import torch.nn.functional
import torch.nn
from functools import partial
from torch.nn.modules.loss import _Loss
def reduced_focal_loss(outputs: 'torch.Tensor', targets: 'torch.Tensor',
threshold: 'float'=0.5, gamma: 'float'=2.0, reduction='mean'):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | Gitsamshi/nnUNet-1 | FocalLossBinary | false | 8,194 | [
"Apache-2.0"
] | 28 | 5341684211e6d91dab6ad76a7595a95addff23be | https://github.com/Gitsamshi/nnUNet-1/tree/5341684211e6d91dab6ad76a7595a95addff23be | import torch
import torch.jit
import torch.nn.functional as F
import torch.nn.functional
import torch.nn
from functools import partial
from torch.nn.modules.loss import _Loss
def reduced_focal_loss(outputs: 'torch.Tensor', targets: 'torch.Tensor',
threshold: 'float'=0.5, gamma: 'float'=2.0, reduction='mean'):
... |
Maximum | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch as th
import torch.nn as nn
def maximum(x, dim=-1, scale_up=False, inplace=False):
if inplace:
x_ = x.clone()
max_x = th.max(x_, dim=dim, keepdim=True)[0]
max_mask = x_ == max_x
x.masked_fill_(max_mask == 0, 0.0)
if scale_up:
x_sum = th... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch as th
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.ass... | HKUST-KnowComp/DualMessagePassing | Maximum | false | 8,195 | [
"MIT"
] | 12 | d29d627be2a8c8f24b52e3db2c383e33a059aaa7 | https://github.com/HKUST-KnowComp/DualMessagePassing/tree/d29d627be2a8c8f24b52e3db2c383e33a059aaa7 | import torch
import torch as th
import torch.nn as nn
def maximum(x, dim=-1, scale_up=False, inplace=False):
if inplace:
x_ = x.clone()
max_x = th.max(x_, dim=dim, keepdim=True)[0]
max_mask = x_ == max_x
x.masked_fill_(max_mask == 0, 0.0)
if scale_up:
x_sum = th... |
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
import torch.utils.data
class HuberLoss(nn.Module):
def __init__(self, delta=1):
super().__init__()
self.huber_loss_delta1 = nn.SmoothL1Loss()
self.delta = delta
def forward(self, x, x_hat):
loss = self.huber_loss_delta1(x / self.delta, x_hat... | 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
i... | Haichao-Zhang/leap | HuberLoss | false | 8,196 | [
"MIT"
] | 36 | 4d75961ff2ff203d4412633cbeb12889de3c79b6 | https://github.com/Haichao-Zhang/leap/tree/4d75961ff2ff203d4412633cbeb12889de3c79b6 | import torch
from torch import nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, delta=1):
super().__init__()
self.huber_loss_delta1 = nn.SmoothL1Loss()
self.delta = delta
def forward(self, x, x_hat):
loss = self.huber_loss_delta1(x / self.delta, x_hat / s... |
UpdateFunc | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
import torch.nn as nn
from torch.nn.modules.module import Module
class UpdateFunc(Module):
"""Implements a Message function"""
def __init__(self, sa_dim, n_agents, hidden_size):
super(UpdateFunc, self).__init__()
self.fv = nn.Linear(hidden_size + sa_di... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import torch.nn as nn
from torch.nn.modules.module i... | HAXRD/PIC | UpdateFunc | false | 8,197 | [
"MIT"
] | 28 | 658b4dd6b01e64413d5f8f0107d9167f1bd78546 | https://github.com/HAXRD/PIC/tree/658b4dd6b01e64413d5f8f0107d9167f1bd78546 | from torch.nn import Module
import torch
import torch.nn as nn
from torch.nn.modules.module import Module
class Model(Module):
"""Implements a Message function"""
def __init__(self, sa_dim, n_agents, hidden_size):
super().__init__()
self.fv = nn.Linear(hidden_size + sa_dim, hidden_size)
... |
ResidualAttentionBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from collections import OrderedDict
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-05):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super(LayerNorm, self).__init__()
self.weight = nn.P... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | FacePerceiver/FaRL | ResidualAttentionBlock | false | 8,198 | [
"MIT"
] | 23 | 38f1d32f4e63940fae524e9f501b88a947ec09cd | https://github.com/FacePerceiver/FaRL/tree/38f1d32f4e63940fae524e9f501b88a947ec09cd | import torch
import torch.nn as nn
from collections import OrderedDict
class LayerNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-05):
"""Construct a layernorm module in the TF style (epsilon inside the square root).
"""
super().__init__()
self.weight = nn.Parameter(torch.... |
maxPool23DUinit | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.utils.data
import torch.nn.init
class maxPool23DUinit(nn.Module):
def __init__(self, kernel_size, stride, padding=1, dilation=1, nd=2):
super(maxPool23DUinit, self).__init__()
assert nd == 1 or nd == 2 or nd == 3, 'nd is not correctly specified!!!!, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import torch.utils.data
import torch.nn.init
assert_size_stride = to... | ForrestPi/Unsupervised-Defect-Segmentation | maxPool23DUinit | false | 8,199 | [
"MIT"
] | 17 | e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | https://github.com/ForrestPi/Unsupervised-Defect-Segmentation/tree/e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | import torch
from torch import nn
import torch.utils.data
import torch.nn.init
class Model(nn.Module):
def __init__(self, kernel_size, stride, padding=1, dilation=1, nd=2):
super().__init__()
assert nd == 1 or nd == 2 or nd == 3, 'nd is not correctly specified!!!!, it should be {1,2,3}'
i... |
TripletAllLoss | # 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 torchvision.transforms.functional as F
import torch.nn.functional as F
import torch.utils.model_zoo
def pdist(A, squared=False, eps=0.0001):
prod = torch.mm(A, A.t())
norm = prod.diag().unsqueeze(1).expand_as(prod)
res = (norm + norm.t() - 2 * prod).clamp(min=0)
if squared:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | CompVis/metric-learning-divide-and-conquer-improved | TripletAllLoss | false | 8,200 | [
"MIT"
] | 11 | 33fe768a54376a090e2d7139898177b06e8903d2 | https://github.com/CompVis/metric-learning-divide-and-conquer-improved/tree/33fe768a54376a090e2d7139898177b06e8903d2 | import torch
import torchvision.transforms.functional as F
import torch.nn.functional as F
import torch.utils.model_zoo
def pdist(A, squared=False, eps=0.0001):
prod = torch.mm(A, A.t())
norm = prod.diag().unsqueeze(1).expand_as(prod)
res = (norm + norm.t() - 2 * prod).clamp(min=0)
if squared:
... |
LRN | # 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.distributed
class LRN(nn.Module):
def __init__(self, local_size=1, alpha=1.0, beta=0.75, ACROSS_CHANNELS=True
):
super(LRN, self).__init__()
self.ACROSS_CHANNELS = ACROSS_CHANNELS
if ACROSS_CHANNELS:
self.avera... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.utils.data.distributed
assert_size_stride = ... | HKBU-HPML/gtopkssgd | LRN | false | 8,201 | [
"Apache-2.0"
] | 33 | 6f57343f3749939b0345d36fcb2c24470942aefd | https://github.com/HKBU-HPML/gtopkssgd/tree/6f57343f3749939b0345d36fcb2c24470942aefd | import torch
import torch.nn as nn
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, local_size=1, alpha=1.0, beta=0.75, ACROSS_CHANNELS=True
):
super().__init__()
self.ACROSS_CHANNELS = ACROSS_CHANNELS
if ACROSS_CHANNELS:
self.average = nn... |
NoiseZ | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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.nn.init
class NoiseZ(nn.Module):
def __init__(self, batchSize):
super(NoiseZ, self).__init__()
self.Z = nn.Parameter(torch.randn(batchSize, 128), requires_grad=True)
def forward(self, input):
out = self.Z * input
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.utils.data
import torch.nn.init
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_stri... | ForrestPi/Unsupervised-Defect-Segmentation | NoiseZ | false | 8,202 | [
"MIT"
] | 17 | e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | https://github.com/ForrestPi/Unsupervised-Defect-Segmentation/tree/e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | import torch
from torch import nn
import torch.utils.data
import torch.nn.init
class Model(nn.Module):
def __init__(self, batchSize):
super().__init__()
self.Z = nn.Parameter(torch.randn(batchSize, 128), requires_grad=True)
def forward(self, input):
out = self.Z * input
retur... |
DiscriminatorLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.utils.data
import torch.nn.init
class DiscriminatorLoss(nn.Module):
def __init__(self):
super(DiscriminatorLoss, self).__init__()
def forward(self, real_out, fake_out):
d_loss = 1 - real_out + fake_out
return d_loss.mean()
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
from torch._inductor.runtime import triton_helpers
from torch import nn
import torch.utils.data
import torch.nn.init
assert_size_stride = to... | ForrestPi/Unsupervised-Defect-Segmentation | DiscriminatorLoss | false | 8,203 | [
"MIT"
] | 17 | e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | https://github.com/ForrestPi/Unsupervised-Defect-Segmentation/tree/e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | import torch
from torch import nn
import torch.utils.data
import torch.nn.init
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, real_out, fake_out):
d_loss = 1 - real_out + fake_out
return d_loss.mean()
def get_inputs():
return [torch.rand([4, 4,... |
LayerNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.utils.data
class LayerNorm(nn.Module):
"""
Simple 1D LayerNorm.
"""
def __init__(self, features, center=True, scale=False, eps=1e-06):
super().__init__()
self.center = center
self.scale = scale
self.eps = eps
if 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
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | Haichao-Zhang/leap | LayerNorm | false | 8,204 | [
"MIT"
] | 36 | 4d75961ff2ff203d4412633cbeb12889de3c79b6 | https://github.com/Haichao-Zhang/leap/tree/4d75961ff2ff203d4412633cbeb12889de3c79b6 | import torch
from torch import nn
import torch.utils.data
class Model(nn.Module):
"""
Simple 1D LayerNorm.
"""
def __init__(self, features, center=True, scale=False, eps=1e-06):
super().__init__()
self.center = center
self.scale = scale
self.eps = eps
if self.s... |
par_start_encoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
from torch import nn
class par_start_encoder(nn.Module):
"""A network which makes the initial states a parameter of the network"""
def __init__(self, nx, nsamples):
super(par_start_encoder, self).__init__()
self.start_state = nn.parameter.Parameter(data=torch.a... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynam... | GerbenBeintema/deepSI | par_start_encoder | false | 8,205 | [
"BSD-3-Clause"
] | 12 | 580711210398064bb7f01e41d08b7a248a88b35b | https://github.com/GerbenBeintema/deepSI/tree/580711210398064bb7f01e41d08b7a248a88b35b | import torch
import numpy as np
from torch import nn
class Model(nn.Module):
"""A network which makes the initial states a parameter of the network"""
def __init__(self, nx, nsamples):
super().__init__()
self.start_state = nn.parameter.Parameter(data=torch.as_tensor(np.
random.nor... |
Attn | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.autograd
import torch.nn
class Attn(nn.Module):
"""
Unit attention operation for alternating co-attention.
``https://arxiv.org/pdf/1606.00061.pdf``
.. math::
\\begin{array}{ll}
H = \\tanh(W_x * X + (W_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | HCY123902/visdial-gnn | Attn | false | 8,206 | [
"MIT"
] | 44 | c38090c672cdf04a4fabe139f96d944fd82cb123 | https://github.com/HCY123902/visdial-gnn/tree/c38090c672cdf04a4fabe139f96d944fd82cb123 | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.autograd
import torch.nn
class Model(nn.Module):
"""
Unit attention operation for alternating co-attention.
``https://arxiv.org/pdf/1606.00061.pdf``
.. math::
\\begin{array}{ll}
H = \\tanh(W_x * X + (W... |
DiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.nn.functional as F
class DiceLoss(nn.Module):
def __init__(self):
super(DiceLoss, self).__init__()
def forward(self, inputs, targets, smooth=1):
inputs = F.sigmoid(inputs)
inputs = inputs.view(-1)
targets = targets.view(-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 import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | HealthML/ContIG | DiceLoss | false | 8,207 | [
"Apache-2.0"
] | 10 | 641d76e0e9a5878e456f9729f2b0a81e51764b16 | https://github.com/HealthML/ContIG/tree/641d76e0e9a5878e456f9729f2b0a81e51764b16 | import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, inputs, targets, smooth=1):
inputs = F.sigmoid(inputs)
inputs = inputs.view(-1)
targets = targets.view(-1)
intersection =... |
CAM_Module | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch.nn import Parameter
from torch.nn import Softmax
class CAM_Module(Module):
""" Channel attention module"""
def __init__(self, in_dim):
super(CAM_Module, self).__init__()
self.chanel_in = in_dim
self.gamma = Parameter(torch.zeros(1))
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | HUuxiaobin/Face-Super-Resolution-Guided-by-3D-Facial-Priors | CAM_Module | false | 8,208 | [
"MIT"
] | 29 | 987e7c74d33d26cc5e9d1c0e395a06519a31792f | https://github.com/HUuxiaobin/Face-Super-Resolution-Guided-by-3D-Facial-Priors/tree/987e7c74d33d26cc5e9d1c0e395a06519a31792f | from torch.nn import Module
import torch
from torch.nn import Parameter
from torch.nn import Softmax
class Model(Module):
""" Channel attention module"""
def __init__(self, in_dim):
super().__init__()
self.chanel_in = in_dim
self.gamma = Parameter(torch.zeros(1))
self.softmax ... |
Project3D | # 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 Project3D(nn.Module):
"""Layer which projects 3D points into a camera with intrinsics K and at position T
"""
def __init__(self, batch_size, height, width, eps=1e-07):
super(Project3D, self).__init__()
self.batch_size = batch_size
self.heig... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | HalleyJiang/PLNet | Project3D | false | 8,209 | [
"MIT"
] | 16 | a02bd5f343b9e4766891fd234e3a338c1eaa26ff | https://github.com/HalleyJiang/PLNet/tree/a02bd5f343b9e4766891fd234e3a338c1eaa26ff | import torch
import torch.nn as nn
class Model(nn.Module):
"""Layer which projects 3D points into a camera with intrinsics K and at position T
"""
def __init__(self, batch_size, height, width, eps=1e-07):
super().__init__()
self.batch_size = batch_size
self.height = height
... |
AsymmetricLossOptimized | # 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 import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class AsymmetricLossOptimized(nn.Module):
""" Notice - optimized version, minimizes memory allocation and gpu uploading,
favors inplace operations"""
... | 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 torchv... | Coler1994/robust-loss-mlml | AsymmetricLossOptimized | false | 8,210 | [
"MIT"
] | 15 | a68718eba7efa82c3eca79031eeee444f8eb5fa3 | https://github.com/Coler1994/robust-loss-mlml/tree/a68718eba7efa82c3eca79031eeee444f8eb5fa3 | import torch
from torchvision import datasets as datasets
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
class Model(nn.Module):
""" Notice - optimized version, minimizes memory allocation and gpu uploading,
favors inplace operations"""
def __init__(... |
unetConvUnit | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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.nn.functional as F
import torch.utils.data
import torch.nn.init as init
import torch.nn.init
class conv23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=True, dilation=1, nd=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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... | ForrestPi/Unsupervised-Defect-Segmentation | unetConvUnit | false | 8,211 | [
"MIT"
] | 17 | e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | https://github.com/ForrestPi/Unsupervised-Defect-Segmentation/tree/e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | import torch
import numpy as np
from torch import nn
import torch.nn.functional as F
import torch.utils.data
import torch.nn.init as init
import torch.nn.init
class conv23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=True, dilation=1, nd=... |
TAE_decoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class TAE_decoder(nn.Module):
"""
Class for temporal autoencoder decoder.
filter_1 : filter size of the first convolution layer
filter_lstm : hidden size of the lstm.
"""
def __init__(self, n_hidden=64, pooling=8):
super().__init__()
self.poo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | HamzaG737/Deep-temporal-clustering---Pytorch | TAE_decoder | false | 8,212 | [
"MIT"
] | 12 | 5ee423d833e655e73b6ba2f1c13be5f1b83f92d2 | https://github.com/HamzaG737/Deep-temporal-clustering---Pytorch/tree/5ee423d833e655e73b6ba2f1c13be5f1b83f92d2 | import torch
import torch.nn as nn
class Model(nn.Module):
"""
Class for temporal autoencoder decoder.
filter_1 : filter size of the first convolution layer
filter_lstm : hidden size of the lstm.
"""
def __init__(self, n_hidden=64, pooling=8):
super().__init__()
self.pooling =... |
Encoder4 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Encoder4(nn.Module):
def __init__(self, model=None, fixed=False):
super(Encoder4, self).__init__()
self.fixed = fixed
self.conv0 = nn.Conv2d(3, 3, 1, 1, 0)
self.conv11 = nn.Conv2d(3, 64, 3, 1, 0)
self.conv12 = nn.Conv2d(64, 64, 3, 1... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | EndyWon/Texture-Reformer | Encoder4 | false | 8,214 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv0 = nn.Conv2d(3, 3, 1, 1, 0)
self.conv11 = nn.Conv2d(3, 64, 3, 1, 0)
self.conv12 = nn.Conv2d(64, 64, 3, 1, 0)
self... |
MultiHeadAttn | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 MultiHeadAttn(nn.Module):
def __init__(self, n_head, d_model, d_head, dropout, dropatt=0,
pre_lnorm=False):
super(MultiHeadAttn, self).__init__()
self.n_head = n_head
self.d_model = d_model
self.d_hea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | HKUST-KnowComp/NeuralSubIsoCnt | MultiHeadAttn | false | 8,215 | [
"MIT"
] | 28 | 7d1deef8e49af90122ea0ad099dec1de390927b6 | https://github.com/HKUST-KnowComp/NeuralSubIsoCnt/tree/7d1deef8e49af90122ea0ad099dec1de390927b6 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, n_head, d_model, d_head, dropout, dropatt=0,
pre_lnorm=False):
super().__init__()
self.n_head = n_head
self.d_model = d_model
self.d_head = d_head
self.dro... |
GatedMultiHeadAttn | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 GatedMultiHeadAttn(nn.Module):
def __init__(self, query_dim, key_dim, value_dim, hidden_dim, num_head,
dropatt=0.0, act_func='softmax', add_zero_attn=False, pre_lnorm=
False, post_lnorm=False):
super(GatedMultiHeadAt... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | HKUST-KnowComp/BMGF-RoBERTa | GatedMultiHeadAttn | false | 8,216 | [
"MIT"
] | 16 | 8e9eebd7e9fb6cc2492131fc8eaa5b5b29d999fd | https://github.com/HKUST-KnowComp/BMGF-RoBERTa/tree/8e9eebd7e9fb6cc2492131fc8eaa5b5b29d999fd | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, query_dim, key_dim, value_dim, hidden_dim, num_head,
dropatt=0.0, act_func='softmax', add_zero_attn=False, pre_lnorm=
False, post_lnorm=False):
super().__init__()
assert h... |
PairwiseNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 PairwiseNetwork(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.fc1 = nn.Linear(hidden_size, 2 * hidden_size)
self.fc2 = nn.Linear(2 * hidden_size, hidden_size)
self.fc3 = nn.Linear(hidde... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | HardiRathod/table-linker | PairwiseNetwork | false | 8,217 | [
"MIT"
] | 21 | 5d0542608cdba72b0d7d8afc58c27f27b8a59192 | https://github.com/HardiRathod/table-linker/tree/5d0542608cdba72b0d7d8afc58c27f27b8a59192 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.fc1 = nn.Linear(hidden_size, 2 * hidden_size)
self.fc2 = nn.Linear(2 * hidden_size, hidden_size)
self.fc3 = nn.Linear(hidden_size, hi... |
SANet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 calc_mean_std(feat, eps=1e-05):
size = feat.size()
assert len(size) == 4
N, C = size[:2]
feat_var = feat.view(N, C, -1).var(dim=2) + eps
feat_std = feat_var.sqrt().view(N, C, 1, 1)
feat_mean = feat.view(N, C, -1).mean(dim=2).view(N, C, 1, 1)
return fe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | HalbertCH/IEContraAST | SANet | false | 8,218 | [
"MIT"
] | 39 | 50ee949f5302a7e4a3cae3226610c03462093c21 | https://github.com/HalbertCH/IEContraAST/tree/50ee949f5302a7e4a3cae3226610c03462093c21 | import torch
import torch.nn as nn
def calc_mean_std(feat, eps=1e-05):
size = feat.size()
assert len(size) == 4
N, C = size[:2]
feat_var = feat.view(N, C, -1).var(dim=2) + eps
feat_std = feat_var.sqrt().view(N, C, 1, 1)
feat_mean = feat.view(N, C, -1).mean(dim=2).view(N, C, 1, 1)
return fe... |
residualUnit | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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.nn.functional as F
import torch.utils.data
import torch.nn.init as init
import torch.nn.init
class conv23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=True, dilation=1, nd=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | ForrestPi/Unsupervised-Defect-Segmentation | residualUnit | false | 8,219 | [
"MIT"
] | 17 | e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | https://github.com/ForrestPi/Unsupervised-Defect-Segmentation/tree/e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | import torch
import numpy as np
from torch import nn
import torch.nn.functional as F
import torch.utils.data
import torch.nn.init as init
import torch.nn.init
class conv23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1, bias=True, dilation=1, nd=... |
Encoder5 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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
class Encoder5(nn.Module):
def __init__(self, model=None, fixed=False):
super(Encoder5, self).__init__()
self.fixed = fixed
self.conv0 = nn.Conv2d(3, 3, 1, 1, 0)
self.conv0.weight = nn.Parameter(torch.from_numpy(np.array([[[[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 import triton_helpers
from torch._inductor.runtime.... | EndyWon/Texture-Reformer | Encoder5 | false | 8,220 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import numpy as np
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv0 = nn.Conv2d(3, 3, 1, 1, 0)
self.conv0.weight = nn.Parameter(torch.from_numpy(np.array([[[[0]],
[[... |
convTranspose23DUnit | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
from torch import nn
import torch.utils.data
import torch.nn.init as init
import torch.nn.init
class convTranspose23DUnit(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, output_padding=0, groups=1, bias=True, dilation=1, nd=2):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
from torch import nn
import torch.utils.data
import torch.nn.... | ForrestPi/Unsupervised-Defect-Segmentation | convTranspose23DUnit | false | 8,221 | [
"MIT"
] | 17 | e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | https://github.com/ForrestPi/Unsupervised-Defect-Segmentation/tree/e366ac7c757bb1b45f38ebbc502dfee7ccb72398 | import torch
import numpy as np
from torch import nn
import torch.utils.data
import torch.nn.init as init
import torch.nn.init
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, output_padding=0, groups=1, bias=True, dilation=1, nd=2):
super().... |
ConvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Conv3x3(nn.Module):
"""Layer to pad and convolve input
"""
def __init__(self, in_channels, out_channels, bias=True):
super(Conv3x3, self).__init__()
self.pad = nn.ZeroPad2d(1)
self.conv = nn.Conv2d(int(in_channels), int(out_channels), 3, bi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | HalleyJiang/UniFuse-Unidirectional-Fusion | ConvBlock | false | 8,222 | [
"MIT"
] | 30 | 27a4441fe3d3031d1c9f3eb2d72a3624407d19fc | https://github.com/HalleyJiang/UniFuse-Unidirectional-Fusion/tree/27a4441fe3d3031d1c9f3eb2d72a3624407d19fc | import torch
import torch.nn as nn
class Conv3x3(nn.Module):
"""Layer to pad and convolve input
"""
def __init__(self, in_channels, out_channels, bias=True):
super().__init__()
self.pad = nn.ZeroPad2d(1)
self.conv = nn.Conv2d(int(in_channels), int(out_channels), 3, bias=bias
... |
NodeMaxpool3by3 | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.cuda
class NodeMaxpool3by3(nn.Module):
def __init__(self):
super(NodeMaxpool3by3, self).__init__()
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=1, padding=1)
def init_weights(self):
pass
def forward(self, x):
return 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
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.cuda
assert_size_stride = torch._C._dynamo.guards.asse... | HanseulJo/COMBO_NKmodel | NodeMaxpool3by3 | false | 8,223 | [
"BSD-2-Clause-FreeBSD"
] | 38 | 6dcee4c39d4cf200f44677925712ce57255d1489 | https://github.com/HanseulJo/COMBO_NKmodel/tree/6dcee4c39d4cf200f44677925712ce57255d1489 | import torch
import torch.nn as nn
import torch.cuda
class Model(nn.Module):
def __init__(self):
super().__init__()
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=1, padding=1)
def init_weights(self):
pass
def forward(self, x):
return self.maxpool(x)
def get_inputs(... |
dnn_generator | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class dnn_generator(nn.Module):
def weight_init(self):
nn.init.xavier_uniform_(self.fc1.weight)
nn.init.xavier_uniform_(self.fc2.weight)
nn.init.xavier_uniform_(self.fc3.weight)
nn.init.xavier_uniform_(self.out.wei... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | Harshitmalaviya/whisper-to-normal-speech-conversion | dnn_generator | false | 8,224 | [
"MIT"
] | 23 | a6d411b27a3c5cc4ad12e3968350b22d88b9b4d9 | https://github.com/Harshitmalaviya/whisper-to-normal-speech-conversion/tree/a6d411b27a3c5cc4ad12e3968350b22d88b9b4d9 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def weight_init(self):
nn.init.xavier_uniform_(self.fc1.weight)
nn.init.xavier_uniform_(self.fc2.weight)
nn.init.xavier_uniform_(self.fc3.weight)
nn.init.xavier_uniform_(self.out.weight)
... |
CircleLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import Tensor
import torch.nn as nn
class CircleLoss(nn.Module):
def __init__(self, m: 'float', gamma: 'float') ->None:
super(CircleLoss, self).__init__()
self.m = m
self.gamma = gamma
self.soft_plus = nn.Softplus()
def forward(self, sp: 'Tensor', sn: ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | HaochengWan/PVT | CircleLoss | false | 8,225 | [
"MIT"
] | 27 | 95818d303ee63084f044a057344b2049d1fa4492 | https://github.com/HaochengWan/PVT/tree/95818d303ee63084f044a057344b2049d1fa4492 | import torch
from torch import Tensor
import torch.nn as nn
class Model(nn.Module):
def __init__(self, m: 'float', gamma: 'float') ->None:
super().__init__()
self.m = m
self.gamma = gamma
self.soft_plus = nn.Softplus()
def forward(self, sp: 'Tensor', sn: 'Tensor') ->Tensor:
... |
Decoder5 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Decoder5(nn.Module):
def __init__(self, model=None, fixed=False):
super(Decoder5, self).__init__()
self.fixed = fixed
self.conv51 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv44 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv43 = nn.Conv2d(512,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | EndyWon/Texture-Reformer | Decoder5 | false | 8,226 | [
"MIT"
] | 11 | f84f95accb3574c7b759a7f03c0b0b4e150314b5 | https://github.com/EndyWon/Texture-Reformer/tree/f84f95accb3574c7b759a7f03c0b0b4e150314b5 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, model=None, fixed=False):
super().__init__()
self.fixed = fixed
self.conv51 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv44 = nn.Conv2d(512, 512, 3, 1, 0)
self.conv43 = nn.Conv2d(512, 512, 3, 1, 0)
... |
Swish | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torch.nn as nn
from math import sqrt as sqrt
from itertools import product as product
class Swish(nn.Module):
def forward(self, x):
return x.mul_(torch.sigmoid(x))
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[]... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
from math import sqrt as sqrt
from itertools import product as product
assert_size_stride = to... | Het-Shah/Monk_Object_Detection | Swish | false | 8,227 | [
"Apache-2.0"
] | 15 | 1d7a07193ea3455221caa41d07c33c81d50c6b3f | https://github.com/Het-Shah/Monk_Object_Detection/tree/1d7a07193ea3455221caa41d07c33c81d50c6b3f | import torch
import torch.utils.data
import torch.nn as nn
from math import sqrt as sqrt
from itertools import product as product
class Model(nn.Module):
def forward(self, x):
return x.mul_(torch.sigmoid(x))
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
BackprojectDepth | # 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 BackprojectDepth(nn.Module):
"""Layer to transform a depth image into a point cloud
"""
def __init__(self, batch_size, height, width):
super(BackprojectDepth, self).__init__()
self.batch_size = batch_size
self.height = height
self.w... | 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... | HalleyJiang/PLNet | BackprojectDepth | false | 8,228 | [
"MIT"
] | 16 | a02bd5f343b9e4766891fd234e3a338c1eaa26ff | https://github.com/HalleyJiang/PLNet/tree/a02bd5f343b9e4766891fd234e3a338c1eaa26ff | import torch
import torch.nn as nn
class Model(nn.Module):
"""Layer to transform a depth image into a point cloud
"""
def __init__(self, batch_size, height, width):
super().__init__()
self.batch_size = batch_size
self.height = height
self.width = width
self.ones = ... |
AlterCoAttn | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.autograd
import torch.nn
class Attn(nn.Module):
"""
Unit attention operation for alternating co-attention.
``https://arxiv.org/pdf/1606.00061.pdf``
.. math::
\\begin{array}{ll}
H = \\tanh(W_x * X + (W_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | HCY123902/visdial-gnn | AlterCoAttn | false | 8,229 | [
"MIT"
] | 44 | c38090c672cdf04a4fabe139f96d944fd82cb123 | https://github.com/HCY123902/visdial-gnn/tree/c38090c672cdf04a4fabe139f96d944fd82cb123 | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.autograd
import torch.nn
class Attn(nn.Module):
"""
Unit attention operation for alternating co-attention.
``https://arxiv.org/pdf/1606.00061.pdf``
.. math::
\\begin{array}{ll}
H = \\tanh(W_x * X + (W_... |
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.nn.functional as F
def init_linear_wt(linear):
nn.init.xavier_uniform_(linear.weight)
if linear.bias is not None:
n = linear.bias.size(0)
start, end = n // 4, n // 2
linear.bias.data.fill_(0.0)
linear.bias.data[start:e... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | HLTCHKUST/sentiment-lookahead | Attention | false | 8,230 | [
"MIT"
] | 13 | 1c076b7c5c31b0f7c454720377db4e733838ebb2 | https://github.com/HLTCHKUST/sentiment-lookahead/tree/1c076b7c5c31b0f7c454720377db4e733838ebb2 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def init_linear_wt(linear):
nn.init.xavier_uniform_(linear.weight)
if linear.bias is not None:
n = linear.bias.size(0)
start, end = n // 4, n // 2
linear.bias.data.fill_(0.0)
linear.bias.data[start:e... |
ResidualBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class ResidualBlock(nn.Module):
def __init__(self, channels):
super(ResidualBlock, self).__init__()
self.channels = channels
self.conv1 = nn.Conv2d(channels, channels, kernel_size=3, padding=1)
self.conv2 = nn.Conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | HuangCongQing/pytorch | ResidualBlock | false | 8,231 | [
"MIT"
] | 12 | 2b2b01d74b45cbe4e467da229798609e79cec97c | https://github.com/HuangCongQing/pytorch/tree/2b2b01d74b45cbe4e467da229798609e79cec97c | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, channels):
super().__init__()
self.channels = channels
self.conv1 = nn.Conv2d(channels, channels, kernel_size=3, padding=1)
self.conv2 = nn.Conv2d(channels, channels, kern... |
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 torch
from torch import nn
from torch.nn import Parameter
class ScaleNorm(nn.Module):
"""ScaleNorm"""
def __init__(self, scale, eps=1e-05):
super(ScaleNorm, self).__init__()
self.scale = Parameter(torch.tensor(scale))
self.eps = eps
def forward(self, x):
norm = sel... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
from to... | HerbertMcSnout/transformers_with_trees | ScaleNorm | false | 8,232 | [
"MIT"
] | 18 | 1afa6d4ad45207c9b2762600a9c227d721fbc825 | https://github.com/HerbertMcSnout/transformers_with_trees/tree/1afa6d4ad45207c9b2762600a9c227d721fbc825 | import torch
from torch import nn
from torch.nn import Parameter
class Model(nn.Module):
"""ScaleNorm"""
def __init__(self, scale, eps=1e-05):
super().__init__()
self.scale = Parameter(torch.tensor(scale))
self.eps = eps
def forward(self, x):
norm = self.scale / torch.nor... |
JointsMSELoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class JointsMSELoss(nn.Module):
def __init__(self, use_target_weight):
super(JointsMSELoss, self).__init__()
self.criterion = nn.MSELoss(reduction='mean')
... | 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.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
assert_size_st... | HowieMa/TransFusion-Pose | JointsMSELoss | false | 8,233 | [
"MIT"
] | 17 | b66ee5bafdc12a971088f9d54233408249e067db | https://github.com/HowieMa/TransFusion-Pose/tree/b66ee5bafdc12a971088f9d54233408249e067db | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, use_target_weight):
super().__init__()
self.criterion = nn.MSELoss(reduction='mean')
self.use_target_weight... |
WBCEDiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
def dice_loss(pred, target, smooth=1e-08):
iflat = pred.view(-1)
tflat = target.view(-1)
intersection = (iflat * tflat).sum()
return 1 - (2.0 * intersection + smooth) / (iflat.sum() + tflat.sum() +
smooth)
def weighted_binary... | 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
... | Hhhhhhhhhhao/change_detection | WBCEDiceLoss | false | 8,234 | [
"MIT"
] | 11 | 13b87c02166cc98d39d8be240a07abcf12893fe3 | https://github.com/Hhhhhhhhhhao/change_detection/tree/13b87c02166cc98d39d8be240a07abcf12893fe3 | import torch
import torch.nn as nn
import torch.nn.functional as F
def dice_loss(pred, target, smooth=1e-08):
iflat = pred.view(-1)
tflat = target.view(-1)
intersection = (iflat * tflat).sum()
return 1 - (2.0 * intersection + smooth) / (iflat.sum() + tflat.sum() +
smooth)
def weighted_binary... |
Norm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Norm(nn.Module):
def __init__(self, d_model, eps=1e-06):
super().__init__()
self.size = d_model
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.zeros(self.size))
self.eps = eps
def forward(self, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | Hyunseung-Kim/molGCT | Norm | false | 8,236 | [
"Apache-2.0"
] | 10 | 5a2604337cf0a9d3c725295ccb7c8ea4b0144636 | https://github.com/Hyunseung-Kim/molGCT/tree/5a2604337cf0a9d3c725295ccb7c8ea4b0144636 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, d_model, eps=1e-06):
super().__init__()
self.size = d_model
self.alpha = nn.Parameter(torch.ones(self.size))
self.bias = nn.Parameter(torch.zeros(self.size))
self.eps = eps
def forward(self,... |
InceptionA | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class InceptionA(nn.Module):
def __init__(self, in_channels):
super(InceptionA, self).__init__()
self.branch1x1 = nn.Conv2d(in_channels, 16, kernel_size=1)
self.branch5x5_1 = nn.Conv2d(in_channels, 16, kernel_size=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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | HuangCongQing/pytorch | InceptionA | false | 8,237 | [
"MIT"
] | 12 | 2b2b01d74b45cbe4e467da229798609e79cec97c | https://github.com/HuangCongQing/pytorch/tree/2b2b01d74b45cbe4e467da229798609e79cec97c | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels):
super().__init__()
self.branch1x1 = nn.Conv2d(in_channels, 16, kernel_size=1)
self.branch5x5_1 = nn.Conv2d(in_channels, 16, kernel_size=1)
self.branch5x5_2 =... |
Concat | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 Concat(nn.Module):
def __init__(self, channels, **kwargs):
super(Concat, self).__init__()
self.conv = nn.Conv2d(channels * 2, channels, 1, bias=False)
self.relu = nn.ReLU(inplace=True)
def forward(self, equi_feat, c2e_feat):
x = torch.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | HalleyJiang/UniFuse-Unidirectional-Fusion | Concat | false | 8,238 | [
"MIT"
] | 30 | 27a4441fe3d3031d1c9f3eb2d72a3624407d19fc | https://github.com/HalleyJiang/UniFuse-Unidirectional-Fusion/tree/27a4441fe3d3031d1c9f3eb2d72a3624407d19fc | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, channels, **kwargs):
super().__init__()
self.conv = nn.Conv2d(channels * 2, channels, 1, bias=False)
self.relu = nn.ReLU(inplace=True)
def forward(self, equi_feat, c2e_feat):
x = torch.cat([equi_fea... |
AveragePoolingLayer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
from torch.nn import functional as F
class AveragePoolingLayer(nn.Module):
"""Implements the average pooling layer.
Basically, this layer can be used to downsample feature maps from spatial
domain.
"""
def __init__(self, scale_factor=2):
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | Hsintien-Ng/idinvert_pytorch-reproduced | AveragePoolingLayer | false | 8,239 | [
"MIT"
] | 20 | cf3302510573138cf16202add06feae7c93624ea | https://github.com/Hsintien-Ng/idinvert_pytorch-reproduced/tree/cf3302510573138cf16202add06feae7c93624ea | import torch
import torch.nn as nn
from torch.nn import functional as F
class Model(nn.Module):
"""Implements the average pooling layer.
Basically, this layer can be used to downsample feature maps from spatial
domain.
"""
def __init__(self, scale_factor=2):
super().__init__()
self.sca... |
CoAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 CoAttention(nn.Module):
"""
CoAttention encoder
in Dynamic Coattention Networks For Question Answering (https://arxiv.org/abs/1611.01604)
check the Figure 2 in paper
* Args:
embed_dim: the number of input embedd... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | GMDennis/claf | CoAttention | false | 8,240 | [
"MIT"
] | 10 | d1e064e593127e5d654f000f5506c5ae1caab5ce | https://github.com/GMDennis/claf/tree/d1e064e593127e5d654f000f5506c5ae1caab5ce | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""
CoAttention encoder
in Dynamic Coattention Networks For Question Answering (https://arxiv.org/abs/1611.01604)
check the Figure 2 in paper
* Args:
embed_dim: the number of input embedding di... |
ClassificationModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch.nn as nn
from math import sqrt as sqrt
from itertools import product as product
class ClassificationModel(nn.Module):
def __init__(self, num_features_in, num_anchors=9, num_classes=80,
prior=0.01, feature_size=256):
super(ClassificationModel, self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
impor... | Het-Shah/Monk_Object_Detection | ClassificationModel | false | 8,241 | [
"Apache-2.0"
] | 15 | 1d7a07193ea3455221caa41d07c33c81d50c6b3f | https://github.com/Het-Shah/Monk_Object_Detection/tree/1d7a07193ea3455221caa41d07c33c81d50c6b3f | import torch
import torch.utils.data
import torch.nn as nn
from math import sqrt as sqrt
from itertools import product as product
class Model(nn.Module):
def __init__(self, num_features_in, num_anchors=9, num_classes=80,
prior=0.01, feature_size=256):
super().__init__()
self.num_classes =... |
Temporal_Attention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
class Temporal_Attention(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,
padding=0, groups=1, bias=False, refinement=False):
super(Temporal_Attention, self).__init__(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | Herrccc/DR-TANet | Temporal_Attention | false | 8,242 | [
"MIT"
] | 12 | 37cc3929833d61451b2fa4a92ccd4286cfc4fd34 | https://github.com/Herrccc/DR-TANet/tree/37cc3929833d61451b2fa4a92ccd4286cfc4fd34 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
class Model(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,
padding=0, groups=1, bias=False, refinement=False):
super().__init__()
self.outc = out_channels
... |
MultiHeadAttn | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 MultiHeadAttn(nn.Module):
def __init__(self, query_dim, key_dim, value_dim, hidden_dim, num_head,
dropatt=0.0, act_func='softmax', add_zero_attn=False, pre_lnorm=
False, post_lnorm=False):
super(MultiHeadAttn, self).... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | HKUST-KnowComp/BMGF-RoBERTa | MultiHeadAttn | false | 8,243 | [
"MIT"
] | 16 | 8e9eebd7e9fb6cc2492131fc8eaa5b5b29d999fd | https://github.com/HKUST-KnowComp/BMGF-RoBERTa/tree/8e9eebd7e9fb6cc2492131fc8eaa5b5b29d999fd | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, query_dim, key_dim, value_dim, hidden_dim, num_head,
dropatt=0.0, act_func='softmax', add_zero_attn=False, pre_lnorm=
False, post_lnorm=False):
super().__init__()
assert h... |
UpConvNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
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 pixel_shuffle(input, scale_factor):
batch_size, channels, in_height, in_width = input.size()
out_channels = int(int(channels / scale_factor) / scale_factor)
out_height = int(in_height * scale_factor)
out_width = int(in_width * scale_factor)
if scale_factor >=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import 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... | Hubert482/cainapp | UpConvNorm | false | 8,244 | [
"MIT"
] | 18 | 7a74a9b186ee358168c8f050e445fbe9f91f9c47 | https://github.com/Hubert482/cainapp/tree/7a74a9b186ee358168c8f050e445fbe9f91f9c47 | import torch
import torch.nn as nn
def pixel_shuffle(input, scale_factor):
batch_size, channels, in_height, in_width = input.size()
out_channels = int(int(channels / scale_factor) / scale_factor)
out_height = int(in_height * scale_factor)
out_width = int(in_width * scale_factor)
if scale_factor >=... |
tofp16 | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.parallel
class tofp16(nn.Module):
def __init__(self):
super(tofp16, self).__init__()
def forward(self, input):
return input.half()
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.nn.parallel
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C... | HuaijiaLin/AGSS-VOS | tofp16 | false | 8,245 | [
"MIT"
] | 11 | e9272365aa45bf098316d7111238fe0ab8df8a17 | https://github.com/HuaijiaLin/AGSS-VOS/tree/e9272365aa45bf098316d7111238fe0ab8df8a17 | import torch
import torch.nn as nn
import torch.nn.parallel
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input):
return input.half()
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return []
|
RegressionModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch.nn as nn
from math import sqrt as sqrt
from itertools import product as product
class RegressionModel(nn.Module):
def __init__(self, num_features_in, num_anchors=9, feature_size=256):
super(RegressionModel, self).__init__()
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
import torch.utils.data
impor... | Het-Shah/Monk_Object_Detection | RegressionModel | false | 8,246 | [
"Apache-2.0"
] | 15 | 1d7a07193ea3455221caa41d07c33c81d50c6b3f | https://github.com/Het-Shah/Monk_Object_Detection/tree/1d7a07193ea3455221caa41d07c33c81d50c6b3f | import torch
import torch.utils.data
import torch.nn as nn
from math import sqrt as sqrt
from itertools import product as product
class Model(nn.Module):
def __init__(self, num_features_in, num_anchors=9, feature_size=256):
super().__init__()
self.conv1 = nn.Conv2d(num_features_in, feature_size, ... |
SpatialAttentionLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data.distributed
class SpatialAttentionLayer(nn.Module):
def __init__(self, spatial_size):
super(SpatialAttentionLayer, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.max_pool = nn.AdaptiveMaxPoo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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.... | HolmesShuan/Compact-Global-Descriptor | SpatialAttentionLayer | false | 8,247 | [
"BSD-2-Clause"
] | 24 | 715601bd7fce76596db960f7dc480241d443fa66 | https://github.com/HolmesShuan/Compact-Global-Descriptor/tree/715601bd7fce76596db960f7dc480241d443fa66 | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, spatial_size):
super().__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.max_pool = nn.AdaptiveMaxPool2d(1)
self.softmax = nn.Softmax(di... |
FeedForward | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class FeedForward(nn.Module):
def __init__(self, d_model, d_ff=2048, dropout=0.1):
super().__init__()
self.linear_1 = nn.Linear(d_model, d_ff)
self.dropout = nn.Dropout(dropout)
self.linear_2 = nn.Linear(d_ff, d_mo... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | Hyunseung-Kim/molGCT | FeedForward | false | 8,248 | [
"Apache-2.0"
] | 10 | 5a2604337cf0a9d3c725295ccb7c8ea4b0144636 | https://github.com/Hyunseung-Kim/molGCT/tree/5a2604337cf0a9d3c725295ccb7c8ea4b0144636 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, d_model, d_ff=2048, dropout=0.1):
super().__init__()
self.linear_1 = nn.Linear(d_model, d_ff)
self.dropout = nn.Dropout(dropout)
self.linear_2 = nn.Linear(d_ff, d_model)
... |
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 math
import torch
import torch.nn.functional as F
import torch.nn as nn
def attention(q, k, v, d_k, mask=None, dropout=None):
scores = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(d_k)
if mask is not None:
mask = mask.unsqueeze(1)
scores = scores.masked_fill(mask == 0, -1000000000.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 import triton_helpers
from torch._inductor.runtime.... | Hyunseung-Kim/molGCT | MultiHeadAttention | false | 8,249 | [
"Apache-2.0"
] | 10 | 5a2604337cf0a9d3c725295ccb7c8ea4b0144636 | https://github.com/Hyunseung-Kim/molGCT/tree/5a2604337cf0a9d3c725295ccb7c8ea4b0144636 | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
def attention(q, k, v, d_k, mask=None, dropout=None):
scores = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(d_k)
if mask is not None:
mask = mask.unsqueeze(1)
scores = scores.masked_fill(mask == 0, -1000000000.0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.