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 |
|---|---|---|---|---|---|---|---|---|---|---|
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... | briancoutinho/glow | SimpleAvgPool1dModule | false | 12,561 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleAddMmModule | false | 12,562 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
Qux | import torch
import torch.jit
import torch.onnx
import torch.nn
class Qux(torch.nn.Module):
def __init__(self, x):
super(Qux, self).__init__()
self.x = x
def forward(self, a, b):
return a - b - self.x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.jit
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | briancoutinho/glow | Qux | false | 12,563 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleCosModule | false | 12,564 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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.... | briancoutinho/glow | SimpleClampMinModel | false | 12,565 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleExpModule | false | 12,566 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
UNet | import torch
import torch.nn as nn
import torch.nn.functional as F
class down(nn.Module):
"""
A class for creating neural network blocks containing layers:
Average Pooling --> Convlution + Leaky ReLU --> Convolution + Leaky ReLU
This is used in the UNet Class to create a UNet like NN archite... | 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 ... | guilindner/Super-SloMo | UNet | false | 12,567 | [
"MIT"
] | 0 | 251200f907581b31d41ccb1abeb7504e377cf4fb | https://github.com/guilindner/Super-SloMo/tree/251200f907581b31d41ccb1abeb7504e377cf4fb |
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._... | briancoutinho/glow | SimpleCeilModule | false | 12,568 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleAbsModule | false | 12,569 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleCumSumModule | false | 12,570 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleNotModule | false | 12,571 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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._... | briancoutinho/glow | SimpleFloorModule | false | 12,572 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | Foo | false | 12,573 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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._... | briancoutinho/glow | SimpleGeluModule | false | 12,574 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleReciprocalModel | false | 12,575 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleLogSoftmaxModel | false | 12,576 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleMatmulModule | false | 12,577 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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.... | briancoutinho/glow | SimpleMaxModule | false | 12,578 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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.... | briancoutinho/glow | SimpleReluModel | false | 12,579 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleLinearModule | false | 12,580 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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._... | briancoutinho/glow | SimpleFmodModule | false | 12,581 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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.... | briancoutinho/glow | SimpleMinModule | false | 12,582 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleReshapeModel | false | 12,583 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleOrModule | false | 12,584 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimplePowModule | false | 12,585 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleLogModule | false | 12,586 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleXorModule | false | 12,587 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleMulModule | false | 12,588 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleSinModule | false | 12,589 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleStackModel | false | 12,590 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleSoftmaxModel | false | 12,591 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
AffineTransform | import torch
from torch import nn
class AffineTransform(nn.Module):
def __init__(self, num_features):
super().__init__()
self.alpha = nn.Parameter(torch.ones(1, 1, num_features))
self.beta = nn.Parameter(torch.zeros(1, 1, num_features))
def forward(self, x):
return self.alpha... | import torch
import triton
import 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... | jaketae/res-mlp | AffineTransform | false | 12,592 | [
"MIT"
] | 0 | 6c957e4fe67a2f13d9b4fd3fa36b7eddcf5323fd | https://github.com/jaketae/res-mlp/tree/6c957e4fe67a2f13d9b4fd3fa36b7eddcf5323fd |
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.... | briancoutinho/glow | SimpleSumModule | false | 12,593 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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._... | briancoutinho/glow | SimpleTanhModel | false | 12,594 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
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... | briancoutinho/glow | SimpleTypeasModel | false | 12,595 | [
"Apache-2.0"
] | 0 | 4c919d60b3c33296c4109aec8020a1733c98f5b5 | https://github.com/briancoutinho/glow/tree/4c919d60b3c33296c4109aec8020a1733c98f5b5 |
AddAndNorm | import torch
import torch.nn as nn
class AddAndNorm(nn.Module):
def __init__(self, d_model, p_drop):
super(AddAndNorm, self).__init__()
self.layer_norm = nn.LayerNorm(d_model)
self.dropout = nn.Dropout(p_drop)
def forward(self, inputs, x):
return self.layer_norm(inputs + 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_... | jaehyek/attention-is-all-you-need | AddAndNorm | false | 12,596 | [
"MIT"
] | 0 | 9b421f7c98414aeb9f397c5195e3a6a9080a4669 | https://github.com/jaehyek/attention-is-all-you-need/tree/9b421f7c98414aeb9f397c5195e3a6a9080a4669 |
ResMLPLayer | import torch
from torch import nn
from torch.nn import functional as F
class AffineTransform(nn.Module):
def __init__(self, num_features):
super().__init__()
self.alpha = nn.Parameter(torch.ones(1, 1, num_features))
self.beta = nn.Parameter(torch.zeros(1, 1, num_features))
def forwar... | 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... | jaketae/res-mlp | ResMLPLayer | false | 12,597 | [
"MIT"
] | 0 | 6c957e4fe67a2f13d9b4fd3fa36b7eddcf5323fd | https://github.com/jaketae/res-mlp/tree/6c957e4fe67a2f13d9b4fd3fa36b7eddcf5323fd |
TSAFusion | import torch
from torch import nn as nn
from torch.nn import init as init
from torchvision.models import vgg as vgg
import torch.utils.data
from torch.utils import data as data
from torch import autograd as autograd
class TSAFusion(nn.Module):
"""Temporal Spatial Attention (TSA) fusion module.
Temporal: Calc... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn as nn
fr... | hyunobae/BasicSR | TSAFusion | false | 12,598 | [
"Apache-2.0"
] | 0 | f2c2fc6cf28933658816c808f55c95fa20b16483 | https://github.com/hyunobae/BasicSR/tree/f2c2fc6cf28933658816c808f55c95fa20b16483 |
CommunicationLayer | import torch
from torch import nn
class AffineTransform(nn.Module):
def __init__(self, num_features):
super().__init__()
self.alpha = nn.Parameter(torch.ones(1, 1, num_features))
self.beta = nn.Parameter(torch.zeros(1, 1, num_features))
def forward(self, x):
return self.alpha... | 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... | jaketae/res-mlp | CommunicationLayer | false | 12,599 | [
"MIT"
] | 0 | 6c957e4fe67a2f13d9b4fd3fa36b7eddcf5323fd | https://github.com/jaketae/res-mlp/tree/6c957e4fe67a2f13d9b4fd3fa36b7eddcf5323fd |
FeedForward | import torch
from torch import nn
from torch.nn import functional as F
class AffineTransform(nn.Module):
def __init__(self, num_features):
super().__init__()
self.alpha = nn.Parameter(torch.ones(1, 1, num_features))
self.beta = nn.Parameter(torch.zeros(1, 1, num_features))
def forwar... | 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... | jaketae/res-mlp | FeedForward | false | 12,600 | [
"MIT"
] | 0 | 6c957e4fe67a2f13d9b4fd3fa36b7eddcf5323fd | https://github.com/jaketae/res-mlp/tree/6c957e4fe67a2f13d9b4fd3fa36b7eddcf5323fd |
DilatedResidualLayer | import torch
import torch.nn as nn
import torch.nn.functional as F
class DilatedResidualLayer(nn.Module):
def __init__(self, dilation, in_channels, out_channels):
super(DilatedResidualLayer, self).__init__()
self.conv_dilated = nn.Conv1d(in_channels, out_channels, 3, padding
=dilation... | 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_... | jeanq1/sign-segmentation | DilatedResidualLayer | false | 12,601 | [
"MIT"
] | 0 | cbf1203b06e82e75e06b96a430dab08da3a46f7b | https://github.com/jeanq1/sign-segmentation/tree/cbf1203b06e82e75e06b96a430dab08da3a46f7b |
MainClassifier | import torch
import torch.nn as nn
class MainClassifier(nn.Module):
def __init__(self, channel, num_classes=100):
super(MainClassifier, self).__init__()
self.pool = nn.AdaptiveAvgPool2d(1)
self.fc = nn.Linear(channel, num_classes)
def forward(self, x):
x = self.pool(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... | janhenriklambrechts/Task-Oriented-Feature-Distillation | MainClassifier | false | 12,602 | [
"MIT"
] | 0 | 87ab75677b02441bce045e76e96afb078e9df2ea | https://github.com/janhenriklambrechts/Task-Oriented-Feature-Distillation/tree/87ab75677b02441bce045e76e96afb078e9df2ea |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.pool = torch.nn.MaxPool2d(kernel_size=2, stride=2, padding=0)
self.fc1 = torch.nn.Linear(3 * 16 * 16, 64)
self.fc2 ... | 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 ... | jcolekaplan/computer_vision | Net | false | 12,603 | [
"MIT"
] | 0 | 48d39b081a7b6b699019052eeae36ab703bb34eb | https://github.com/jcolekaplan/computer_vision/tree/48d39b081a7b6b699019052eeae36ab703bb34eb |
MultiHeadAttention | import torch
import torch.nn as nn
class ScaledDotProductAttention(nn.Module):
def __init__(self, d_k):
super(ScaledDotProductAttention, self).__init__()
self.scale = d_k ** -0.5
def forward(self, q, k, v, mask):
x = torch.matmul(q, k.transpose(-2, -1))
x = x if mask is None ... | 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.... | jaehyek/attention-is-all-you-need | MultiHeadAttention | false | 12,604 | [
"MIT"
] | 0 | 9b421f7c98414aeb9f397c5195e3a6a9080a4669 | https://github.com/jaehyek/attention-is-all-you-need/tree/9b421f7c98414aeb9f397c5195e3a6a9080a4669 |
PositionwiseFeedForward | import torch
import torch.nn as nn
import torch.nn.functional as F
class PositionwiseFeedForward(nn.Module):
"""Implements FFN equation."""
def __init__(self, d_model, d_ff, dropout=0.1):
super(PositionwiseFeedForward, self).__init__()
self.w_1 = nn.Linear(d_model, d_ff)
self.norm = 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
import torch.nn as nn
assert_... | jetd1/dcp | PositionwiseFeedForward | false | 12,605 | [
"MIT"
] | 0 | 2fe7256a14bf382f1ea0a9e1df6d52ff21a99a4d | https://github.com/jetd1/dcp/tree/2fe7256a14bf382f1ea0a9e1df6d52ff21a99a4d |
Tanh | import math
import torch
class Tanh(torch.nn.Tanh):
"""
Class that extends ``torch.nn.Tanh`` additionally computing the log diagonal
blocks of the Jacobian.
"""
def forward(self, inputs, grad: 'torch.Tensor'=None):
"""
Parameters
----------
inputs : ``torch.Tensor`... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
assert_size_stride = torch._C._dynamo.guards.assert_size_strid... | gndctrl2mjrtm/BNAF | Tanh | false | 12,606 | [
"MIT"
] | 0 | a8ecaa2844b5338f9091e58dd571fdc6a598e2f1 | https://github.com/gndctrl2mjrtm/BNAF/tree/a8ecaa2844b5338f9091e58dd571fdc6a598e2f1 |
Model | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, n_input_features):
super(Model, self).__init__()
self.linear = nn.Linear(n_input_features, 1)
def forward(self, x):
y_pred = torch.sigmoid(self.linear(x))
return y_pred
def get_inputs():
retur... | 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... | jaykasundra2/pytorchTutorial | Model | false | 12,607 | [
"MIT"
] | 0 | 954a96797353d463cb96c66596272e180c602134 | https://github.com/jaykasundra2/pytorchTutorial/tree/954a96797353d463cb96c66596272e180c602134 |
NeuralNet1 | import torch
import torch.nn as nn
class NeuralNet1(nn.Module):
def __init__(self, input_size, hidden_size):
super(NeuralNet1, self).__init__()
self.linear1 = nn.Linear(input_size, hidden_size)
self.relu = nn.ReLU()
self.linear2 = nn.Linear(hidden_size, 1)
def forward(self, x... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | jaykasundra2/pytorchTutorial | NeuralNet1 | false | 12,608 | [
"MIT"
] | 0 | 954a96797353d463cb96c66596272e180c602134 | https://github.com/jaykasundra2/pytorchTutorial/tree/954a96797353d463cb96c66596272e180c602134 |
ModMBStddevLayer | import torch
import torch.nn as nn
import torch.distributed as dist
import torch.autograd as autograd
class AllGatherLayer(autograd.Function):
"""All gather layer with backward propagation path.
Indeed, this module is to make ``dist.all_gather()`` in the backward graph.
Such kind of operation has been wi... | import torch
import triton
import triton.language 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.distributed as dist
import torch.autograd as... | jiangwenj02/mmgeneration | ModMBStddevLayer | false | 12,609 | [
"Apache-2.0"
] | 0 | da9ad377ae19260467fc332ddb88f505c38a915a | https://github.com/jiangwenj02/mmgeneration/tree/da9ad377ae19260467fc332ddb88f505c38a915a |
MiniBatchStddevLayer | import torch
import torch.nn as nn
import torch.distributed as dist
import torch.autograd as autograd
class AllGatherLayer(autograd.Function):
"""All gather layer with backward propagation path.
Indeed, this module is to make ``dist.all_gather()`` in the backward graph.
Such kind of operation has been wi... | import torch
import triton
import triton.language 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.distributed as dist
import torch.autograd as... | jiangwenj02/mmgeneration | MiniBatchStddevLayer | false | 12,610 | [
"Apache-2.0"
] | 0 | da9ad377ae19260467fc332ddb88f505c38a915a | https://github.com/jiangwenj02/mmgeneration/tree/da9ad377ae19260467fc332ddb88f505c38a915a |
PixelNorm | import torch
import torch.nn as nn
def pixel_norm(x, eps=1e-06):
"""Pixel Normalization.
This normalization is proposed in:
Progressive Growing of GANs for Improved Quality, Stability, and Variation
Args:
x (torch.Tensor): Tensor to be normalized.
eps (float, optional): Epsilon to av... | import torch
import triton
import triton.language 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_... | jiangwenj02/mmgeneration | PixelNorm | false | 12,611 | [
"Apache-2.0"
] | 0 | da9ad377ae19260467fc332ddb88f505c38a915a | https://github.com/jiangwenj02/mmgeneration/tree/da9ad377ae19260467fc332ddb88f505c38a915a |
AuxiliaryConvolutions | import torch
from torch import nn
import torch.nn.functional as F
from itertools import product as product
import torch.optim
import torch.utils.data
class AuxiliaryConvolutions(nn.Module):
"""
Additional convolutions to produce higher-level feature maps.
"""
def __init__(self):
super(Auxilia... | 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
from ite... | gigajet/ICDAR-2019-SROIE | AuxiliaryConvolutions | false | 12,612 | [
"MIT"
] | 0 | 62dd3ecc90600c0bdf8ceece796fc4e555d3bd16 | https://github.com/gigajet/ICDAR-2019-SROIE/tree/62dd3ecc90600c0bdf8ceece796fc4e555d3bd16 |
CAM_Module | from torch.nn import Module
import torch
from torch.nn import Parameter
from torch.nn import Softmax
class CAM_Module(Module):
""" Channel attention module"""
def __init__(self, in_dim):
super(CAM_Module, self).__init__()
self.chanel_in = in_dim
self.gamma = Parameter(torch.zeros(1))
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | jiaxu0017/Segmentation_attention_mainfold-Pytorch | CAM_Module | false | 12,613 | [
"MIT"
] | 0 | ff42168b5e77618221dc3bc6887765aa14530e8e | https://github.com/jiaxu0017/Segmentation_attention_mainfold-Pytorch/tree/ff42168b5e77618221dc3bc6887765aa14530e8e |
EqualLinearActModule | import torch
from copy import deepcopy
import torch.nn as nn
from functools import partial
from torch.nn.init import _calculate_correct_fan
def equalized_lr(module, name='weight', gain=2 ** 0.5, mode='fan_in',
lr_mul=1.0):
"""Equalized Learning Rate.
This trick is proposed in:
Progressive Growing of ... | 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 copy import deepcopy
import torch.nn as nn
from functools import partial
fr... | jiangwenj02/mmgeneration | EqualLinearActModule | false | 12,614 | [
"Apache-2.0"
] | 0 | da9ad377ae19260467fc332ddb88f505c38a915a | https://github.com/jiangwenj02/mmgeneration/tree/da9ad377ae19260467fc332ddb88f505c38a915a |
AdaptiveInstanceNorm | import torch
import torch.nn as nn
from torch.nn.init import _calculate_correct_fan
def equalized_lr(module, name='weight', gain=2 ** 0.5, mode='fan_in',
lr_mul=1.0):
"""Equalized Learning Rate.
This trick is proposed in:
Progressive Growing of GANs for Improved Quality, Stability, and Variation
... | 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 ... | jiangwenj02/mmgeneration | AdaptiveInstanceNorm | false | 12,615 | [
"Apache-2.0"
] | 0 | da9ad377ae19260467fc332ddb88f505c38a915a | https://github.com/jiangwenj02/mmgeneration/tree/da9ad377ae19260467fc332ddb88f505c38a915a |
Critic | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
def __init__(self, state_dim, action_dim):
super(Critic, self).__init__()
self.l1 = nn.Linear(state_dim + action_dim, 400)
self.l2 = nn.Linear(400, 300)
self.l3 = nn.Linear(300, 1)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | jinPrelude/ksp-ai | Critic | false | 12,616 | [
"MIT"
] | 0 | d8b235d1ef77afe413fbff2e859e1210330bde37 | https://github.com/jinPrelude/ksp-ai/tree/d8b235d1ef77afe413fbff2e859e1210330bde37 |
LinearDeepQNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch as T
class LinearDeepQNetwork(nn.Module):
def __init__(self, lr, input, n_actions):
super(LinearDeepQNetwork, self).__init__()
self.fc1 = nn.Linear(input, 128)
self.fc2 = nn.Linear(... | 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 ... | joaomanojr/tecprog | LinearDeepQNetwork | false | 12,617 | [
"MIT"
] | 0 | 825ae3dd9f2ddd0bce2d410af7deae8eb5ba3d21 | https://github.com/joaomanojr/tecprog/tree/825ae3dd9f2ddd0bce2d410af7deae8eb5ba3d21 |
GCN | from torch.nn import Module
import math
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
import torch.nn.functional as F
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | jindl465/pygcn | GCN | false | 12,618 | [
"MIT"
] | 0 | bbbedc2278d1b1bc260e138f98cf27733995914d | https://github.com/jindl465/pygcn/tree/bbbedc2278d1b1bc260e138f98cf27733995914d |
CSNet | import torch
class CSNet(torch.nn.Module):
def __init__(self):
super(CSNet, self).__init__()
k_stride = 20
color_channel = 3
mr = 12
self.conv0 = torch.nn.Conv2d(in_channels=color_channel,
out_channels=mr, kernel_size=2 * k_stride, stride=k_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._inductor.runtime import triton_helpers
assert_size_stride = torch._C... | jiang-du/Multi-rate-VCS | CSNet | false | 12,619 | [
"MIT"
] | 0 | 18457a7e0be76cad8b78b7dee32f8f6704d2f7e0 | https://github.com/jiang-du/Multi-rate-VCS/tree/18457a7e0be76cad8b78b7dee32f8f6704d2f7e0 |
Net | import torch
import torch.nn as tnn
class Net(tnn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = tnn.Conv2d(3, 6, 5)
self.pool = tnn.MaxPool2d(2, 2)
self.conv2 = tnn.Conv2d(6, 16, 5)
self.fc1 = tnn.Linear(16 * 5 * 5, 120)
self.fc2 = tnn.Linea... | 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 tnn
assert... | jittor-online-first/jittor | Net | false | 12,620 | [
"Apache-2.0"
] | 0 | 4217359f86cbcf174fab27c3b723487a8d78b729 | https://github.com/jittor-online-first/jittor/tree/4217359f86cbcf174fab27c3b723487a8d78b729 |
BahdanauAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
class BahdanauAttention(nn.Module):
""" Class performs Additive Bahdanau Attention.
Source: https://arxiv.org/pdf/1409.0473.pdf
"""
def __init__(self, num_features, hidden_dim, output_dim=1):
super(BahdanauAttention,... | 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.... | joao-d-oliveira/CV-Image_Captioning | BahdanauAttention | false | 12,621 | [
"MIT"
] | 0 | 76186c326e4fc44a60da401f4ec71176cba42e87 | https://github.com/joao-d-oliveira/CV-Image_Captioning/tree/76186c326e4fc44a60da401f4ec71176cba42e87 |
RegressionModel | import torch
import torch.nn as nn
class RegressionModel(nn.Module):
def __init__(self, num_features_in, num_anchors=1, feature_size=256):
super(RegressionModel, self).__init__()
self.conv1 = nn.Conv2d(num_features_in, feature_size, kernel_size=3,
padding=1)
self.act1 = nn.ReL... | 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_... | fmrdev/ctracker | RegressionModel | false | 12,622 | [
"Apache-2.0"
] | 0 | 6f5a88d569d0132a9f844cd1e55e60032d32bcba | https://github.com/fmrdev/ctracker/tree/6f5a88d569d0132a9f844cd1e55e60032d32bcba |
ModulatedToRGB | import torch
import torch.nn.functional as F
from copy import deepcopy
import torch.nn as nn
from functools import partial
from torch.nn.init import _calculate_correct_fan
def upsample(in_tens, out_H=64):
"""Upsamples the input to the given size.
Args:
in_tens (Tensor): Tensor with shape [N, C, H, W]... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional as F
from copy import deepcopy
import torch.nn as nn
... | jiangwenj02/mmgeneration | ModulatedToRGB | false | 12,623 | [
"Apache-2.0"
] | 0 | da9ad377ae19260467fc332ddb88f505c38a915a | https://github.com/jiangwenj02/mmgeneration/tree/da9ad377ae19260467fc332ddb88f505c38a915a |
ClassificationModel | import torch
import torch.nn as nn
class ClassificationModel(nn.Module):
def __init__(self, num_features_in, num_anchors=1, num_classes=80,
prior=0.01, feature_size=256):
super(ClassificationModel, self).__init__()
self.num_classes = num_classes
self.num_anchors = num_anchors
... | 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_... | fmrdev/ctracker | ClassificationModel | false | 12,624 | [
"Apache-2.0"
] | 0 | 6f5a88d569d0132a9f844cd1e55e60032d32bcba | https://github.com/fmrdev/ctracker/tree/6f5a88d569d0132a9f844cd1e55e60032d32bcba |
GroupNorm32 | import torch
import torch.nn as nn
import torch.nn.functional as F
class GroupNorm32(nn.GroupNorm):
def __init__(self, num_groups, num_channels, swish, eps=1e-05):
super().__init__(num_groups=num_groups, num_channels=num_channels,
eps=eps)
self.swish = swish
def forward(self, 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._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | johnpaulbin/glide-text2im | GroupNorm32 | false | 12,625 | [
"MIT"
] | 0 | 4897050c4c540316dfb1ec7e6ff95698bcb20487 | https://github.com/johnpaulbin/glide-text2im/tree/4897050c4c540316dfb1ec7e6ff95698bcb20487 |
TransformerEncoderLayer | import math
import torch
from torch import nn
import torch.nn.functional as F
def _normalize(tensor, norm_layer):
"""
Broadcast layer norm
"""
size = tensor.size()
return norm_layer(tensor.view(-1, size[-1])).view(size)
class MultiHeadAttention(nn.Module):
def __init__(self, n_heads, dim, 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.... | jinjiren/ParlAI | TransformerEncoderLayer | false | 12,626 | [
"MIT"
] | 0 | 40799aeee69f2a0bb25a1341bb8da0c44861268e | https://github.com/jinjiren/ParlAI/tree/40799aeee69f2a0bb25a1341bb8da0c44861268e |
ModulatedConv2d | from torch.autograd import Function
import math
import torch
from torch import nn
import torch.nn.functional as F
def make_kernel(k):
k = torch.tensor(k, dtype=torch.float32)
if k.ndim == 1:
k = k[None, :] * k[:, None]
k /= k.sum()
return k
def upfirdn2d(input, kernel, up=1, down=1, pad=(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
from torch.autograd... | johnberg1/psp_s | ModulatedConv2d | false | 12,627 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | 0 | 717f4c448a4e7537cf4b74067d454c7644609ca3 | https://github.com/johnberg1/psp_s/tree/717f4c448a4e7537cf4b74067d454c7644609ca3 |
GaussianKLLoss | import torch
import torch.nn as nn
class GaussianKLLoss(nn.Module):
def __init__(self):
super(GaussianKLLoss, self).__init__()
def forward(self, mu1, logvar1, mu2, logvar2):
numerator = logvar1.exp() + torch.pow(mu1 - mu2, 2)
fraction = torch.div(numerator, logvar2.exp())
kl ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | johnson7788/Info-HCVAE | GaussianKLLoss | false | 12,628 | [
"Apache-2.0"
] | 0 | f43bf705aab3dcdc340ded3be09fb87420a48c51 | https://github.com/johnson7788/Info-HCVAE/tree/f43bf705aab3dcdc340ded3be09fb87420a48c51 |
CategoricalKLLoss | import torch
import torch.nn as nn
class CategoricalKLLoss(nn.Module):
def __init__(self):
super(CategoricalKLLoss, self).__init__()
def forward(self, P, Q):
log_P = P.log()
log_Q = Q.log()
kl = (P * (log_P - log_Q)).sum(dim=-1).sum(dim=-1)
return kl.mean(dim=0)
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
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | johnson7788/Info-HCVAE | CategoricalKLLoss | false | 12,629 | [
"Apache-2.0"
] | 0 | f43bf705aab3dcdc340ded3be09fb87420a48c51 | https://github.com/johnson7788/Info-HCVAE/tree/f43bf705aab3dcdc340ded3be09fb87420a48c51 |
Feedback | 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... | IacoSimoncini/tfvaegan | Feedback | false | 12,630 | [
"MIT"
] | 0 | 157b526d65d0b0d5412f4be6fed02fc7d6325827 | https://github.com/IacoSimoncini/tfvaegan/tree/157b526d65d0b0d5412f4be6fed02fc7d6325827 |
ToRGB | from torch.autograd import Function
import math
import torch
from torch import nn
import torch.nn.functional as F
def make_kernel(k):
k = torch.tensor(k, dtype=torch.float32)
if k.ndim == 1:
k = k[None, :] * k[:, None]
k /= k.sum()
return k
def upfirdn2d(input, kernel, up=1, down=1, pad=(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 math
from torch import nn
import torc... | johnberg1/psp_s | ToRGB | false | 12,631 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | 0 | 717f4c448a4e7537cf4b74067d454c7644609ca3 | https://github.com/johnberg1/psp_s/tree/717f4c448a4e7537cf4b74067d454c7644609ca3 |
SirenLayer | import torch
import numpy as np
from torch import nn
class SirenLayer(nn.Module):
def __init__(self, in_f, out_f, w0=30, is_first=False, is_last=False):
super().__init__()
self.in_f = in_f
self.w0 = w0
self.linear = nn.Linear(in_f, out_f)
self.is_first = is_first
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.triton_helpers import math as tl_math
import numpy ... | jonathanfrawley/pixel-nerf | SirenLayer | false | 12,632 | [
"BSD-2-Clause"
] | 0 | 11d06decbda363d6c5188ec45091da8605da4dfd | https://github.com/jonathanfrawley/pixel-nerf/tree/11d06decbda363d6c5188ec45091da8605da4dfd |
PredictionConvolutions | import torch
from torch import nn
import torch.optim
import torch.utils.data
class PredictionConvolutions(nn.Module):
"""
Convolutions to predict class scores and bounding boxes using lower and higher-level feature maps.
The bounding boxes (locations) are predicted as encoded offsets w.r.t each of the 245... | 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.optim
import torch.utils.data
assert_size_stri... | doduythao/ssd | PredictionConvolutions | false | 12,633 | [
"MIT"
] | 0 | 170064a3edef05d3274b08ea7f622eb3238b5c5c | https://github.com/doduythao/ssd/tree/170064a3edef05d3274b08ea7f622eb3238b5c5c |
GCN | from torch.nn import Module
import math
import torch
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
import torch.nn as nn
import torch.nn.functional as F
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
i... | jarvis08/gpackage-gcn-torch | GCN | false | 12,634 | [
"MIT"
] | 0 | 5e483ea3012dfd0f23b194519c1295e3efcbdc35 | https://github.com/jarvis08/gpackage-gcn-torch/tree/5e483ea3012dfd0f23b194519c1295e3efcbdc35 |
TransformerDecoderLayer | import math
import torch
from torch import nn
import torch.nn.functional as F
def _normalize(tensor, norm_layer):
"""
Broadcast layer norm
"""
size = tensor.size()
return norm_layer(tensor.view(-1, size[-1])).view(size)
class MultiHeadAttention(nn.Module):
def __init__(self, n_heads, dim, 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.... | jinjiren/ParlAI | TransformerDecoderLayer | false | 12,635 | [
"MIT"
] | 0 | 40799aeee69f2a0bb25a1341bb8da0c44861268e | https://github.com/jinjiren/ParlAI/tree/40799aeee69f2a0bb25a1341bb8da0c44861268e |
AugCNN | 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... | joshnroy/contrastive-rl | AugCNN | false | 12,636 | [
"MIT"
] | 0 | d0e8cd8fd6963983dc62dd282b788002a892704e | https://github.com/joshnroy/contrastive-rl/tree/d0e8cd8fd6963983dc62dd282b788002a892704e |
GlobalAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
class GlobalAttention(nn.Module):
"""
Global Attention between encoder and decoder
"""
def __init__(self, key_features, query_features, value_features,
hidden_features=None, dropout=0.0):
"""
Args:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | juheeuu/flowseq | GlobalAttention | false | 12,637 | [
"Apache-2.0"
] | 0 | e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb | https://github.com/juheeuu/flowseq/tree/e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb |
MultiheadAttention | import math
import torch
import torch.nn as nn
import torch as th
class QKVMultiheadAttention(nn.Module):
def __init__(self, n_heads: 'int', n_ctx: 'int'):
super().__init__()
self.n_heads = n_heads
self.n_ctx = n_ctx
def forward(self, qkv):
bs, n_ctx, width = qkv.shape
... | 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.... | johnpaulbin/glide-text2im | MultiheadAttention | false | 12,638 | [
"MIT"
] | 0 | 4897050c4c540316dfb1ec7e6ff95698bcb20487 | https://github.com/johnpaulbin/glide-text2im/tree/4897050c4c540316dfb1ec7e6ff95698bcb20487 |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(3, 16, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(16, 32, 5)
self.fc1 = nn.Linear(32 * 5 * 5, 120)
... | 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_... | juliowaissman/cifar10-jwv | Net | false | 12,639 | [
"MIT"
] | 0 | a279ccf51f0e8cbacfcc34a9eee381c16ae536fc | https://github.com/juliowaissman/cifar10-jwv/tree/a279ccf51f0e8cbacfcc34a9eee381c16ae536fc |
Disc | import torch
import torch.nn as nn
import torch.nn.functional as F
class Disc(nn.Module):
def __init__(self, N, z_dim):
super(Disc, self).__init__()
self.lin1 = nn.Linear(z_dim, N)
self.lin2 = nn.Linear(N, N)
self.lin3 = nn.Linear(N, 1)
def forward(self, x):
x = F.dro... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | junhahyung/Pytorch-Sketch-RNN | Disc | false | 12,640 | [
"MIT"
] | 0 | 7aa82755fdfdb9bd36f8a83f1cfc0ade43e50a7a | https://github.com/junhahyung/Pytorch-Sketch-RNN/tree/7aa82755fdfdb9bd36f8a83f1cfc0ade43e50a7a |
GumbelSoftMaxSampler | import torch
from torch.nn import functional as F
from torch import nn
from typing import *
class GumbelSoftMaxSampler(nn.Module):
def __init__(self, hard=False):
super().__init__()
self.hard = hard
def forward(self, logits):
return F.gumbel_softmax(logits=logits, hard=self.hard)
d... | import torch
import triton
import triton.language 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... | jvrana/deep-learning-guides | GumbelSoftMaxSampler | false | 12,641 | [
"MIT"
] | 0 | 18b7a0808073dd7b345e7a683dd7ee89e97e47ce | https://github.com/jvrana/deep-learning-guides/tree/18b7a0808073dd7b345e7a683dd7ee89e97e47ce |
Gaussian | import torch
from torch import Tensor
import torch.utils.tensorboard
import torch.utils.data
class Gaussian(torch.nn.Module):
"""Gaussian activation"""
def forward(self, x: 'Tensor') ->Tensor:
return torch.exp(-x * x)
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.utils.tensorboard
import torch.utils.data
assert_size_stride... | isayev/torchani | Gaussian | false | 12,642 | [
"MIT"
] | 0 | f8edffe384e2cb2eebe3a7e04faa01b6f5e26b37 | https://github.com/isayev/torchani/tree/f8edffe384e2cb2eebe3a7e04faa01b6f5e26b37 |
NodeAdaptiveEncoder | import torch
import torch.utils.data
import torch.nn as nn
import torch as torch
class NodeAdaptiveEncoder(nn.Module):
def __init__(self, num_features, dropout=0.5):
super(NodeAdaptiveEncoder, self).__init__()
self.fc = nn.Parameter(torch.zeros(size=(num_features, 1)))
nn.init.xavier_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.utils.data
import torch.nn as nn
import torch as torch
assert_size_... | ckhui/cogdl | NodeAdaptiveEncoder | false | 12,643 | [
"MIT"
] | 0 | 93bea17c2dc7084857cd0a4af8178c174965127c | https://github.com/ckhui/cogdl/tree/93bea17c2dc7084857cd0a4af8178c174965127c |
InvertibleMultiHeadFlow | import torch
from typing import Dict
from typing import Tuple
import torch.nn as nn
from torch.nn import Parameter
import torch.nn.functional as F
class Flow(nn.Module):
"""
Normalizing Flow base class
"""
_registry = dict()
def __init__(self, inverse):
super(Flow, 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 typing import Dict
from typing import Tuple
import torch.nn as nn
from torc... | juheeuu/flowseq | InvertibleMultiHeadFlow | false | 12,644 | [
"Apache-2.0"
] | 0 | e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb | https://github.com/juheeuu/flowseq/tree/e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb |
is_she_mad | import torch
import torch.nn.functional as F
import torch.nn as nn
class is_she_mad(nn.Module):
def __init__(self, modality_size):
super(is_she_mad, self).__init__()
self.fc1 = nn.Linear(modality_size, 200)
self.fc2 = nn.Linear(200, 128)
self.fc3 = nn.Linear(128, 1)
def forwa... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | jryzkns/IsSheMadAtMe | is_she_mad | false | 12,645 | [
"MIT"
] | 0 | 7776fb9730dab56f42418460efa0c2dec3988e46 | https://github.com/jryzkns/IsSheMadAtMe/tree/7776fb9730dab56f42418460efa0c2dec3988e46 |
ResidualAttentionBlock | import math
import torch
import torch.nn as nn
import torch as th
class LayerNorm(nn.LayerNorm):
"""
Implementation that supports fp16 inputs but fp32 gains/biases.
"""
def forward(self, x: 'th.Tensor'):
return super().forward(x.float())
class QKVMultiheadAttention(nn.Module):
def __in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | johnpaulbin/glide-text2im | ResidualAttentionBlock | false | 12,646 | [
"MIT"
] | 0 | 4897050c4c540316dfb1ec7e6ff95698bcb20487 | https://github.com/johnpaulbin/glide-text2im/tree/4897050c4c540316dfb1ec7e6ff95698bcb20487 |
DistMultLayer | import torch
import torch.utils.data
import torch.nn as nn
import torch as torch
class DistMultLayer(nn.Module):
def __init__(self):
super(DistMultLayer, self).__init__()
def forward(self, sub_emb, obj_emb, rel_emb):
return torch.sum(sub_emb * obj_emb * rel_emb, dim=-1)
def predict(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
import torch.utils.data
import torch.nn as nn
import torch as torch
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_st... | ckhui/cogdl | DistMultLayer | false | 12,647 | [
"MIT"
] | 0 | 93bea17c2dc7084857cd0a4af8178c174965127c | https://github.com/ckhui/cogdl/tree/93bea17c2dc7084857cd0a4af8178c174965127c |
RobertaClassificationHead | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class RobertaClassificationHead(nn.Module):
"""Head for sentence-level classification tasks."""
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size * 2, config.hidden_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.triton_helpers import libdevice
import torch.nn as ... | kamranazmat/CodeBERT | RobertaClassificationHead | false | 12,648 | [
"MIT"
] | 0 | 109c1b58b96c61314a76563c6bd686bb09f86eab | https://github.com/kamranazmat/CodeBERT/tree/109c1b58b96c61314a76563c6bd686bb09f86eab |
InvertibleLinearFlow | import torch
from typing import Dict
from typing import Tuple
import torch.nn as nn
from torch.nn import Parameter
import torch.nn.functional as F
class Flow(nn.Module):
"""
Normalizing Flow base class
"""
_registry = dict()
def __init__(self, inverse):
super(Flow, 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 typing import Dict
from typing import Tuple
import torch.nn as nn
from torc... | juheeuu/flowseq | InvertibleLinearFlow | false | 12,649 | [
"Apache-2.0"
] | 0 | e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb | https://github.com/juheeuu/flowseq/tree/e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb |
ActNormFlow | import torch
from typing import Dict
from typing import Tuple
import torch.nn as nn
from torch.nn import Parameter
class Flow(nn.Module):
"""
Normalizing Flow base class
"""
_registry = dict()
def __init__(self, inverse):
super(Flow, self).__init__()
self.inverse = inverse
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.triton_helpers import math as tl_math
from typing import Dict
from typing import Tuple
import torch.nn as nn
fr... | juheeuu/flowseq | ActNormFlow | false | 12,650 | [
"Apache-2.0"
] | 0 | e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb | https://github.com/juheeuu/flowseq/tree/e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb |
PrototypicalDecoder | import torch
import typing
from torch import Tensor
from collections import Counter
from typing import List
from typing import Optional
from typing import Union
from torch.utils.data import Dataset
import torch.utils.data.dataloader
from torch import nn
import torch.nn
from torch.utils.data.dataset import Dataset
from ... | import torch
import 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 typing
from torch import Tensor
from collections import Counter
from typing import List
from typing import Optional
from typing impor... | k2room/ParaphraseQA | PrototypicalDecoder | false | 12,651 | [
"MIT"
] | 0 | 5aebe02c26a0bac3731f18bb115b33ba3a772756 | https://github.com/k2room/ParaphraseQA/tree/5aebe02c26a0bac3731f18bb115b33ba3a772756 |
TwoLinearsModel | import torch
import torch.nn as nn
import torch.nn
import torch.utils.data
import torch.utils.tensorboard._pytorch_graph
import torch.onnx.symbolic_caffe2
class TwoLinearsModel(nn.Module):
def __init__(self, per_sample_shape: 'list', hidden_size: 'int',
output_size: 'int'):
super(TwoLinearsModel,... | 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 ... | arjunsuresh/aimet | TwoLinearsModel | false | 12,652 | [
"BSD-3-Clause"
] | 0 | f6e09cb07a91eed3a5e6b8e19e6b065303af5a39 | https://github.com/arjunsuresh/aimet/tree/f6e09cb07a91eed3a5e6b8e19e6b065303af5a39 |
Net | import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_size, out_size, kernel=3, stride=1, padding=1,
activ='relu', norm=None):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_size, out_size, kernel, stride, padding)
self.norm = 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... | jth1011/ECE539-Project | Net | false | 12,653 | [
"MIT"
] | 0 | bce6ffd75da92e862d8fda3852be247602b1567e | https://github.com/jth1011/ECE539-Project/tree/bce6ffd75da92e862d8fda3852be247602b1567e |
ColorJitterLayer | from torch.autograd import Function
import math
import numbers
import torch
import numpy as np
import torch.nn as nn
import torch.utils.cpp_extension
def hsv2rgb(hsv):
"""Convert a 4-d HSV tensor to the RGB counterpart.
>>> %timeit hsv2rgb_lookup(hsv)
2.37 ms ± 13.4 µs per loop (mean ± std. dev. of 7 runs... | import torch
import triton
import triton.language 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.... | hugobloem/PyTorch-StudioGAN | ColorJitterLayer | false | 12,654 | [
"MIT"
] | 0 | 3deab27c0774adba5a94c7f452d32d4cbc3b117c | https://github.com/hugobloem/PyTorch-StudioGAN/tree/3deab27c0774adba5a94c7f452d32d4cbc3b117c |
DiceLoss | 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... | kant/open-solution-ship-detection | DiceLoss | false | 12,655 | [
"MIT"
] | 0 | 94fa14fc461d6088d884930cbd8e2a2b99a338b5 | https://github.com/kant/open-solution-ship-detection/tree/94fa14fc461d6088d884930cbd8e2a2b99a338b5 |
NetVLAD | import torch
import torch.nn as nn
import torch.optim
import torch.utils.data
import torch.nn.functional as F
class NetVLAD(nn.Module):
"""NetVLAD layer implementation"""
def __init__(self, num_clusters=16, dim=2048, alpha=30.0,
normalize_input=True):
"""
Args:
num_cluster... | 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.... | fede-vaccaro/cnnimageretrieval-pytorch | NetVLAD | false | 12,656 | [
"MIT"
] | 0 | 56bf4ee865e9769801819943f75fff207f0c2f00 | https://github.com/fede-vaccaro/cnnimageretrieval-pytorch/tree/56bf4ee865e9769801819943f75fff207f0c2f00 |
Conv1dWeightNorm | import torch
import torch.nn as nn
class Conv1dWeightNorm(nn.Module):
"""
Conv1d with weight normalization
"""
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, bias=True):
super(Conv1dWeightNorm, self).__init__()
self.conv =... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | juheeuu/flowseq | Conv1dWeightNorm | false | 12,657 | [
"Apache-2.0"
] | 0 | e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb | https://github.com/juheeuu/flowseq/tree/e6e50406656335ff7a2f9ed4bd81d7cc7d1195fb |
Scaler | import torch
from abc import ABC
class BaseOperator(ABC):
"""
Abstract class defining the basic structure for operator implementations in Hummingbird.
"""
def __init__(self, regression=False, classification=False, transformer=
False, anomaly_detection=False, **kwargs):
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
from abc import ABC
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_stri... | kernc/hummingbird | Scaler | false | 12,658 | [
"MIT"
] | 0 | 8c9d5b1f19054d521b22ad7fcffa8ee10e405ac3 | https://github.com/kernc/hummingbird/tree/8c9d5b1f19054d521b22ad7fcffa8ee10e405ac3 |
ConConv | import torch
import torch.nn as nn
class ConConv(nn.Module):
def __init__(self, inplanes_x1, inplanes_x2, planes):
super(ConConv, self).__init__()
self.conv = nn.Conv2d(inplanes_x1 + inplanes_x2, planes,
kernel_size=1, bias=True)
def forward(self, x1, x2):
x1 = torch.cat(... | 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... | karoly-hars/DE_hybrid_CNN | ConConv | false | 12,659 | [
"BSD-3-Clause"
] | 0 | d74ba4291d6db335151d5262ab96e8e3806a7587 | https://github.com/karoly-hars/DE_hybrid_CNN/tree/d74ba4291d6db335151d5262ab96e8e3806a7587 |
Net_mish_ranger | import torch
import torch.nn.functional as F
def mish(x):
return x * torch.tanh(F.softplus(x))
class Net_mish_ranger(torch.nn.Module):
def __init__(self, n_feature, n_hidden, n_output):
super(Net_mish_ranger, self).__init__()
self.hidden1 = torch.nn.Linear(n_feature, n_hidden)
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... | kartheikiyer/dense_basis_toolbelt | Net_mish_ranger | false | 12,660 | [
"MIT"
] | 0 | 5cae6e8f4ea6983fba3625f47413d40d6b3bc6e4 | https://github.com/kartheikiyer/dense_basis_toolbelt/tree/5cae6e8f4ea6983fba3625f47413d40d6b3bc6e4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.