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
Homography
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 Homography(nn.Module): """Homography geometric model to be used together with ImageRegistrator module for the optimization-based image registration.""" def __init__(self) ->None: super().__init__() self.model = nn.Parameter(torch.eye(3)) ...
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...
YanivHollander/kornia
Homography
false
14,641
[ "ECL-2.0", "Apache-2.0" ]
418
ccd258d0956da89b1feca96448eff8e4969d405a
https://github.com/YanivHollander/kornia/tree/ccd258d0956da89b1feca96448eff8e4969d405a
import torch import torch.nn as nn class Model(nn.Module): """Homography geometric model to be used together with ImageRegistrator module for the optimization-based image registration.""" def __init__(self) ->None: super().__init__() self.model = nn.Parameter(torch.eye(3)) sel...
RepeatModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class RepeatModule(torch.nn.Module): def __init__(self, repeats): super(RepeatModule, self).__init__() self.repeats = repeats def forward(self, tensor): tensor = tensor + tensor return tensor.repeat(self.repeats)...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
RepeatModule
false
14,642
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, repeats): super().__init__() self.repeats = repeats def forward(self, tensor): tensor = tensor + tensor return tensor.repeat(self.repeats) def get_inputs(): ...
SimpleASinModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleASinModule(torch.nn.Module): def __init__(self): super(SimpleASinModule, self).__init__() def forward(self, a): return torch.asin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleASinModule
false
14,643
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.asin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleConvTranspose2dModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleConvTranspose2dModule(torch.nn.Module): def __init__(self, stride=1, padding=0, output_padding=0, dilation=1, groups=1): super(SimpleConvTranspose2dModule, self).__init__() self.str...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch...
YaronBenAtar/glow
SimpleConvTranspose2dModule
false
14,644
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, stride=1, padding=0, output_padding=0, dilation=1, groups=1): super().__init__() self.stride = stride self.padding = padding sel...
MultiHeadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.utils.data import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel from typing import Optional def generate_local_map_mask(chunk_size: 'int', attention_size: 'int', mask_future=False, device: 'torch.device'='cpu') ->torch.BoolTensor: """Compu...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YanLu-nyu/transferlearning
MultiHeadAttention
false
14,645
[ "MIT" ]
9,657
037806c6eb8b0c12aefbfbf3e35cbf893093cff9
https://github.com/YanLu-nyu/transferlearning/tree/037806c6eb8b0c12aefbfbf3e35cbf893093cff9
import torch import numpy as np import torch.utils.data import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel from typing import Optional def generate_local_map_mask(chunk_size: 'int', attention_size: 'int', mask_future=False, device: 'torch.device'='cpu') ->torch.BoolTensor: """Compu...
SimpleArgSortModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleArgSortModule(torch.nn.Module): def __init__(self, descending=True): super(SimpleArgSortModule, self).__init__() self.descending = descending def forward(self, inputs): return torch.argsort(inputs, dim=-1, de...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
SimpleArgSortModule
false
14,646
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, descending=True): super().__init__() self.descending = descending def forward(self, inputs): return torch.argsort(inputs, dim=-1, descending=self.descending) def get_inp...
SimpleAvgPool2dModule
# 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.onnx import torch.nn class SimpleAvgPool2dModule(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0): super(SimpleAvgPool2dModule, self).__init__() self.kernel_size = kernel_size self.padding ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleAvgPool2dModule
false
14,647
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0): super().__init__() self.kernel_size = kernel_size self.padding = padding self.stride = stride ...
SimpleAbsModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleAbsModule(torch.nn.Module): def __init__(self): super(SimpleAbsModule, self).__init__() def forward(self, a): return torch.abs(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleAbsModule
false
14,648
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.abs(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleATanModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleATanModule(torch.nn.Module): def __init__(self): super(SimpleATanModule, self).__init__() def forward(self, a): return torch.atan(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleATanModule
false
14,649
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.atan(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Wide_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 def match_score(s1, s2, mask1, mask2): """ s1, s2: batch_size * seq_len * dim """ _batch, seq_len, _dim = s1.shape s1 = s1 * mask1.eq(0).unsqueeze(2).float() s2 = s2 * mask2.eq(0).unsqueeze(2).float() s1 = s1.unsqueeze(2).repeat(1, 1, seq_len, 1) s2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
YJiangcm/Chinese-sentence-pair-modeling
Wide_Conv
false
14,650
[ "Apache-2.0" ]
49
90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
https://github.com/YJiangcm/Chinese-sentence-pair-modeling/tree/90adbc5c121832ce3e4a4057e30417a6ec5e7ebc
import torch import torch.nn as nn def match_score(s1, s2, mask1, mask2): """ s1, s2: batch_size * seq_len * dim """ _batch, seq_len, _dim = s1.shape s1 = s1 * mask1.eq(0).unsqueeze(2).float() s2 = s2 * mask2.eq(0).unsqueeze(2).float() s1 = s1.unsqueeze(2).repeat(1, 1, seq_len, 1) s2...
SimpleAddMmModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleAddMmModule(torch.nn.Module): def __init__(self, alpha=1, beta=1): super(SimpleAddMmModule, self).__init__() self.alpha = alpha self.beta = beta def forward(self, a, b, c): return (a + a).addmm(b, c) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
YaronBenAtar/glow
SimpleAddMmModule
false
14,651
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, alpha=1, beta=1): super().__init__() self.alpha = alpha self.beta = beta def forward(self, a, b, c): return (a + a).addmm(b, c) def get_inputs(): return [tor...
SimpleBmmModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleBmmModule(torch.nn.Module): def forward(self, a, b): return (a + a).bmm(b) def get_inputs(): return [torch.rand([4, 4, 4]), torch.rand([4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
YaronBenAtar/glow
SimpleBmmModule
false
14,652
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, a, b): return (a + a).bmm(b) def get_inputs(): return [torch.rand([4, 4, 4]), torch.rand([4, 4, 4])] def get_init_inputs(): return []
SimpleAvgPool1dModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleAvgPool1dModule(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0): super(SimpleAvgPool1dModule, self).__init__() self.kernel_size = kernel_size self.padding ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleAvgPool1dModule
false
14,653
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, kernel_size, stride=None, padding=0): super().__init__() self.kernel_size = kernel_size self.padding = padding self.stride = stride ...
SimpleClampMinModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleClampMinModel(torch.nn.Module): def __init__(self, min): super(SimpleClampMinModel, self).__init__() self.min = min def forward(self, input): return torch.clamp_min(input, self.min) def get_inputs(): re...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
SimpleClampMinModel
false
14,654
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, min): super().__init__() self.min = min def forward(self, input): return torch.clamp_min(input, self.min) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def g...
SimpleCeilModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleCeilModule(torch.nn.Module): def forward(self, a, b): c = a + b return torch.ceil(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleCeilModule
false
14,655
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, a, b): c = a + b return torch.ceil(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleAndModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleAndModule(torch.nn.Module): def __init__(self): super(SimpleAndModule, self).__init__() def forward(self, a, b): c = torch.logical_and(a, b) return torch.logical_and(c, c) def get_inputs(): return [torc...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleAndModule
false
14,656
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): c = torch.logical_and(a, b) return torch.logical_and(c, c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.ran...
SimpleNotModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleNotModule(torch.nn.Module): def __init__(self): super(SimpleNotModule, self).__init__() def forward(self, a): b = torch.logical_not(a) return torch.logical_not(b) def get_inputs(): return [torch.rand([4...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleNotModule
false
14,657
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): b = torch.logical_not(a) return torch.logical_not(b) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inp...
SimpleCosModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleCosModule(torch.nn.Module): def __init__(self): super(SimpleCosModule, self).__init__() def forward(self, a): return torch.cos(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleCosModule
false
14,658
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.cos(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleFmodModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleFmodModule(torch.nn.Module): def __init__(self): super(SimpleFmodModule, self).__init__() def forward(self, a, b): if b.size() == torch.Size([]): c = a.fmod(b.item()) else: c = a.fmod(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleFmodModule
false
14,659
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): if b.size() == torch.Size([]): c = a.fmod(b.item()) else: c = a.fmod(b) return c.fmod(torch.te...
SimpleLinearModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleLinearModule(torch.nn.Module): def __init__(self): super(SimpleLinearModule, self).__init__() def forward(self, input, weight, bias=None): return F.linear(input + input, weight, bias) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
YaronBenAtar/glow
SimpleLinearModule
false
14,660
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, input, weight, bias=None): return F.linear(input + input, weight, bias) def get_inputs(): return [torch...
SimpleFloorModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleFloorModule(torch.nn.Module): def forward(self, a, b): c = a + b return torch.floor(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleFloorModule
false
14,661
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, a, b): c = a + b return torch.floor(c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleExpModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleExpModule(torch.nn.Module): def forward(self, input): other = torch.exp(input) return torch.exp(other) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleExpModule
false
14,662
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, input): other = torch.exp(input) return torch.exp(other) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleCumSumModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleCumSumModule(torch.nn.Module): def __init__(self, dim): super(SimpleCumSumModule, self).__init__() self.dim = dim def forward(self, tensor): return torch.cumsum(tensor, self.dim) def get_inputs(): retur...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleCumSumModule
false
14,663
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dim): super().__init__() self.dim = dim def forward(self, tensor): return torch.cumsum(tensor, self.dim) def get_inputs(): return [torch.rand([4, 4, 4, 4, 4])] def...
SimpleMinModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleMinModule(torch.nn.Module): def __init__(self): super(SimpleMinModule, self).__init__() def forward(self, a, b): return torch.min(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
SimpleMinModule
false
14,664
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): return torch.min(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inpu...
SimpleGeluModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleGeluModule(torch.nn.Module): def forward(self, tensor): return F.gelu(tensor + tensor) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleGeluModule
false
14,665
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def forward(self, tensor): return F.gelu(tensor + tensor) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleLogModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleLogModule(torch.nn.Module): def __init__(self, *dimensions): super(SimpleLogModule, self).__init__() def forward(self, a): b = torch.log(a) return torch.log(b) def get_inputs(): return [torch.rand([4, 4...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleLogModule
false
14,666
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, *dimensions): super().__init__() def forward(self, a): b = torch.log(a) return torch.log(b) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
SimpleMatmulModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleMatmulModule(torch.nn.Module): def __init__(self): super(SimpleMatmulModule, self).__init__() def forward(self, a, b): return a.matmul(b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C...
YaronBenAtar/glow
SimpleMatmulModule
false
14,667
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): return a.matmul(b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inputs(): ...
SimpleMulModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleMulModule(torch.nn.Module): def __init__(self): super(SimpleMulModule, self).__init__() def forward(self, left, right): other = left.mul(right.item() if right.size() == torch.Size([]) else right) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleMulModule
false
14,668
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, left, right): other = left.mul(right.item() if right.size() == torch.Size([]) else right) return other.mul(other) def g...
SimpleModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleModule(torch.nn.Module): def __init__(self): super(SimpleModule, self).__init__() def forward(self, x): y = x + x y = y + 2 return y def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleModule
false
14,669
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): y = x + x y = y + 2 return y def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): retur...
SimpleConv2dModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleConv2dModule(torch.nn.Module): def __init__(self, stride=1, padding=0, dilation=1, groups=1): super(SimpleConv2dModule, self).__init__() self.stride = stride self.padding = padding ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch...
YaronBenAtar/glow
SimpleConv2dModule
false
14,670
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, stride=1, padding=0, dilation=1, groups=1): super().__init__() self.stride = stride self.padding = padding self.dilation = dilation ...
SimpleOrModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleOrModule(torch.nn.Module): def __init__(self): super(SimpleOrModule, self).__init__() def forward(self, a, b): c = torch.logical_or(a, b) return torch.logical_or(c, c) def get_inputs(): return [torch.ra...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleOrModule
false
14,671
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): c = torch.logical_or(a, b) return torch.logical_or(c, c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand(...
SimpleLogSoftmaxModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleLogSoftmaxModel(torch.nn.Module): def __init__(self, dimension): super(SimpleLogSoftmaxModel, self).__init__() self.dimension = dimension def forward(self, tensor): return F.lo...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit impor...
YaronBenAtar/glow
SimpleLogSoftmaxModel
false
14,672
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dimension): super().__init__() self.dimension = dimension def forward(self, tensor): return F.log_softmax(tensor, self.dimension) def get...
Foo
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.jit import torch.onnx import torch.nn class Foo(torch.nn.Module): def __init__(self): super(Foo, self).__init__() self.conv1 = torch.nn.Conv2d(3, 6, 3) self.relu = torch.nn.ReLU() self.conv2 = torch.nn.Conv2d(6, 16, 3) def forward(self, x): x...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch...
YaronBenAtar/glow
Foo
false
14,673
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = torch.nn.Conv2d(3, 6, 3) self.relu = torch.nn.ReLU() self.conv2 = torch.nn.Conv2d(6, 16, 3) def forward(self, x): x = self...
SimpleReluModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleReluModel(torch.nn.Module): def __init__(self, inplace=False): super(SimpleReluModel, self).__init__() self.inplace = inplace def forward(self, tensor): other = F.relu(tensor, ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
SimpleReluModel
false
14,674
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, inplace=False): super().__init__() self.inplace = inplace def forward(self, tensor): other = F.relu(tensor, inplace=self.inplace) r...
SimpleLeakyReluModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleLeakyReluModule(torch.nn.Module): def __init__(self, negative_slope=0.01, inplace=False): super(SimpleLeakyReluModule, self).__init__() self.negative_slope = negative_slope self.inplace = inplace def forward(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleLeakyReluModule
false
14,675
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, negative_slope=0.01, inplace=False): super().__init__() self.negative_slope = negative_slope self.inplace = inplace def forward(self, a): return torch.nn.functiona...
SimplePowModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimplePowModule(torch.nn.Module): def __init__(self, power): super(SimplePowModule, self).__init__() self.power = power def forward(self, tensor): return torch.pow(tensor, self.power) def get_inputs(): return...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimplePowModule
false
14,676
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, power): super().__init__() self.power = power def forward(self, tensor): return torch.pow(tensor, self.power) def get_inputs(): return [torch.rand([4, 4, 4, 4])] d...
SimpleMaxModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleMaxModule(torch.nn.Module): def __init__(self): super(SimpleMaxModule, self).__init__() def forward(self, a, b): return torch.max(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
SimpleMaxModule
false
14,677
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): return torch.max(a + a, b + b) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])] def get_init_inpu...
SimpleXorModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleXorModule(torch.nn.Module): def __init__(self): super(SimpleXorModule, self).__init__() def forward(self, a, b): c = torch.logical_xor(a, b) return torch.logical_xor(c, c) def get_inputs(): return [torc...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleXorModule
false
14,678
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a, b): c = torch.logical_xor(a, b) return torch.logical_xor(c, c) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.ran...
SimpleReciprocalModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleReciprocalModel(torch.nn.Module): def __init__(self, inplace=False): super(SimpleReciprocalModel, self).__init__() self.inplace = inplace def forward(self, tensor): other = tensor + tensor return othe...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleReciprocalModel
false
14,679
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, inplace=False): super().__init__() self.inplace = inplace def forward(self, tensor): other = tensor + tensor return other.reciprocal_() if self.inplace else torch....
SimpleSinModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleSinModule(torch.nn.Module): def __init__(self): super(SimpleSinModule, self).__init__() def forward(self, a): return torch.sin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs():...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit import torch.onnx import torch.nn assert_size_stride = t...
YaronBenAtar/glow
SimpleSinModule
false
14,680
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.sin(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleTanhModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleTanhModel(torch.nn.Module): def __init__(self, inplace=False): super(SimpleTanhModel, self).__init__() self.inplace = inplace def forward(self, tensor): tensor = tensor + tensor return tensor.tanh_() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._...
YaronBenAtar/glow
SimpleTanhModel
false
14,681
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, inplace=False): super().__init__() self.inplace = inplace def forward(self, tensor): tensor = tensor + tensor return tensor.tanh_() if self.inplace else tensor.tan...
UnaryMaxModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class UnaryMaxModule(torch.nn.Module): def __init__(self): super(UnaryMaxModule, self).__init__() def forward(self, a): return torch.max(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
UnaryMaxModule
false
14,682
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.max(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleSoftmaxModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class SimpleSoftmaxModel(torch.nn.Module): def __init__(self, dimension): super(SimpleSoftmaxModel, self).__init__() self.dimension = dimension def forward(self, tensor): return F.softmax(...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.jit impor...
YaronBenAtar/glow
SimpleSoftmaxModel
false
14,683
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dimension): super().__init__() self.dimension = dimension def forward(self, tensor): return F.softmax(tensor, self.dimension) def get_inp...
SimpleReshapeModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleReshapeModel(torch.nn.Module): def __init__(self, shape): super(SimpleReshapeModel, self).__init__() self.shape = shape def forward(self, tensor): combined = tensor + tensor return combined.reshape(se...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleReshapeModel
false
14,684
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, shape): super().__init__() self.shape = shape def forward(self, tensor): combined = tensor + tensor return combined.reshape(self.shape) def get_inputs(): ret...
SimpleTypeasModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleTypeasModel(torch.nn.Module): def __init__(self): super(SimpleTypeasModel, self).__init__() def forward(self, tensor, other=None): other = tensor if other is None else other if tensor.dtype != torch.bool: ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleTypeasModel
false
14,685
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, tensor, other=None): other = tensor if other is None else other if tensor.dtype != torch.bool: tensor = tensor + tensor ...
UnaryMinModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class UnaryMinModule(torch.nn.Module): def __init__(self): super(UnaryMinModule, self).__init__() def forward(self, a): return torch.min(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
UnaryMinModule
false
14,686
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, a): return torch.min(a + a) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
SimpleSumModule
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleSumModule(torch.nn.Module): def __init__(self, dtype=None): super(SimpleSumModule, self).__init__() self.dtype = dtype def forward(self, a): b = a + a return torch.sum(b, dtype=self.dtype) def get_i...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo....
YaronBenAtar/glow
SimpleSumModule
false
14,687
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dtype=None): super().__init__() self.dtype = dtype def forward(self, a): b = a + a return torch.sum(b, dtype=self.dtype) def get_inputs(): return [torch.rand...
SimpleStackModel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.jit import torch.onnx import torch.nn class SimpleStackModel(torch.nn.Module): def __init__(self, dim): super(SimpleStackModel, self).__init__() self.dim = dim def forward(self, a, b): c = b + b return torch.stack((a, c), dim=self.dim) def get_inpu...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.jit import torch.onnx import torch.nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torc...
YaronBenAtar/glow
SimpleStackModel
false
14,688
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self, dim): super().__init__() self.dim = dim def forward(self, a, b): c = b + b return torch.stack((a, c), dim=self.dim) def get_inputs(): return [torch.rand([4, ...
SpatialAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SpatialAttention(nn.Module): def __init__(self, kernel_size=7): super(SpatialAttention, self).__init__() assert kernel_size in (3, 7), 'kernel size must be 3 or 7' padding = 3 if kernel_size == 7 else 1 self.conv1 = nn.Conv2d(2, 1, kernel_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_...
YeRen123455/Infrared-Small-Target-Detection
SpatialAttention
false
14,689
[ "MIT" ]
62
23d84f436afb422d0d0b6cbf65305e1b53aea6db
https://github.com/YeRen123455/Infrared-Small-Target-Detection/tree/23d84f436afb422d0d0b6cbf65305e1b53aea6db
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, kernel_size=7): super().__init__() assert kernel_size in (3, 7), 'kernel size must be 3 or 7' padding = 3 if kernel_size == 7 else 1 self.conv1 = nn.Conv2d(2, 1, kernel_size, padding=padding, bias=False)...
QNetworkSmall
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 QNetworkSmall(nn.Module): def __init__(self, state_size, action_size, seed): """ Build a fully connected neural network state_size (int): State dimension action_size (int): Action dimension seed (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 import torch.nn as nn assert_...
Yigit-Arisoy/deep-rts
QNetworkSmall
false
14,690
[ "MIT" ]
144
a5ed2c29b76789830df9f7075480c7229ccf0f4d
https://github.com/Yigit-Arisoy/deep-rts/tree/a5ed2c29b76789830df9f7075480c7229ccf0f4d
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_size, action_size, seed): """ Build a fully connected neural network state_size (int): State dimension action_size (int): Action dimension seed (int): rando...
SimpleSoftPlusModel
# 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.onnx import torch.nn class SimpleSoftPlusModel(torch.nn.Module): def __init__(self): super(SimpleSoftPlusModel, self).__init__() def forward(self, tensor): tensor = tensor + tensor return F.softplus(tensor) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torch.jit import torch.onnx import torch.nn assert_size...
YaronBenAtar/glow
SimpleSoftPlusModel
false
14,691
[ "Apache-2.0" ]
2,838
a13706a4239fa7eaf059c670dc573e3eb0768f86
https://github.com/YaronBenAtar/glow/tree/a13706a4239fa7eaf059c670dc573e3eb0768f86
import torch import torch.jit import torch.nn.functional as F import torch.onnx import torch.nn class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, tensor): tensor = tensor + tensor return F.softplus(tensor) def get_inputs(): return [torch.ran...
GRUCell
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn.functional as F from torch import nn class GRUCell(nn.Module): def __init__(self, input_size, hidden_size, bias=True): super(GRUCell, self).__init__() self.input_size = input_size self.hidden_size = hidden_size self.bias = 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 numpy as np ...
YilliaJing/PM2.5-GNN
GRUCell
false
14,692
[ "MIT" ]
91
7aacc6b6b9562ad2a9dad6197e6c4d73607ebdf2
https://github.com/YilliaJing/PM2.5-GNN/tree/7aacc6b6b9562ad2a9dad6197e6c4d73607ebdf2
import torch import numpy as np import torch.nn.functional as F from torch import nn class Model(nn.Module): def __init__(self, input_size, hidden_size, bias=True): super().__init__() self.input_size = input_size self.hidden_size = hidden_size self.bias = bias self.x2h = n...
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...
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import * class Attention(nn.Module): def __init__(self, opt): super(Attention, self).__init__() self.rnn_size = opt.rnn_size self.att_hid_size = opt.att_hid...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YinTaiChen/NeuralBabyTalk
Attention
false
14,693
[ "MIT" ]
554
2915ca702657866dc5b6b44614d0f6333c72bd3b
https://github.com/YinTaiChen/NeuralBabyTalk/tree/2915ca702657866dc5b6b44614d0f6333c72bd3b
from _paritybench_helpers import _mock_config import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import * class Model(nn.Module): def __init__(self, opt): super().__init__() self.rnn_size = opt.rnn_size self.att_hid_size = opt.att_hid_size self....
SeparableConv1D
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SeparableConv1D(nn.Module): """Depthwise separable 1D convolution. Args: in_channels (int): Number of input channels. out_channels (int): Number of output channels. kernel_size (int): Size of the convolving kernel. stride (int): Stride o...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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...
YiwenShaoStephen/snowfall
SeparableConv1D
false
14,694
[ "Apache-2.0" ]
145
949226f35b29c629cb03cae36fa43da5993d27a3
https://github.com/YiwenShaoStephen/snowfall/tree/949226f35b29c629cb03cae36fa43da5993d27a3
import torch from torch import nn class Model(nn.Module): """Depthwise separable 1D convolution. Args: in_channels (int): Number of input channels. out_channels (int): Number of output channels. kernel_size (int): Size of the convolving kernel. stride (int): Stride of the conv...
ScaledDotProductAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.utils.data import torch.nn as nn class ScaledDotProductAttention(nn.Module): """ Scaled dot-product attention """ def __init__(self, *, d_model: int, d_k: int, d_v: int, h: int): """ :param d_model: Output dimensionality of the model ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YehLi/xmodaler
ScaledDotProductAttention
false
14,695
[ "Apache-2.0" ]
830
5340054398c076cfa717317d151ca595c5e37198
https://github.com/YehLi/xmodaler/tree/5340054398c076cfa717317d151ca595c5e37198
import torch import numpy as np import torch.utils.data import torch.nn as nn class Model(nn.Module): """ Scaled dot-product attention """ def __init__(self, *, d_model: int, d_k: int, d_v: int, h: int): """ :param d_model: Output dimensionality of the model :param d_k: Dimens...
QNetworkMedium
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 QNetworkMedium(nn.Module): def __init__(self, state_size, action_size, seed): """ Build a fully connected neural network state_size (int): State dimension action_size (int): Action dimension seed (in...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Yigit-Arisoy/deep-rts
QNetworkMedium
false
14,696
[ "MIT" ]
144
a5ed2c29b76789830df9f7075480c7229ccf0f4d
https://github.com/Yigit-Arisoy/deep-rts/tree/a5ed2c29b76789830df9f7075480c7229ccf0f4d
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, state_size, action_size, seed): """ Build a fully connected neural network state_size (int): State dimension action_size (int): Action dimension seed (int): rando...
PositionalEmbedding
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import math import torch class PositionalEmbedding(torch.nn.Module): def __init__(self): super(PositionalEmbedding, self).__init__() def forward(self, inputs): if inputs.dim() != 3: raise ValueError('The rank of input must be 3.') length = inputs.shape[1] channels...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_str...
Yuran-Zhao/THUMT
PositionalEmbedding
false
14,697
[ "BSD-3-Clause" ]
422
10f0433c1f2fe3f992d26ccb6f4f8dec457ce695
https://github.com/Yuran-Zhao/THUMT/tree/10f0433c1f2fe3f992d26ccb6f4f8dec457ce695
import math import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, inputs): if inputs.dim() != 3: raise ValueError('The rank of input must be 3.') length = inputs.shape[1] channels = inputs.shape[2] half_dim = c...
MaxOut
# 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 MaxOut(nn.Module): def __init__(self, pool_size): super(MaxOut, self).__init__() self.pool_size = pool_size def forward(self, ipt): """ input: reduce_size: """ input_size = list(ipt.size()) assert input_...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions
MaxOut
false
14,698
[ "MIT" ]
62
6e5ef241c64b5b30a6ff54ddad31e610013b8388
https://github.com/YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions/tree/6e5ef241c64b5b30a6ff54ddad31e610013b8388
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, pool_size): super().__init__() self.pool_size = pool_size def forward(self, ipt): """ input: reduce_size: """ input_size = list(ipt.size()) assert input_size[-1] % se...
ScaledDotProductAttentionMemory
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.utils.data import torch.nn as nn class ScaledDotProductAttentionMemory(nn.Module): """ Scaled dot-product attention with memory """ def __init__(self, *, d_model: int, d_k: int, d_v: int, h: int, m: int): """ :param d_model: Output dimensio...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YehLi/xmodaler
ScaledDotProductAttentionMemory
false
14,699
[ "Apache-2.0" ]
830
5340054398c076cfa717317d151ca595c5e37198
https://github.com/YehLi/xmodaler/tree/5340054398c076cfa717317d151ca595c5e37198
import torch import numpy as np import torch.utils.data import torch.nn as nn class Model(nn.Module): """ Scaled dot-product attention with memory """ def __init__(self, *, d_model: int, d_k: int, d_v: int, h: int, m: int): """ :param d_model: Output dimensionality of the model ...
TransformerDecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import Tensor from typing import Optional from torch import nn def _get_activation_fn(activation: 'str'): if activation == 'relu': return nn.functional.relu elif activation == 'gelu': return nn.functional.gelu raise RuntimeError('activation should be relu/gelu, not ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YiwenShaoStephen/snowfall
TransformerDecoderLayer
false
14,700
[ "Apache-2.0" ]
145
949226f35b29c629cb03cae36fa43da5993d27a3
https://github.com/YiwenShaoStephen/snowfall/tree/949226f35b29c629cb03cae36fa43da5993d27a3
import torch from torch import Tensor from typing import Optional from torch import nn def _get_activation_fn(activation: 'str'): if activation == 'relu': return nn.functional.relu elif activation == 'gelu': return nn.functional.gelu raise RuntimeError('activation should be relu/gelu, not ...
l2_norm_layer
# 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 l2_norm_layer(nn.Module): def __init__(self): super(l2_norm_layer, self).__init__() def forward(self, x): """ :param x: B x D :return: """ norm_x = torch.sqrt((x ** 2).sum(1) + 1e-10) return x / norm_x[:, None]...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
YunzhuLi/CompositionalKoopmanOperators
l2_norm_layer
false
14,701
[ "MIT" ]
56
116057b11192bb2fbea2b9af411cddcee354dae8
https://github.com/YunzhuLi/CompositionalKoopmanOperators/tree/116057b11192bb2fbea2b9af411cddcee354dae8
import torch import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): """ :param x: B x D :return: """ norm_x = torch.sqrt((x ** 2).sum(1) + 1e-10) return x / norm_x[:, None] def get_inputs(): re...
Net1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim class Net1(nn.Module): def __init__(self): super(Net1, self).__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1) self.conv2...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
Yixiao99/deep-learning-containers
Net1
false
14,702
[ "Apache-2.0" ]
383
01f078adf5abfb92e802b326511981bdd4a8c85c
https://github.com/Yixiao99/deep-learning-containers/tree/01f078adf5abfb92e802b326511981bdd4a8c85c
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.utils.data.distributed import torch.nn.parallel import torch.optim class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1) self.conv2 = nn.Con...
ScaledDotProductAttention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attn_dropout) self.softmax = nn.So...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions
ScaledDotProductAttention
false
14,703
[ "MIT" ]
62
6e5ef241c64b5b30a6ff54ddad31e610013b8388
https://github.com/YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions/tree/6e5ef241c64b5b30a6ff54ddad31e610013b8388
import torch import torch.nn as nn class Model(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attn_dropout) self.softmax = nn.Softmax(dim=2) de...
TransformerEncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import Tensor from typing import Optional from torch import nn def _get_activation_fn(activation: 'str'): if activation == 'relu': return nn.functional.relu elif activation == 'gelu': return nn.functional.gelu raise RuntimeError('activation should be relu/gelu, not ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YiwenShaoStephen/snowfall
TransformerEncoderLayer
false
14,704
[ "Apache-2.0" ]
145
949226f35b29c629cb03cae36fa43da5993d27a3
https://github.com/YiwenShaoStephen/snowfall/tree/949226f35b29c629cb03cae36fa43da5993d27a3
import torch from torch import Tensor from typing import Optional from torch import nn def _get_activation_fn(activation: 'str'): if activation == 'relu': return nn.functional.relu elif activation == 'gelu': return nn.functional.gelu raise RuntimeError('activation should be relu/gelu, not ...
SCAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 class BasicAtt(nn.Module): def __init__(self, mid_dims: 'list', mid_dropout: 'float'): super(BasicAtt, self).__init__() sequential = [] for i in range(1, len(mid_dims) - 1): sequential.a...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YehLi/xmodaler
SCAttention
false
14,705
[ "Apache-2.0" ]
830
5340054398c076cfa717317d151ca595c5e37198
https://github.com/YehLi/xmodaler/tree/5340054398c076cfa717317d151ca595c5e37198
import torch import torch.utils.data import torch.nn as nn import torch.nn.functional as F class BasicAtt(nn.Module): def __init__(self, mid_dims: 'list', mid_dropout: 'float'): super().__init__() sequential = [] for i in range(1, len(mid_dims) - 1): sequential.append(nn.Linea...
FlawDetectorCriterion
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class FlawDetectorCriterion(nn.Module): """ Criterion of the flaw detector. """ def __init__(self): super(FlawDetectorCriterion, self).__init__() def forward(self, pred, gt, is_ssl=False, reduction=True): loss = F.mse...
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...
ZHKKKe/PixelSSL
FlawDetectorCriterion
false
14,706
[ "Apache-2.0" ]
223
ce192034355ae6a77e47d2983d9c9242df60802a
https://github.com/ZHKKKe/PixelSSL/tree/ce192034355ae6a77e47d2983d9c9242df60802a
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """ Criterion of the flaw detector. """ def __init__(self): super().__init__() def forward(self, pred, gt, is_ssl=False, reduction=True): loss = F.mse_loss(pred, gt, reduction='none') i...
MultiHeadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.utils.data import torch.nn as nn class ScaledDotProductAttention(nn.Module): """ Scaled dot-product attention """ def __init__(self, *, d_model: int, d_k: int, d_v: int, h: int): """ :param d_model: Output dimensionality of the model ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YehLi/xmodaler
MultiHeadAttention
false
14,707
[ "Apache-2.0" ]
830
5340054398c076cfa717317d151ca595c5e37198
https://github.com/YehLi/xmodaler/tree/5340054398c076cfa717317d151ca595c5e37198
import torch import numpy as np import torch.utils.data import torch.nn as nn class ScaledDotProductAttention(nn.Module): """ Scaled dot-product attention """ def __init__(self, *, d_model: int, d_k: int, d_v: int, h: int): """ :param d_model: Output dimensionality of the model ...
MultiHeadAttentionMemory
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.utils.data import torch.nn as nn class ScaledDotProductAttentionMemory(nn.Module): """ Scaled dot-product attention with memory """ def __init__(self, *, d_model: int, d_k: int, d_v: int, h: int, m: int): """ :param d_model: Output dimensio...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YehLi/xmodaler
MultiHeadAttentionMemory
false
14,708
[ "Apache-2.0" ]
830
5340054398c076cfa717317d151ca595c5e37198
https://github.com/YehLi/xmodaler/tree/5340054398c076cfa717317d151ca595c5e37198
import torch import numpy as np import torch.utils.data import torch.nn as nn class ScaledDotProductAttentionMemory(nn.Module): """ Scaled dot-product attention with memory """ def __init__(self, *, d_model: int, d_k: int, d_v: int, h: int, m: int): """ :param d_model: Output dimensio...
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.cuda class Generator(nn.Module): def __init__(self, hidden_size: 'int', tgt_vocab_size: 'int'): self.vocab_size = tgt_vocab_size super(Generator, self).__init__() self.linear_hidden = nn.Linear(hidden_size, tgt_vocab_size) self.lsm =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
YuxueShi/transformerNMT
Generator
false
14,709
[ "BSD-3-Clause" ]
68
4ec660aa46f5edfeb5db749c73776d50c02c9324
https://github.com/YuxueShi/transformerNMT/tree/4ec660aa46f5edfeb5db749c73776d50c02c9324
import torch import torch.nn as nn import torch.cuda class Model(nn.Module): def __init__(self, hidden_size: 'int', tgt_vocab_size: 'int'): self.vocab_size = tgt_vocab_size super().__init__() self.linear_hidden = nn.Linear(hidden_size, tgt_vocab_size) self.lsm = nn.LogSoftmax(dim=...
DecInit
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 DecInit(nn.Module): def __init__(self, d_enc, d_dec, n_enc_layer): self.d_enc_model = d_enc self.n_enc_layer = n_enc_layer self.d_dec_model = d_dec super(DecInit, self).__init__() self.initer = nn.Linear(self.d_enc_model * self.n_en...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions
DecInit
false
14,710
[ "MIT" ]
62
6e5ef241c64b5b30a6ff54ddad31e610013b8388
https://github.com/YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions/tree/6e5ef241c64b5b30a6ff54ddad31e610013b8388
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, d_enc, d_dec, n_enc_layer): self.d_enc_model = d_enc self.n_enc_layer = n_enc_layer self.d_dec_model = d_dec super().__init__() self.initer = nn.Linear(self.d_enc_model * self.n_enc_layer, self. ...
NLayerNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import Tensor import torch.nn as nn from torch.nn import Parameter class NLayerNorm(nn.Module): def __init__(self, n_features: 'int', d: 'int') ->None: super().__init__() self.weight = Parameter(torch.ones(n_features, d)) self.bias = Parameter(torch.zeros(n_feature...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn from torch.nn import Parameter assert_size_stride = torch...
Yura52/tabular-dl-num-embeddings
NLayerNorm
false
14,711
[ "MIT" ]
57
e49e95c52f829ad0ab7d653e0776c2a84c03e261
https://github.com/Yura52/tabular-dl-num-embeddings/tree/e49e95c52f829ad0ab7d653e0776c2a84c03e261
import torch from torch import Tensor import torch.nn as nn from torch.nn import Parameter class Model(nn.Module): def __init__(self, n_features: 'int', d: 'int') ->None: super().__init__() self.weight = Parameter(torch.ones(n_features, d)) self.bias = Parameter(torch.zeros(n_features, d)...
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 import torch.functional as F class PositionwiseFeedForward(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.onelayer = d_hid == d_in if self.onel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions
PositionwiseFeedForward
false
14,712
[ "MIT" ]
62
6e5ef241c64b5b30a6ff54ddad31e610013b8388
https://github.com/YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions/tree/6e5ef241c64b5b30a6ff54ddad31e610013b8388
import torch import torch.nn as nn import torch.nn.functional as F import torch.functional as F class Model(nn.Module): """ A two-feed-forward-layer module """ def __init__(self, d_in, d_hid, dropout=0.1): super().__init__() self.onelayer = d_hid == d_in if self.onelayer: ...
NLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import Tensor import torch.nn as nn from torch.nn import Parameter class NLinear(nn.Module): def __init__(self, n: 'int', d_in: 'int', d_out: 'int', bias: 'bool'=True ) ->None: super().__init__() self.weight = Parameter(Tensor(n, d_in, d_out)) self.bias = P...
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 Tensor import torch.nn as nn from torch.nn import Parameter assert_size_stride = torch._C._dynamo.guards.assert_size_strid...
Yura52/tabular-dl-num-embeddings
NLinear
false
14,713
[ "MIT" ]
57
e49e95c52f829ad0ab7d653e0776c2a84c03e261
https://github.com/Yura52/tabular-dl-num-embeddings/tree/e49e95c52f829ad0ab7d653e0776c2a84c03e261
import torch from torch import Tensor import torch.nn as nn from torch.nn import Parameter class Model(nn.Module): def __init__(self, n: 'int', d_in: 'int', d_out: 'int', bias: 'bool'=True ) ->None: super().__init__() self.weight = Parameter(Tensor(n, d_in, d_out)) self.bias = Par...
_leaky_relu
# 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.optim import torch.utils.data class _leaky_relu(nn.Module): def __init__(self): super(_leaky_relu, self).__init__() def forward(self, x): x_neg = 0.1 * x return torch.max(x_neg, x) def get_inputs(): return [torch.rand([4, 4, 4, 4])...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import torch.optim import torch.utils.data assert_size_stride = torc...
ZephyrII/competitive_colaboration
_leaky_relu
false
14,714
[ "MIT" ]
357
a557d1e23ef2c0b8e3794f085a79bfffb860f9df
https://github.com/ZephyrII/competitive_colaboration/tree/a557d1e23ef2c0b8e3794f085a79bfffb860f9df
import torch from torch import nn import torch.optim import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): x_neg = 0.1 * x return torch.max(x_neg, x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs...
Attention
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init def sequence_mask(lengths, max_len=None): """ Creates a boolean mask from sequence lengths. """ batch_size = lengths.numel() max_len = max_len or lengths.max() return torch.arange(0, max_len).type_a...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ZfSangkuan/ASER
Attention
false
14,715
[ "MIT" ]
256
c34d6f2432b181bae9f4ee4fa70ce270dbc1dee7
https://github.com/ZfSangkuan/ASER/tree/c34d6f2432b181bae9f4ee4fa70ce270dbc1dee7
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init def sequence_mask(lengths, max_len=None): """ Creates a boolean mask from sequence lengths. """ batch_size = lengths.numel() max_len = max_len or lengths.max() return torch.arange(0, max_len).type_a...
GraphAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 GraphAttention(nn.Module): def __init__(self, d_q, d_v, alpha, dropout=0.1): super(GraphAttention, self).__init__() self.dropout = nn.Dropout(dropout) self.attention = nn.Linear(d_q + d_v, 1) self.leaky_relu = nn.LeakyReLU(alpha) def 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....
YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions
GraphAttention
false
14,716
[ "MIT" ]
62
6e5ef241c64b5b30a6ff54ddad31e610013b8388
https://github.com/YuxiXie/Semantic-Graphs-for-Generating-Deep-Questions/tree/6e5ef241c64b5b30a6ff54ddad31e610013b8388
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, d_q, d_v, alpha, dropout=0.1): super().__init__() self.dropout = nn.Dropout(dropout) self.attention = nn.Linear(d_q + d_v, 1) self.leaky_relu = nn.LeakyReLU(alpha) def forward(self, query, value, ma...
FCDiscriminatorCriterion
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F class FCDiscriminatorCriterion(nn.Module): def __init__(self): super(FCDiscriminatorCriterion, self).__init__() def forward(self, pred, gt): loss = F.binary_cross_entropy_with_logits(pred, gt, reduction='none') return...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
ZHKKKe/PixelSSL
FCDiscriminatorCriterion
false
14,717
[ "Apache-2.0" ]
223
ce192034355ae6a77e47d2983d9c9242df60802a
https://github.com/ZHKKKe/PixelSSL/tree/ce192034355ae6a77e47d2983d9c9242df60802a
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, pred, gt): loss = F.binary_cross_entropy_with_logits(pred, gt, reduction='none') return torch.mean(loss, dim=(1, 2, 3)) def get_inputs...
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.cuda class Generator(nn.Module): def __init__(self, hidden_size: 'int', tgt_vocab_size: 'int'): self.vocab_size = tgt_vocab_size super(Generator, self).__init__() self.linear_hidden = nn.Linear(hidden_size, tgt_vocab_size) self.lsm =...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ZNLP/ATSum
Generator
false
14,718
[ "BSD-3-Clause" ]
73
02e92489ebfa4652a4f3354c578f3a64c34ff64b
https://github.com/ZNLP/ATSum/tree/02e92489ebfa4652a4f3354c578f3a64c34ff64b
import torch import torch.nn as nn import torch.cuda class Model(nn.Module): def __init__(self, hidden_size: 'int', tgt_vocab_size: 'int'): self.vocab_size = tgt_vocab_size super().__init__() self.linear_hidden = nn.Linear(hidden_size, tgt_vocab_size) self.lsm = nn.LogSoftmax(dim=...
BasicBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.optim import torch.utils.data def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) class BasicBlock(nn.Module): expansion = 1 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import t...
ZephyrII/competitive_colaboration
BasicBlock
false
14,719
[ "MIT" ]
357
a557d1e23ef2c0b8e3794f085a79bfffb860f9df
https://github.com/ZephyrII/competitive_colaboration/tree/a557d1e23ef2c0b8e3794f085a79bfffb860f9df
import torch from torch import nn import torch.optim import torch.utils.data def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) class Model(nn.Module): expansion = 1 de...
AttnScore
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init def sequence_mask(lengths, max_len=None): """ Creates a boolean mask from sequence lengths. """ batch_size = lengths.numel() max_len = max_len or lengths.max() return torch.arange(0, max_len).type_a...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
ZfSangkuan/ASER
AttnScore
false
14,720
[ "MIT" ]
256
c34d6f2432b181bae9f4ee4fa70ce270dbc1dee7
https://github.com/ZfSangkuan/ASER/tree/c34d6f2432b181bae9f4ee4fa70ce270dbc1dee7
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init def sequence_mask(lengths, max_len=None): """ Creates a boolean mask from sequence lengths. """ batch_size = lengths.numel() max_len = max_len or lengths.max() return torch.arange(0, max_len).type_a...
FixedSubnetConv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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.multiprocessing import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch.nn.functional as F class FixedSubnetConv(nn.Conv2d): def __init__(self, *args, **kwargs): super().__init__(*args...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import math import torch.multiprocessing import torch.nn as nn import torch.nn.p...
ZeroEi8ht/hidden-networks
FixedSubnetConv
false
14,721
[ "Apache-2.0" ]
132
ebe13e71d2f60356ee473cd3cff3e14b69d13d70
https://github.com/ZeroEi8ht/hidden-networks/tree/ebe13e71d2f60356ee473cd3cff3e14b69d13d70
import math import torch import torch.multiprocessing import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch.nn.functional as F class Model(nn.Conv2d): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs...
GeneralizedMeanPooling
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import Tensor import torch.nn as nn from torch.functional import Tensor import torch.nn.functional as F from torch import Tensor from torch.nn.parameter import Parameter def gem(x: 'Tensor', p: 'Parameter', eps: 'float'=1e-06, clamp=True) ->Tensor: if clamp: x = x.clamp(min=eps) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
YuxinZou/mmclassification
GeneralizedMeanPooling
false
14,722
[ "Apache-2.0" ]
1,190
2037260ea6c98a3b115e97727e1151a1c2c32f7a
https://github.com/YuxinZou/mmclassification/tree/2037260ea6c98a3b115e97727e1151a1c2c32f7a
import torch from torch import Tensor import torch.nn as nn from torch.functional import Tensor import torch.nn.functional as F from torch import Tensor from torch.nn.parameter import Parameter def gem(x: 'Tensor', p: 'Parameter', eps: 'float'=1e-06, clamp=True) ->Tensor: if clamp: x = x.clamp(min=eps) ...
NN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class NN(nn.Module): def __init__(self, input_size, num_classes): super(NN, self).__init__() self.fc1 = nn.Linear(input_size, 50) self.fc2 = nn.Linear(50, num_classes) def forward(self, x): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
ZonePG/Machine-Learning-Collection
NN
false
14,723
[ "MIT" ]
3,094
85f1e761fab85b61d4dbd44285d6483b75ba649c
https://github.com/ZonePG/Machine-Learning-Collection/tree/85f1e761fab85b61d4dbd44285d6483b75ba649c
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class Model(nn.Module): def __init__(self, input_size, num_classes): super().__init__() self.fc1 = nn.Linear(input_size, 50) self.fc2 = nn.Linear(50, num_classes) def forward(self, x): ...
TripletMarginCosineLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from torch.nn import Module import torch from torch.nn.functional import cosine_similarity def triplet_margin_cosine_loss(anchor, positive, negative, margin=1.0, eps= 1e-08, sum_loss=False): 'Creates a criterion that measures the triplet cosine loss given input\n tensors x1, x2, x3 and a margin with a valu...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch.nn import Module ...
ZhangShiyue/oposum
TripletMarginCosineLoss
false
14,724
[ "Apache-2.0" ]
97
5aefea20c5c0846b4cf09a5b4643ffb0b2ff39d8
https://github.com/ZhangShiyue/oposum/tree/5aefea20c5c0846b4cf09a5b4643ffb0b2ff39d8
from torch.nn import Module import torch from torch.nn.functional import cosine_similarity def triplet_margin_cosine_loss(anchor, positive, negative, margin=1.0, eps= 1e-08, sum_loss=False): 'Creates a criterion that measures the triplet cosine loss given input\n tensors x1, x2, x3 and a margin with a valu...
InstanceLoss
# 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.init class InstanceLoss(nn.Module): """ Compute instance loss """ def __init__(self): super(InstanceLoss, self).__init__() self.loss = nn.CrossEntropyLoss() def forward(self, img_cls, txt_cls, labels): cost_im = self.loss...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
ZihaoWang-233/CAMP_iccv19
InstanceLoss
false
14,725
[ "Apache-2.0" ]
116
b0ec07908f479e76f7ebddbcfb2199790305240a
https://github.com/ZihaoWang-233/CAMP_iccv19/tree/b0ec07908f479e76f7ebddbcfb2199790305240a
import torch import torch.nn as nn import torch.nn.init class Model(nn.Module): """ Compute instance loss """ def __init__(self): super().__init__() self.loss = nn.CrossEntropyLoss() def forward(self, img_cls, txt_cls, labels): cost_im = self.loss(img_cls, labels) ...
TemporalPooling
# 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 import torch class TemporalPooling(nn.Module): def __init__(self, frames, kernel_size=3, stride=2, mode='avg'): """ Parameters ---------- fra...
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 import torch a...
ZijiaLewisLu/action-recognition-pytorch
TemporalPooling
false
14,726
[ "Apache-2.0" ]
149
6ee04ed249081eb0d8e1b4a3e7a5c11fa65b8d70
https://github.com/ZijiaLewisLu/action-recognition-pytorch/tree/6ee04ed249081eb0d8e1b4a3e7a5c11fa65b8d70
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch class Model(nn.Module): def __init__(self, frames, kernel_size=3, stride=2, mode='avg'): """ Parameters ---------- frames (int):...
WSConv2d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 WSConv2d(nn.Module): """ Weight scaled Conv2d (Equalized Learning Rate) Note that input is multiplied rather than changing weights this will have the same result. Inspired by: https://github.com/nvnbny/progressive_growing_of_gan...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
ZonePG/Machine-Learning-Collection
WSConv2d
false
14,727
[ "MIT" ]
3,094
85f1e761fab85b61d4dbd44285d6483b75ba649c
https://github.com/ZonePG/Machine-Learning-Collection/tree/85f1e761fab85b61d4dbd44285d6483b75ba649c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """ Weight scaled Conv2d (Equalized Learning Rate) Note that input is multiplied rather than changing weights this will have the same result. Inspired by: https://github.com/nvnbny/progressive_growing_of_gans/b...
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 class LayerNorm(nn.Module): """ Layer Normalization class """ def __init__(self, features, eps=1e-06): super(LayerNorm, self).__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(features)) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ZfSangkuan/ASER
PositionwiseFeedForward
false
14,728
[ "MIT" ]
256
c34d6f2432b181bae9f4ee4fa70ce270dbc1dee7
https://github.com/ZfSangkuan/ASER/tree/c34d6f2432b181bae9f4ee4fa70ce270dbc1dee7
import torch import torch.nn as nn class LayerNorm(nn.Module): """ Layer Normalization class """ def __init__(self, features, eps=1e-06): super().__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(features)) self.eps = eps ...
NonLocal2D
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import math import torch import torch.utils.data from torch import nn from torch.nn.modules.utils import _pair def get_group_gn(dim, dim_per_gp, num_groups): """get number of groups used by GroupNorm, based on number of channels.""" assert dim_per_gp == -1 or num_groups == -1, 'GroupNorm: can only specify G o...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
Yuliang-Liu/bezier_curve_text_spotting
NonLocal2D
false
14,729
[ "BSD-2-Clause" ]
423
8986ff0eb7f9ccd5943cc46191bded2affdfe61f
https://github.com/Yuliang-Liu/bezier_curve_text_spotting/tree/8986ff0eb7f9ccd5943cc46191bded2affdfe61f
import math import torch import torch.utils.data from torch import nn from torch.nn.modules.utils import _pair def get_group_gn(dim, dim_per_gp, num_groups): """get number of groups used by GroupNorm, based on number of channels.""" assert dim_per_gp == -1 or num_groups == -1, 'GroupNorm: can only specify G o...
ExampleTorchModule
# 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 ExampleTorchModule(torch.nn.Module): def __init__(self): super(ExampleTorchModule, self).__init__() def forward(self, input): residual = 10 - input return residual def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
abhigoudar/ceres_python_bindings
ExampleTorchModule
false
14,730
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
86
2106d043bce37adcfef450dd23d3005480948c37
https://github.com/abhigoudar/ceres_python_bindings/tree/2106d043bce37adcfef450dd23d3005480948c37
import torch class Model(torch.nn.Module): def __init__(self): super().__init__() def forward(self, input): residual = 10 - input return residual def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
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 import numpy as np import torch.nn as nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))...
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 numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo....
abhipsabasu/rubi.bootstrap.pytorch
GeLU
false
14,731
[ "BSD-3-Clause" ]
83
9fa9639c1ee4a040958d976eeb5dca2dd2203980
https://github.com/abhipsabasu/rubi.bootstrap.pytorch/tree/9fa9639c1ee4a040958d976eeb5dca2dd2203980
import torch import numpy as np import torch.nn as nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))...
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 import torch.nn as nn import torch.nn.parallel class AsymmetricLossOptimized(nn.Module): """ Notice - optimized version, minimizes memory allocation and gpu uploading, favors inplace operations""" def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_f...
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...
aangelopoulos/rcps
AsymmetricLossOptimized
false
14,732
[ "MIT" ]
52
b400457f7cc7261d1ed610cdf7aa2230de657c57
https://github.com/aangelopoulos/rcps/tree/b400457f7cc7261d1ed610cdf7aa2230de657c57
import torch import torch.nn as nn import torch.nn.parallel class Model(nn.Module): """ Notice - optimized version, minimizes memory allocation and gpu uploading, favors inplace operations""" def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): ...
SEModule
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.parallel class FastAvgPool2d(nn.Module): def __init__(self, flatten=False): super(FastAvgPool2d, self).__init__() self.flatten = flatten def forward(self, x): if self.flatten: in_size = x.size() return x.view(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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 ...
aangelopoulos/rcps
SEModule
false
14,733
[ "MIT" ]
52
b400457f7cc7261d1ed610cdf7aa2230de657c57
https://github.com/aangelopoulos/rcps/tree/b400457f7cc7261d1ed610cdf7aa2230de657c57
import torch import torch.nn as nn import torch.nn.parallel class FastAvgPool2d(nn.Module): def __init__(self, flatten=False): super().__init__() self.flatten = flatten def forward(self, x): if self.flatten: in_size = x.size() return x.view((in_size[0], in_siz...
SelfAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SelfAttention(nn.Module): def __init__(self, embed_size, heads): super(SelfAttention, self).__init__() self.embed_size = embed_size self.heads = heads self.head_dim = embed_size // heads assert self.head_dim ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ZonePG/Machine-Learning-Collection
SelfAttention
false
14,734
[ "MIT" ]
3,094
85f1e761fab85b61d4dbd44285d6483b75ba649c
https://github.com/ZonePG/Machine-Learning-Collection/tree/85f1e761fab85b61d4dbd44285d6483b75ba649c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self, embed_size, heads): super().__init__() self.embed_size = embed_size self.heads = heads self.head_dim = embed_size // heads assert self.head_dim * heads == embed_size, 'Emb...
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 import torch.utils.data class WSConv2d(nn.Module): """ Weight scaled Conv2d (Equalized Learning Rate) Note that input is multiplied rather than changing weights this will have the same result. Inspired by: https://github.com/nvnbny/progressive_growing_of_gan...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
ZonePG/Machine-Learning-Collection
ConvBlock
false
14,735
[ "MIT" ]
3,094
85f1e761fab85b61d4dbd44285d6483b75ba649c
https://github.com/ZonePG/Machine-Learning-Collection/tree/85f1e761fab85b61d4dbd44285d6483b75ba649c
import torch import torch.nn as nn import torch.utils.data class WSConv2d(nn.Module): """ Weight scaled Conv2d (Equalized Learning Rate) Note that input is multiplied rather than changing weights this will have the same result. Inspired by: https://github.com/nvnbny/progressive_growing_of_gan...
SpatialAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SpatialAttention(nn.Module): def __init__(self, kernel_size=7): super(SpatialAttention, self).__init__() assert kernel_size in (3, 7), 'kernel size must be 3 or 7' padding = 3 if kernel_size == 7 else 1 self.conv1 = nn.Conv2d(1, 1, kernel_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_...
abandonsea/BBS-Net
SpatialAttention
false
14,736
[ "MIT" ]
66
fd4e60bf3025d0cec745c0594b7104c5746f6d0f
https://github.com/abandonsea/BBS-Net/tree/fd4e60bf3025d0cec745c0594b7104c5746f6d0f
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, kernel_size=7): super().__init__() assert kernel_size in (3, 7), 'kernel size must be 3 or 7' padding = 3 if kernel_size == 7 else 1 self.conv1 = nn.Conv2d(1, 1, kernel_size, padding=padding, bias=False)...
SpatialAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 SpatialAttention(nn.Module): def __init__(self, kernel=3): super(SpatialAttention, self).__init__() self.conv1 = nn.Conv2d(2, 1, kernel_size=kernel, padding=kernel // 2, bias=False) self.sigmoid = nn.Sigmoid() def forward(self, x):...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
abhirajasp/CDCN
SpatialAttention
false
14,737
[ "MIT" ]
463
c9863775b1c1bffd91f956b5b2c6c78abfc988ec
https://github.com/abhirajasp/CDCN/tree/c9863775b1c1bffd91f956b5b2c6c78abfc988ec
import torch from torch import nn class Model(nn.Module): def __init__(self, kernel=3): super().__init__() self.conv1 = nn.Conv2d(2, 1, kernel_size=kernel, padding=kernel // 2, bias=False) self.sigmoid = nn.Sigmoid() def forward(self, x): avg_out = torch.mean(x, ...
AddReadout
# 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 AddReadout(nn.Module): """Handles readout operation when `readout` parameter is `add`. Removes `cls_token` or `readout_token` from tensor and adds it to the rest of tensor""" def __init__(self, start_index=1): super(AddReadout, self).__init__() self.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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
aditya-agrawal-30502/vformer
AddReadout
false
14,738
[ "MIT" ]
90
e1f4950f980238442ff1dc39a8f0791e4fbc9dac
https://github.com/aditya-agrawal-30502/vformer/tree/e1f4950f980238442ff1dc39a8f0791e4fbc9dac
import torch import torch.nn as nn class Model(nn.Module): """Handles readout operation when `readout` parameter is `add`. Removes `cls_token` or `readout_token` from tensor and adds it to the rest of tensor""" def __init__(self, start_index=1): super().__init__() self.start_index = start_in...
TAM
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch import torch.nn.functional as F class SEModule(nn.Module): def __init__(self, channels, dw_conv): super().__init__() ks = 1 pad = (ks - 1...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
ZijiaLewisLu/action-recognition-pytorch
TAM
false
14,739
[ "Apache-2.0" ]
149
6ee04ed249081eb0d8e1b4a3e7a5c11fa65b8d70
https://github.com/ZijiaLewisLu/action-recognition-pytorch/tree/6ee04ed249081eb0d8e1b4a3e7a5c11fa65b8d70
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed import torch import torch.nn.functional as F class SEModule(nn.Module): def __init__(self, channels, dw_conv): super().__init__() ks = 1 pad = (ks - 1...
GatedBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan 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 GatedBlock(nn.Module): def __init__(self, dilation: 'int', w_dim: 'int'): """Gated block with sigmoid/tanh gates.""" super().__init__() self.dilation = dilation self.tanh_conv = nn.Conv2d(w_dim, w_dim, kernel_size=(2, 1), dilati...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
Zymrael/wattnet-fx-trading
GatedBlock
false
14,740
[ "MIT" ]
69
b4babf21e6156df3ec0002ee45db118e1de24f1f
https://github.com/Zymrael/wattnet-fx-trading/tree/b4babf21e6156df3ec0002ee45db118e1de24f1f
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, dilation: 'int', w_dim: 'int'): """Gated block with sigmoid/tanh gates.""" super().__init__() self.dilation = dilation self.tanh_conv = nn.Conv2d(w_dim, w_dim, kernel_size=(2, 1), dilation=(d...