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
Ceil
# 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.onnx import torch.nn as nn class Ceil(nn.Module): def forward(self, x): return torch.ceil(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mil-tokyo/webdnn
Ceil
false
16,060
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.ceil(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Concat3
# 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.onnx import torch.nn as nn class Concat3(nn.Module): def __init__(self): super().__init__() def forward(self, c0, c1, c2): return torch.cat([c0, c1, c2], dim=1) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( [...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
Concat3
false
16,061
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, c0, c1, c2): return torch.cat([c0, c1, c2], dim=1) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( [4,...
MultiSoftmaxCrossEntropyLoss
# 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 as th import torch.nn as nn import torch.utils.data.distributed class MultiSoftmaxCrossEntropyLoss(nn.Module): def __init__(self, class_weight=None, label_smoothing_value=0): super(MultiSoftmaxCrossEntropyLoss, self).__init__() self.class_weight = clas...
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 numpy as np imp...
microsoft/vision-longformer
MultiSoftmaxCrossEntropyLoss
false
16,062
[ "MIT" ]
169
c9ce386de3e633bb3c805368d118356fbd696487
https://github.com/microsoft/vision-longformer/tree/c9ce386de3e633bb3c805368d118356fbd696487
import torch import numpy as np import torch as th import torch.nn as nn import torch.utils.data.distributed class Model(nn.Module): def __init__(self, class_weight=None, label_smoothing_value=0): super().__init__() self.class_weight = class_weight if self.class_weight is not None: ...
Asin
# 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.onnx import torch.nn as nn class Asin(nn.Module): def forward(self, x): return torch.asin(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mil-tokyo/webdnn
Asin
false
16,063
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.asin(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Atanh
# 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.onnx import torch.nn as nn class Atanh(nn.Module): def forward(self, x): return torch.atanh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mil-tokyo/webdnn
Atanh
false
16,064
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.atanh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
AveragePool
# 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.onnx import torch.nn as nn class AveragePool(nn.Module): def __init__(self): super().__init__() self.pool = nn.AvgPool2d(kernel_size=3, stride=1, padding=0, ceil_mode=True, count_include_pad=False) def forward(self, x): return self.pool(x) def ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
AveragePool
false
16,065
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.pool = nn.AvgPool2d(kernel_size=3, stride=1, padding=0, ceil_mode=True, count_include_pad=False) def forward(self, x): return self.pool(x) def get_in...
Attention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): def __init__(self, hidden_size): super(Attention, self).__init__() self.hidden_size = hidden_size self.linear_in = nn.Linear(hidden_size, hidden_size, bias=False) def score(self, hidden_sta...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
michiyasunaga/DrRepair
Attention
false
16,066
[ "MIT" ]
139
fb447594149ac4f80fef8ba091373184120019c7
https://github.com/michiyasunaga/DrRepair/tree/fb447594149ac4f80fef8ba091373184120019c7
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, hidden_size): super().__init__() self.hidden_size = hidden_size self.linear_in = nn.Linear(hidden_size, hidden_size, bias=False) def score(self, hidden_state, encoder_states)...
Acos
# 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.onnx import torch.nn as nn class Acos(nn.Module): def forward(self, x): return torch.acos(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mil-tokyo/webdnn
Acos
false
16,067
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.acos(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Concat4
# 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.onnx import torch.nn as nn class Concat4(nn.Module): def __init__(self): super().__init__() def forward(self, c0, c1, c2, c3): return torch.cat([c0, c1, c2, c3], dim=1) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
Concat4
false
16,068
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() def forward(self, c0, c1, c2, c3): return torch.cat([c0, c1, c2, c3], dim=1) def get_inputs(): return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand( ...
Cast
# 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.onnx import torch.nn as nn class Cast(nn.Module): def forward(self, x): return x.type(torch.int32) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
Cast
false
16,069
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return x.type(torch.int32) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Asinh
# 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.onnx import torch.nn as nn class Asinh(nn.Module): def forward(self, x): return torch.asinh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mil-tokyo/webdnn
Asinh
false
16,070
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.asinh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
ResBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super(AdaptiveInstanceNorm2d, self).__init__() self.num_features = num_features self.eps = eps ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language 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 ...
microsoft/S2R-DepthNet
ResBlock
false
16,071
[ "MIT" ]
144
aebc931c7e8c7baad4dec2a0fd8643244741c52e
https://github.com/microsoft/S2R-DepthNet/tree/aebc931c7e8c7baad4dec2a0fd8643244741c52e
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super().__init__() self.num_features = num_features self.eps = eps self.momentum = moment...
Sign
# 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.onnx import torch.nn as nn class Sign(nn.Module): def forward(self, x): return torch.sign(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
Sign
false
16,072
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.sign(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Neg
# AOT ID: ['2_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.onnx import torch.nn as nn class Neg(nn.Module): def forward(self, x): return torch.neg(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
Neg
false
16,073
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.neg(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Reciprocal
# 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.onnx import torch.nn as nn class Reciprocal(nn.Module): def forward(self, x): return torch.reciprocal(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
Reciprocal
false
16,074
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.reciprocal(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
ReduceSum3
# 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.onnx import torch.nn as nn class ReduceSum3(nn.Module): def forward(self, x): return torch.sum(x, (1, 3), keepdim=False) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
ReduceSum3
false
16,075
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.sum(x, (1, 3), keepdim=False) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Gather1D
# 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.onnx import torch.nn as nn class Gather1D(nn.Module): def forward(self, x): return x[[2, 4, 5]] def get_inputs(): return [torch.rand([6, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
Gather1D
false
16,076
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return x[[2, 4, 5]] def get_inputs(): return [torch.rand([6, 4, 4, 4])] def get_init_inputs(): return []
ReduceMin
# 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.onnx import torch.nn as nn class ReduceMin(nn.Module): def forward(self, x): return torch.min(x, -1, keepdim=True)[0] def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.asse...
mil-tokyo/webdnn
ReduceMin
false
16,077
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.min(x, -1, keepdim=True)[0] def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
ReduceMean
# 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.onnx import torch.nn as nn class ReduceMean(nn.Module): def forward(self, x): return torch.mean(x, -1, keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
ReduceMean
false
16,078
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.mean(x, -1, keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
ReduceSum
# 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.onnx import torch.nn as nn class ReduceSum(nn.Module): def forward(self, x): return torch.sum(x, -1, keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
ReduceSum
false
16,079
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.sum(x, -1, keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Cosh
# 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.onnx import torch.nn as nn class Cosh(nn.Module): def forward(self, x): return torch.cosh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mil-tokyo/webdnn
Cosh
false
16,080
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.cosh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
Permute
# 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.onnx import torch.nn as nn class Permute(nn.Module): def forward(self, x): x = x + 1.0 return x.permute(2, 0, 1) def get_inputs(): return [torch.rand([4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
Permute
false
16,081
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): x = x + 1.0 return x.permute(2, 0, 1) def get_inputs(): return [torch.rand([4, 4, 4])] def get_init_inputs(): return []
Softsign
# 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.onnx import torch.nn as nn class Softsign(nn.Module): def forward(self, x): return torch.nn.Softsign()(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dy...
mil-tokyo/webdnn
Softsign
false
16,082
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.nn.Softsign()(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
ReduceMax
# 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.onnx import torch.nn as nn class ReduceMax(nn.Module): def forward(self, x): return torch.max(x, -1, keepdim=True)[0] def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.asse...
mil-tokyo/webdnn
ReduceMax
false
16,083
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.max(x, -1, keepdim=True)[0] def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
ReLUExp
# 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.onnx import torch.nn as nn import torch.nn.functional as F class ReLUExp(nn.Module): def __init__(self): super().__init__() def forward(self, x): return torch.exp(F.relu(x)) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.onnx impo...
mil-tokyo/webdnn
ReLUExp
false
16,084
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() def forward(self, x): return torch.exp(F.relu(x)) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return ...
Cube
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn class CubeFunctionBackward(torch.autograd.Function): @staticmethod def forward(ctx, X, M): ctx.save_for_backward(X, M) return M * 3 * X ** 2 @staticmethod def backward(ctx, V): X, M = ctx.saved_tensors return V * 6 * X * M, V * 3 * X ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
minhnhat93/didyprog
Cube
false
16,086
[ "MIT" ]
57
78886ed939d269b9b2bcb192bf849aa34082880c
https://github.com/minhnhat93/didyprog/tree/78886ed939d269b9b2bcb192bf849aa34082880c
import torch from torch import nn class CubeFunctionBackward(torch.autograd.Function): @staticmethod def forward(ctx, X, M): ctx.save_for_backward(X, M) return M * 3 * X ** 2 @staticmethod def backward(ctx, V): X, M = ctx.saved_tensors return V * 6 * X * M, V * 3 * X ...
ReduceSum2
# 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.onnx import torch.nn as nn class ReduceSum2(nn.Module): def forward(self, x): return torch.sum(x, (1, 3), keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
ReduceSum2
false
16,087
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.sum(x, (1, 3), keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
MaxPool
# 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.onnx import torch.nn as nn class MaxPool(nn.Module): def __init__(self): super().__init__() self.pool = nn.MaxPool2d(kernel_size=3, stride=2, padding=0, ceil_mode=True) def forward(self, x): return self.pool(x) def get_inputs(): return [tor...
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.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.asse...
mil-tokyo/webdnn
MaxPool
false
16,088
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.pool = nn.MaxPool2d(kernel_size=3, stride=2, padding=0, ceil_mode=True) def forward(self, x): return self.pool(x) def get_inputs(): return [torch...
Tan
# 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.onnx import torch.nn as nn class Tan(nn.Module): def forward(self, x): return torch.tan(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mil-tokyo/webdnn
Tan
false
16,089
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.tan(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
ReduceProd
# 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.onnx import torch.nn as nn class ReduceProd(nn.Module): def forward(self, x): return torch.prod(x, -1, keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mil-tokyo/webdnn
ReduceProd
false
16,090
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.prod(x, -1, keepdim=True) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
LinearPotential
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn from torch.nn import Parameter class LinearPotential(torch.nn.Module): def __init__(self, n_features, n_states, init_idx=None, eos_idx=None): super(LinearPotential, self).__init__() self.transition = Parameter(torch.zeros((n_states, n_states))) self.init_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn from torch.nn import Parameter assert_size_stride = torch._...
minhnhat93/didyprog
LinearPotential
false
16,091
[ "MIT" ]
57
78886ed939d269b9b2bcb192bf849aa34082880c
https://github.com/minhnhat93/didyprog/tree/78886ed939d269b9b2bcb192bf849aa34082880c
import torch from torch import nn from torch.nn import Parameter class Model(torch.nn.Module): def __init__(self, n_features, n_states, init_idx=None, eos_idx=None): super().__init__() self.transition = Parameter(torch.zeros((n_states, n_states))) self.init_idx = init_idx self.eos...
MSELoss2d
# 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 MSELoss2d(nn.Module): def __init__(self, size_average=None, reduce=None, reduction='mean', ignore_index=255): super(MSELoss2d, self).__init__() self.MSE = nn.MSELoss(size_average=size_average, reduce=reduce, reduction=reduction) de...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
mimiliaogo/DACS
MSELoss2d
false
16,092
[ "MIT" ]
59
9f13e32566c293de560df4848b23631d9e11cf32
https://github.com/mimiliaogo/DACS/tree/9f13e32566c293de560df4848b23631d9e11cf32
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, size_average=None, reduce=None, reduction='mean', ignore_index=255): super().__init__() self.MSE = nn.MSELoss(size_average=size_average, reduce=reduce, reduction=reduction) def forward(self, out...
AugCNN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F def apply_init_(modules): """ Initialize NN modules """ for m in modules: if isinstance(m, nn.Conv2d): nn.init.xavier_uniform_(m.weight) if m.bias is not None: nn.init.constant_(m.bias, 0...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.functional as F assert_size_stride = torch...
minqi/auto-drac
AugCNN
false
16,093
[ "MIT" ]
84
59a25bbabd51946d7a645db9c5d59071b73b006d
https://github.com/minqi/auto-drac/tree/59a25bbabd51946d7a645db9c5d59071b73b006d
import torch import torch.nn as nn import torch.nn.functional as F def apply_init_(modules): """ Initialize NN modules """ for m in modules: if isinstance(m, nn.Conv2d): nn.init.xavier_uniform_(m.weight) if m.bias is not None: nn.init.constant_(m.bias, 0...
ClassicalFC1
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.utils.prune import torch.backends.cudnn import torch.cuda import torch.nn import torch.utils.data class ClassicalFC1(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 1024) self.f...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mit-han-lab/pytorch-quantum
ClassicalFC1
false
16,094
[ "MIT" ]
98
05cf000d689307f6b1fe02d12744ad455685935b
https://github.com/mit-han-lab/pytorch-quantum/tree/05cf000d689307f6b1fe02d12744ad455685935b
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.utils.prune import torch.backends.cudnn import torch.cuda import torch.nn import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 1024) self.fc2 = nn...
DiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.parallel class DiceLoss(nn.Module): def __init__(self): super(DiceLoss, self).__init__() self.smooth = 1.0 def forward(self, y_pred, y_true): assert y_pred.size() == y_true.size() y_pred = y_pred[:, 0].contiguous().view(-1) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.nn.parallel assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C...
mkoivi-ms/unet-pytorch-azureml
DiceLoss
false
16,095
[ "MIT" ]
517
f0fa5b15cfad19f6b04bb309a965726c25c39e03
https://github.com/mkoivi-ms/unet-pytorch-azureml/tree/f0fa5b15cfad19f6b04bb309a965726c25c39e03
import torch import torch.nn as nn import torch.nn.parallel class Model(nn.Module): def __init__(self): super().__init__() self.smooth = 1.0 def forward(self, y_pred, y_true): assert y_pred.size() == y_true.size() y_pred = y_pred[:, 0].contiguous().view(-1) y_true = y...
chroma_subsampling
# 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 chroma_subsampling(nn.Module): """ Chroma subsampling on CbCv channels Input: image(tensor): batch x height x width x 3 Output: y(tensor): batch x height x width cb(tensor): batch x height/2 x width/2 cr(tensor): batch x height/2 x w...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
mlomnitz/DifferentiableJPEG
chroma_subsampling
false
16,096
[ "MIT" ]
86
a5767feba955a1bcb78600135a09c36a806f6249
https://github.com/mlomnitz/DifferentiableJPEG/tree/a5767feba955a1bcb78600135a09c36a806f6249
import torch import torch.nn as nn class Model(nn.Module): """ Chroma subsampling on CbCv channels Input: image(tensor): batch x height x width x 3 Output: y(tensor): batch x height x width cb(tensor): batch x height/2 x width/2 cr(tensor): batch x height/2 x width/2 ""...
LearnedPositionalEncoding
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class LayerNorm(nn.Module): """A layernorm module in the TF style (epsilon inside the square root).""" def __init__(self, d_model, variance_epsilon=1e-12): super().__init__() self.gamma = nn.Parameter(torch.ones(d_model)) self.beta = nn.Parameter(torc...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
minhnn-tiny/vietocr
LearnedPositionalEncoding
false
16,097
[ "Apache-2.0" ]
307
80ed99b5d29df3f04c54ae394c525117846b503a
https://github.com/minhnn-tiny/vietocr/tree/80ed99b5d29df3f04c54ae394c525117846b503a
import torch from torch import nn class LayerNorm(nn.Module): """A layernorm module in the TF style (epsilon inside the square root).""" def __init__(self, d_model, variance_epsilon=1e-12): super().__init__() self.gamma = nn.Parameter(torch.ones(d_model)) self.beta = nn.Parameter(torc...
ClassificationHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch class ClassificationHead(torch.nn.Linear): def __init__(self, normalize, weights, biases=None): output_size, input_size = weights.shape super().__init__(input_size, output_size) self.normalize = normalize if weights is not None: self.weight = torch.nn.Para...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice assert_size_stride ...
mlfoundations/wise-ft
ClassificationHead
false
16,098
[ "MIT" ]
79
58b7a4b343b09dc06606aa929c2ef51accced8d1
https://github.com/mlfoundations/wise-ft/tree/58b7a4b343b09dc06606aa929c2ef51accced8d1
import torch class Model(torch.nn.Linear): def __init__(self, normalize, weights, biases=None): output_size, input_size = weights.shape super().__init__(input_size, output_size) self.normalize = normalize if weights is not None: self.weight = torch.nn.Parameter(weights...
M_VDNMixer
# 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 _paritybench_helpers import _mock_config import torch import numpy as np import torch.nn as nn def to_torch(input): return torch.from_numpy(input) if type(input) == np.ndarray else input class M_VDNMixer(nn.Module): """ Computes total Q values given agent q values and global states. :param args...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dyna...
Maxtoq/off-policy
M_VDNMixer
false
16,099
[ "MIT" ]
76
e866f13a3d144a29552c38f104bcdfb411036138
https://github.com/Maxtoq/off-policy/tree/e866f13a3d144a29552c38f104bcdfb411036138
from _paritybench_helpers import _mock_config import torch import numpy as np import torch.nn as nn def to_torch(input): return torch.from_numpy(input) if type(input) == np.ndarray else input class Model(nn.Module): """ Computes total Q values given agent q values and global states. :param args: (na...
ycbcr_to_rgb_jpeg
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn class ycbcr_to_rgb_jpeg(nn.Module): """ Converts YCbCr image to RGB JPEG Input: image(tensor): batch x height x width x 3 Outpput: result(tensor): batch x 3 x height x width """ def __init__(self): super(ycbcr_to_rgb_jp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mlomnitz/DifferentiableJPEG
ycbcr_to_rgb_jpeg
false
16,100
[ "MIT" ]
86
a5767feba955a1bcb78600135a09c36a806f6249
https://github.com/mlomnitz/DifferentiableJPEG/tree/a5767feba955a1bcb78600135a09c36a806f6249
import torch import numpy as np import torch.nn as nn class Model(nn.Module): """ Converts YCbCr image to RGB JPEG Input: image(tensor): batch x height x width x 3 Outpput: result(tensor): batch x 3 x height x width """ def __init__(self): super().__init__() matrix...
LightHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 RMSNorm(nn.Module): """An implementation of RMS Normalization. # https://catalyst-team.github.io/catalyst/_modules/catalyst/contrib/nn/modules/rms_norm.html#RMSNorm """ def __init__(self, dimension: 'int', epsilon: 'float'=1e-08, is_bias: 'bool'=False)...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
mohamedbakrey12/prpjectINDeepLearning
LightHead
false
16,101
[ "MIT" ]
122
b6106ee13ff9377e4a84bee4814bd54a34156930
https://github.com/mohamedbakrey12/prpjectINDeepLearning/tree/b6106ee13ff9377e4a84bee4814bd54a34156930
import torch from torch import nn class RMSNorm(nn.Module): """An implementation of RMS Normalization. # https://catalyst-team.github.io/catalyst/_modules/catalyst/contrib/nn/modules/rms_norm.html#RMSNorm """ def __init__(self, dimension: 'int', epsilon: 'float'=1e-08, is_bias: 'bool'=False)...
TVLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn from torch.nn import functional as F class TVLoss(nn.Module): def forward(self, input): input = F.pad(input, (0, 1, 0, 1), 'replicate') x_diff = input[..., :-1, 1:] - input[..., :-1, :-1] y_diff = input[..., 1:, :-1] - input[..., :-1, :-1] diff = ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
momo-the-monster/vqgan-clip-app
TVLoss
false
16,102
[ "MIT" ]
63
56cfc0a53928d6d8f90ed8c79439afb4430bc118
https://github.com/momo-the-monster/vqgan-clip-app/tree/56cfc0a53928d6d8f90ed8c79439afb4430bc118
import torch from torch import nn from torch.nn import functional as F class Model(nn.Module): def forward(self, input): input = F.pad(input, (0, 1, 0, 1), 'replicate') x_diff = input[..., :-1, 1:] - input[..., :-1, :-1] y_diff = input[..., 1:, :-1] - input[..., :-1, :-1] diff = x...
ClassicalConv2
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.utils.prune import torch.backends.cudnn import torch.cuda import torch.nn import torch.utils.data class ClassicalConv2(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 4, 2, 1) 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 from torch._inductor.runtime....
mit-han-lab/pytorch-quantum
ClassicalConv2
false
16,103
[ "MIT" ]
98
05cf000d689307f6b1fe02d12744ad455685935b
https://github.com/mit-han-lab/pytorch-quantum/tree/05cf000d689307f6b1fe02d12744ad455685935b
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.utils.prune import torch.backends.cudnn import torch.cuda import torch.nn import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 4, 2, 1) self.conv2...
Anchor3DHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import numpy as np import torch.nn as nn def bbox_overlaps(bboxes1, bboxes2, mode='iou', is_aligned=False, eps=1e-06): """Calculate overlap between two set of bboxes. If ``is_aligned `` is ``False``, then calculate the overlaps between each bbox of bboxes1 and bboxes2, otherwise the overlaps...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import numpy as np import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mi-exwzd/Open3D-ML
Anchor3DHead
false
16,104
[ "MIT" ]
447
d58b24edd37de7889446360164cd5500e0bde060
https://github.com/mi-exwzd/Open3D-ML/tree/d58b24edd37de7889446360164cd5500e0bde060
import torch import numpy as np import torch.nn as nn def bbox_overlaps(bboxes1, bboxes2, mode='iou', is_aligned=False, eps=1e-06): """Calculate overlap between two set of bboxes. If ``is_aligned `` is ``False``, then calculate the overlaps between each bbox of bboxes1 and bboxes2, otherwise the overlaps...
CRF
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 CRF(nn.Module): def __init__(self, num_nodes, iteration=10): """Initialize the CRF module Args: num_nodes: int, number of nodes/patches within the fully CRF iteration: int, number of mean field iterations, e.g. 10 """ ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
mingrui/NCRF
CRF
false
16,105
[ "Apache-2.0" ]
734
d3dcb50739a9eb8621d42ea98b7d0496afe430ca
https://github.com/mingrui/NCRF/tree/d3dcb50739a9eb8621d42ea98b7d0496afe430ca
import torch from torch import nn class Model(nn.Module): def __init__(self, num_nodes, iteration=10): """Initialize the CRF module Args: num_nodes: int, number of nodes/patches within the fully CRF iteration: int, number of mean field iterations, e.g. 10 """ ...
AODnet
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 AODnet(nn.Module): def __init__(self): super(AODnet, self).__init__() self.conv1 = nn.Conv2d(in_channels=3, out_channels=3, kernel_size=1) self.conv2 = nn.Conv2d(in_channels=3, out_channels=3, kernel_size=3, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
misads/cv_template
AODnet
false
16,106
[ "MIT" ]
69
9976ee0ada449a494d26f896c598610f233edc10
https://github.com/misads/cv_template/tree/9976ee0ada449a494d26f896c598610f233edc10
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(in_channels=3, out_channels=3, kernel_size=1) self.conv2 = nn.Conv2d(in_channels=3, out_channels=3, kernel_size=3, padding=1...
ClassicalConv5
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.utils.prune import torch.backends.cudnn import torch.cuda import torch.nn import torch.utils.data class ClassicalConv5(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1, padding=...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mit-han-lab/pytorch-quantum
ClassicalConv5
false
16,107
[ "MIT" ]
98
05cf000d689307f6b1fe02d12744ad455685935b
https://github.com/mit-han-lab/pytorch-quantum/tree/05cf000d689307f6b1fe02d12744ad455685935b
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.utils.prune import torch.backends.cudnn import torch.cuda import torch.nn import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1, padding=1) ...
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 from torch import nn def gumbel_softmax(logits, tau=1.0, hard=False, log_mode=True, dim=-1): while True: gumbels = -torch.empty_like(logits).exponential_().log() gumbels = (logits + gumbels) / tau if log_mode: y_soft = gumbels.log_softmax(dim) else: ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mosespv96/SCAPT-ABSA
Generator
false
16,108
[ "MIT" ]
49
6f7f89a131127f262a8d1fd2774e5a96b58e7193
https://github.com/mosespv96/SCAPT-ABSA/tree/6f7f89a131127f262a8d1fd2774e5a96b58e7193
import torch from torch import nn def gumbel_softmax(logits, tau=1.0, hard=False, log_mode=True, dim=-1): while True: gumbels = -torch.empty_like(logits).exponential_().log() gumbels = (logits + gumbels) / tau if log_mode: y_soft = gumbels.log_softmax(dim) else: ...
ShiftSoftplus
# 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 from torch.nn import Softplus class ShiftSoftplus(Softplus): """ Shiftsoft plus activation function: 1/beta * (log(1 + exp**(beta * x)) - log(shift)) """ def __init__(self, beta=1, shift=2, threshold=20): super().__init__(beta, threshold) 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 from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch.nn import Softplus assert_size_stride = torch._C._d...
mufeili/Alchemy
ShiftSoftplus
false
16,109
[ "MIT" ]
116
659c59fbbe93d406f8b3e0711e5a048e58c9c43c
https://github.com/mufeili/Alchemy/tree/659c59fbbe93d406f8b3e0711e5a048e58c9c43c
import torch import numpy as np from torch.nn import Softplus class Model(Softplus): """ Shiftsoft plus activation function: 1/beta * (log(1 + exp**(beta * x)) - log(shift)) """ def __init__(self, beta=1, shift=2, threshold=20): super().__init__(beta, threshold) self.shift = s...
Sinh
# 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.onnx import torch.nn as nn class Sinh(nn.Module): def forward(self, x): return torch.sinh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.onnx import torch.nn as nn assert_size_stride = torch._C._dynamo.g...
mil-tokyo/webdnn
Sinh
false
16,110
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.sinh(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []
VAE
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class VAE(nn.Module): def __init__(self): super(VAE, self).__init__() self.fc1 = nn.Linear(784, 400) self.fc21 = nn.Linear(400, 20) self.fc22 = nn.Linear(400, 20) self.fc3 = nn.Linear(20, 400) self....
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
momohatt/chainer-compiler
VAE
false
16,111
[ "MIT" ]
116
26782cd29a5becf8e2badf268b47d98b3a6aea1d
https://github.com/momohatt/chainer-compiler/tree/26782cd29a5becf8e2badf268b47d98b3a6aea1d
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784, 400) self.fc21 = nn.Linear(400, 20) self.fc22 = nn.Linear(400, 20) self.fc3 = nn.Linear(20, 400) self.fc4 = n...
idct_8x8
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 itertools import torch import numpy as np import torch.nn as nn class idct_8x8(nn.Module): """ Inverse discrete Cosine Transformation Input: dcp(tensor): batch x height x width Output: image(tensor): batch x height x width """ def __init__(self): super(idct_8x8, sel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import itertools import numpy as np import torch.nn as nn assert_size_stride = t...
mlomnitz/DifferentiableJPEG
idct_8x8
false
16,112
[ "MIT" ]
86
a5767feba955a1bcb78600135a09c36a806f6249
https://github.com/mlomnitz/DifferentiableJPEG/tree/a5767feba955a1bcb78600135a09c36a806f6249
import itertools import torch import numpy as np import torch.nn as nn class Model(nn.Module): """ Inverse discrete Cosine Transformation Input: dcp(tensor): batch x height x width Output: image(tensor): batch x height x width """ def __init__(self): super().__init__() ...
NextSentencePrediction
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 NextSentencePrediction(nn.Module): """ 2-class classification model : is_next, is_not_next """ def __init__(self, hidden): """ :param hidden: BERT model output size """ super().__init__() self.linear = nn.Linear(hidden, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mortonjt/BERT-pytorch
NextSentencePrediction
false
16,113
[ "Apache-2.0" ]
5,013
d10dc4f9d5a6f2ca74380f62039526eb7277c671
https://github.com/mortonjt/BERT-pytorch/tree/d10dc4f9d5a6f2ca74380f62039526eb7277c671
import torch import torch.nn as nn class Model(nn.Module): """ 2-class classification model : is_next, is_not_next """ def __init__(self, hidden): """ :param hidden: BERT model output size """ super().__init__() self.linear = nn.Linear(hidden, 2) self.s...
ClassicalConv6
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.utils.prune import torch.backends.cudnn import torch.cuda import torch.nn import torch.utils.data class ClassicalConv6(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1, padding=...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
mit-han-lab/pytorch-quantum
ClassicalConv6
false
16,114
[ "MIT" ]
98
05cf000d689307f6b1fe02d12744ad455685935b
https://github.com/mit-han-lab/pytorch-quantum/tree/05cf000d689307f6b1fe02d12744ad455685935b
import torch import torch.nn.functional as F import torch.nn as nn import torch.nn.utils.prune import torch.backends.cudnn import torch.cuda import torch.nn import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 32, 3, 1, padding=1) ...
ComplexDropout
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn import torch.utils class ComplexDropout(nn.Module): def __init__(self, p=0.5, inplace=False): super(ComplexDropout, self).__init__() self.p = p self.inplace = inplace self.dropout_r = nn.Dropout(p, inplace) self.dropout_i = nn.Dropout(p, 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 import nn import torch.utils assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
muqiaoy/dl_signal
ComplexDropout
false
16,115
[ "MIT" ]
54
3a30d14982016644bfc96a7d1ca0109b441f17fd
https://github.com/muqiaoy/dl_signal/tree/3a30d14982016644bfc96a7d1ca0109b441f17fd
import torch from torch import nn import torch.utils class Model(nn.Module): def __init__(self, p=0.5, inplace=False): super().__init__() self.p = p self.inplace = inplace self.dropout_r = nn.Dropout(p, inplace) self.dropout_i = nn.Dropout(p, inplace) def forward(self...
SeparableBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch from torch.nn import Linear class SeparableBlock(Module): def __init__(self, input_size, kernel_channels_in, kernel_channels_out, kernel_size): super(SeparableBlock, self).__init__() self.input_size = input_size self.kernel_size = kernel_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.nn import Module from torch.nn import Linear assert_size_stride = tor...
morzh/hyperstyle
SeparableBlock
false
16,116
[ "MIT" ]
692
ed87f620143d045f374aa42712a43abd751a90e6
https://github.com/morzh/hyperstyle/tree/ed87f620143d045f374aa42712a43abd751a90e6
from torch.nn import Module import torch from torch.nn import Linear class Model(Module): def __init__(self, input_size, kernel_channels_in, kernel_channels_out, kernel_size): super().__init__() self.input_size = input_size self.kernel_size = kernel_size self.kernel_channe...
ComplexReLU
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn import torch.utils class ComplexReLU(nn.Module): def __init__(self): super(ComplexReLU, self).__init__() self.relu_r = nn.ReLU() self.relu_i = nn.ReLU() def forward(self, input_r, input_i): return self.relu_r(input_r), self.relu_i(input_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 from torch import nn import torch.utils assert_size_stride = torch._C._dynamo.guards.asse...
muqiaoy/dl_signal
ComplexReLU
false
16,117
[ "MIT" ]
54
3a30d14982016644bfc96a7d1ca0109b441f17fd
https://github.com/muqiaoy/dl_signal/tree/3a30d14982016644bfc96a7d1ca0109b441f17fd
import torch from torch import nn import torch.utils class Model(nn.Module): def __init__(self): super().__init__() self.relu_r = nn.ReLU() self.relu_i = nn.ReLU() def forward(self, input_r, input_i): return self.relu_r(input_r), self.relu_i(input_i) def get_inputs(): r...
LabelSmoothing
# 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 LabelSmoothing(nn.Module): """ NLL loss with label smoothing. """ def __init__(self, smoothing=0.0, n_cls=2): """ Constructor for the LabelSmoothing module. :param smoothing: label smoothing factor """ super(LabelSmoothi...
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 ...
mrblasco/kaggle_moa_winner_hungry_for_gold
LabelSmoothing
false
16,118
[ "Apache-2.0" ]
89
00df6d0aa4a48e526cee3e36f6e723a1534bfa08
https://github.com/mrblasco/kaggle_moa_winner_hungry_for_gold/tree/00df6d0aa4a48e526cee3e36f6e723a1534bfa08
import torch import torch.nn as nn class Model(nn.Module): """ NLL loss with label smoothing. """ def __init__(self, smoothing=0.0, n_cls=2): """ Constructor for the LabelSmoothing module. :param smoothing: label smoothing factor """ super().__init__() ...
ComplexConv1d
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.utils class ComplexConv1d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=0, dilation=1, groups=1, bias=True): super(ComplexConv1d, self).__init__() self.conv_r = nn.Conv1d(in_channels, out_channels,...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.utils assert_size_stride = torch._C._dynamo.gu...
muqiaoy/dl_signal
ComplexConv1d
false
16,119
[ "MIT" ]
54
3a30d14982016644bfc96a7d1ca0109b441f17fd
https://github.com/muqiaoy/dl_signal/tree/3a30d14982016644bfc96a7d1ca0109b441f17fd
import torch from torch import nn import torch.utils class Model(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=0, dilation=1, groups=1, bias=True): super().__init__() self.conv_r = nn.Conv1d(in_channels, out_channels, kernel_size, s...
ComplexMaxPool1d
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import nn import torch.utils class ComplexMaxPool1d(nn.Module): def __init__(self, kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False): super(ComplexMaxPool1d, self).__init__() self.kernel_size = kernel_size self.stride =...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn import torch.utils assert_size_stride = torch._C._dynamo.guards.asse...
muqiaoy/dl_signal
ComplexMaxPool1d
false
16,120
[ "MIT" ]
54
3a30d14982016644bfc96a7d1ca0109b441f17fd
https://github.com/muqiaoy/dl_signal/tree/3a30d14982016644bfc96a7d1ca0109b441f17fd
import torch from torch import nn import torch.utils class Model(nn.Module): def __init__(self, kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False): super().__init__() self.kernel_size = kernel_size self.stride = stride self.padding = pa...
LinearWithGroupNorm
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.utils.data from torch import nn from math import gcd import torch.cuda class LinearWithGroupNorm(nn.Module): """Linear layer with group normalization activation used in LaneGCN.""" def __init__(self, n_in: 'int', n_out: 'int', num_groups: 'int'=32, activation: 'bool'=True) -...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
motional/nuplan-devkit
LinearWithGroupNorm
false
16,121
[ "Apache-2.0" ]
128
e39029e788b17f47f2fcadb774098ef8fbdd0d67
https://github.com/motional/nuplan-devkit/tree/e39029e788b17f47f2fcadb774098ef8fbdd0d67
import torch import torch.utils.data from torch import nn from math import gcd import torch.cuda class Model(nn.Module): """Linear layer with group normalization activation used in LaneGCN.""" def __init__(self, n_in: 'int', n_out: 'int', num_groups: 'int'=32, activation: 'bool'=True) ->None: ...
CRNNcell
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 CRNNcell(nn.Module): """ Convolutional RNN cell that evolves over both time and iterations Parameters ----------------- input: 4d tensor, shape (batch_size, channel, width, height) hidden: hidden states in temporal dimension, 4d tensor, shape (batch_si...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
myyaqubpython/https-github.com-cq615-Deep-MRI-Reconstruction
CRNNcell
false
16,122
[ "Apache-2.0" ]
260
4484cff9f1e19ff9874c279c5c5d6cf2a317ddbf
https://github.com/myyaqubpython/https-github.com-cq615-Deep-MRI-Reconstruction/tree/4484cff9f1e19ff9874c279c5c5d6cf2a317ddbf
import torch import torch.nn as nn class Model(nn.Module): """ Convolutional RNN cell that evolves over both time and iterations Parameters ----------------- input: 4d tensor, shape (batch_size, channel, width, height) hidden: hidden states in temporal dimension, 4d tensor, shape (batch_size,...
ComplexLinear
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.utils class ComplexLinear(nn.Module): def __init__(self, in_features, out_features): super(ComplexLinear, self).__init__() self.fc_r = nn.Linear(in_features, out_features) self.fc_i = nn.Linear(in_features, out_features) def forward(self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.utils assert_size_stride = torch._C._dynamo.gu...
muqiaoy/dl_signal
ComplexLinear
false
16,123
[ "MIT" ]
54
3a30d14982016644bfc96a7d1ca0109b441f17fd
https://github.com/muqiaoy/dl_signal/tree/3a30d14982016644bfc96a7d1ca0109b441f17fd
import torch from torch import nn import torch.utils class Model(nn.Module): def __init__(self, in_features, out_features): super().__init__() self.fc_r = nn.Linear(in_features, out_features) self.fc_i = nn.Linear(in_features, out_features) def forward(self, input_r, input_i): ...
LovaszLoss
# 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 from torch import nn import torch.nn.functional as F from itertools import filterfalse def jaccard(outputs, targets, per_image=False, non_empty=False, min_pixels=5): batch_size = outputs.size()[0] eps = 0.001 if not per_image: batch_size = 1 dice_target = target...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import numpy as np from torch import nn import torch.nn.functional as F from itertools im...
kevinkwshin/kaggle-pneumothorax
LovaszLoss
false
16,124
[ "MIT" ]
74
24b91a9425097023f0cc7781a9380cb247babe22
https://github.com/kevinkwshin/kaggle-pneumothorax/tree/24b91a9425097023f0cc7781a9380cb247babe22
import torch import numpy as np from torch import nn import torch.nn.functional as F from itertools import filterfalse def jaccard(outputs, targets, per_image=False, non_empty=False, min_pixels=5): batch_size = outputs.size()[0] eps = 0.001 if not per_image: batch_size = 1 dice_target = target...
RZTXDecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 RZTXDecoderLayer(nn.Module): """RZTXDecoderLayer is made up of self-attn and feedforward network with residual weights for faster convergece. This encoder layer is based on the paper "ReZero is All You Need: Fast Convergence at L...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
mpariente/rezero
RZTXDecoderLayer
false
16,125
[ "MIT" ]
376
6bcf1df00bc9a3560b093a2bbe12dade92f86eba
https://github.com/mpariente/rezero/tree/6bcf1df00bc9a3560b093a2bbe12dade92f86eba
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): """RZTXDecoderLayer is made up of self-attn and feedforward network with residual weights for faster convergece. This encoder layer is based on the paper "ReZero is All You Need: Fast Convergence at Large Depth"...
LearnableClsToken
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 as th from torch import nn class LearnableClsToken(nn.Module): """ Layer that adds learnable CLS tokens to sequence input. """ def __init__(self, d_model: 'int'): super().__init__() cls_token = th.zeros(d_model) self.cls_param = nn.Parameter(cls_token...
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 as th from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynam...
mzolfaghari/coot-videotext
LearnableClsToken
false
16,126
[ "Apache-2.0" ]
213
ee09c56c2600f56581167773d7f7dc5d036cc5e6
https://github.com/mzolfaghari/coot-videotext/tree/ee09c56c2600f56581167773d7f7dc5d036cc5e6
import torch import torch as th from torch import nn class Model(nn.Module): """ Layer that adds learnable CLS tokens to sequence input. """ def __init__(self, d_model: 'int'): super().__init__() cls_token = th.zeros(d_model) self.cls_param = nn.Parameter(cls_token, requires_g...
RZTXEncoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.nn import Module import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.modules.activation import MultiheadAttention from torch.nn.modules.dropout import Dropout from torch.nn.modules.linear import Linear class RZTXEncoderLayer(Module): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
mpariente/rezero
RZTXEncoderLayer
false
16,127
[ "MIT" ]
376
6bcf1df00bc9a3560b093a2bbe12dade92f86eba
https://github.com/mpariente/rezero/tree/6bcf1df00bc9a3560b093a2bbe12dade92f86eba
from torch.nn import Module import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.modules.activation import MultiheadAttention from torch.nn.modules.dropout import Dropout from torch.nn.modules.linear import Linear class Model(Module): """RZTXE...
AddCoords
# 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 AddCoords(nn.Module): """ Add Coords to a tensor """ def __init__(self, with_r=False): super(AddCoords, self).__init__() self.with_r = with_r def forward(self, x): """ :param x: shape (batch, channel, x_dim, y_dim) ...
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...
nandbhat/dressing-in-order
AddCoords
false
16,128
[ "BSD-3-Clause" ]
172
93ed967f588de9f3f80dcc40c51d5790569fbcab
https://github.com/nandbhat/dressing-in-order/tree/93ed967f588de9f3f80dcc40c51d5790569fbcab
import torch import torch.nn as nn class Model(nn.Module): """ Add Coords to a tensor """ def __init__(self, with_r=False): super().__init__() self.with_r = with_r def forward(self, x): """ :param x: shape (batch, channel, x_dim, y_dim) :return: shape (bat...
CoordConv
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from torch.nn.utils.spectral_norm import spectral_norm as SpectralNorm def spectral_norm(module, use_spect=True): """use spectral normal layer to stable the training process""" if use_spect: return SpectralNorm(module) else: return module class AddCoord...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.nn.utils.spectral_norm import spectral_norm as ...
nandbhat/dressing-in-order
CoordConv
false
16,129
[ "BSD-3-Clause" ]
172
93ed967f588de9f3f80dcc40c51d5790569fbcab
https://github.com/nandbhat/dressing-in-order/tree/93ed967f588de9f3f80dcc40c51d5790569fbcab
import torch import torch.nn as nn from torch.nn.utils.spectral_norm import spectral_norm as SpectralNorm def spectral_norm(module, use_spect=True): """use spectral normal layer to stable the training process""" if use_spect: return SpectralNorm(module) else: return module class AddCoord...
SLN
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 SLN(nn.Module): """ Self-modulated LayerNorm """ def __init__(self, num_features): super(SLN, self).__init__() self.ln = nn.LayerNorm(num_features) self.gamma = nn.Parameter(torch.randn(1, 1, 1)) self.beta = nn.Parameter(torch.r...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
nandkishore1/TransformersInVision
SLN
false
16,130
[ "MIT" ]
94
134ef26b63916d2b9ae384124de7365a97102b06
https://github.com/nandkishore1/TransformersInVision/tree/134ef26b63916d2b9ae384124de7365a97102b06
import torch import torch.nn as nn class Model(nn.Module): """ Self-modulated LayerNorm """ def __init__(self, num_features): super().__init__() self.ln = nn.LayerNorm(num_features) self.gamma = nn.Parameter(torch.randn(1, 1, 1)) self.beta = nn.Parameter(torch.randn(1,...
ToLongTensor
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torch import Tensor from typing import List import torch.nn as nn class ToLongTensor(nn.Module): """Convert a list of integers to long tensor """ def __init__(self): super(ToLongTensor, self).__init__() def forward(self, tokens: 'List[List[int]]') ->Tensor: return t...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
nateanl/text
ToLongTensor
false
16,131
[ "BSD-3-Clause" ]
3,172
b26e9350ad387a84aefe131443bbbf1c51a8a618
https://github.com/nateanl/text/tree/b26e9350ad387a84aefe131443bbbf1c51a8a618
import torch from torch import Tensor from typing import List import torch.nn as nn class Model(nn.Module): """Convert a list of integers to long tensor """ def __init__(self): super().__init__() def forward(self, tokens: 'List[List[int]]') ->Tensor: return torch.tensor(tokens) def...
BucketingEmbedding
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 BucketingEmbedding(nn.Module): def __init__(self, min_val, max_val, count, dim, use_log_scale=False): super().__init__() self.min_val = min_val self.max_val = max_val self.count = count self.dim = dim self.use_log_scale = us...
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...
narekvslife/OccupancyAnticipation
BucketingEmbedding
false
16,132
[ "MIT" ]
53
19b9f4d72b114339d07bd225a1c3feed73e982c2
https://github.com/narekvslife/OccupancyAnticipation/tree/19b9f4d72b114339d07bd225a1c3feed73e982c2
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, min_val, max_val, count, dim, use_log_scale=False): super().__init__() self.min_val = min_val self.max_val = max_val self.count = count self.dim = dim self.use_log_scale = use_log_scale ...
conv_head_pooling
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn class conv_head_pooling(nn.Module): def __init__(self, in_feature, out_feature, stride, padding_mode='zeros'): super(conv_head_pooling, self).__init__() self.conv = nn.Conv2d(in_feature, out_feature, kernel_size=stride + 1, padding=stride // 2, stride...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
naver-ai/PfLayer
conv_head_pooling
false
16,133
[ "Apache-2.0" ]
59
da8f80b2ea3b6bd7fbee3beee8b1516c89bc0441
https://github.com/naver-ai/PfLayer/tree/da8f80b2ea3b6bd7fbee3beee8b1516c89bc0441
import torch from torch import nn class Model(nn.Module): def __init__(self, in_feature, out_feature, stride, padding_mode='zeros'): super().__init__() self.conv = nn.Conv2d(in_feature, out_feature, kernel_size=stride + 1, padding=stride // 2, stride=stride, padding_mode= ...
Dec
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 def weights_init(m): classname = m.__class__.__name__ if classname.find('Linear') != -1: m.weight.data.normal_(0.0, 0.02) m.bias.data.fill_(0) elif classname.find('BatchNorm') != -1: m.weight.data.norm...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
naraysa/gzsl-od
Dec
false
16,134
[ "MIT" ]
50
be771e12e17a4c02386c70697c4b26e3170a7557
https://github.com/naraysa/gzsl-od/tree/be771e12e17a4c02386c70697c4b26e3170a7557
from _paritybench_helpers import _mock_config import torch import torch.nn as nn def weights_init(m): classname = m.__class__.__name__ if classname.find('Linear') != -1: m.weight.data.normal_(0.0, 0.02) m.bias.data.fill_(0) elif classname.find('BatchNorm') != -1: m.weight.data.norm...
MultiheadAttention
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch import nn import torch.utils from torch.nn.parameter import Parameter import torch.nn.functional as F from torch.nn import Parameter class MultiheadAttention(nn.Module): """Multi-headed attention. See "Attention Is All You Need" for more details. """ def __init__(self, embed_d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
muqiaoy/dl_signal
MultiheadAttention
false
16,135
[ "MIT" ]
54
3a30d14982016644bfc96a7d1ca0109b441f17fd
https://github.com/muqiaoy/dl_signal/tree/3a30d14982016644bfc96a7d1ca0109b441f17fd
import torch from torch import nn import torch.utils from torch.nn.parameter import Parameter import torch.nn.functional as F from torch.nn import Parameter class Model(nn.Module): """Multi-headed attention. See "Attention Is All You Need" for more details. """ def __init__(self, embed_dim, num_heads...
AdaptiveFeatureNorm
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class AdaptiveFeatureNorm(nn.Module): """ The `Stepwise Adaptive Feature Norm loss (ICCV 2019) <https://arxiv.org/pdf/1811.07456v2.pdf>`_ Instead of using restrictive scalar R to match the corresponding feature norm, Stepwise Adaptive Feature Nor...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dy...
neka-nat/Transfer-Learning-Library
AdaptiveFeatureNorm
false
16,136
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """ The `Stepwise Adaptive Feature Norm loss (ICCV 2019) <https://arxiv.org/pdf/1811.07456v2.pdf>`_ Instead of using restrictive scalar R to match the corresponding feature norm, Stepwise Adaptive Feature Norm is used ...
BatchSpectralPenalizationLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class BatchSpectralPenalizationLoss(nn.Module): """Batch spectral penalization loss from `Transferability vs. Discriminability: Batch Spectral Penalization for Adversarial Domain Adaptation (ICML 2019) <http://ise.thss.tsinghua.edu.cn/~mlong/doc/b...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
neka-nat/Transfer-Learning-Library
BatchSpectralPenalizationLoss
false
16,137
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """Batch spectral penalization loss from `Transferability vs. Discriminability: Batch Spectral Penalization for Adversarial Domain Adaptation (ICML 2019) <http://ise.thss.tsinghua.edu.cn/~mlong/doc/batch-spectral-penalizati...
conv_embedding
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 conv_embedding(nn.Module): def __init__(self, in_channels, out_channels, patch_size, stride, padding): super(conv_embedding, self).__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size= patch_size, stride=stride, padding=paddin...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import 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...
naver-ai/PfLayer
conv_embedding
false
16,138
[ "Apache-2.0" ]
59
da8f80b2ea3b6bd7fbee3beee8b1516c89bc0441
https://github.com/naver-ai/PfLayer/tree/da8f80b2ea3b6bd7fbee3beee8b1516c89bc0441
import torch from torch import nn class Model(nn.Module): def __init__(self, in_channels, out_channels, patch_size, stride, padding): super().__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size= patch_size, stride=stride, padding=padding, bias=True) def forwar...
MLP_G
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 def weights_init(m): classname = m.__class__.__name__ if classname.find('Linear') != -1: m.weight.data.normal_(0.0, 0.02) m.bias.data.fill_(0) elif classname.find('BatchNorm') != -1: m.weight.data.norm...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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_...
naraysa/gzsl-od
MLP_G
false
16,139
[ "MIT" ]
50
be771e12e17a4c02386c70697c4b26e3170a7557
https://github.com/naraysa/gzsl-od/tree/be771e12e17a4c02386c70697c4b26e3170a7557
from _paritybench_helpers import _mock_config import torch import torch.nn as nn def weights_init(m): classname = m.__class__.__name__ if classname.find('Linear') != -1: m.weight.data.normal_(0.0, 0.02) m.bias.data.fill_(0) elif classname.find('BatchNorm') != -1: m.weight.data.norm...
PyramidPoolingModule
# 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 PyramidPoolingModule(nn.Module): def __init__(self, pyramids=[1, 2, 3, 6]): super(PyramidPoolingModule, self).__init__() self.pyramids = pyramids def forward(self, input): feat = input height, width = in...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
nassir90/ICNet-pytorch
PyramidPoolingModule
false
16,140
[ "MIT" ]
83
af6eec01a4419ce43c52d295bc502c366478fbd7
https://github.com/nassir90/ICNet-pytorch/tree/af6eec01a4419ce43c52d295bc502c366478fbd7
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, pyramids=[1, 2, 3, 6]): super().__init__() self.pyramids = pyramids def forward(self, input): feat = input height, width = input.shape[2:] for bin_size in sel...
RobertaClassificationHead
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn from typing import Optional class RobertaClassificationHead(nn.Module): def __init__(self, num_classes, input_dim, inner_dim: 'Optional[int]'= None, dropout: 'float'=0.1, activation=nn.ReLU): super().__init__() if not inner_dim: inner_dim = i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn from ty...
nateanl/text
RobertaClassificationHead
false
16,141
[ "BSD-3-Clause" ]
3,172
b26e9350ad387a84aefe131443bbbf1c51a8a618
https://github.com/nateanl/text/tree/b26e9350ad387a84aefe131443bbbf1c51a8a618
import torch import torch.nn as nn from typing import Optional class Model(nn.Module): def __init__(self, num_classes, input_dim, inner_dim: 'Optional[int]'= None, dropout: 'float'=0.1, activation=nn.ReLU): super().__init__() if not inner_dim: inner_dim = input_dim sel...
BatchSpectralShrinkage
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class BatchSpectralShrinkage(nn.Module): """ The regularization term in `Catastrophic Forgetting Meets Negative Transfer: Batch Spectral Shrinkage for Safe Transfer Learning (NIPS 2019) <https://proceedings.neurips.cc/paper/2019/file/c6bff625bdb03...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
neka-nat/Transfer-Learning-Library
BatchSpectralShrinkage
false
16,142
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """ The regularization term in `Catastrophic Forgetting Meets Negative Transfer: Batch Spectral Shrinkage for Safe Transfer Learning (NIPS 2019) <https://proceedings.neurips.cc/paper/2019/file/c6bff625bdb0393992c9d4db0c6bbe...
CIFAR10_Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class CIFAR10_Net(nn.Module): def __init__(self): super(CIFAR10_Net, self).__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=5) self.conv2 = nn.Conv2d(32, 32, kernel_size=5) self.conv3 = nn.Conv2d(32, 64, kernel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
nannullna/deep-active-learning
CIFAR10_Net
false
16,143
[ "MIT" ]
465
c54a995640c63ba4679129c5a1fd5cec9a2858e6
https://github.com/nannullna/deep-active-learning/tree/c54a995640c63ba4679129c5a1fd5cec9a2858e6
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=5) self.conv2 = nn.Conv2d(32, 32, kernel_size=5) self.conv3 = nn.Conv2d(32, 64, kernel_size=5) self.f...
BridgeFeatLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class BridgeFeatLoss(nn.Module): def __init__(self): super(BridgeFeatLoss, self).__init__() def forward(self, f_s, f_t, f_mixed, lam): dist_mixed2s = ((f_mixed - f_s) ** 2).sum(1, keepdim=True) dist_mixed2t = ((f_mixed - f_t)...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import...
neka-nat/Transfer-Learning-Library
BridgeFeatLoss
false
16,144
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() def forward(self, f_s, f_t, f_mixed, lam): dist_mixed2s = ((f_mixed - f_s) ** 2).sum(1, keepdim=True) dist_mixed2t = ((f_mixed - f_t) ** 2).sum(1, keepdim=True) ...
DirectedGraphConvolution
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F def normalize_adj(adj): last_dim = adj.size(-1) rowsum = adj.sum(2, keepdim=True).repeat(1, 1, last_dim) return torch.div(adj, rowsum) class DirectedGraphConvolution(nn.Module): def __init__(self, in_features, out_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 import torch.nn as nn assert_...
naszilla/naszilla
DirectedGraphConvolution
false
16,145
[ "Apache-2.0" ]
112
5575cc8c95e79ce5743e8ea7ef53d6da900f8480
https://github.com/naszilla/naszilla/tree/5575cc8c95e79ce5743e8ea7ef53d6da900f8480
import torch import torch.nn as nn import torch.nn.functional as F def normalize_adj(adj): last_dim = adj.size(-1) rowsum = adj.sum(2, keepdim=True).repeat(1, 1, last_dim) return torch.div(adj, rowsum) class Model(nn.Module): def __init__(self, in_features, out_features): super().__init__()...
ShapedSineModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 class ShapedSineModel(torch.nn.Module): def __init__(self, theta=None): super(ShapedSineModel, self).__init__() if theta is None: self.freq = torch.nn.Parameter(torch.Tensor([0.1])) else: self.freq = torch.nn.Parameter(torch.Ten...
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.utils.data assert_size_stride = torch._C._dynamo.guards.asse...
neha191091/LearningToLearn
ShapedSineModel
false
16,146
[ "MIT" ]
76
3619d27bb3b7a836d9423dfbdd8da82460d4fa73
https://github.com/neha191091/LearningToLearn/tree/3619d27bb3b7a836d9423dfbdd8da82460d4fa73
import torch import torch.utils.data class Model(torch.nn.Module): def __init__(self, theta=None): super().__init__() if theta is None: self.freq = torch.nn.Parameter(torch.Tensor([0.1])) else: self.freq = torch.nn.Parameter(torch.Tensor([theta])) self.lear...
VanillaGenerativeAdversarialLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class VanillaGenerativeAdversarialLoss(nn.Module): """ Loss for `Vanilla Generative Adversarial Network <https://arxiv.org/abs/1406.2661>`_ Args: reduction (str, optional): Specifies the reduction to apply to the output: ``'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 import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
neka-nat/Transfer-Learning-Library
VanillaGenerativeAdversarialLoss
false
16,147
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """ Loss for `Vanilla Generative Adversarial Network <https://arxiv.org/abs/1406.2661>`_ Args: reduction (str, optional): Specifies the reduction to apply to the output: ``'none'`` | ``'mean'`` | ``'sum'`...
LeastSquaresGenerativeAdversarialLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class LeastSquaresGenerativeAdversarialLoss(nn.Module): """ Loss for `Least Squares Generative Adversarial Network (LSGAN) <https://arxiv.org/abs/1611.04076>`_ Args: reduction (str, optional): Specifies the reduction to apply to the outpu...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guard...
neka-nat/Transfer-Learning-Library
LeastSquaresGenerativeAdversarialLoss
false
16,148
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """ Loss for `Least Squares Generative Adversarial Network (LSGAN) <https://arxiv.org/abs/1611.04076>`_ Args: reduction (str, optional): Specifies the reduction to apply to the output: ``'none'`` | ``'mea...
Theta
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
from torch.autograd import Function import torch import torch.nn as nn from typing import Tuple from typing import Optional from typing import Any import torch.utils.data class GradientReverseFunction(Function): @staticmethod def forward(ctx: 'Any', input: 'torch.Tensor', coeff: 'Optional[float]'=1.0 ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch.autograd import Function import torch.nn as nn from typing import Tup...
neka-nat/Transfer-Learning-Library
Theta
false
16,149
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
from torch.autograd import Function import torch import torch.nn as nn from typing import Tuple from typing import Optional from typing import Any import torch.utils.data class GradientReverseFunction(Function): @staticmethod def forward(ctx: 'Any', input: 'torch.Tensor', coeff: 'Optional[float]'=1.0 ...
GaussianKernel
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn from typing import Optional import torch.utils.data class GaussianKernel(nn.Module): """Gaussian Kernel Matrix Gaussian Kernel k is defined by .. math:: k(x_1, x_2) = \\exp \\left( - \\dfrac{\\| x_1 - x_2 \\|^2}{2\\sigma^2} \\right) where :math:`x_1, x_2 \...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
neka-nat/Transfer-Learning-Library
GaussianKernel
false
16,150
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn from typing import Optional import torch.utils.data class Model(nn.Module): """Gaussian Kernel Matrix Gaussian Kernel k is defined by .. math:: k(x_1, x_2) = \\exp \\left( - \\dfrac{\\| x_1 - x_2 \\|^2}{2\\sigma^2} \\right) where :math:`x_1, x_2 \\in R^d` ...
DivLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class DivLoss(nn.Module): def __init__(self): super(DivLoss, self).__init__() def forward(self, lam): mu = lam.mean(0) std = ((lam - mu) ** 2).mean(0, keepdim=True).clamp(min=1e-12).sqrt() loss_std = -std.sum() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import...
neka-nat/Transfer-Learning-Library
DivLoss
false
16,151
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): def __init__(self): super().__init__() def forward(self, lam): mu = lam.mean(0) std = ((lam - mu) ** 2).mean(0, keepdim=True).clamp(min=1e-12).sqrt() loss_std = -std.sum() return loss_s...
CorrelationAlignmentLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.utils.data class CorrelationAlignmentLoss(nn.Module): """The `Correlation Alignment Loss` in `Deep CORAL: Correlation Alignment for Deep Domain Adaptation (ECCV 2016) <https://arxiv.org/pdf/1607.01719.pdf>`_. Given source features :math:`f_S` and target fea...
import torch from torch._inductor.select_algorithm import extern_kernels import 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...
neka-nat/Transfer-Learning-Library
CorrelationAlignmentLoss
false
16,152
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.utils.data class Model(nn.Module): """The `Correlation Alignment Loss` in `Deep CORAL: Correlation Alignment for Deep Domain Adaptation (ECCV 2016) <https://arxiv.org/pdf/1607.01719.pdf>`_. Given source features :math:`f_S` and target features :math:`f_T`, ...
Accuracy
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
from torch.nn import Module import torch from torch import Tensor class Accuracy(Module): """ Class for calculating the accuracy for a given prediction and the labels for comparison. Expects the inputs to be from a range of 0 to 1 and sets a crossing threshold at 0.5 the labels are similarly round...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn import Module from torch import Tensor assert_size_stride = torch._C._dynam...
neuralmagic/sparseml
Accuracy
false
16,153
[ "Apache-2.0" ]
922
3fe5f4d75796eba43508401de4070cb494370683
https://github.com/neuralmagic/sparseml/tree/3fe5f4d75796eba43508401de4070cb494370683
from torch.nn import Module import torch from torch import Tensor class Model(Module): """ Class for calculating the accuracy for a given prediction and the labels for comparison. Expects the inputs to be from a range of 0 to 1 and sets a crossing threshold at 0.5 the labels are similarly rounded....
DiceLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn class DiceLoss(nn.Module): def __init__(self, smooth=0, eps=1e-07): super(DiceLoss, self).__init__() self.smooth = smooth self.eps = eps def forward(self, output, target): return 1 - (2 * torch.sum(output * target) + self.smooth) / (torch. ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
neptune-ml/data-science-bowl-2018
DiceLoss
false
16,154
[ "MIT" ]
92
2f76f2fc9836e53ada16d1e084afa0108b119011
https://github.com/neptune-ml/data-science-bowl-2018/tree/2f76f2fc9836e53ada16d1e084afa0108b119011
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, smooth=0, eps=1e-07): super().__init__() self.smooth = smooth self.eps = eps def forward(self, output, target): return 1 - (2 * torch.sum(output * target) + self.smooth) / (torch. sum(ou...
FocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.optim class FocalLoss(torch.nn.Module): """Sigmoid focal cross entropy loss. Focal loss down-weights well classified examples and focusses on the hard examples. See https://arxiv.org/pdf/1708.02002.pdf for the loss definition. """ def __init__(self, gamma...
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...
neuralsyn/self-supervised-relational-reasoning
FocalLoss
false
16,155
[ "MIT" ]
130
6ecfafcf4a36c2eacef7ddd5bd1b23c28fbb14c8
https://github.com/neuralsyn/self-supervised-relational-reasoning/tree/6ecfafcf4a36c2eacef7ddd5bd1b23c28fbb14c8
import torch import torch.nn as nn import torch.optim class Model(torch.nn.Module): """Sigmoid focal cross entropy loss. Focal loss down-weights well classified examples and focusses on the hard examples. See https://arxiv.org/pdf/1708.02002.pdf for the loss definition. """ def __init__(self, gamma=2.0...
StackTime
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch from torchvision.models.quantization import * class StackTime(torch.nn.Module): __constants__ = ['factor'] def __init__(self, factor): super().__init__() self.factor = int(factor) def forward(self, x, x_lens): r = torch.transpose(x, 0, 1) s = r.shape ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torchvision.models.quantization import * assert_size_stride = torch._C._dy...
mlperf/inference
StackTime
false
16,156
[ "Apache-2.0" ]
388
b284212941bcce7a558813c31ba2d356bac71885
https://github.com/mlperf/inference/tree/b284212941bcce7a558813c31ba2d356bac71885
import torch from torchvision.models.quantization import * class Model(torch.nn.Module): __constants__ = ['factor'] def __init__(self, factor): super().__init__() self.factor = int(factor) def forward(self, x, x_lens): r = torch.transpose(x, 0, 1) s = r.shape zero...
SVHN_Net
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch import torch.nn as nn import torch.nn.functional as F class SVHN_Net(nn.Module): def __init__(self): super(SVHN_Net, self).__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=3) self.conv2 = nn.Conv2d(32, 32, kernel_size=3) self.conv3 = nn.Conv2d(32, 32, kernel_size=...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
nannullna/deep-active-learning
SVHN_Net
false
16,157
[ "MIT" ]
465
c54a995640c63ba4679129c5a1fd5cec9a2858e6
https://github.com/nannullna/deep-active-learning/tree/c54a995640c63ba4679129c5a1fd5cec9a2858e6
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 32, kernel_size=3) self.conv2 = nn.Conv2d(32, 32, kernel_size=3) self.conv3 = nn.Conv2d(32, 32, kernel_size=3) self.c...
TripletLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms.functional as F import torch.utils.data def hard_examples_mining(dist_mat, identity_mat, return_idxes=False): """Select hard positives and hard negatives according to `In defense of the Triplet Loss for Person Re-...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from 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....
neka-nat/Transfer-Learning-Library
TripletLoss
false
16,158
[ "MIT" ]
1,474
a3b27b0d7562fa90a02e914140b37ab438469e6c
https://github.com/neka-nat/Transfer-Learning-Library/tree/a3b27b0d7562fa90a02e914140b37ab438469e6c
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms.functional as F import torch.utils.data def hard_examples_mining(dist_mat, identity_mat, return_idxes=False): """Select hard positives and hard negatives according to `In defense of the Triplet Loss for Person Re-...
MockOpticalFlowModel
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, 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 MockOpticalFlowModel(nn.Module): def __init__(self, img_channels): super().__init__() self.model = nn.Conv2d(img_channels * 2, 2, kernel_size=1) def forward(self, img1, img2): x = torch.cat([img1, img2], dim=-3) return self.model(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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
neu-vig/ezflow
MockOpticalFlowModel
false
16,159
[ "MIT" ]
94
1eb6f675e72b1de6db7b35d61ca4ef0082bae890
https://github.com/neu-vig/ezflow/tree/1eb6f675e72b1de6db7b35d61ca4ef0082bae890
import torch import torch.nn as nn class Model(nn.Module): def __init__(self, img_channels): super().__init__() self.model = nn.Conv2d(img_channels * 2, 2, kernel_size=1) def forward(self, img1, img2): x = torch.cat([img1, img2], dim=-3) return self.model(x) def get_inputs(...
Softplus
# 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.onnx import torch.nn as nn class Softplus(nn.Module): def forward(self, x): return torch.nn.Softplus()(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torch.onnx import torch.nn as nn assert_size_stride = t...
mil-tokyo/webdnn
Softplus
false
16,160
[ "MIT" ]
1,967
38a60fd3e1a4e72bc01108189a3aa51e0752aecd
https://github.com/mil-tokyo/webdnn/tree/38a60fd3e1a4e72bc01108189a3aa51e0752aecd
import torch import torch.onnx import torch.nn as nn class Model(nn.Module): def forward(self, x): return torch.nn.Softplus()(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return []