entry_point stringlengths 1 65 | original_triton_python_code stringlengths 208 619k | optimised_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 |
|---|---|---|---|---|---|---|---|---|---|---|
SimpleASinModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleASinModule(torch.nn.Module):
def __init__(self):
super(SimpleASinModule, self).__init__()
def forward(self, a):
return torch.asin(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | opti-mix/glow | SimpleASinModule | false | 7,378 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleAvgPool1dModule | import torch
import torch.nn.functional as F
import torch.jit
import torch.onnx
import torch.nn
class SimpleAvgPool1dModule(torch.nn.Module):
def __init__(self, kernel_size, stride=None, padding=0):
super(SimpleAvgPool1dModule, self).__init__()
self.kernel_size = kernel_size
self.padding ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleAvgPool1dModule | false | 7,379 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
MixtureDensityHead | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.distributions import Categorical
class MixtureDensityHead(nn.Module):
def __init__(self, config: 'DictConfig', **kwargs):
self.hparams = config
super().__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | Actis92/pytorch_tabular | MixtureDensityHead | false | 7,380 | [
"MIT"
] | 1 | 78dabf5e7b97d8ff24db4bc83d9d0a2273941bbe | https://github.com/Actis92/pytorch_tabular/tree/78dabf5e7b97d8ff24db4bc83d9d0a2273941bbe |
SimpleACosModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleACosModule(torch.nn.Module):
def __init__(self):
super(SimpleACosModule, self).__init__()
def forward(self, a):
return torch.acos(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | opti-mix/glow | SimpleACosModule | false | 7,381 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleATanModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleATanModule(torch.nn.Module):
def __init__(self):
super(SimpleATanModule, self).__init__()
def forward(self, a):
return torch.atan(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | opti-mix/glow | SimpleATanModule | false | 7,382 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleAddMmModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleAddMmModule(torch.nn.Module):
def __init__(self, alpha=1, beta=1):
super(SimpleAddMmModule, self).__init__()
self.alpha = alpha
self.beta = beta
def forward(self, a, b, c):
return (a + a).addmm(b, c)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C... | opti-mix/glow | SimpleAddMmModule | false | 7,383 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleAbsModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleAbsModule(torch.nn.Module):
def __init__(self):
super(SimpleAbsModule, self).__init__()
def forward(self, a):
return torch.abs(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = t... | opti-mix/glow | SimpleAbsModule | false | 7,384 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleCeilModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleCeilModule(torch.nn.Module):
def forward(self, a, b):
c = a + b
return torch.ceil(c)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | opti-mix/glow | SimpleCeilModule | false | 7,385 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
OneTupleModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class OneTupleModule(torch.nn.Module):
def __init__(self):
super(OneTupleModule, self).__init__()
def forward(self, x):
y = 2 * x
return y,
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | OneTupleModule | false | 7,386 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleBmmModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleBmmModule(torch.nn.Module):
def forward(self, a, b):
return (a + a).bmm(b)
def get_inputs():
return [torch.rand([4, 4, 4]), torch.rand([4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C... | opti-mix/glow | SimpleBmmModule | false | 7,387 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
ConvGRUCell | import torch
from torch import nn as nn
import torch.nn.functional as F
def one_param(m):
"""First parameter in `m`"""
return next(m.parameters())
class ConvGRUCell(nn.Module):
def __init__(self, input_dim, hidden_dim, kernel_size=(3, 3), bias=True,
activation=F.tanh, batchnorm=False):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | openclimatefix/MetNet | ConvGRUCell | false | 7,388 | [
"MIT"
] | 1 | 06eed550e93da6325641958b0d36c15adde1d928 | https://github.com/openclimatefix/MetNet/tree/06eed550e93da6325641958b0d36c15adde1d928 |
SimpleAndModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleAndModule(torch.nn.Module):
def __init__(self):
super(SimpleAndModule, self).__init__()
def forward(self, a, b):
c = torch.logical_and(a, b)
return torch.logical_and(c, c)
def get_inputs():
return [torc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleAndModule | false | 7,389 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleClampMinModel | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleClampMinModel(torch.nn.Module):
def __init__(self, min):
super(SimpleClampMinModel, self).__init__()
self.min = min
def forward(self, input):
return torch.clamp_min(input, self.min)
def get_inputs():
re... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | opti-mix/glow | SimpleClampMinModel | false | 7,390 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
EnsembleModel | import math
import torch
import numpy as np
import torch.nn.functional as F
def truncated_standardized_normal(shape, a=-2.0, b=2.0):
a = torch.Tensor([a])
b = torch.Tensor([b])
U = torch.distributions.uniform.Uniform(0, 1)
u = U.sample(shape)
Fa = 0.5 * (1 + torch.erf(a / math.sqrt(2)))
Fb = 0... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | numahha/wmopo | EnsembleModel | false | 7,391 | [
"MIT"
] | 1 | 1557dab2e8168c1f2e53ffbc435b4000680f1d28 | https://github.com/numahha/wmopo/tree/1557dab2e8168c1f2e53ffbc435b4000680f1d28 |
SimpleClampModel | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleClampModel(torch.nn.Module):
def __init__(self, min, max):
super(SimpleClampModel, self).__init__()
self.min = min
self.max = max
def forward(self, input):
return torch.clamp(input, self.min, self.max... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | opti-mix/glow | SimpleClampModel | false | 7,392 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleExpModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleExpModule(torch.nn.Module):
def forward(self, input):
other = torch.exp(input)
return torch.exp(other)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = t... | opti-mix/glow | SimpleExpModule | false | 7,393 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleGeluModule | import torch
import torch.nn.functional as F
import torch.jit
import torch.onnx
import torch.nn
class SimpleGeluModule(torch.nn.Module):
def forward(self, tensor):
return F.gelu(tensor + tensor)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | opti-mix/glow | SimpleGeluModule | false | 7,394 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleCosModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleCosModule(torch.nn.Module):
def __init__(self):
super(SimpleCosModule, self).__init__()
def forward(self, a):
return torch.cos(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = t... | opti-mix/glow | SimpleCosModule | false | 7,395 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleMaxModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleMaxModule(torch.nn.Module):
def __init__(self):
super(SimpleMaxModule, self).__init__()
def forward(self, a, b):
return torch.max(a + a, b + b)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | opti-mix/glow | SimpleMaxModule | false | 7,396 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleFloorModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleFloorModule(torch.nn.Module):
def forward(self, a, b):
c = a + b
return torch.floor(c)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | opti-mix/glow | SimpleFloorModule | false | 7,397 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleConv2dModule | import torch
import torch.nn.functional as F
import torch.jit
import torch.onnx
import torch.nn
class SimpleConv2dModule(torch.nn.Module):
def __init__(self, stride=1, padding=0, dilation=1, groups=1):
super(SimpleConv2dModule, self).__init__()
self.stride = stride
self.padding = padding
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch... | opti-mix/glow | SimpleConv2dModule | false | 7,398 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleConvTranspose2dModule | import torch
import torch.nn.functional as F
import torch.jit
import torch.onnx
import torch.nn
class SimpleConvTranspose2dModule(torch.nn.Module):
def __init__(self, stride=1, padding=0, output_padding=0, dilation=1,
groups=1):
super(SimpleConvTranspose2dModule, self).__init__()
self.str... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch... | opti-mix/glow | SimpleConvTranspose2dModule | false | 7,399 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleCumSumModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleCumSumModule(torch.nn.Module):
def __init__(self, dim):
super(SimpleCumSumModule, self).__init__()
self.dim = dim
def forward(self, tensor):
return torch.cumsum(tensor, self.dim)
def get_inputs():
retur... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleCumSumModule | false | 7,400 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleLogModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleLogModule(torch.nn.Module):
def __init__(self, *dimensions):
super(SimpleLogModule, self).__init__()
def forward(self, a):
b = torch.log(a)
return torch.log(b)
def get_inputs():
return [torch.rand([4, 4... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = t... | opti-mix/glow | SimpleLogModule | false | 7,401 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleFmodModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleFmodModule(torch.nn.Module):
def __init__(self):
super(SimpleFmodModule, self).__init__()
def forward(self, a, b):
if b.size() == torch.Size([]):
c = a.fmod(b.item())
else:
c = a.fmod(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | opti-mix/glow | SimpleFmodModule | false | 7,402 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
Foo | import torch
import torch.jit
import torch.onnx
import torch.nn
class Foo(torch.nn.Module):
def __init__(self):
super(Foo, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 6, 3)
self.relu = torch.nn.ReLU()
self.conv2 = torch.nn.Conv2d(6, 16, 3)
def forward(self, x):
x... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch... | opti-mix/glow | Foo | false | 7,403 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleNotModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleNotModule(torch.nn.Module):
def __init__(self):
super(SimpleNotModule, self).__init__()
def forward(self, a):
b = torch.logical_not(a)
return torch.logical_not(b)
def get_inputs():
return [torch.rand([4... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleNotModule | false | 7,404 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleMatmulModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleMatmulModule(torch.nn.Module):
def __init__(self):
super(SimpleMatmulModule, self).__init__()
def forward(self, a, b):
return a.matmul(b + b)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C... | opti-mix/glow | SimpleMatmulModule | false | 7,405 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleLinearModule | import torch
import torch.nn.functional as F
import torch.jit
import torch.onnx
import torch.nn
class SimpleLinearModule(torch.nn.Module):
def __init__(self):
super(SimpleLinearModule, self).__init__()
def forward(self, input, weight, bias=None):
return F.linear(input + input, weight, bias)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C... | opti-mix/glow | SimpleLinearModule | false | 7,406 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleOrModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleOrModule(torch.nn.Module):
def __init__(self):
super(SimpleOrModule, self).__init__()
def forward(self, a, b):
c = torch.logical_or(a, b)
return torch.logical_or(c, c)
def get_inputs():
return [torch.ra... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleOrModule | false | 7,407 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleMulModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleMulModule(torch.nn.Module):
def __init__(self):
super(SimpleMulModule, self).__init__()
def forward(self, left, right):
other = left.mul(right.item() if right.size() == torch.Size([]) else
right)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleMulModule | false | 7,408 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleMinModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleMinModule(torch.nn.Module):
def __init__(self):
super(SimpleMinModule, self).__init__()
def forward(self, a, b):
return torch.min(a + a, b + b)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | opti-mix/glow | SimpleMinModule | false | 7,409 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleReciprocalModel | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleReciprocalModel(torch.nn.Module):
def __init__(self, inplace=False):
super(SimpleReciprocalModel, self).__init__()
self.inplace = inplace
def forward(self, tensor):
other = tensor + tensor
return othe... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleReciprocalModel | false | 7,410 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleReluModel | import torch
import torch.nn.functional as F
import torch.jit
import torch.onnx
import torch.nn
class SimpleReluModel(torch.nn.Module):
def __init__(self, inplace=False):
super(SimpleReluModel, self).__init__()
self.inplace = inplace
def forward(self, tensor):
other = F.relu(tensor, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | opti-mix/glow | SimpleReluModel | false | 7,411 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleTypeasModel | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleTypeasModel(torch.nn.Module):
def __init__(self):
super(SimpleTypeasModel, self).__init__()
def forward(self, tensor, other=None):
other = tensor if other is None else other
if tensor.dtype != torch.bool:
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleTypeasModel | false | 7,412 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleLogSoftmaxModel | import torch
import torch.nn.functional as F
import torch.jit
import torch.onnx
import torch.nn
class SimpleLogSoftmaxModel(torch.nn.Module):
def __init__(self, dimension):
super(SimpleLogSoftmaxModel, self).__init__()
self.dimension = dimension
def forward(self, tensor):
return F.lo... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.jit
impor... | opti-mix/glow | SimpleLogSoftmaxModel | false | 7,413 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleReshapeModel | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleReshapeModel(torch.nn.Module):
def __init__(self, shape):
super(SimpleReshapeModel, self).__init__()
self.shape = shape
def forward(self, tensor):
combined = tensor + tensor
return combined.reshape(se... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleReshapeModel | false | 7,414 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleSumModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleSumModule(torch.nn.Module):
def __init__(self, dtype=None):
super(SimpleSumModule, self).__init__()
self.dtype = dtype
def forward(self, a):
b = a + a
return torch.sum(b, dtype=self.dtype)
def get_i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.... | opti-mix/glow | SimpleSumModule | false | 7,415 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleXorModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleXorModule(torch.nn.Module):
def __init__(self):
super(SimpleXorModule, self).__init__()
def forward(self, a, b):
c = torch.logical_xor(a, b)
return torch.logical_xor(c, c)
def get_inputs():
return [torc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleXorModule | false | 7,416 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimplePowModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimplePowModule(torch.nn.Module):
def __init__(self, power):
super(SimplePowModule, self).__init__()
self.power = power
def forward(self, tensor):
return torch.pow(tensor, self.power)
def get_inputs():
return... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimplePowModule | false | 7,417 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleSinModule | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleSinModule(torch.nn.Module):
def __init__(self):
super(SimpleSinModule, self).__init__()
def forward(self, a):
return torch.sin(a + a)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = t... | opti-mix/glow | SimpleSinModule | false | 7,418 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleStackModel | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleStackModel(torch.nn.Module):
def __init__(self, dim):
super(SimpleStackModel, self).__init__()
self.dim = dim
def forward(self, a, b):
c = b + b
return torch.stack((a, c), dim=self.dim)
def get_inpu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | opti-mix/glow | SimpleStackModel | false | 7,419 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleTanhModel | import torch
import torch.jit
import torch.onnx
import torch.nn
class SimpleTanhModel(torch.nn.Module):
def __init__(self, inplace=False):
super(SimpleTanhModel, self).__init__()
self.inplace = inplace
def forward(self, tensor):
tensor = tensor + tensor
return tensor.tanh_() ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._... | opti-mix/glow | SimpleTanhModel | false | 7,420 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
SimpleSoftmaxModel | import torch
import torch.nn.functional as F
import torch.jit
import torch.onnx
import torch.nn
class SimpleSoftmaxModel(torch.nn.Module):
def __init__(self, dimension):
super(SimpleSoftmaxModel, self).__init__()
self.dimension = dimension
def forward(self, tensor):
return F.softmax(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.jit
impor... | opti-mix/glow | SimpleSoftmaxModel | false | 7,421 | [
"Apache-2.0"
] | 1 | 4ba074df5da9822986a23a6679ab592c22660f6d | https://github.com/opti-mix/glow/tree/4ba074df5da9822986a23a6679ab592c22660f6d |
HardKumaBinarizer | import torch
import torch.nn as nn
import torch.optim
def kuma_reparametrization(a, b):
u = torch.rand_like(a)
k = (1 - (1 - u) ** (1 / (b + 1e-08))) ** (1 / (a + 1e-08))
return k
class Rectifier(nn.Module):
def __init__(self, l=-0.1, r=1.1):
super().__init__()
self.l = l
se... | import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, ma... | ovechkinVT/SkipRNN | HardKumaBinarizer | false | 7,422 | [
"MIT"
] | 1 | 7c1f37349d464b1b6bf8835520abad22b199f1ad | https://github.com/ovechkinVT/SkipRNN/tree/7c1f37349d464b1b6bf8835520abad22b199f1ad |
L1Loss | import torch
from torch import nn
from torch import torch
class L1Loss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, Yp, Yt):
num = Yt.size(0)
Yp = Yp.view(num, -1)
Yt = Yt.view(num, -1)
loss = nn.functional.l1_loss(Yp, Yt)
return loss
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
f... | oskarnatan/RGBDVS-fusion | L1Loss | false | 7,423 | [
"MIT"
] | 1 | 5e560f54442d387a86e3a469107cf65859693987 | https://github.com/oskarnatan/RGBDVS-fusion/tree/5e560f54442d387a86e3a469107cf65859693987 |
HuberLoss | import torch
from torch import nn
from torch import torch
class HuberLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, Yp, Yt):
num = Yt.size(0)
Yp = Yp.view(num, -1)
Yt = Yt.view(num, -1)
loss = nn.functional.smooth_l1_loss(Yp, Yt, beta=0.5)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
f... | oskarnatan/RGBDVS-fusion | HuberLoss | false | 7,424 | [
"MIT"
] | 1 | 5e560f54442d387a86e3a469107cf65859693987 | https://github.com/oskarnatan/RGBDVS-fusion/tree/5e560f54442d387a86e3a469107cf65859693987 |
BCEDiceLoss | import torch
from torch import nn
from torch import torch
class BCEDiceLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, Yp, Yt, smooth=1e-07):
num = Yt.size(0)
Yp = Yp.view(num, -1)
Yt = Yt.view(num, -1)
bce = nn.functional.binary_cross_entrop... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | oskarnatan/RGBDVS-fusion | BCEDiceLoss | false | 7,425 | [
"MIT"
] | 1 | 5e560f54442d387a86e3a469107cf65859693987 | https://github.com/oskarnatan/RGBDVS-fusion/tree/5e560f54442d387a86e3a469107cf65859693987 |
UnpoolAvgEquiangular | import torch
from torch.nn import functional as F
def equiangular_dimension_unpack(nodes, ratio):
"""Calculate the two underlying dimensions
from the total number of nodes
Args:
nodes (int): combined dimensions
ratio (float): ratio between the two dimensions
Returns:
int, int: ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret... | ownzonefeng/weather_prediction | UnpoolAvgEquiangular | false | 7,426 | [
"MIT"
] | 1 | 723c02b6b3c0a40751d87572b66c7a4e040dec92 | https://github.com/ownzonefeng/weather_prediction/tree/723c02b6b3c0a40751d87572b66c7a4e040dec92 |
UnpoolAvgHealpix | import torch
class UnpoolAvgHealpix(torch.nn.Module):
"""Healpix Average Unpooling module
Parameters
----------
kernel_size : int
Pooling kernel width
"""
def __init__(self, kernel_size, *args, **kwargs):
"""kernel_size should be 4, 16, 64, etc."""
super().__init_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret... | ownzonefeng/weather_prediction | UnpoolAvgHealpix | false | 7,427 | [
"MIT"
] | 1 | 723c02b6b3c0a40751d87572b66c7a4e040dec92 | https://github.com/ownzonefeng/weather_prediction/tree/723c02b6b3c0a40751d87572b66c7a4e040dec92 |
IOUScore | import torch
from torch import nn
from torch import torch
class IOUScore(nn.Module):
def __init__(self):
super().__init__()
def forward(self, Yp, Yt):
output_ = Yp > 0.5
target_ = Yt > 0.5
intersection = (output_ & target_).sum()
union = (output_ | target_).sum()
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from torch import torch
assert_size_stride = torch._C._dynamo.guards... | oskarnatan/RGBDVS-fusion | IOUScore | false | 7,428 | [
"MIT"
] | 1 | 5e560f54442d387a86e3a469107cf65859693987 | https://github.com/oskarnatan/RGBDVS-fusion/tree/5e560f54442d387a86e3a469107cf65859693987 |
Critic | import torch
import numpy as np
from torch import nn
import torch.autograd
def fanin_(size):
fan_in = size[0]
weight = 1.0 / np.sqrt(fan_in)
return torch.Tensor(size).uniform_(-weight, weight)
class Critic(nn.Module):
def __init__(self, state_dim, action_dim, h1=64, h2=32, init_w=0.003):
su... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import numpy as np
from torch... | ori-goals/lfd-min-human-effort | Critic | false | 7,429 | [
"MIT"
] | 1 | f9fd70cdeb661151e5f81ac538ceb865531146b9 | https://github.com/ori-goals/lfd-min-human-effort/tree/f9fd70cdeb661151e5f81ac538ceb865531146b9 |
HintonBinarizer | import torch
import torch.nn as nn
import torch.optim
class hinton_binarize(torch.autograd.Function):
"""
Binarize function from the paper
'SKIP RNN: LEARNING TO SKIP STATE UPDATES IN RECURRENT NEURAL NETWORKS'
https://openreview.net/forum?id=HkwVAXyCW
Works as round function but has a unit gradie... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.optim
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dyna... | ovechkinVT/SkipRNN | HintonBinarizer | false | 7,430 | [
"MIT"
] | 1 | 7c1f37349d464b1b6bf8835520abad22b199f1ad | https://github.com/ovechkinVT/SkipRNN/tree/7c1f37349d464b1b6bf8835520abad22b199f1ad |
torch_return_int8_argmax | import torch
class torch_return_int8_argmax(torch.nn.Module):
def __init__(self):
super(torch_return_int8_argmax, self).__init__()
def forward(self, x):
x0 = x.squeeze(0)
_, x1 = torch.max(x0, 0)
return x1
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_in... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | ozendelait/pytorch-semseg | torch_return_int8_argmax | false | 7,431 | [
"MIT"
] | 1 | 200491febd653bd26befcd5b3d52c614aa832b7e | https://github.com/ozendelait/pytorch-semseg/tree/200491febd653bd26befcd5b3d52c614aa832b7e |
Actor | import torch
import numpy as np
from torch import nn
import torch.autograd
def fanin_(size):
fan_in = size[0]
weight = 1.0 / np.sqrt(fan_in)
return torch.Tensor(size).uniform_(-weight, weight)
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, h1=64, h2=32, init_w=0.003):
sup... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ori-goals/lfd-min-human-effort | Actor | false | 7,432 | [
"MIT"
] | 1 | f9fd70cdeb661151e5f81ac538ceb865531146b9 | https://github.com/ori-goals/lfd-min-human-effort/tree/f9fd70cdeb661151e5f81ac538ceb865531146b9 |
Rectifier | import torch
import torch.nn as nn
import torch.optim
class Rectifier(nn.Module):
def __init__(self, l=-0.1, r=1.1):
super().__init__()
self.l = l
self.r = r
self.eps = 1e-07
def forward(self, x, l=None, r=None):
l = l if l is not None else self.l
r = r if r i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.optim
assert_size_stride = torch._C._dynamo.guards.ass... | ovechkinVT/SkipRNN | Rectifier | false | 7,433 | [
"MIT"
] | 1 | 7c1f37349d464b1b6bf8835520abad22b199f1ad | https://github.com/ovechkinVT/SkipRNN/tree/7c1f37349d464b1b6bf8835520abad22b199f1ad |
torch_fakeint8_to_float | import torch
class torch_fakeint8_to_float(torch.nn.Module):
def __init__(self):
super(torch_fakeint8_to_float, self).__init__()
def forward(self, x):
x0 = x.permute(2, 0, 1)
x0 += torch.clamp(x0, -1, 0) * -256.0
return x0.unsqueeze(0).contiguous()
def get_inputs():
ret... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | ozendelait/pytorch-semseg | torch_fakeint8_to_float | false | 7,434 | [
"MIT"
] | 1 | 200491febd653bd26befcd5b3d52c614aa832b7e | https://github.com/ozendelait/pytorch-semseg/tree/200491febd653bd26befcd5b3d52c614aa832b7e |
torch_uint8_to_float_normed | import torch
class torch_uint8_to_float_normed(torch.nn.Module):
def __init__(self):
super(torch_uint8_to_float_normed, self).__init__()
def forward(self, x):
return (x.permute(2, 0, 1) / 255.0).unsqueeze(0).contiguous()
def get_inputs():
return [torch.rand([4, 4, 4])]
def get_init_i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | ozendelait/pytorch-semseg | torch_uint8_to_float_normed | false | 7,435 | [
"MIT"
] | 1 | 200491febd653bd26befcd5b3d52c614aa832b7e | https://github.com/ozendelait/pytorch-semseg/tree/200491febd653bd26befcd5b3d52c614aa832b7e |
Attention | import math
import torch
import torch.nn as nn
import torch.optim
import torch.nn.functional as F
class Attention(nn.Module):
"""Attention layer - Custom layer to perform weighted average over the second axis (axis=1)
Transforming a tensor of size [N, W, H] to [N, 1, H].
N: batch size
W: n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | ovechkinVT/SkipRNN | Attention | false | 7,436 | [
"MIT"
] | 1 | 7c1f37349d464b1b6bf8835520abad22b199f1ad | https://github.com/ovechkinVT/SkipRNN/tree/7c1f37349d464b1b6bf8835520abad22b199f1ad |
AvgLayer | import torch
import torch.nn as nn
import torch.utils.data
class AvgLayer(nn.Module):
def forward(self, input):
return input.mean(3, keepdim=True)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | pYtoner/EasyOCR | AvgLayer | false | 7,437 | [
"Apache-2.0"
] | 1 | cbb2df77ae789dd4c7807541e0357d9a698ba801 | https://github.com/pYtoner/EasyOCR/tree/cbb2df77ae789dd4c7807541e0357d9a698ba801 |
LearnedUtility | import torch
import torch.nn as nn
class LearnedUtility(nn.Module):
def __init__(self, slope=0):
super().__init__()
self.theta_tt = torch.nn.Parameter(slope * torch.ones(1))
self.theta_tt.requiresGrad = True
def forward(self, x):
return torch.multiply(self.theta_tt, x)
def ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | pabloguarda/NeuralTransportationNetworks | LearnedUtility | false | 7,438 | [
"MIT"
] | 1 | 0461c26128b09488aff237b760068b43d131f8a9 | https://github.com/pabloguarda/NeuralTransportationNetworks/tree/0461c26128b09488aff237b760068b43d131f8a9 |
PreNet | import torch
from torch import nn
import torch.nn.functional as F
class PreNet(nn.Module):
def __init__(self, in_dims, fc1_dims=256, fc2_dims=128, dropout=0.5):
super().__init__()
self.fc1 = nn.Linear(in_dims, fc1_dims)
self.fc2 = nn.Linear(fc1_dims, fc2_dims)
self.p = dropout
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | padmalcom/AISpeechAssistant | PreNet | false | 7,439 | [
"Apache-2.0"
] | 1 | b7501a23a8f513acb5043f3c7bb06df129bdc2cc | https://github.com/padmalcom/AISpeechAssistant/tree/b7501a23a8f513acb5043f3c7bb06df129bdc2cc |
torch_uint8_to_float | import torch
class torch_uint8_to_float(torch.nn.Module):
def __init__(self):
super(torch_uint8_to_float, self).__init__()
def forward(self, x):
return x.permute(2, 0, 1).unsqueeze(0).contiguous()
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | ozendelait/pytorch-semseg | torch_uint8_to_float | false | 7,440 | [
"MIT"
] | 1 | 200491febd653bd26befcd5b3d52c614aa832b7e | https://github.com/ozendelait/pytorch-semseg/tree/200491febd653bd26befcd5b3d52c614aa832b7e |
LearnedSigmoid | import torch
import torch.nn as nn
class LearnedSigmoid(nn.Module):
def __init__(self, slope=1):
super().__init__()
self.q = torch.nn.Parameter(torch.ones(slope))
self.q.requiresGrad = True
def forward(self, x):
return torch.multiply(torch.sigmoid(x), self.q)
def get_inputs... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | pabloguarda/NeuralTransportationNetworks | LearnedSigmoid | false | 7,441 | [
"MIT"
] | 1 | 0461c26128b09488aff237b760068b43d131f8a9 | https://github.com/pabloguarda/NeuralTransportationNetworks/tree/0461c26128b09488aff237b760068b43d131f8a9 |
Lenet | import torch
from torch import nn
from torch.nn import Sequential
from torch.nn import Conv2d
import torch.nn
import torch.optim
class Lenet(nn.Module):
def __init__(self):
super(Lenet, self).__init__()
layer1 = Sequential()
layer1.add_module('conv1', Conv2d(3, 32, 3, 1, padding=1))
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from torch.nn import Sequential
from torch.nn import Conv2d... | partnernetsoftware/openlab | Lenet | false | 7,442 | [
"MIT"
] | 1 | faa4e58486a7bc4140ad3d56545bfb736cb86696 | https://github.com/partnernetsoftware/openlab/tree/faa4e58486a7bc4140ad3d56545bfb736cb86696 |
SilogLoss | import torch
import torch.nn as nn
class SilogLoss(nn.Module):
def __init__(self, ratio=10, ratio2=0.85):
super().__init__()
self.ratio = ratio
self.ratio2 = ratio2
def forward(self, pred, gt):
log_diff = torch.log(pred * self.ratio) - torch.log(gt * self.ratio)
silog... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | pection/packnet-sfm | SilogLoss | false | 7,443 | [
"MIT"
] | 1 | d5673567b649e6bfda292c894cacdeb06aa80913 | https://github.com/pection/packnet-sfm/tree/d5673567b649e6bfda292c894cacdeb06aa80913 |
BerHuLoss | import torch
import torch.nn as nn
class BerHuLoss(nn.Module):
"""Class implementing the BerHu loss."""
def __init__(self, threshold=0.2):
"""
Initializes the BerHuLoss class.
Parameters
----------
threshold : float
Mask parameter
"""
super... | 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
... | pection/packnet-sfm | BerHuLoss | false | 7,444 | [
"MIT"
] | 1 | d5673567b649e6bfda292c894cacdeb06aa80913 | https://github.com/pection/packnet-sfm/tree/d5673567b649e6bfda292c894cacdeb06aa80913 |
_ImpalaCNN | import torch
from typing import Tuple
from torch import nn
class _ImpalaResBlock(nn.Module):
def __init__(self, n_channels: 'int'):
super().__init__()
self.n_channels = n_channels
kernel_size = 3
padding = 1
self.relu = nn.ReLU()
self.relu_inplace = nn.ReLU()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 typing import Tuple
from... | nrfulton/vsrl-framework | _ImpalaCNN | false | 7,445 | [
"MIT"
] | 1 | c778824b3285e3e994a4c5846c7b1c2ac03c669b | https://github.com/nrfulton/vsrl-framework/tree/c778824b3285e3e994a4c5846c7b1c2ac03c669b |
Decoder | import torch
import torch.nn as nn
class Decoder(nn.Module):
def __init__(self, input_size):
super(Decoder, self).__init__()
self.fully = nn.Linear(input_size, 40)
self.conv1 = nn.ConvTranspose2d(40, 20, kernel_size=5, stride=2)
self.conv2 = nn.ConvTranspose2d(20, 10, 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_... | pacslab/serverless-ml-serving | Decoder | false | 7,446 | [
"MIT"
] | 1 | 03a4cd5f1739aa4710ef886edd9332b3d755efbd | https://github.com/pacslab/serverless-ml-serving/tree/03a4cd5f1739aa4710ef886edd9332b3d755efbd |
InvDepth | import torch
import torch.nn as nn
class InvDepth(nn.Module):
"""Inverse depth layer"""
def __init__(self, in_channels, out_channels=1, min_depth=0.5):
"""
Initializes an InvDepth object.
Parameters
----------
in_channels : int
Number of input channels
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | pection/packnet-sfm | InvDepth | false | 7,447 | [
"MIT"
] | 1 | d5673567b649e6bfda292c894cacdeb06aa80913 | https://github.com/pection/packnet-sfm/tree/d5673567b649e6bfda292c894cacdeb06aa80913 |
StackedAutoencoder | import torch
import torch.nn as nn
class StackedAutoencoder(nn.Module):
"""
1-hidden layer AE trained with MSE loss
"""
def __init__(self, input_size, hidden_layer_size):
super(StackedAutoencoder, self).__init__()
self.encoder = nn.Linear(input_size, hidden_layer_size)
self.de... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | pemami4911/ppi-with-stacked-autoencoders | StackedAutoencoder | false | 7,448 | [
"MIT"
] | 1 | c09aba827ac6991da3dbf1b2628ac5d0f5041548 | https://github.com/pemami4911/ppi-with-stacked-autoencoders/tree/c09aba827ac6991da3dbf1b2628ac5d0f5041548 |
HardGRUCellNUAPT | import math
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
def truncated_normal(t, mean=0.0, std=0.01):
torch.nn.init.normal_(t, mean=mea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 math
import torch.nn a... | pan185/UnarySim | HardGRUCellNUAPT | false | 7,449 | [
"MIT"
] | 1 | c03386efdbb8151f3c33f34b44d1d6a6fc960434 | https://github.com/pan185/UnarySim/tree/c03386efdbb8151f3c33f34b44d1d6a6fc960434 |
InstanceNormLayer | import torch
import torch.nn as nn
class InstanceNormLayer(nn.Module):
"""Implements instance normalization layer."""
def __init__(self, epsilon=1e-08):
super().__init__()
self.epsilon = epsilon
def forward(self, x):
if len(x.shape) != 4:
raise ValueError(
... | 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_... | perladoubinsky/balanced_sampling_gan_controls | InstanceNormLayer | false | 7,450 | [
"MIT"
] | 1 | cbec7a38176406c0e19d4b6ebbc6c6b52d268036 | https://github.com/perladoubinsky/balanced_sampling_gan_controls/tree/cbec7a38176406c0e19d4b6ebbc6c6b52d268036 |
ModelNet | import torch
import torch.nn as nn
class ModelNet(nn.Module):
def __init__(self, input_size, num_hidden_layers=1, hidden_layer_size=
512, num_labels=2):
super(ModelNet, self).__init__()
self.model = nn.Sequential()
for i in range(num_hidden_layers):
self.model.add_modu... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | patelrajnath/makeesy-deep-learning | ModelNet | false | 7,451 | [
"Apache-2.0"
] | 1 | 172f8a4301d6b60927824a56648d60559ba3f14e | https://github.com/patelrajnath/makeesy-deep-learning/tree/172f8a4301d6b60927824a56648d60559ba3f14e |
LocalDictionaryLoss | import torch
import torch.nn
class LocalDictionaryLoss(torch.nn.Module):
def __init__(self, penalty):
super(LocalDictionaryLoss, self).__init__()
self.penalty = penalty
def forward(self, A, y, x):
return self.forward_detailed(A, y, x)[2]
def forward_detailed(self, A, y, 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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
... | pbt17/manifold-learning-with-simplex-constraints | LocalDictionaryLoss | false | 7,452 | [
"MIT"
] | 1 | 36609e2d05600965ee1331823547a077ba7b5a51 | https://github.com/pbt17/manifold-learning-with-simplex-constraints/tree/36609e2d05600965ee1331823547a077ba7b5a51 |
Discriminator | import math
import torch
import torch.nn as nn
import torch.utils.data
from collections import *
class Discriminator(nn.Module):
def __init__(self, n_hidden):
super(Discriminator, self).__init__()
self.weight = nn.Parameter(torch.Tensor(n_hidden, n_hidden))
self.reset_parameters()
de... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
import torch.utils.data
from collections impor... | pgplus1628/dgl | Discriminator | false | 7,453 | [
"Apache-2.0"
] | 1 | bf3994eea68b5841349f1616f41d0f70123a11ec | https://github.com/pgplus1628/dgl/tree/bf3994eea68b5841349f1616f41d0f70123a11ec |
baseline | import torch
import torch.nn.functional as F
class baseline(torch.nn.Module):
def __init__(self):
super(baseline, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 6, 5)
self.pool = torch.nn.MaxPool2d(2, 2)
self.conv2 = torch.nn.Conv2d(6, 16, 5)
self.fc1 = torch.nn.Linear(1... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | patrickjdarrow/unsupervised_augmentations | baseline | false | 7,454 | [
"MIT"
] | 1 | 5a81fa45865f2537c4c73e9307f83a873928e5ae | https://github.com/patrickjdarrow/unsupervised_augmentations/tree/5a81fa45865f2537c4c73e9307f83a873928e5ae |
HaltingUnit | import torch
import torch.nn as nn
import torch as th
import torch.utils.data
from collections import *
import torch.nn.init as INIT
from torch.nn import LayerNorm
class HaltingUnit(nn.Module):
halting_bias_init = 1.0
def __init__(self, dim_model):
super(HaltingUnit, self).__init__()
self.lin... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | pgplus1628/dgl | HaltingUnit | false | 7,455 | [
"Apache-2.0"
] | 1 | bf3994eea68b5841349f1616f41d0f70123a11ec | https://github.com/pgplus1628/dgl/tree/bf3994eea68b5841349f1616f41d0f70123a11ec |
EuclideanGMM | import math
import torch
import torch.nn as nn
def gaussian_prob_density(x, mu, sigma, normalized=False):
if normalized:
k = mu.shape[-1]
scaler = (2 * math.pi) ** (-k / 2)
sigma_det = torch.prod(sigma, dim=-1) ** -0.5
bias = (x - mu).unsqueeze(-2)
sigma_inv = torch.diag_embed(1 / ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import math
i... | ownzonefeng/Graph-based-text-representations | EuclideanGMM | false | 7,456 | [
"MIT"
] | 1 | 4ddac6980d2741284474778dae2c2afa0adb5cda | https://github.com/ownzonefeng/Graph-based-text-representations/tree/4ddac6980d2741284474778dae2c2afa0adb5cda |
HardMGUCellNUA | import math
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
def truncated_normal(t, mean=0.0, std=0.01):
torch.nn.init.normal_(t, mean=mea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 math
import torch.nn a... | pan185/UnarySim | HardMGUCellNUA | false | 7,457 | [
"MIT"
] | 1 | c03386efdbb8151f3c33f34b44d1d6a6fc960434 | https://github.com/pan185/UnarySim/tree/c03386efdbb8151f3c33f34b44d1d6a6fc960434 |
UnpackLayerConv2d | import torch
import torch.nn as nn
class Conv2D(nn.Module):
"""
2D convolution with GroupNorm and ELU
Parameters
----------
in_channels : int
Number of input channels
out_channels : int
Number of output channels
kernel_size : int
Kernel size
stride : int
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | pection/packnet-sfm | UnpackLayerConv2d | false | 7,459 | [
"MIT"
] | 1 | d5673567b649e6bfda292c894cacdeb06aa80913 | https://github.com/pection/packnet-sfm/tree/d5673567b649e6bfda292c894cacdeb06aa80913 |
Conv2dLayer | import torch
import torch.nn as nn
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-08, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
self.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | piggy2303/DeepFillv2_Pytorch | Conv2dLayer | false | 7,460 | [
"MIT"
] | 1 | dd35299f11704f878ed7a33e14ccd51a9d64baaf | https://github.com/piggy2303/DeepFillv2_Pytorch/tree/dd35299f11704f878ed7a33e14ccd51a9d64baaf |
Contracting_Block | import torch
import torch.nn as nn
import torch.nn.functional as F
class Contracting_Block(nn.Module):
def __init__(self, in_channels, out_channels):
super(Contracting_Block, self).__init__()
self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3)
self.conv2 = nn.Conv2d(out_chann... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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_... | parth2035/U-Net-Implementation | Contracting_Block | false | 7,461 | [
"MIT"
] | 1 | 36ed8d140ef8a0031f63f2d1f577dcef92c4dab6 | https://github.com/parth2035/U-Net-Implementation/tree/36ed8d140ef8a0031f63f2d1f577dcef92c4dab6 |
Differencial_SMAPE | import torch
import torch.nn as nn
class Differencial_SMAPE(nn.Module):
def __init__(self):
super(Differencial_SMAPE, self).__init__()
def forward(self, true, predicted):
epsilon = 0.1
summ = torch.clamp(torch.abs(true) + torch.abs(predicted) + epsilon,
min=0.5 + epsilon)... | 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
... | pixel-ports/PV_prod_predic | Differencial_SMAPE | false | 7,462 | [
"Apache-2.0"
] | 1 | 2ceb4cf8218f43f3ea94c5520b1904663cfb0de1 | https://github.com/pixel-ports/PV_prod_predic/tree/2ceb4cf8218f43f3ea94c5520b1904663cfb0de1 |
HardMGUCellPT | import math
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
def truncated_normal(t, mean=0.0, std=0.01):
torch.nn.init.normal_(t, mean=mea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from 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 math
import torch.nn a... | pan185/UnarySim | HardMGUCellPT | false | 7,463 | [
"MIT"
] | 1 | c03386efdbb8151f3c33f34b44d1d6a6fc960434 | https://github.com/pan185/UnarySim/tree/c03386efdbb8151f3c33f34b44d1d6a6fc960434 |
BertMixedLayer | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn
import torch.nn as nn
class BertAttention(nn.Module):
"""BERT attention layer.
Based on: BERT (pytorch-transformer)
https://github.com/huggingface/transformers
"""
def __init__(self, config) ->None:
sup... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Jianrong-Lu/MONAI | BertMixedLayer | false | 7,464 | [
"Apache-2.0"
] | 1 | c319ca8ff31aa980a045f1b913fb2eb22aadb080 | https://github.com/Jianrong-Lu/MONAI/tree/c319ca8ff31aa980a045f1b913fb2eb22aadb080 |
SmoothL1Loss | import torch
import torch.nn as nn
import torch.cuda
import torch.distributed
import torch.multiprocessing
class SmoothL1Loss(nn.Module):
"""Smooth L1 Loss"""
def __init__(self, beta=0.11):
super().__init__()
self.beta = beta
def forward(self, pred, target):
x = (pred - target).a... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
import torch.cuda
import torch.distributed
import t... | pkashinkunti/retinanet-examples | SmoothL1Loss | false | 7,465 | [
"BSD-3-Clause"
] | 1 | 30466522c018d4d0bd921485024e871b32ec4e73 | https://github.com/pkashinkunti/retinanet-examples/tree/30466522c018d4d0bd921485024e871b32ec4e73 |
ConvBatchNorm2d | import torch
import torch.nn as nn
class ConvBatchNorm2d(nn.BatchNorm2d):
def __init__(self, num_features, momentum=0.9, epsilon=1e-05):
"""
input: assume 4D input (mini_batch_size, # channel, w, h)
momentum: momentum for exponential average
"""
super(nn.BatchNorm2d, self)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | pigunther/Self-Correction-Human-Parsing-Updated | ConvBatchNorm2d | false | 7,466 | [
"MIT"
] | 1 | 17331eaa5d6586a1ebb633eb61ed810d00d30a2f | https://github.com/pigunther/Self-Correction-Human-Parsing-Updated/tree/17331eaa5d6586a1ebb633eb61ed810d00d30a2f |
AdaIN | import torch
class AdaIN(torch.nn.Module):
def __init__(self, channels_in, channels_out, norm=True):
super(AdaIN, self).__init__()
self.channels_in = channels_in
self.channels_out = channels_out
self.norm = norm
self.affine_scale = torch.nn.Linear(channels_in, channels_out... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | pigunther/Self-Correction-Human-Parsing-Updated | AdaIN | false | 7,467 | [
"MIT"
] | 1 | 17331eaa5d6586a1ebb633eb61ed810d00d30a2f | https://github.com/pigunther/Self-Correction-Human-Parsing-Updated/tree/17331eaa5d6586a1ebb633eb61ed810d00d30a2f |
TransposeConv2dLayer | import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-08, affine=True):
super(LayerNorm, self).__init__()
self.num_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from torch.nn import Parameter
assert_size_stride = torch.... | piggy2303/DeepFillv2_Pytorch | TransposeConv2dLayer | false | 7,468 | [
"MIT"
] | 1 | dd35299f11704f878ed7a33e14ccd51a9d64baaf | https://github.com/piggy2303/DeepFillv2_Pytorch/tree/dd35299f11704f878ed7a33e14ccd51a9d64baaf |
FocalLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.cuda
import torch.distributed
import torch.multiprocessing
class FocalLoss(nn.Module):
"""Focal Loss - https://arxiv.org/abs/1708.02002"""
def __init__(self, alpha=0.25, gamma=2):
super().__init__()
self.alpha = a... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | pkashinkunti/retinanet-examples | FocalLoss | false | 7,469 | [
"BSD-3-Clause"
] | 1 | 30466522c018d4d0bd921485024e871b32ec4e73 | https://github.com/pkashinkunti/retinanet-examples/tree/30466522c018d4d0bd921485024e871b32ec4e73 |
sobel_net | import torch
import numpy as np
from torch import nn
import torch.nn.functional as F
class sobel_net(nn.Module):
def __init__(self):
super().__init__()
self.conv_opx = nn.Conv2d(1, 1, 3, bias=False)
self.conv_opy = nn.Conv2d(1, 1, 3, bias=False)
sobel_kernelx = np.array([[-1, 0, 1... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | phonhay103/DocTr | sobel_net | false | 7,470 | [
"MIT"
] | 1 | f052703976e2558633027907af48ecb1dc7718ff | https://github.com/phonhay103/DocTr/tree/f052703976e2558633027907af48ecb1dc7718ff |
TrendNet | import torch
import torch.nn as nn
class TrendNet(nn.Module):
def __init__(self, feature_size):
super(TrendNet, self).__init__()
self.hidden_size1 = 16
self.hidden_size2 = 16
self.output_size = 1
self.fc1 = nn.Linear(feature_size, self.hidden_size1)
self.fc2 = nn.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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | pixel-ports/PV_prod_predic | TrendNet | false | 7,471 | [
"Apache-2.0"
] | 1 | 2ceb4cf8218f43f3ea94c5520b1904663cfb0de1 | https://github.com/pixel-ports/PV_prod_predic/tree/2ceb4cf8218f43f3ea94c5520b1904663cfb0de1 |
FlowHead | import torch
from torch import nn
class FlowHead(nn.Module):
def __init__(self, input_dim=128, hidden_dim=256):
super(FlowHead, self).__init__()
self.conv1 = nn.Conv2d(input_dim, hidden_dim, 3, padding=1)
self.conv2 = nn.Conv2d(hidden_dim, 2, 3, padding=1)
self.relu = nn.ReLU(inpl... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | phonhay103/DocTr | FlowHead | false | 7,472 | [
"MIT"
] | 1 | f052703976e2558633027907af48ecb1dc7718ff | https://github.com/phonhay103/DocTr/tree/f052703976e2558633027907af48ecb1dc7718ff |
GatedConv2d | import torch
import torch.nn as nn
from torch.nn import Parameter
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-08, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
self.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | piggy2303/DeepFillv2_Pytorch | GatedConv2d | false | 7,473 | [
"MIT"
] | 1 | dd35299f11704f878ed7a33e14ccd51a9d64baaf | https://github.com/piggy2303/DeepFillv2_Pytorch/tree/dd35299f11704f878ed7a33e14ccd51a9d64baaf |
ContinuousActor | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class ContinuousActor(nn.Module):
"""ContinuousActor network
:param state_size: the size of the 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.triton_helpers import libdevice
import numpy as np
... | pjordan/rlcc | ContinuousActor | false | 7,474 | [
"Apache-2.0"
] | 1 | e84b8b5c14680dbad2efae22756fb40606b2384a | https://github.com/pjordan/rlcc/tree/e84b8b5c14680dbad2efae22756fb40606b2384a |
PositionwiseFeedForward | import torch
import torch.nn as nn
import torch.nn.functional as F
class PositionwiseFeedForward(nn.Module):
"""Positionwise feed forward
:param int idim: input dimenstion
:param int hidden_units: number of hidden units
:param float dropout_rate: dropout rate
"""
def __init__(self, idim, hid... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | pkufool/DaVinci-Speech | PositionwiseFeedForward | false | 7,475 | [
"MIT"
] | 1 | 98602363168476356d492852093adbe65c65ac95 | https://github.com/pkufool/DaVinci-Speech/tree/98602363168476356d492852093adbe65c65ac95 |
BertPooler | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class BertPooler(nn.Module):
def __init__(self, config):
super(BertPooler, self).__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.activation = nn.Tanh()
def forward(self, hi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | AlanFokCo/bert-chinese-horovod-elastic | BertPooler | false | 7,476 | [
"Apache-2.0"
] | 1 | 02317d0857e0e8e313dd63ead61ca9996b25548e | https://github.com/AlanFokCo/bert-chinese-horovod-elastic/tree/02317d0857e0e8e313dd63ead61ca9996b25548e |
VariableBoxMLP | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class VariableBoxMLP(nn.Module):
def __init__(self, num_in_features: 'int', num_out_features: 'int',
neurons_per_layer: 'int', hidden_layers: 'int'):
super(VariableBoxMLP, self).__init__()
self.hidden_layers = hidden_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.triton_helpers import libdevice
import torch.optim
... | plaveczlambert/deep_euler_tests | VariableBoxMLP | false | 7,477 | [
"MIT"
] | 1 | a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a | https://github.com/plaveczlambert/deep_euler_tests/tree/a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a |
SimpleMLP | import torch
import torch.optim
import torch.jit
import torch.nn as nn
class SimpleMLP(nn.Module):
def __init__(self, num_in_features: 'int', num_out_features: 'int',
neurons_per_layer: 'int'):
super(SimpleMLP, self).__init__()
self.act = nn.ELU()
self.l_in = nn.Linear(in_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.triton_helpers import libdevice
import torch.optim
... | plaveczlambert/deep_euler_tests | SimpleMLP | false | 7,478 | [
"MIT"
] | 1 | a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a | https://github.com/plaveczlambert/deep_euler_tests/tree/a3ceef98ba76bd7a00ccd3c773cd9850311b3b1a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.