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 |
|---|---|---|---|---|---|---|---|---|---|---|
MaxElementwise | import torch
class MaxElementwise(torch.nn.Module):
def forward(self, x, y):
return torch.max(x, y)
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 import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | bunderhi/torch2trt | MaxElementwise | false | 1,588 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
MultiHeadAttention | import math
import torch
from torch import nn
class ScaleDotProductAttention(nn.Module):
"""
compute scale dot product attention
Query : given sentence that we focused on (decoder)
Key : every sentence to check relationship with Qeury(encoder)
Value : every sentence same with Key (encoder)
""... | 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.... | bsgiovanini/transformer | MultiHeadAttention | false | 1,589 | [
"Apache-2.0"
] | 0 | e128fa862f1b3d17d7b92df169a2bbee3f08366f | https://github.com/bsgiovanini/transformer/tree/e128fa862f1b3d17d7b92df169a2bbee3f08366f |
WaveNetLayer | import torch
import typing as T
class WaveNetLayer(torch.nn.Module):
"""a single gated residual wavenet layer"""
def __init__(self, channels: 'int', kernel_size: 'int', dilation: 'int'):
super().__init__()
self._conv = torch.nn.Conv1d(in_channels=channels, out_channels=
channels, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride ... | brentspell/hifi-gan-bwe | WaveNetLayer | false | 1,590 | [
"MIT"
] | 0 | 63579ac8055c63fc0e5a20ae90e2a86575fc8e12 | https://github.com/brentspell/hifi-gan-bwe/tree/63579ac8055c63fc0e5a20ae90e2a86575fc8e12 |
IDiv | import torch
class IDiv(torch.nn.Module):
def __init__(self):
super(IDiv, self).__init__()
def forward(self, x, y):
x /= y
return x
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_div_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | bunderhi/torch2trt | IDiv | false | 1,591 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
Mul | import torch
class Mul(torch.nn.Module):
def __init__(self):
super(Mul, self).__init__()
def forward(self, x, y):
return x * y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | Mul | false | 1,592 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
EQ | import torch
class EQ(torch.nn.Module):
def __init__(self):
super(EQ, self).__init__()
def forward(self, x, y):
return x == y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | EQ | false | 1,593 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
GT | import torch
class GT(torch.nn.Module):
def __init__(self):
super(GT, self).__init__()
def forward(self, x, y):
return x > y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | GT | false | 1,594 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
RAddFloat | import torch
class RAddFloat(torch.nn.Module):
def __init__(self):
super(RAddFloat, self).__init__()
def forward(self, x):
return 1.0 + x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | RAddFloat | false | 1,595 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
ISub | import torch
class ISub(torch.nn.Module):
def __init__(self):
super(ISub, self).__init__()
def forward(self, x, y):
x -= y
return x
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_sub_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | bunderhi/torch2trt | ISub | false | 1,596 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
IAdd | import torch
class IAdd(torch.nn.Module):
def __init__(self):
super(IAdd, self).__init__()
def forward(self, x, y):
x += y
return x
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_add_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | bunderhi/torch2trt | IAdd | false | 1,597 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
MinElementwise | import torch
class MinElementwise(torch.nn.Module):
def forward(self, x, y):
return torch.min(x, y)
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 import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | bunderhi/torch2trt | MinElementwise | false | 1,598 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
IMul | import torch
class IMul(torch.nn.Module):
def __init__(self):
super(IMul, self).__init__()
def forward(self, x, y):
x *= y
return x
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
@triton.jit
def triton_poi_fused_mul_0(in_ptr0, in_ptr1, out_ptr1, xnumel,... | bunderhi/torch2trt | IMul | false | 1,599 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
LT | import torch
class LT(torch.nn.Module):
def __init__(self):
super(LT, self).__init__()
def forward(self, x, y):
return x < y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | LT | false | 1,600 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
Pow | import torch
class Pow(torch.nn.Module):
def __init__(self):
super(Pow, self).__init__()
def forward(self, x, y):
return x ** y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | bunderhi/torch2trt | Pow | false | 1,601 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
RDivFloat | import torch
class RDivFloat(torch.nn.Module):
def __init__(self):
super(RDivFloat, self).__init__()
def forward(self, x):
return 100.0 / x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | RDivFloat | false | 1,602 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
TensorClamp | import torch
class TensorClamp(torch.nn.Module):
def forward(self, x):
return x.clamp(-0.1, 0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | bunderhi/torch2trt | TensorClamp | false | 1,603 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
RSubInt | import torch
class RSubInt(torch.nn.Module):
def __init__(self):
super(RSubInt, self).__init__()
def forward(self, x):
return 1 - x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | RSubInt | false | 1,604 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
RMulInt | import torch
class RMulInt(torch.nn.Module):
def __init__(self):
super(RMulInt, self).__init__()
def forward(self, x):
return 10 * x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | RMulInt | false | 1,605 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
RMulFloat | import torch
class RMulFloat(torch.nn.Module):
def __init__(self):
super(RMulFloat, self).__init__()
def forward(self, x):
return 10.0 * x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | RMulFloat | false | 1,606 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
TensorClampOptionMax | import torch
class TensorClampOptionMax(torch.nn.Module):
def forward(self, x):
return x.clamp(max=0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | bunderhi/torch2trt | TensorClampOptionMax | false | 1,607 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
RDivInt | import torch
class RDivInt(torch.nn.Module):
def __init__(self):
super(RDivInt, self).__init__()
def forward(self, x):
return 100 / x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | RDivInt | false | 1,608 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
TorchSub | import torch
class TorchSub(torch.nn.Module):
def __init__(self):
super(TorchSub, self).__init__()
def forward(self, x, y):
return torch.sub(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | TorchSub | false | 1,609 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
Sub | import torch
class Sub(torch.nn.Module):
def __init__(self):
super(Sub, self).__init__()
def forward(self, x, y):
return x - y
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | Sub | false | 1,610 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
TorchClampMin | import torch
class TorchClampMin(torch.nn.Module):
def forward(self, x):
return torch.clamp_min(x, -0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | bunderhi/torch2trt | TorchClampMin | false | 1,611 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
TorchDiv | import torch
class TorchDiv(torch.nn.Module):
def __init__(self):
super(TorchDiv, self).__init__()
def forward(self, x, y):
return torch.div(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | TorchDiv | false | 1,612 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
RSubFloat | import torch
class RSubFloat(torch.nn.Module):
def __init__(self):
super(RSubFloat, self).__init__()
def forward(self, x):
return 1.0 - x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | bunderhi/torch2trt | RSubFloat | false | 1,613 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
TensorClampMax | import torch
class TensorClampMax(torch.nn.Module):
def forward(self, x):
return x.clamp_max(0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | bunderhi/torch2trt | TensorClampMax | false | 1,614 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
RpowFloat | import torch
class RpowFloat(torch.nn.Module):
def __init__(self):
super(RpowFloat, self).__init__()
def forward(self, x):
return 2.0 ** x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | bunderhi/torch2trt | RpowFloat | false | 1,615 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
TorchPow | import torch
class TorchPow(torch.nn.Module):
def __init__(self):
super(TorchPow, self).__init__()
def forward(self, x, y):
return torch.pow(x, y)
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
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | bunderhi/torch2trt | TorchPow | false | 1,616 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
TransformerEncoderLayerWithConv1d | import torch
import torch.nn as nn
import torch.nn.functional as F
class TransformerEncoderLayerWithConv1d(nn.Module):
"""
Input and output shape: seqlen x batch_size x dim
"""
def __init__(self, dim_model, nheads, dim_feedforward, dropout,
kernel_size, stride):
super(TransformerEnc... | 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.... | bliunlpr/pykaldi2 | TransformerEncoderLayerWithConv1d | false | 1,617 | [
"MIT"
] | 0 | f6020b5dd9900f97ab69c97442a91196a03dd93b | https://github.com/bliunlpr/pykaldi2/tree/f6020b5dd9900f97ab69c97442a91196a03dd93b |
EncoderLayer | import math
import torch
from torch import nn
class LayerNorm(nn.Module):
def __init__(self, d_model, eps=1e-12):
super(LayerNorm, self).__init__()
self.gamma = nn.Parameter(torch.ones(d_model))
self.beta = nn.Parameter(torch.zeros(d_model))
self.eps = eps
def forward(self, x... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | bsgiovanini/transformer | EncoderLayer | false | 1,618 | [
"Apache-2.0"
] | 0 | e128fa862f1b3d17d7b92df169a2bbee3f08366f | https://github.com/bsgiovanini/transformer/tree/e128fa862f1b3d17d7b92df169a2bbee3f08366f |
DecoderLayer | import math
import torch
from torch import nn
class LayerNorm(nn.Module):
def __init__(self, d_model, eps=1e-12):
super(LayerNorm, self).__init__()
self.gamma = nn.Parameter(torch.ones(d_model))
self.beta = nn.Parameter(torch.zeros(d_model))
self.eps = eps
def forward(self, x... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | bsgiovanini/transformer | DecoderLayer | false | 1,619 | [
"Apache-2.0"
] | 0 | e128fa862f1b3d17d7b92df169a2bbee3f08366f | https://github.com/bsgiovanini/transformer/tree/e128fa862f1b3d17d7b92df169a2bbee3f08366f |
CrossEntropyWithLogSoftmax | import torch
import torch.nn as nn
class CrossEntropyWithLogSoftmax(nn.Module):
def forward(self, y_hat, y):
return -(y_hat * y).mean()
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 import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | cadurosar/graph_kd_dense_cifar100 | CrossEntropyWithLogSoftmax | false | 1,620 | [
"MIT"
] | 0 | 84054ab4f8f61c9db3460993661ba7bf1d951b36 | https://github.com/cadurosar/graph_kd_dense_cifar100/tree/84054ab4f8f61c9db3460993661ba7bf1d951b36 |
KlLoss | import torch
import torch.nn as nn
def kl_div(p: 'torch.Tensor', q: 'torch.Tensor') ->torch.Tensor:
x = p * torch.log(p / q)
return x.abs().mean()
class KlLoss(nn.Module):
def __init__(self) ->None:
super().__init__()
def forward(self, inputs: 'torch.Tensor', targets: '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 import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | by-liu/RetinalApp | KlLoss | false | 1,621 | [
"MIT"
] | 0 | 53173b2b20dfcf613a3a22d6caa5178771d14225 | https://github.com/by-liu/RetinalApp/tree/53173b2b20dfcf613a3a22d6caa5178771d14225 |
BatchMeanCrossEntropyWithLogSoftmax | import torch
import torch.nn as nn
class BatchMeanCrossEntropyWithLogSoftmax(nn.Module):
def forward(self, y_hat, y):
return -(y_hat * y).sum(dim=1).mean(dim=0)
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | cadurosar/graph_kd_dense_cifar100 | BatchMeanCrossEntropyWithLogSoftmax | false | 1,622 | [
"MIT"
] | 0 | 84054ab4f8f61c9db3460993661ba7bf1d951b36 | https://github.com/cadurosar/graph_kd_dense_cifar100/tree/84054ab4f8f61c9db3460993661ba7bf1d951b36 |
GAT | import torch
from torch import nn
import torch.nn.functional as F
class GraphAttentionLayer(nn.Module):
"""
https://github.com/Diego999/pyGAT/blob/master/layers.py
Simple GAT layer, similar to https://arxiv.org/abs/1710.10903
"""
def __init__(self, in_features, out_features, dropout, alpha, batch... | 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.... | bpilseo/VLP_GAT | GAT | false | 1,623 | [
"MIT"
] | 0 | ca8a2594036ab8fe4a180e5ced87f59f8984e54f | https://github.com/bpilseo/VLP_GAT/tree/ca8a2594036ab8fe4a180e5ced87f59f8984e54f |
RemoveChannelMeanStd | import torch
class RemoveChannelMeanStd(torch.nn.Module):
def forward(self, x):
x2 = x.view(x.size(0), x.size(1), -1)
mean = x2.mean(dim=2).view(x.size(0), x.size(1), 1, 1)
std = x2.std(dim=2).view(x.size(0), x.size(1), 1, 1)
return (x - mean) / std
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
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | cadurosar/graph_kd_dense_cifar100 | RemoveChannelMeanStd | false | 1,624 | [
"MIT"
] | 0 | 84054ab4f8f61c9db3460993661ba7bf1d951b36 | https://github.com/cadurosar/graph_kd_dense_cifar100/tree/84054ab4f8f61c9db3460993661ba7bf1d951b36 |
BERTEmbedding2 | import torch
import torch.nn as nn
from itertools import chain as chain
import torch.utils.data
import torch.hub
import torch.nn.parallel
import torch.optim
class LearnedPositionalEmbedding2(nn.Module):
def __init__(self, d_model, max_len=512):
super().__init__()
pe = torch.zeros(max_len, d_model... | import torch
import 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 itertools import chain as chain
import torch.utils.data
import torch.hub
import torch.nn.parallel
import torch.op... | byeongjokim/LateTemporalModeling3DCNN_for_sign | BERTEmbedding2 | false | 1,625 | [
"MIT"
] | 0 | e3a802fcf91dc3930aea782464ee34d9b747d3ab | https://github.com/byeongjokim/LateTemporalModeling3DCNN_for_sign/tree/e3a802fcf91dc3930aea782464ee34d9b747d3ab |
PositionwiseFeedForward | import math
import torch
import torch.nn as nn
from itertools import chain as chain
import torch.utils.data
import torch.hub
import torch.nn.parallel
import torch.optim
class GELU(nn.Module):
"""
Paper Section 3.4, last paragraph notice that BERT used the GELU instead of RELU
"""
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.triton_helpers import libdevice
import math
import ... | byeongjokim/LateTemporalModeling3DCNN_for_sign | PositionwiseFeedForward | false | 1,626 | [
"MIT"
] | 0 | e3a802fcf91dc3930aea782464ee34d9b747d3ab | https://github.com/byeongjokim/LateTemporalModeling3DCNN_for_sign/tree/e3a802fcf91dc3930aea782464ee34d9b747d3ab |
Evidential_layer | import torch
import torch.nn as nn
class Evidential_layer(nn.Module):
def __init__(self, in_dim, num_classes):
super(Evidential_layer, self).__init__()
self.num_classes = num_classes
self.fc1 = nn.Linear(in_dim, 2 * self.num_classes)
self.relu = torch.nn.ReLU()
def forward(se... | 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_... | caisr-hh/DEED | Evidential_layer | false | 1,627 | [
"MIT"
] | 0 | 2a9edb1df31d99c1e8da177dec696d7c90c2e7de | https://github.com/caisr-hh/DEED/tree/2a9edb1df31d99c1e8da177dec696d7c90c2e7de |
NextSentencePrediction | import torch
import torch.nn as nn
from itertools import chain as chain
import torch.utils.data
import torch.hub
import torch.nn.parallel
import torch.optim
class NextSentencePrediction(nn.Module):
"""
2-class classification model : is_next, is_not_next
"""
def __init__(self, hidden):
"""
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | byeongjokim/LateTemporalModeling3DCNN_for_sign | NextSentencePrediction | false | 1,628 | [
"MIT"
] | 0 | e3a802fcf91dc3930aea782464ee34d9b747d3ab | https://github.com/byeongjokim/LateTemporalModeling3DCNN_for_sign/tree/e3a802fcf91dc3930aea782464ee34d9b747d3ab |
BatchMeanKLDivWithLogSoftmax | import torch
import torch.nn as nn
class BatchMeanKLDivWithLogSoftmax(nn.Module):
def forward(self, p, log_q, log_p):
return (p * log_p - p * log_q).sum(dim=1).mean(dim=0)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), torch.rand(
[4, 4, 4, 4])]
def get_init... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | cadurosar/graph_kd_dense_cifar100 | BatchMeanKLDivWithLogSoftmax | false | 1,629 | [
"MIT"
] | 0 | 84054ab4f8f61c9db3460993661ba7bf1d951b36 | https://github.com/cadurosar/graph_kd_dense_cifar100/tree/84054ab4f8f61c9db3460993661ba7bf1d951b36 |
BWCEWLoss | import torch
from torch import Tensor
from typing import Optional
from torch import nn
class BWCEWLoss(nn.Module):
""" Binary weighted cross entropy loss. """
def __init__(self, positive_class_weight: 'Optional[Tensor]'=None,
robust_lambda: 'int'=0, confidence_penalty: 'int'=0, **kwargs):
sup... | import torch
import triton
import triton.language 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 ... | carlogrisetti/ludwig | BWCEWLoss | false | 1,630 | [
"Apache-2.0"
] | 0 | 5c0887f14867e1577e0ddc3806c5cf7a781fb665 | https://github.com/carlogrisetti/ludwig/tree/5c0887f14867e1577e0ddc3806c5cf7a781fb665 |
ConvLayer | import torch
class ConvLayer(torch.nn.Module):
def __init__(self, in_features, out_features, kernel_size=1, stride=1):
super().__init__()
padding = kernel_size // 2
self.refpadding = torch.nn.ReflectionPad2d(padding)
self.conv = torch.nn.Conv2d(in_features, out_features, kernel_si... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_s... | bruchano/GTAVSelfDriving | ConvLayer | false | 1,631 | [
"MIT"
] | 0 | c5f929f793b48e47725dbdb8f0991e04e3c43eba | https://github.com/bruchano/GTAVSelfDriving/tree/c5f929f793b48e47725dbdb8f0991e04e3c43eba |
ReduceMax | import torch
class ReduceMax(torch.nn.Module):
def forward(self, inputs, mask=None):
return torch.amax(inputs, dim=1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | carlogrisetti/ludwig | ReduceMax | false | 1,632 | [
"Apache-2.0"
] | 0 | 5c0887f14867e1577e0ddc3806c5cf7a781fb665 | https://github.com/carlogrisetti/ludwig/tree/5c0887f14867e1577e0ddc3806c5cf7a781fb665 |
SingleLayer | import torch
import torch.nn as nn
class SingleLayer(nn.Module):
def __init__(self, nChannels, growthRate):
super(SingleLayer, self).__init__()
self.bn1 = nn.GroupNorm(nChannels, nChannels, affine=True)
self.conv1 = nn.Conv2d(nChannels, growthRate, kernel_size=3,
padding=1, bi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | cadurosar/graph_kd_dense_cifar100 | SingleLayer | false | 1,633 | [
"MIT"
] | 0 | 84054ab4f8f61c9db3460993661ba7bf1d951b36 | https://github.com/cadurosar/graph_kd_dense_cifar100/tree/84054ab4f8f61c9db3460993661ba7bf1d951b36 |
TransformerLayer | import math
import torch
import uuid
from torch import Tensor
import torch.nn as nn
from typing import Tuple
import torch.nn.functional as F
from typing import Optional
from typing import Dict
from torch.nn import Parameter
def gelu(x):
"""Implementation of the gelu activation function.
For information: Open... | 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.... | boxiangliu/esm | TransformerLayer | false | 1,634 | [
"MIT"
] | 0 | 3c143d99103e0ea38a9455f30a73cd9c87376606 | https://github.com/boxiangliu/esm/tree/3c143d99103e0ea38a9455f30a73cd9c87376606 |
my_Hingeloss | import torch
import torch.nn as nn
class my_Hingeloss(nn.Module):
def __init__(self):
super(my_Hingeloss, self).__init__()
def forward(self, output, target):
pos = torch.sum(output * target, 2)
neg = torch.max((1 - target) * output, 2)
loss = neg[0] - pos + 1
loss[los... | import torch
import triton
import triton.language 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... | carsault/chord_sequence_prediction | my_Hingeloss | false | 1,635 | [
"MIT"
] | 0 | 6eb539a963ca6350bcf0c88b8d8756775ad7c488 | https://github.com/carsault/chord_sequence_prediction/tree/6eb539a963ca6350bcf0c88b8d8756775ad7c488 |
SigmoidCrossEntropyLoss | import torch
from torch import Tensor
from typing import List
from typing import Optional
from typing import Union
from torch import nn
class SigmoidCrossEntropyLoss(nn.Module):
def __init__(self, class_weights: 'Optional[Union[Tensor, List]]'=None,
**kwargs):
"""
Params:
clas... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | carlogrisetti/ludwig | SigmoidCrossEntropyLoss | false | 1,636 | [
"Apache-2.0"
] | 0 | 5c0887f14867e1577e0ddc3806c5cf7a781fb665 | https://github.com/carlogrisetti/ludwig/tree/5c0887f14867e1577e0ddc3806c5cf7a781fb665 |
Explorer | import torch
import numpy as np
import torch.nn as nn
def init(module, weight_init, bias_init, gain=1):
weight_init(module.weight.data, gain=gain)
bias_init(module.bias.data)
return module
class Explorer(nn.Module):
def __init__(self, state_dim, max_action, exp_regularization):
super(Explor... | 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
... | baturaysaglam/DISCOVER | Explorer | false | 1,637 | [
"MIT"
] | 0 | 423158c84a5935ca5755ccad06ea5fe20fb57d76 | https://github.com/baturaysaglam/DISCOVER/tree/423158c84a5935ca5755ccad06ea5fe20fb57d76 |
ReduceLast | import torch
def sequence_length_3D(sequence: 'torch.Tensor') ->torch.Tensor:
used = torch.sign(torch.amax(torch.abs(sequence), dim=2))
length = torch.sum(used, 1)
length = length.int()
return length
class ReduceLast(torch.nn.Module):
def forward(self, inputs, mask=None):
batch_size = i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_stride = t... | carlogrisetti/ludwig | ReduceLast | false | 1,638 | [
"Apache-2.0"
] | 0 | 5c0887f14867e1577e0ddc3806c5cf7a781fb665 | https://github.com/carlogrisetti/ludwig/tree/5c0887f14867e1577e0ddc3806c5cf7a781fb665 |
Block | import torch
import torch.nn as nn
import torch.nn.functional as F
class RemoveChannelMeanStd(torch.nn.Module):
def forward(self, x):
x2 = x.view(x.size(0), x.size(1), -1)
mean = x2.mean(dim=2).view(x.size(0), x.size(1), 1, 1)
std = x2.std(dim=2).view(x.size(0), x.size(1), 1, 1)
r... | 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.... | cadurosar/graph_kd_dense_cifar100 | Block | false | 1,639 | [
"MIT"
] | 0 | 84054ab4f8f61c9db3460993661ba7bf1d951b36 | https://github.com/cadurosar/graph_kd_dense_cifar100/tree/84054ab4f8f61c9db3460993661ba7bf1d951b36 |
NPairsLoss | import torch
from torch import nn
class NPairsLoss(nn.Module):
def __init__(self, name):
super(NPairsLoss, self).__init__()
self.name = name
def forward(self, r1, r2):
"""
Computes the N-Pairs Loss between the r1 and r2 representations.
:param r1: Tensor of shape (bat... | 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.... | celsofranssa/PAWS | NPairsLoss | false | 1,640 | [
"MIT"
] | 0 | 3171c8a22990059f5d4c0e7e81cc0299a716efb2 | https://github.com/celsofranssa/PAWS/tree/3171c8a22990059f5d4c0e7e81cc0299a716efb2 |
CNNCifar | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.nn.functional as F
class CNNCifar(nn.Module):
def __init__(self, args):
super(CNNCifar, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Joey61Liuyi/Federated-Learning-PyTorch | CNNCifar | false | 1,641 | [
"MIT"
] | 0 | e95f096b18c5a1bf30fc0485acd5a15c84327f2e | https://github.com/Joey61Liuyi/Federated-Learning-PyTorch/tree/e95f096b18c5a1bf30fc0485acd5a15c84327f2e |
RMSELoss | import torch
import torch.nn as nn
class RMSELoss(nn.Module):
def __init__(self, eps=1e-08):
super(RMSELoss, self).__init__()
self.mse = nn.MSELoss()
self.eps = eps
def forward(self, y_hat, y):
return torch.sqrt(self.mse(y_hat, y) + self.eps)
def get_inputs():
return [t... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert... | cerisara/weibull-knowledge-informed-ml | RMSELoss | false | 1,642 | [
"MIT"
] | 0 | 19017817f5324fb1fffd8322d2d3567a6271948c | https://github.com/cerisara/weibull-knowledge-informed-ml/tree/19017817f5324fb1fffd8322d2d3567a6271948c |
MAPELoss | import torch
import torch.nn as nn
class MAPELoss(nn.Module):
def __init__(self, eps=1e-08):
super(MAPELoss, self).__init__()
self.eps = eps
def forward(self, y_hat, y):
return torch.mean(torch.abs(y - y_hat) / torch.abs(y + self.eps)) * 100
def get_inputs():
return [torch.rand... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | cerisara/weibull-knowledge-informed-ml | MAPELoss | false | 1,643 | [
"MIT"
] | 0 | 19017817f5324fb1fffd8322d2d3567a6271948c | https://github.com/cerisara/weibull-knowledge-informed-ml/tree/19017817f5324fb1fffd8322d2d3567a6271948c |
MY_NGM_FFNN | import random
import torch
import torch.nn as nn
from collections import defaultdict
import torch.nn.functional as F
import torch.optim as optim
class MY_NGM_FFNN(nn.Module):
def __init__(self, alpha, input_dim, hidden1_dim, hidden2_dim,
output_dim, device=torch.device('cpu')):
super(MY_NGM_FFNN,... | 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.... | calpoly-bioinf/knowledge_driven_modeling | MY_NGM_FFNN | false | 1,644 | [
"MIT"
] | 0 | dbe55d5bb07f7c5a1834a21fde8833f295e3ac96 | https://github.com/calpoly-bioinf/knowledge_driven_modeling/tree/dbe55d5bb07f7c5a1834a21fde8833f295e3ac96 |
Discriminator | import torch
import torch.nn as nn
import torch.nn.functional as F
class Discriminator(nn.Module):
def __init__(self, n_layersDecod, hidden_size, output_size=2):
super(Discriminator, self).__init__()
self.map1 = nn.Linear(n_layersDecod * hidden_size, hidden_size)
self.map2 = nn.Linear(hid... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | carsault/chord_sequence_prediction | Discriminator | false | 1,645 | [
"MIT"
] | 0 | 6eb539a963ca6350bcf0c88b8d8756775ad7c488 | https://github.com/carsault/chord_sequence_prediction/tree/6eb539a963ca6350bcf0c88b8d8756775ad7c488 |
NeuralNet | import torch
class NeuralNet(torch.nn.Module):
def __init__(self, input_size, output_size, hidden_size, lr=0.0001):
super(NeuralNet, self).__init__()
self.input_size = input_size
self.hidden_size = hidden_size
self.output_size = output_size
self.HiddenLayer = torch.nn.Line... | 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.... | bva-bme/Constrained_Policy_Gradient | NeuralNet | false | 1,646 | [
"MIT"
] | 0 | 2331f55ff3bf06e2276662517c34cc45d5a51da8 | https://github.com/bva-bme/Constrained_Policy_Gradient/tree/2331f55ff3bf06e2276662517c34cc45d5a51da8 |
RMSLELoss | import torch
import torch.nn as nn
class RMSLELoss(nn.Module):
def __init__(self, eps=1e-08):
super(RMSLELoss, self).__init__()
self.mse = nn.MSELoss()
self.eps = eps
def forward(self, y_hat, y):
return torch.sqrt(self.mse(torch.log(y_hat + 1), torch.log(y + 1)) +
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | cerisara/weibull-knowledge-informed-ml | RMSLELoss | false | 1,647 | [
"MIT"
] | 0 | 19017817f5324fb1fffd8322d2d3567a6271948c | https://github.com/cerisara/weibull-knowledge-informed-ml/tree/19017817f5324fb1fffd8322d2d3567a6271948c |
BERTEmbedding4 | import torch
import torch.nn as nn
from itertools import chain as chain
import torch.utils.data
import torch.hub
import torch.nn.parallel
import torch.optim
class LearnedPositionalEmbedding3(nn.Module):
def __init__(self, d_model, max_len=512):
super().__init__()
pe = torch.zeros(max_len, d_model... | import torch
import 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 itertools import chain as chain
import torch.utils.data
import torch.hub
import torch.nn.parallel
import torch.op... | byeongjokim/LateTemporalModeling3DCNN_for_sign | BERTEmbedding4 | false | 1,648 | [
"MIT"
] | 0 | e3a802fcf91dc3930aea782464ee34d9b747d3ab | https://github.com/byeongjokim/LateTemporalModeling3DCNN_for_sign/tree/e3a802fcf91dc3930aea782464ee34d9b747d3ab |
SpaceToBatch | import torch
import torch.nn as nn
import torch.utils.data
class SpaceToDim(nn.Module):
def __init__(self, scale_factor, dims=(-2, -1), dim=0):
super(SpaceToDim, self).__init__()
self.scale_factor = scale_factor
self.dims = dims
self.dim = dim
def forward(self, x):
_s... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | cestcedric/TSSR-GAN | SpaceToBatch | false | 1,649 | [
"BSD-2-Clause",
"MIT"
] | 0 | d6e1b50409e0f0591660552993e6d5b70d41e766 | https://github.com/cestcedric/TSSR-GAN/tree/d6e1b50409e0f0591660552993e6d5b70d41e766 |
RpowInt | import torch
class RpowInt(torch.nn.Module):
def __init__(self):
super(RpowInt, self).__init__()
def forward(self, x):
return 2 ** x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | bunderhi/torch2trt | RpowInt | false | 1,650 | [
"MIT"
] | 0 | fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d | https://github.com/bunderhi/torch2trt/tree/fa5e31e742a0f0c9a9ee38909a6fa56bb07ba96d |
Perplexity | import torch
from torch import nn as nn
from torch.nn.modules.loss import CrossEntropyLoss
class Perplexity(CrossEntropyLoss):
__constants__ = ['weight', 'ignore_index', 'reduction']
def __init__(self, weight=None, size_average=None, ignore_index=-100,
reduce=None):
super(Perplexity, 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 import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn a... | cesarali/Tyche | Perplexity | false | 1,651 | [
"MIT"
] | 0 | d892df9e0b982f538ae38221ff5848f6d726a4fb | https://github.com/cesarali/Tyche/tree/d892df9e0b982f538ae38221ff5848f6d726a4fb |
NoiseInjection | import torch
from torch import nn
class NoiseInjection(nn.Module):
def __init__(self, channel):
super().__init__()
self.weight = nn.Parameter(torch.zeros(1, channel, 1, 1))
def forward(self, image, noise):
return image + self.weight * noise
def get_inputs():
return [torch.rand(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | celdeldel/style_conditionnal_gan | NoiseInjection | false | 1,652 | [
"MIT"
] | 0 | 3a4623560af1e12d46e2f9ffa9726c29df9d5680 | https://github.com/celdeldel/style_conditionnal_gan/tree/3a4623560af1e12d46e2f9ffa9726c29df9d5680 |
Stub | import torch
import torch.nn as nn
import torch.utils.data
class Stub(nn.Module):
def __init__(self, shape):
super(Stub, self).__init__()
self.shape = shape
return
def forward(self, x):
return x.new_ones(self.shape)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | cestcedric/TSSR-GAN | Stub | false | 1,653 | [
"BSD-2-Clause",
"MIT"
] | 0 | d6e1b50409e0f0591660552993e6d5b70d41e766 | https://github.com/cestcedric/TSSR-GAN/tree/d6e1b50409e0f0591660552993e6d5b70d41e766 |
FusedDownsample | import torch
from torch import nn
from torch.nn import functional as F
from math import sqrt
class FusedDownsample(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, padding=0):
super().__init__()
weight = torch.randn(out_channel, in_channel, kernel_size, kernel_size)
bi... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from math import sqrt
assert_size_stride = torch._C._dynamo... | celdeldel/style_conditionnal_gan | FusedDownsample | false | 1,654 | [
"MIT"
] | 0 | 3a4623560af1e12d46e2f9ffa9726c29df9d5680 | https://github.com/celdeldel/style_conditionnal_gan/tree/3a4623560af1e12d46e2f9ffa9726c29df9d5680 |
CustomReLU | import torch
import torch.nn as nn
class CustomReLU(nn.Module):
def __init__(self, max_z=6.0):
super(CustomReLU, self).__init__()
self.max_z = max_z
def forward(self, x):
return torch.clamp(x, min=0, max=self.max_z)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | charlesmackin/tiny | CustomReLU | false | 1,655 | [
"Apache-2.0"
] | 0 | bf8afc5cfc15e12efdd3bca0d559adfdfc435981 | https://github.com/charlesmackin/tiny/tree/bf8afc5cfc15e12efdd3bca0d559adfdfc435981 |
FusedUpsample | import torch
from torch import nn
from torch.nn import functional as F
from math import sqrt
class FusedUpsample(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, padding=0):
super().__init__()
weight = torch.randn(in_channel, out_channel, kernel_size, kernel_size)
bias... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
from math import sqrt
assert_size_stride = torch._C._dynamo... | celdeldel/style_conditionnal_gan | FusedUpsample | false | 1,656 | [
"MIT"
] | 0 | 3a4623560af1e12d46e2f9ffa9726c29df9d5680 | https://github.com/celdeldel/style_conditionnal_gan/tree/3a4623560af1e12d46e2f9ffa9726c29df9d5680 |
_UpsampleLinear | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class _UpsampleLinear(nn.Module):
def __init__(self, scale):
super(_UpsampleLinear, self).__init__()
self._mode = 'linear', 'bilinear', 'trilinear'
self.scale = scale
def forward(self, x, scale... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guard... | cestcedric/TSSR-GAN | _UpsampleLinear | false | 1,657 | [
"BSD-2-Clause",
"MIT"
] | 0 | d6e1b50409e0f0591660552993e6d5b70d41e766 | https://github.com/cestcedric/TSSR-GAN/tree/d6e1b50409e0f0591660552993e6d5b70d41e766 |
FlawDetectorCriterion | import torch
import torch.nn as nn
import torch.nn.functional as F
class FlawDetectorCriterion(nn.Module):
""" Criterion of the flaw detector.
"""
def __init__(self):
super(FlawDetectorCriterion, self).__init__()
def forward(self, pred, gt, is_ssl=False, reduction=True):
loss = F.mse... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | charlesCXK/PixelSSL | FlawDetectorCriterion | false | 1,658 | [
"Apache-2.0"
] | 0 | 2e85e12c1db5b24206bfbbf2d7f6348ae82b2105 | https://github.com/charlesCXK/PixelSSL/tree/2e85e12c1db5b24206bfbbf2d7f6348ae82b2105 |
ActivationNoise | import torch
import torch.nn as nn
class ActivationNoise(nn.Module):
"""Gaussian noise regularizer.
Args:
sigma (float, optional): relative standard deviation used to generate the
noise. Relative means that it will be multiplied by the magnitude of
the value your are adding th... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | charlesmackin/tiny | ActivationNoise | false | 1,659 | [
"Apache-2.0"
] | 0 | bf8afc5cfc15e12efdd3bca0d559adfdfc435981 | https://github.com/charlesmackin/tiny/tree/bf8afc5cfc15e12efdd3bca0d559adfdfc435981 |
MeanVoxelFeatureExtractor | import torch
import torch.nn as nn
class VoxelFeatureExtractor(nn.Module):
def __init__(self, **kwargs):
super().__init__()
def get_output_feature_dim(self):
raise NotImplementedError
def forward(self, **kwargs):
raise NotImplementedError
class MeanVoxelFeatureExtractor(VoxelF... | import torch
import 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... | charlesyz/PCDet | MeanVoxelFeatureExtractor | false | 1,660 | [
"Apache-2.0"
] | 0 | 1eb6b1dc5a3d563d7532b1c8ee3be007cbeafc80 | https://github.com/charlesyz/PCDet/tree/1eb6b1dc5a3d563d7532b1c8ee3be007cbeafc80 |
make_dilation_dense | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
class make_dilation_dense(nn.Module):
def __init__(self, nChannels, growthRate, kernel_size=3):
super(make_dilation_dense, self).__init__()
self.conv = nn.Conv2d(nChannels, growthRate, 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
import ... | cestcedric/TSSR-GAN | make_dilation_dense | false | 1,661 | [
"BSD-2-Clause",
"MIT"
] | 0 | d6e1b50409e0f0591660552993e6d5b70d41e766 | https://github.com/cestcedric/TSSR-GAN/tree/d6e1b50409e0f0591660552993e6d5b70d41e766 |
SelfAttentionRE | import torch
import torch.nn.functional as F
from torch import nn
class SelfAttentionRE(nn.Module):
def __init__(self, emb_dim):
super().__init__()
self.query_mlp = nn.Linear(in_features=emb_dim, out_features=1)
self.value_mlp = nn.Linear(in_features=emb_dim, out_features=emb_dim)
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | chaitanya2334/lsm | SelfAttentionRE | false | 1,662 | [
"MIT"
] | 0 | 504c732238b419cd77e7e0a97af040778ee9c7dd | https://github.com/chaitanya2334/lsm/tree/504c732238b419cd77e7e0a97af040778ee9c7dd |
FFN | import torch
import torch.nn as nn
from collections import OrderedDict
class FFN(nn.Module):
def __init__(self, layer_arch, input_size, output_size, bias=True):
super(FFN, self).__init__()
self.layer_arch = layer_arch
self.input_size = input_size
self.output_size = output_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
from co... | charlesxin97/ToolFinder_binder | FFN | false | 1,663 | [
"Apache-2.0"
] | 0 | 49467d5519adcd6d881e57d460c97c37b6a45add | https://github.com/charlesxin97/ToolFinder_binder/tree/49467d5519adcd6d881e57d460c97c37b6a45add |
FCDiscriminatorCriterion | import torch
import torch.nn as nn
import torch.nn.functional as F
class FCDiscriminatorCriterion(nn.Module):
def __init__(self):
super(FCDiscriminatorCriterion, self).__init__()
def forward(self, pred, gt):
loss = F.binary_cross_entropy_with_logits(pred, gt, reduction='none')
return... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | charlesCXK/PixelSSL | FCDiscriminatorCriterion | false | 1,664 | [
"Apache-2.0"
] | 0 | 2e85e12c1db5b24206bfbbf2d7f6348ae82b2105 | https://github.com/charlesCXK/PixelSSL/tree/2e85e12c1db5b24206bfbbf2d7f6348ae82b2105 |
PolicyNetwork | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
class PolicyNetwork(nn.Module):
def __init__(self, num_inputs, num_actions, hidden_size, action_range=
1.0, init_w=0.003, log_std_min=-20, log_std_max=2):
super(PolicyNetwo... | 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.... | chagri/SOTA-RL-Algorithms | PolicyNetwork | false | 1,665 | [
"Apache-2.0"
] | 0 | 58b416e7c706d8426dc402482e72ca7283568e71 | https://github.com/chagri/SOTA-RL-Algorithms/tree/58b416e7c706d8426dc402482e72ca7283568e71 |
TemporalAggregation_Mean | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
from math import sqrt as sqrt
from itertools import product as product
class TemporalAggregation_Mean(nn.Module):
def __init__(self, cfg):
super(TemporalAggregation_Mean, self).__init__()
self.K = cfg.K
def forw... | import torch
import 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 math import sqrt as sqrt
from itertools import product as product
assert_size_stride = torch._C._dynamo.guards.as... | burhanmudassar/pytorch-action-detection | TemporalAggregation_Mean | false | 1,666 | [
"MIT"
] | 0 | 16afb9312248d73c0e2be56ac733e0a33040307e | https://github.com/burhanmudassar/pytorch-action-detection/tree/16afb9312248d73c0e2be56ac733e0a33040307e |
GlobalMaxPool1D | import torch
import torch.nn.functional as functional
class GlobalMaxPool1D(torch.nn.Module):
def __init__(self):
super(GlobalMaxPool1D, self).__init__()
def forward(self, x):
"""
x shape: (batch_size, channel, seq_len)
return shape: (batch_size, channel, 1)
"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | charliemorning/mlws | GlobalMaxPool1D | false | 1,667 | [
"MIT"
] | 0 | 8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784 | https://github.com/charliemorning/mlws/tree/8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784 |
GlobalAvgPool1D | import torch
import torch.nn.functional as functional
class GlobalAvgPool1D(torch.nn.Module):
def __init__(self):
super(GlobalAvgPool1D, self).__init__()
def forward(self, x):
"""
x shape: (batch_size, channel, seq_len)
return shape: (batch_size, channel, 1)
"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret... | charliemorning/mlws | GlobalAvgPool1D | false | 1,668 | [
"MIT"
] | 0 | 8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784 | https://github.com/charliemorning/mlws/tree/8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784 |
Mask | import torch
import torch.nn as nn
class Mask(nn.Module):
def forward(self, seq, mask):
seq_mask = torch.unsqueeze(mask, 2)
seq_mask = torch.transpose(seq_mask.repeat(1, 1, seq.size()[1]), 1, 2)
return seq.where(torch.eq(seq_mask, 1), torch.zeros_like(seq))
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.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | charliemorning/mlws | Mask | false | 1,669 | [
"MIT"
] | 0 | 8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784 | https://github.com/charliemorning/mlws/tree/8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784 |
Network | import torch
import torch.nn as nn
import torch.nn.functional as F
class Network(nn.Module):
def __init__(self, input_size, nb_action):
super(Network, self).__init__()
self.input_size = input_size
self.nb_action = nb_action
self.fc1 = nn.Linear(input_size, 32)
self.fc2 = 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_... | cheapmouse94/Machine_Learning-Gates-python | Network | false | 1,670 | [
"MIT"
] | 0 | 1e159ccf8f9a5db9104fa3926b85750787676e15 | https://github.com/cheapmouse94/Machine_Learning-Gates-python/tree/1e159ccf8f9a5db9104fa3926b85750787676e15 |
FeedForwardNN | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class FeedForwardNN(nn.Module):
"""
A standard in_dim-64-64-out_dim Feed Forward Neural Network.
"""
def __init__(self, in_dim, out_dim):
"""
Initialize the network and set up the layers.
Parameters:
i... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | chenjun-110/WZCQ | FeedForwardNN | false | 1,671 | [
"Apache-2.0"
] | 0 | e2de7743ad671e8632cfa084638555d7f1deb42f | https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f |
MLPEncoder | import torch
import torch.nn as nn
import torch.nn.functional as F
class MLPEncoder(nn.Module):
def __init__(self, d_in, d_out):
super(MLPEncoder, self).__init__()
H1 = 100
H2 = 10
self.d_in = d_in
self.l1 = nn.Linear(d_in, H1)
self.l11 = nn.Linear(H1, H2)
... | 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.... | cheng-xie/motionEncode | MLPEncoder | false | 1,672 | [
"MIT"
] | 0 | fa2152b3eaf2e09ad9477d054566db0a7bc4c7b4 | https://github.com/cheng-xie/motionEncode/tree/fa2152b3eaf2e09ad9477d054566db0a7bc4c7b4 |
posFFN1d | import torch
from torch import nn
class posFFN1d(nn.Module):
def __init__(self, d_hid, d_inner_hid, window=1, dropout=0.1):
super().__init__()
self.w_1 = nn.Conv1d(d_hid, d_inner_hid, kernel_size=window)
self.relu = nn.ReLU()
self.w_2 = nn.Conv1d(d_inner_hid, d_hid, kernel_size=wi... | 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.... | chaitanya2334/lsm | posFFN1d | false | 1,673 | [
"MIT"
] | 0 | 504c732238b419cd77e7e0a97af040778ee9c7dd | https://github.com/chaitanya2334/lsm/tree/504c732238b419cd77e7e0a97af040778ee9c7dd |
BaseModel | import torch
from torchvision.transforms import *
import torch.nn as nn
import torch.nn.functional as F
class BaseModel(nn.Module):
def __init__(self, num_classes):
super().__init__()
self.conv1 = nn.Conv2d(3, 32, kernel_size=7, stride=1)
self.conv2 = nn.Conv2d(32, 64, kernel_size=3, stri... | 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 torchvision.transforms i... | bsm8734/BC_stage1_Image_Classification | BaseModel | false | 1,674 | [
"MIT"
] | 0 | f915a6fb6748bd9041b1dc2e917d732e202e9cc3 | https://github.com/bsm8734/BC_stage1_Image_Classification/tree/f915a6fb6748bd9041b1dc2e917d732e202e9cc3 |
LinearCombine | import torch
import torch.nn as nn
import torch.nn.functional as F
class LinearCombine(nn.Module):
def __init__(self, layers_num, trainable=True, input_aware=False,
word_level=False):
super(LinearCombine, self).__init__()
self.input_aware = input_aware
self.word_level = word_level... | import torch
import triton
import triton.language 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... | charliemorning/mlws | LinearCombine | false | 1,675 | [
"MIT"
] | 0 | 8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784 | https://github.com/charliemorning/mlws/tree/8e9bad59ca9f5e774cc1ae7fe454ff3b8a8e1784 |
autoencoder | import torch
import torch.nn.functional as F
class autoencoder(torch.nn.Module):
def __init__(self, inputDim):
"""
In the constructor we instantiate two nn.Linear modules and assign them as
member variables.
"""
h_size = 128
c_size = 8
use_bias = True
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C... | charlesmackin/tiny | autoencoder | false | 1,676 | [
"Apache-2.0"
] | 0 | bf8afc5cfc15e12efdd3bca0d559adfdfc435981 | https://github.com/charlesmackin/tiny/tree/bf8afc5cfc15e12efdd3bca0d559adfdfc435981 |
MLPDecoder | import torch
import torch.nn as nn
import torch.nn.functional as F
class MLPDecoder(nn.Module):
def __init__(self, d_in, d_out):
super(MLPDecoder, self).__init__()
H1 = 10
H2 = 100
self._d_in = d_in
self._d_out = d_out
self.l1 = nn.Linear(d_in, H1)
self.l11... | 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_... | cheng-xie/motionEncode | MLPDecoder | false | 1,677 | [
"MIT"
] | 0 | fa2152b3eaf2e09ad9477d054566db0a7bc4c7b4 | https://github.com/cheng-xie/motionEncode/tree/fa2152b3eaf2e09ad9477d054566db0a7bc4c7b4 |
AE | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
import torch.utils.data
class AE(nn.Module):
""" Class for the AE using Fully Connected
"""
def __init__(self, opt):
super().__init__()
assert opt.isize % 4 == 0, 'input size has to be a multiple of 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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | cerbero94/GAN_CP | AE | false | 1,678 | [
"MIT"
] | 0 | e255f5f5b3733c55d47997c1ffc4161529701f8a | https://github.com/cerbero94/GAN_CP/tree/e255f5f5b3733c55d47997c1ffc4161529701f8a |
my_BinaryCross | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class my_BinaryCross(nn.Module):
def __init__(self, args):
super(my_BinaryCross, self).__init__()
self.args = args
def forward(self, output, target, beat):
modif_beat = 1.0 / torch.exp(beat) * 10
... | import torch
import triton
import triton.language 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
... | carsault/chord_sequence_prediction | my_BinaryCross | false | 1,679 | [
"MIT"
] | 0 | 6eb539a963ca6350bcf0c88b8d8756775ad7c488 | https://github.com/carsault/chord_sequence_prediction/tree/6eb539a963ca6350bcf0c88b8d8756775ad7c488 |
GATLayer | from torch.nn import Module
import torch
import torch.nn.functional as F
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
class GATLayer(Module):
def __init__(self, input_channel, output_channel, use_bias=True):
super(GATLayer, self).__init__()
self.use_bias = u... | 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.... | chengsilin/Graph_model | GATLayer | false | 1,680 | [
"MIT"
] | 0 | 0d9714a8b02196fabf5b0ecd0680b7269a22c53b | https://github.com/chengsilin/Graph_model/tree/0d9714a8b02196fabf5b0ecd0680b7269a22c53b |
FeedForward | import math
import torch
import numpy as np
import torch.nn as nn
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class 全连接层(nn.Module):
def __init__(self, 输入_接口, 输出_接口):
super().__init__()
np.random.seed(1)
self.weig... | 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 math
import ... | chenjun-110/WZCQ | FeedForward | false | 1,681 | [
"Apache-2.0"
] | 0 | e2de7743ad671e8632cfa084638555d7f1deb42f | https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f |
L1Part | import torch
import torch.nn as nn
from itertools import chain as chain
import torch.utils.data
from collections import OrderedDict
import torch.hub
import torch.nn.parallel
import torch.optim
class concatLayer(nn.Module):
def __init__(self, in_channels, out_channels_perSub, i, j, appendix):
super(concat... | 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 itertools import chain as chain
import torch.utils.da... | byeongjokim/LateTemporalModeling3DCNN_for_sign | L1Part | false | 1,682 | [
"MIT"
] | 0 | e3a802fcf91dc3930aea782464ee34d9b747d3ab | https://github.com/byeongjokim/LateTemporalModeling3DCNN_for_sign/tree/e3a802fcf91dc3930aea782464ee34d9b747d3ab |
判断状态 | import math
import torch
import numpy as np
import torch.nn as nn
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 *
torch.pow(x, 3))))
class 全连接层(nn.Module):
def __init__(self, 输入_接口, 输出_接口):
super().__init__()
np.random.seed(1)
self.weig... | 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 math
import ... | chenjun-110/WZCQ | 判断状态 | false | 1,683 | [
"Apache-2.0"
] | 0 | e2de7743ad671e8632cfa084638555d7f1deb42f | https://github.com/chenjun-110/WZCQ/tree/e2de7743ad671e8632cfa084638555d7f1deb42f |
SoftDiceLoss | import torch
from torch.utils.data.sampler import *
import torch.nn as nn
import torch.nn.functional as F
class SoftDiceLoss(nn.Module):
def __init__(self, weight=None, size_average=True):
super(SoftDiceLoss, self).__init__()
def forward(self, logits, targets):
num = targets.size(0)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.utils.data.sampler import *
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | chicm/carvana | SoftDiceLoss | false | 1,684 | [
"Apache-2.0"
] | 0 | 493a19fbb2fdab1cc1b4b95d97742684e4144229 | https://github.com/chicm/carvana/tree/493a19fbb2fdab1cc1b4b95d97742684e4144229 |
ScaledDotProductAttention | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.utils.checkpoint
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature = temperature
self.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.... | chenxiaoyu523/FEAT3D | ScaledDotProductAttention | false | 1,685 | [
"MIT"
] | 0 | ba45ba7c26628a7cc0070b010f4f33893cdac926 | https://github.com/chenxiaoyu523/FEAT3D/tree/ba45ba7c26628a7cc0070b010f4f33893cdac926 |
BCELoss2d | import torch
from torch.utils.data.sampler import *
import torch.nn as nn
import torch.nn.functional as F
class BCELoss2d(nn.Module):
def __init__(self, weight=None, size_average=True):
super(BCELoss2d, self).__init__()
self.bce_loss = nn.BCELoss(weight, size_average)
def forward(self, logit... | import torch
import triton
import triton.language 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.... | chicm/carvana | BCELoss2d | false | 1,686 | [
"Apache-2.0"
] | 0 | 493a19fbb2fdab1cc1b4b95d97742684e4144229 | https://github.com/chicm/carvana/tree/493a19fbb2fdab1cc1b4b95d97742684e4144229 |
L2Part | import torch
import torch.nn as nn
from itertools import chain as chain
import torch.utils.data
from collections import OrderedDict
import torch.hub
import torch.nn.parallel
import torch.optim
class concatLayer(nn.Module):
def __init__(self, in_channels, out_channels_perSub, i, j, appendix):
super(concat... | 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 itertools import chain as chain
import torch.utils.da... | byeongjokim/LateTemporalModeling3DCNN_for_sign | L2Part | false | 1,687 | [
"MIT"
] | 0 | e3a802fcf91dc3930aea782464ee34d9b747d3ab | https://github.com/byeongjokim/LateTemporalModeling3DCNN_for_sign/tree/e3a802fcf91dc3930aea782464ee34d9b747d3ab |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.