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 |
|---|---|---|---|---|---|---|---|---|---|---|
TorchMod | import torch
class TorchMod(torch.nn.Module):
def __init__(self):
super(TorchMod, self).__init__()
def forward(self, x, y):
return torch.fmod(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... | NVIDIA-AI-IOT-private/torch2trt | TorchMod | false | 10,536 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
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... | NVIDIA-AI-IOT-private/torch2trt | TorchDiv | false | 10,537 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TensorClampMin | import torch
class TensorClampMin(torch.nn.Module):
def forward(self, x):
return x.clamp_min(-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... | NVIDIA-AI-IOT-private/torch2trt | TensorClampMin | false | 10,538 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
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... | NVIDIA-AI-IOT-private/torch2trt | RpowInt | false | 10,539 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
NotEqual | import torch
class NotEqual(torch.nn.Module):
def __init__(self):
super(NotEqual, 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... | NVIDIA-AI-IOT-private/torch2trt | NotEqual | false | 10,540 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
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... | NVIDIA-AI-IOT-private/torch2trt | Sub | false | 10,541 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TorchFloorDiv | import torch
class TorchFloorDiv(torch.nn.Module):
def __init__(self):
super(TorchFloorDiv, self).__init__()
def forward(self, x, y):
return torch.floor_divide(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... | NVIDIA-AI-IOT-private/torch2trt | TorchFloorDiv | false | 10,542 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
RAddInt | import torch
class RAddInt(torch.nn.Module):
def __init__(self):
super(RAddInt, 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... | NVIDIA-AI-IOT-private/torch2trt | RAddInt | false | 10,543 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TorchClampOptionMax | import torch
class TorchClampOptionMax(torch.nn.Module):
def forward(self, x):
return torch.clamp(x, 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... | NVIDIA-AI-IOT-private/torch2trt | TorchClampOptionMax | false | 10,544 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TorchNotEqual | import torch
class TorchNotEqual(torch.nn.Module):
def __init__(self):
super(TorchNotEqual, self).__init__()
def forward(self, x, y):
return torch.ne(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... | NVIDIA-AI-IOT-private/torch2trt | TorchNotEqual | false | 10,545 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
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... | NVIDIA-AI-IOT-private/torch2trt | Pow | false | 10,546 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TorchMul | import torch
class TorchMul(torch.nn.Module):
def __init__(self):
super(TorchMul, self).__init__()
def forward(self, x, y):
return torch.mul(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... | NVIDIA-AI-IOT-private/torch2trt | TorchMul | false | 10,547 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
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... | NVIDIA-AI-IOT-private/torch2trt | TorchPow | false | 10,548 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
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... | NVIDIA-AI-IOT-private/torch2trt | RDivFloat | false | 10,549 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
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... | NVIDIA-AI-IOT-private/torch2trt | TorchSub | false | 10,550 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
TorchAdd | import torch
class TorchAdd(torch.nn.Module):
def __init__(self):
super(TorchAdd, self).__init__()
def forward(self, x, y):
return torch.add(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... | NVIDIA-AI-IOT-private/torch2trt | TorchAdd | false | 10,551 | [
"MIT"
] | 0 | 953d60039e0c81e90eea467c3df2e6e3f7040242 | https://github.com/NVIDIA-AI-IOT-private/torch2trt/tree/953d60039e0c81e90eea467c3df2e6e3f7040242 |
WassersteinGeneratorLoss | import torch
import torch.nn as nn
import torch.autograd
import torch.utils.data
def reduce(x, reduction=None):
"""Applies reduction on a torch.Tensor.
Args:
x (torch.Tensor): The tensor on which reduction is to be applied.
reduction (str, optional): The reduction to be applied. If ``mean`` 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
import torch.nn as nn
import torch.autograd
import torch.utils.data
assert_size_stride = ... | kayuksel/torchgan | WassersteinGeneratorLoss | false | 10,552 | [
"MIT"
] | 0 | 739d97cef4c49fb80155de84e609471efafab107 | https://github.com/kayuksel/torchgan/tree/739d97cef4c49fb80155de84e609471efafab107 |
MinimaxDiscriminatorLoss | import torch
import torch.nn as nn
import torch.autograd
import torch.utils.data
import torch.nn.functional as F
def minimax_discriminator_loss(dx, dgz, label_smoothing=0.0, reduction='mean'):
target_ones = torch.ones_like(dgz) * (1.0 - label_smoothing)
target_zeros = torch.zeros_like(dx)
loss = F.binary_... | import torch
import triton
import triton.language 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... | kayuksel/torchgan | MinimaxDiscriminatorLoss | false | 10,553 | [
"MIT"
] | 0 | 739d97cef4c49fb80155de84e609471efafab107 | https://github.com/kayuksel/torchgan/tree/739d97cef4c49fb80155de84e609471efafab107 |
WassersteinDiscriminatorLoss | import torch
import torch.nn as nn
import torch.autograd
import torch.utils.data
def reduce(x, reduction=None):
"""Applies reduction on a torch.Tensor.
Args:
x (torch.Tensor): The tensor on which reduction is to be applied.
reduction (str, optional): The reduction to be applied. If ``mean`` 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
import torch.nn as nn
import torch.autograd
import torch.utils.data
assert_size_stride = ... | kayuksel/torchgan | WassersteinDiscriminatorLoss | false | 10,554 | [
"MIT"
] | 0 | 739d97cef4c49fb80155de84e609471efafab107 | https://github.com/kayuksel/torchgan/tree/739d97cef4c49fb80155de84e609471efafab107 |
VirtualBatchNorm | import torch
import torch.nn as nn
import torch.autograd
import torch.utils.data
class VirtualBatchNorm(nn.Module):
"""Virtual Batch Normalization Module as proposed in the paper
`"Improved Techniques for Training GANs by Salimans et. al." <https://arxiv.org/abs/1805.08318>`_
Performs Normalizes the feat... | import torch
import triton
import triton.language 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.autograd
import torch.utils.data
assert_size... | kayuksel/torchgan | VirtualBatchNorm | false | 10,555 | [
"MIT"
] | 0 | 739d97cef4c49fb80155de84e609471efafab107 | https://github.com/kayuksel/torchgan/tree/739d97cef4c49fb80155de84e609471efafab107 |
ConvCIFAR | import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvCIFAR(nn.Module):
def __init__(self):
super(ConvCIFAR, self).__init__()
self.conv1 = nn.Conv2d(3, 16, 3, padding=1)
self.conv2 = nn.Conv2d(16, 32, 3, padding=1)
self.conv3 = nn.Conv2d(32, 64, 3, padding=1... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | mnguyen0226/soo_non_convex_ml | ConvCIFAR | false | 10,556 | [
"MIT"
] | 0 | 2ffbedbe5eb536e017c643f725cc08551a5b1e9f | https://github.com/mnguyen0226/soo_non_convex_ml/tree/2ffbedbe5eb536e017c643f725cc08551a5b1e9f |
GGCL_D | 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 GGCL_D(Module):
"""Graph Gaussian Convolution Layer (GGCL) when the input is distribution"""
def __init__(self, in_features, out_features, dropout... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | marblet/DeepRobust | GGCL_D | false | 10,557 | [
"MIT"
] | 0 | 126c05818e38062c2423cd40dc8937ccc43c738b | https://github.com/marblet/DeepRobust/tree/126c05818e38062c2423cd40dc8937ccc43c738b |
Autoencoder | import torch
import torch.nn as nn
import torch.nn.functional as F
class Autoencoder(nn.Module):
def __init__(self, input_length, output_length=None, neuron_multiplier=
1, sigmoid=False, drop=False, drop_pct=0.3):
"""
Dense autoencoder.
Args:
input_length (in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | mariajmolina/ML-for-S2S | Autoencoder | false | 10,558 | [
"MIT"
] | 0 | 3de32e72042ba7e8b37a433579fa9c5630246d8c | https://github.com/mariajmolina/ML-for-S2S/tree/3de32e72042ba7e8b37a433579fa9c5630246d8c |
GGCL_F | 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 GGCL_F(Module):
"""Graph Gaussian Convolution Layer (GGCL) when the input is feature"""
def __init__(self, in_features, out_features, dropout=0.6)... | 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.... | marblet/DeepRobust | GGCL_F | false | 10,559 | [
"MIT"
] | 0 | 126c05818e38062c2423cd40dc8937ccc43c738b | https://github.com/marblet/DeepRobust/tree/126c05818e38062c2423cd40dc8937ccc43c738b |
MinibatchDiscrimination1d | import torch
import torch.nn as nn
import torch.autograd
import torch.utils.data
class MinibatchDiscrimination1d(nn.Module):
"""1D Minibatch Discrimination Module as proposed in the paper `"Improved Techniques for
Training GANs by Salimans et. al." <https://arxiv.org/abs/1805.08318>`_
Allows the Discrimi... | 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 torch.... | kayuksel/torchgan | MinibatchDiscrimination1d | false | 10,560 | [
"MIT"
] | 0 | 739d97cef4c49fb80155de84e609471efafab107 | https://github.com/kayuksel/torchgan/tree/739d97cef4c49fb80155de84e609471efafab107 |
Generator | import torch
import torch.nn as nn
import torch.nn.functional as F
class Generator(nn.Module):
"""Define standard linear + softmax generation step."""
def __init__(self, emb_size, vocab_size):
super(Generator, self).__init__()
self.proj = nn.Linear(emb_size, vocab_size, bias=False)
def f... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | msobrevillac/Multilingual-RDF-Verbalizer | Generator | false | 10,561 | [
"MIT"
] | 0 | ba396693f65eaf74d1f60eb9aed3e78ab9593b22 | https://github.com/msobrevillac/Multilingual-RDF-Verbalizer/tree/ba396693f65eaf74d1f60eb9aed3e78ab9593b22 |
MVloss | import torch
import torch.distributed
import torch.nn as nn
class MVloss(nn.Module):
def __init__(self):
super(MVloss, self).__init__()
def forward(self, xRA0, xRA20, xRA_20, target, wRA0, wRA20, wRA_20):
criterion_MV = torch.nn.CrossEntropyLoss()
loss_multiview = criterion_MV(wRA0 *... | import torch
import triton
import triton.language 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.distribut... | muzammilbehzad/MultiviewTransformer | MVloss | false | 10,562 | [
"MIT"
] | 0 | c6c7c34c8d156e187a986e35268e1fc4a5d0175d | https://github.com/muzammilbehzad/MultiviewTransformer/tree/c6c7c34c8d156e187a986e35268e1fc4a5d0175d |
Critic | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1.0 / np.sqrt(fan_in)
return -lim, lim
class Critic(nn.Module):
"""Critic (Value) Model."""
def __init__(self, state_size, action_size, seed, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import numpy as np
import tor... | moritzzzzz/Continuous_Control | Critic | false | 10,563 | [
"Apache-2.0"
] | 0 | 655530bdbbe77eb285c95246331be4636c0d076c | https://github.com/moritzzzzz/Continuous_Control/tree/655530bdbbe77eb285c95246331be4636c0d076c |
Loss | import torch
import torch.utils.data
import torch
import torch.nn as nn
class Loss(nn.Module):
def __init__(self):
super(Loss, self).__init__()
def forward(self, x, y):
z = (x - y) ** 2
t = z[:, 1:].sum(dim=1)
loss = z[:, 0] + y[:, 0] * t
loss = loss.mean()
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
import torch.utils.data
import torch
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cud... | medric49/lookatme | Loss | false | 10,564 | [
"Apache-2.0"
] | 0 | bbd3d9ae8e5787d7ec53955df9aaba80959f46e5 | https://github.com/medric49/lookatme/tree/bbd3d9ae8e5787d7ec53955df9aaba80959f46e5 |
EqualLinear | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
class EqualLinear(nn.Module):
"""Equalized Linear as StyleGAN2.
Args:
in_channels (int): Size of each sample.
out_channels (int): Size of each output sample.
bias (bool): If set to ``False``, the layer... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | naarkhoo/GFPGAN | EqualLinear | false | 10,565 | [
"BSD-3-Clause"
] | 0 | 73559ec44a734fe084b6a0e28107295c5e98f335 | https://github.com/naarkhoo/GFPGAN/tree/73559ec44a734fe084b6a0e28107295c5e98f335 |
traspose_conv | import torch
import torch.nn as nn
class traspose_conv(nn.Module):
def __init__(self, num_of_channels):
super(traspose_conv, self).__init__()
self.trasnpose_conv = nn.ConvTranspose2d(num_of_channels, int(
num_of_channels / 2), kernel_size=2, stride=2)
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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | mhakyash/UNet-MNIST-denoising | traspose_conv | false | 10,566 | [
"MIT"
] | 0 | 0e3c20cbb3f34af575e33209425ae4d7cb0bcd82 | https://github.com/mhakyash/UNet-MNIST-denoising/tree/0e3c20cbb3f34af575e33209425ae4d7cb0bcd82 |
DeepAutoencoder | import torch
import torch.nn as nn
import torch.nn.functional as F
class DeepAutoencoder(nn.Module):
def __init__(self, input_length, output_length=None, neuron_multiplier=
1, sigmoid=False, drop=False, drop_pct=0.3):
"""
Dense deep autoencoder.
Args:
input_l... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | mariajmolina/ML-for-S2S | DeepAutoencoder | false | 10,567 | [
"MIT"
] | 0 | 3de32e72042ba7e8b37a433579fa9c5630246d8c | https://github.com/mariajmolina/ML-for-S2S/tree/3de32e72042ba7e8b37a433579fa9c5630246d8c |
DeeperAutoencoder | import torch
import torch.nn as nn
import torch.nn.functional as F
class DeeperAutoencoder(nn.Module):
def __init__(self, input_length, output_length=None, neuron_multiplier=
1, sigmoid=False, drop=False, drop_pct=0.3):
"""
Dense deeper autoencoder.
Args:
inp... | 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_... | mariajmolina/ML-for-S2S | DeeperAutoencoder | false | 10,568 | [
"MIT"
] | 0 | 3de32e72042ba7e8b37a433579fa9c5630246d8c | https://github.com/mariajmolina/ML-for-S2S/tree/3de32e72042ba7e8b37a433579fa9c5630246d8c |
ConveRTOuterFeedForward | import torch
import torch.nn as nn
import torch.nn.functional as fnn
from torch.nn.modules.normalization import LayerNorm
class ConveRTOuterFeedForward(nn.Module):
"""Fully-Connected 3-layer Linear Model"""
def __init__(self, input_hidden: 'int', intermediate_hidden: 'int',
dropout_rate: 'float'=0.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
import torch.nn as ... | luweishuang/ConveRT-pytorch | ConveRTOuterFeedForward | false | 10,569 | [
"Apache-2.0"
] | 0 | e14aaf2287eb3a78ee7d83ea02d9bd322863227f | https://github.com/luweishuang/ConveRT-pytorch/tree/e14aaf2287eb3a78ee7d83ea02d9bd322863227f |
MultiheadAttention | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
from typing import Optional
class MultiheadAttention(nn.Module):
"""Multi-Head Attention Implemenetation from huggingface/transformer"""
def __init__(self, config: 'ConveRTModelConfig'):
super().__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | luweishuang/ConveRT-pytorch | MultiheadAttention | false | 10,570 | [
"Apache-2.0"
] | 0 | e14aaf2287eb3a78ee7d83ea02d9bd322863227f | https://github.com/luweishuang/ConveRT-pytorch/tree/e14aaf2287eb3a78ee7d83ea02d9bd322863227f |
Keypoint2DLoss | import torch
import torch.nn as nn
class Keypoint2DLoss(nn.Module):
def __init__(self, loss_type: 'str'='l1'):
"""
2D keypoint loss module.
Args:
loss_type (str): Choose between l1 and l2 losses.
"""
super(Keypoint2DLoss, self).__init__()
if loss_type =... | import torch
import triton
import triton.language 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... | michael-p-sachen/ProHMR | Keypoint2DLoss | false | 10,571 | [
"BSD-3-Clause"
] | 0 | 0167d05a9a45939a217d02b4ef8fd67977c15f82 | https://github.com/michael-p-sachen/ProHMR/tree/0167d05a9a45939a217d02b4ef8fd67977c15f82 |
TripletMarginCosineLoss | from torch.nn import Module
import torch
from torch.nn.functional import cosine_similarity
def triplet_margin_cosine_loss(anchor, positive, negative, margin=1.0, eps=
1e-08, sum_loss=False):
'Creates a criterion that measures the triplet cosine loss given input\n tensors x1, x2, x3 and a margin with a valu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn import Module
... | monkeyhjy/aspect_summarization | TripletMarginCosineLoss | false | 10,572 | [
"MIT"
] | 0 | 3018815cd0aeccb752e9f51a4d49453c4f441650 | https://github.com/monkeyhjy/aspect_summarization/tree/3018815cd0aeccb752e9f51a4d49453c4f441650 |
ParameterLoss | import torch
import torch.nn as nn
class ParameterLoss(nn.Module):
def __init__(self):
"""
SMPL parameter loss module.
"""
super(ParameterLoss, self).__init__()
self.loss_fn = nn.MSELoss(reduction='none')
def forward(self, pred_param: 'torch.Tensor', gt_param: '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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | michael-p-sachen/ProHMR | ParameterLoss | false | 10,573 | [
"BSD-3-Clause"
] | 0 | 0167d05a9a45939a217d02b4ef8fd67977c15f82 | https://github.com/michael-p-sachen/ProHMR/tree/0167d05a9a45939a217d02b4ef8fd67977c15f82 |
double_decoder_conv | import torch
import torch.nn as nn
class double_decoder_conv(nn.Module):
def __init__(self, input_channels1, output_channels1, output_channels2):
super(double_decoder_conv, self).__init__()
self.conv1 = nn.Conv2d(input_channels1, output_channels1,
kernel_size=3, padding='same')
... | 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_... | mhakyash/UNet-MNIST-denoising | double_decoder_conv | false | 10,574 | [
"MIT"
] | 0 | 0e3c20cbb3f34af575e33209425ae4d7cb0bcd82 | https://github.com/mhakyash/UNet-MNIST-denoising/tree/0e3c20cbb3f34af575e33209425ae4d7cb0bcd82 |
Keypoint3DLoss | import torch
import torch.nn as nn
class Keypoint3DLoss(nn.Module):
def __init__(self, loss_type: 'str'='l1'):
"""
3D keypoint loss module.
Args:
loss_type (str): Choose between l1 and l2 losses.
"""
super(Keypoint3DLoss, self).__init__()
if loss_type =... | import torch
import triton
import triton.language 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... | michael-p-sachen/ProHMR | Keypoint3DLoss | false | 10,575 | [
"BSD-3-Clause"
] | 0 | 0167d05a9a45939a217d02b4ef8fd67977c15f82 | https://github.com/michael-p-sachen/ProHMR/tree/0167d05a9a45939a217d02b4ef8fd67977c15f82 |
ContrastiveLoss | import torch
import torch.nn as nn
import torch.nn.init
import torch.utils.data
import torch.utils.data.distributed
def cosine_sim(im, s):
return im.mm(s.t())
class ContrastiveLoss(nn.Module):
def __init__(self, margin=0):
super(ContrastiveLoss, self).__init__()
self.margin = margin
... | import torch
import triton
import triton.language 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.nn.init
import torch.utils.data
import torch.utils.dat... | nfyfamr/ActionEstimation | ContrastiveLoss | false | 10,576 | [
"MIT"
] | 0 | 8f18dba49d9558b28a277ea82c70fb4e3425bbbb | https://github.com/nfyfamr/ActionEstimation/tree/8f18dba49d9558b28a277ea82c70fb4e3425bbbb |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
"""policy-value network module"""
def __init__(self, board_width, board_height):
super(Net, self).__init__()
self.board_width = board_width
self.board_height = board_height
self.conv1 = nn... | 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.... | moddent/Gomoku_Deep | Net | false | 10,577 | [
"MIT"
] | 0 | 5d9bca97e6b30db4f99a4686152bcef7a6160ac6 | https://github.com/moddent/Gomoku_Deep/tree/5d9bca97e6b30db4f99a4686152bcef7a6160ac6 |
ExpLinear | import torch
from torch import nn
import torch.nn
from scipy.linalg import logm
class InverseNotAvailable(Exception):
"""Exception to be thrown when a transform does not have an inverse."""
pass
class Transform(nn.Module):
"""Base class for all transform objects."""
def forward(self, inputs, contex... | 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.nn
from scipy.linalg import logm
assert_size_s... | mshakerinava/nflows | ExpLinear | false | 10,578 | [
"MIT"
] | 0 | d86cb1478ff36ffd3e005e980d92a3b0bbffbf02 | https://github.com/mshakerinava/nflows/tree/d86cb1478ff36ffd3e005e980d92a3b0bbffbf02 |
SingleConv3DBlock | import torch
from torch import nn
import torch._utils
class SingleConv3DBlock(nn.Module):
def __init__(self, in_planes, out_planes, kernel_size):
super().__init__()
self.block = nn.Conv3d(in_planes, out_planes, kernel_size=
kernel_size, stride=1, padding=(kernel_size - 1) // 2)
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 import nn
import torch._utils
assert_size_stride = torch._C._dynamo.g... | ilcessadecalcular/segmentation | SingleConv3DBlock | false | 10,579 | [
"MIT"
] | 0 | 24ba499a399efdba212ec5e2235b72ed8270cc24 | https://github.com/ilcessadecalcular/segmentation/tree/24ba499a399efdba212ec5e2235b72ed8270cc24 |
MeanMaxPooling | import torch
from torch import nn
class MeanMaxPooling(nn.Module):
def __init__(self):
super(MeanMaxPooling, self).__init__()
def forward(self, doc_state, entity_mapping, entity_lens):
"""
:param doc_state: N x L x d
:param entity_mapping: N x E x L
:param entity_le... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | mottled233/DFGN-pytorch | MeanMaxPooling | false | 10,580 | [
"MIT"
] | 0 | 7d9f6a75404cfa429f1e2b57ec5055df382ed0a4 | https://github.com/mottled233/DFGN-pytorch/tree/7d9f6a75404cfa429f1e2b57ec5055df382ed0a4 |
SphereLoss | import torch
import torch.nn as nn
from torchvision.transforms import *
class SphereLoss(nn.Module):
def __init__(self, in_feats, n_classes, scale=14, *args, **kwargs):
super(SphereLoss, self).__init__(*args, **kwargs)
self.scale = scale
self.cross_entropy = nn.CrossEntropyLoss()
... | 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.... | modricwang/SphereReID | SphereLoss | false | 10,581 | [
"MIT"
] | 0 | d0c39d2ce52cbc35e4d3adc1e90c0e54585aa492 | https://github.com/modricwang/SphereReID/tree/d0c39d2ce52cbc35e4d3adc1e90c0e54585aa492 |
CNNAutoencoder | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNNAutoencoder(nn.Module):
def __init__(self, depth_0=1, depth_1=64, depth_2=32, depth_3=16,
lastdepth=1):
super(CNNAutoencoder, self).__init__()
self.depth_0 = depth_0
self.depth_1 = depth_1
self.dep... | 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_... | mariajmolina/ML-for-S2S | CNNAutoencoder | false | 10,582 | [
"MIT"
] | 0 | 3de32e72042ba7e8b37a433579fa9c5630246d8c | https://github.com/mariajmolina/ML-for-S2S/tree/3de32e72042ba7e8b37a433579fa9c5630246d8c |
BCEFocalLoss | import torch
import torch._utils
class BCEFocalLoss(torch.nn.Module):
"""
二分类的Focalloss alpha 固定
"""
def __init__(self, gamma=2, alpha=0.25, reduction='elementwise_mean'):
super().__init__()
self.gamma = gamma
self.alpha = alpha
self.reduction = reduction
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
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch._utils
as... | ilcessadecalcular/segmentation | BCEFocalLoss | false | 10,583 | [
"MIT"
] | 0 | 24ba499a399efdba212ec5e2235b72ed8270cc24 | https://github.com/ilcessadecalcular/segmentation/tree/24ba499a399efdba212ec5e2235b72ed8270cc24 |
Embeddings | import torch
from torch import nn
import torch._utils
class Embeddings(nn.Module):
def __init__(self, input_dim, embed_dim, cube_size, patch_size, dropout):
super().__init__()
self.n_patches = int(cube_size[0] * cube_size[1] * cube_size[2] / (
patch_size * patch_size * patch_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 import nn
import torch._utils
assert_size_stride = torch._C._dynamo.g... | ilcessadecalcular/segmentation | Embeddings | false | 10,584 | [
"MIT"
] | 0 | 24ba499a399efdba212ec5e2235b72ed8270cc24 | https://github.com/ilcessadecalcular/segmentation/tree/24ba499a399efdba212ec5e2235b72ed8270cc24 |
DotRNNSelector | from _paritybench_helpers import _mock_config
import torch
import torch as th
from torch.distributions import Categorical
import torch.nn as nn
import torch.nn.functional as F
class DotRNNSelector(nn.Module):
def __init__(self, input_shape, args):
super(DotRNNSelector, self).__init__()
self.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
import torch as th
from torch... | NagisaZj/RODE | DotRNNSelector | false | 10,585 | [
"Apache-2.0"
] | 0 | f7f6831fee58a7910e1d7c3a8ae19cef82ab8d03 | https://github.com/NagisaZj/RODE/tree/f7f6831fee58a7910e1d7c3a8ae19cef82ab8d03 |
MeanPooling | import torch
from torch import nn
class MeanPooling(nn.Module):
def __init__(self):
super(MeanPooling, self).__init__()
def forward(self, doc_state, entity_mapping, entity_lens):
entity_states = entity_mapping.unsqueeze(3) * doc_state.unsqueeze(1)
mean_pooled = torch.sum(entity_state... | import torch
import triton
import 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... | mottled233/DFGN-pytorch | MeanPooling | false | 10,586 | [
"MIT"
] | 0 | 7d9f6a75404cfa429f1e2b57ec5055df382ed0a4 | https://github.com/mottled233/DFGN-pytorch/tree/7d9f6a75404cfa429f1e2b57ec5055df382ed0a4 |
SeparableConv2d_same | import torch
import torch.nn as nn
import torch.nn.functional as F
def fixed_padding(inputs, kernel_size, dilation):
kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1)
pad_total = kernel_size_effective - 1
pad_beg = pad_total // 2
pad_end = pad_total - pad_beg
padded_inputs =... | 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... | lutbook/pytorch-segmentation-pipeline | SeparableConv2d_same | false | 10,587 | [
"MIT"
] | 0 | eb29d1bf240c158c64d81177e9be93cd958c0026 | https://github.com/lutbook/pytorch-segmentation-pipeline/tree/eb29d1bf240c158c64d81177e9be93cd958c0026 |
ActorCriticModel | import torch
import torch.nn as nn
import torch.nn.functional as F
class ActorCriticModel(nn.Module):
def __init__(self, n_state, n_actions):
super(ActorCriticModel, self).__init__()
self.fc1 = nn.Linear(n_state, 16)
self.action1 = nn.Linear(16, 16)
self.action2 = nn.Linear(16, n_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | nikolim/cablab | ActorCriticModel | false | 10,588 | [
"MIT"
] | 0 | 1dcf0d7da01ed3988f84309acfb31cc9a9893de1 | https://github.com/nikolim/cablab/tree/1dcf0d7da01ed3988f84309acfb31cc9a9893de1 |
GlobalAvgPool1d | import torch
import torch.nn as nn
from abc import abstractmethod
from torch.nn import functional
class AvgPool(nn.Module):
"""AvgPool Module.
"""
def __init__(self):
super().__init__()
@abstractmethod
def forward(self, input_tensor):
pass
class GlobalAvgPool1d(AvgPool):
""... | import torch
import 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 abc import abstractmethod
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = to... | lawwu/nni | GlobalAvgPool1d | false | 10,589 | [
"MIT"
] | 0 | b869dd48dfe36392e7b78c70ea35eb6d4b4779dc | https://github.com/lawwu/nni/tree/b869dd48dfe36392e7b78c70ea35eb6d4b4779dc |
ResidualConvUnit | import torch
import torch.nn as nn
class ResidualConvUnit(nn.Module):
"""Residual convolution module.
"""
def __init__(self, features):
"""Init.
Args:
features (int): number of features
"""
super().__init__()
self.conv1 = nn.Conv2d(features, features, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | maayan-myheritage/3d-photo-inpainting | ResidualConvUnit | false | 10,590 | [
"MIT"
] | 0 | 6293eecfeb55ceba019655723f6efe31e8ecb177 | https://github.com/maayan-myheritage/3d-photo-inpainting/tree/6293eecfeb55ceba019655723f6efe31e8ecb177 |
Temporal_Attention_layer | import torch
import torch.nn.functional as F
import torch.nn as nn
class Temporal_Attention_layer(nn.Module):
def __init__(self, DEVICE, in_channels, num_of_vertices, num_of_timesteps):
super(Temporal_Attention_layer, self).__init__()
self.U1 = nn.Parameter(torch.FloatTensor(num_of_vertices))
... | 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.... | msalvato/pytorch_geometric_temporal | Temporal_Attention_layer | false | 10,591 | [
"MIT"
] | 0 | 149bd46d3b2bddfc3570e31a91a3f53e8873d50e | https://github.com/msalvato/pytorch_geometric_temporal/tree/149bd46d3b2bddfc3570e31a91a3f53e8873d50e |
MultiHeadAttention | import math
import torch
import numpy as np
from torch import nn
class MultiHeadAttention(nn.Module):
def __init__(self, n_heads, input_dim, embed_dim, val_dim=None, key_dim
=None):
super(MultiHeadAttention, self).__init__()
if val_dim is None:
val_dim = embed_dim // n_heads
... | 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.... | neo-pan/attention-learn-to-route | MultiHeadAttention | false | 10,592 | [
"MIT"
] | 0 | bb094d6e96276719ab2e379f279c614df7d822f9 | https://github.com/neo-pan/attention-learn-to-route/tree/bb094d6e96276719ab2e379f279c614df7d822f9 |
PositiveLinear | import torch
import torch.nn as nn
import torch.nn.functional as F
class PositiveLinear(nn.Linear):
def forward(self, input):
return F.linear(input, self.weight ** 2, self.bias)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {'in_features': 4, 'out_feat... | 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... | oguzserbetci/monotone-network | PositiveLinear | false | 10,593 | [
"MIT"
] | 0 | 33a317a1dde1a3d3e74dcbe3eb12d1a81e745c95 | https://github.com/oguzserbetci/monotone-network/tree/33a317a1dde1a3d3e74dcbe3eb12d1a81e745c95 |
Spatial_Attention_layer | import torch
import torch.nn.functional as F
import torch.nn as nn
class Spatial_Attention_layer(nn.Module):
"""
compute spatial attention scores
"""
def __init__(self, DEVICE, in_channels, num_of_vertices, num_of_timesteps):
super(Spatial_Attention_layer, self).__init__()
self.W1 = n... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | msalvato/pytorch_geometric_temporal | Spatial_Attention_layer | false | 10,594 | [
"MIT"
] | 0 | 149bd46d3b2bddfc3570e31a91a3f53e8873d50e | https://github.com/msalvato/pytorch_geometric_temporal/tree/149bd46d3b2bddfc3570e31a91a3f53e8873d50e |
TorchAdd | import torch
import torch.nn as nn
class TorchAdd(nn.Module):
"""TorchAdd Module.
"""
def forward(self, input_list):
return input_list[0] + input_list[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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | lawwu/nni | TorchAdd | false | 10,595 | [
"MIT"
] | 0 | b869dd48dfe36392e7b78c70ea35eb6d4b4779dc | https://github.com/lawwu/nni/tree/b869dd48dfe36392e7b78c70ea35eb6d4b4779dc |
GlobalMaxPooling | import torch
import torch.nn as nn
class GlobalMaxPooling(nn.Module):
def __init__(self, dim=-1):
super(self.__class__, self).__init__()
self.dim = dim
def forward(self, x):
return x.max(dim=self.dim)[0]
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs(... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | numb3r33/toxic_comments_classification | GlobalMaxPooling | false | 10,596 | [
"MIT"
] | 0 | c5de56751aee29b6dee6e330237a4fd0bcd7fd51 | https://github.com/numb3r33/toxic_comments_classification/tree/c5de56751aee29b6dee6e330237a4fd0bcd7fd51 |
PartialConv | import math
import torch
import torch.nn as nn
def weights_init(init_type='gaussian'):
def init_fun(m):
classname = m.__class__.__name__
if (classname.find('Conv') == 0 or classname.find('Linear') == 0
) and hasattr(m, 'weight'):
if init_type == 'gaussian':
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.a... | maayan-myheritage/3d-photo-inpainting | PartialConv | false | 10,597 | [
"MIT"
] | 0 | 6293eecfeb55ceba019655723f6efe31e8ecb177 | https://github.com/maayan-myheritage/3d-photo-inpainting/tree/6293eecfeb55ceba019655723f6efe31e8ecb177 |
Mul | import torch
import torch as ch
class Mul(ch.nn.Module):
def __init__(self, weight):
super(Mul, self).__init__()
self.weight = weight
def forward(self, x):
return x * self.weight
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {'weig... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch as ch
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strid... | njwfish/ffcv | Mul | false | 10,598 | [
"Apache-2.0"
] | 0 | 3c219787da2fb8dbdaab24e75f34b3398ad7b7d1 | https://github.com/njwfish/ffcv/tree/3c219787da2fb8dbdaab24e75f34b3398ad7b7d1 |
MPJPE | import torch
import torch.nn as nn
import torch.nn.functional
class BaseMetric(nn.Module):
def forward(self, y_pr, points_gt, gt_mask=None):
"""
Base forward method for metric evaluation
Args:
y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3)
p... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.nn.functional
assert_size_stride = torch._C.... | miracleyoo/lifting_events_to_3d_hpe | MPJPE | false | 10,599 | [
"Apache-2.0"
] | 0 | dfe734ee055900d6ab90c064bf82db7672830ac7 | https://github.com/miracleyoo/lifting_events_to_3d_hpe/tree/dfe734ee055900d6ab90c064bf82db7672830ac7 |
PCK | import torch
import torch.nn as nn
import torch.nn.functional
class BaseMetric(nn.Module):
def forward(self, y_pr, points_gt, gt_mask=None):
"""
Base forward method for metric evaluation
Args:
y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3)
p... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.nn.functional
assert_size_stride = torch._C.... | miracleyoo/lifting_events_to_3d_hpe | PCK | false | 10,600 | [
"Apache-2.0"
] | 0 | dfe734ee055900d6ab90c064bf82db7672830ac7 | https://github.com/miracleyoo/lifting_events_to_3d_hpe/tree/dfe734ee055900d6ab90c064bf82db7672830ac7 |
DiceLoss | import torch
from torch import nn
import torch.nn.functional as F
import torch._utils
class BinaryDiceLoss(nn.Module):
"""Dice loss of binary class
Args:
smooth: A float number to smooth loss, and avoid NaN error, default: 1
p: Denominator value: \\sum{x^p} + \\sum{y^p}, default: 2
pre... | import torch
import triton
import triton.language 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
i... | ilcessadecalcular/segmentation | DiceLoss | false | 10,601 | [
"MIT"
] | 0 | 24ba499a399efdba212ec5e2235b72ed8270cc24 | https://github.com/ilcessadecalcular/segmentation/tree/24ba499a399efdba212ec5e2235b72ed8270cc24 |
CompositeActivation | import torch
class CompositeActivation(torch.nn.Module):
def forward(self, x):
x = torch.atan(x)
return torch.cat([x / 0.67, x * x / 0.6], 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.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | ndey96/lucent | CompositeActivation | false | 10,602 | [
"Apache-2.0"
] | 0 | d868d8ca52520bd245c1e5fcf3b026782f77e561 | https://github.com/ndey96/lucent/tree/d868d8ca52520bd245c1e5fcf3b026782f77e561 |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 12, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(12, 16, 5)
self.fc1 = nn.Linear(16 * 5 * 5, 120)
s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | neal2018/torch_learn | Net | false | 10,603 | [
"MIT"
] | 0 | 80bda3a44952aca6fce7156fe4aecb48ddd602ee | https://github.com/neal2018/torch_learn/tree/80bda3a44952aca6fce7156fe4aecb48ddd602ee |
DeepCoxMixturesTorch | import torch
import torch.nn as nn
def create_representation(inputdim, layers, activation):
"""Helper function to generate the representation function for DSM.
Deep Survival Machines learns a representation (\\ Phi(X) \\) for the input
data. This representation is parameterized using a Non Linear Multilayer
... | 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.... | mononitogoswami/auton-survival | DeepCoxMixturesTorch | false | 10,604 | [
"MIT"
] | 0 | 04739adac55e47d3d2c61101d92784a9fbb2dd86 | https://github.com/mononitogoswami/auton-survival/tree/04739adac55e47d3d2c61101d92784a9fbb2dd86 |
ReluSquared | import torch
from torch.nn import functional as F
from torch import nn
class ReluSquared(nn.Module):
def forward(self, x):
return F.relu(x) ** 2
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
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | ncoop57/x-transformers | ReluSquared | false | 10,605 | [
"MIT"
] | 0 | b65f25384349abfc101001b42482b05745c861fa | https://github.com/ncoop57/x-transformers/tree/b65f25384349abfc101001b42482b05745c861fa |
SpatialAttentionGate | import torch
import torch.nn.functional as F
import torch.nn as nn
class SpatialAttentionGate(nn.Module):
def __init__(self, channel, reduction=16):
super(SpatialAttentionGate, self).__init__()
self.fc1 = nn.Conv2d(channel, reduction, kernel_size=1, padding=0)
self.fc2 = nn.Conv2d(reducti... | 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_... | lawwu/nni | SpatialAttentionGate | false | 10,606 | [
"MIT"
] | 0 | b869dd48dfe36392e7b78c70ea35eb6d4b4779dc | https://github.com/lawwu/nni/tree/b869dd48dfe36392e7b78c70ea35eb6d4b4779dc |
RMSNorm | import torch
from torch import nn
class RMSNorm(nn.Module):
def __init__(self, dim, eps=1e-08):
super().__init__()
self.scale = dim ** -0.5
self.eps = eps
self.g = nn.Parameter(torch.ones(dim))
def forward(self, x):
norm = torch.norm(x, dim=-1, keepdim=True) * self.sc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_... | ncoop57/x-transformers | RMSNorm | false | 10,607 | [
"MIT"
] | 0 | b65f25384349abfc101001b42482b05745c861fa | https://github.com/ncoop57/x-transformers/tree/b65f25384349abfc101001b42482b05745c861fa |
LanguageModelCriterion | import torch
import torch.nn as nn
class LanguageModelCriterion(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, target, mask):
x = x.contiguous().view(-1, x.size(2))
target = target.contiguous().view(-1, 1)
mask = mask.contiguous().view(-1, 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | neal2018/torch_learn | LanguageModelCriterion | false | 10,608 | [
"MIT"
] | 0 | 80bda3a44952aca6fce7156fe4aecb48ddd602ee | https://github.com/neal2018/torch_learn/tree/80bda3a44952aca6fce7156fe4aecb48ddd602ee |
ScaleNorm | import torch
from torch import nn
class ScaleNorm(nn.Module):
def __init__(self, dim, eps=1e-05):
super().__init__()
self.scale = dim ** -0.5
self.eps = eps
self.g = nn.Parameter(torch.ones(1))
def forward(self, x):
norm = torch.norm(x, dim=-1, keepdim=True) * self.sc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_... | ncoop57/x-transformers | ScaleNorm | false | 10,609 | [
"MIT"
] | 0 | b65f25384349abfc101001b42482b05745c861fa | https://github.com/ncoop57/x-transformers/tree/b65f25384349abfc101001b42482b05745c861fa |
DuelingQNetwork | import torch
import torch.nn as nn
from collections import OrderedDict
class DuelingQNetwork(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, hidden_advantage=[512,
512], hidden_state_value=[512, 512]):
"""Initialize parameters and build model.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from co... | nullbyte91/udacity-drl-navigation | DuelingQNetwork | false | 10,610 | [
"MIT"
] | 0 | d981ab906fd3dfc9939d639b2083d004cde0b961 | https://github.com/nullbyte91/udacity-drl-navigation/tree/d981ab906fd3dfc9939d639b2083d004cde0b961 |
L2 | import torch
import torch.nn as nn
class L2(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
out = (s - t) ** 2
return (out.view(out.size(0), -1).sum(dim=1) + 1e-14) ** 0.5
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | mrernst/rl_robotics_research | L2 | false | 10,611 | [
"MIT"
] | 0 | 0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | https://github.com/mrernst/rl_robotics_research/tree/0bc446cfb69591cb4ee3ce8d39815c463090a5f6 |
DotProd | import torch
import numpy as np
import torch.nn as nn
class DotProd(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
if isinstance(s, np.ndarray):
s = torch.from_numpy(s).float()
if isinstance(t, np.ndarray):
t = torch.from_num... | import torch
import 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... | mrernst/rl_robotics_research | DotProd | false | 10,612 | [
"MIT"
] | 0 | 0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | https://github.com/mrernst/rl_robotics_research/tree/0bc446cfb69591cb4ee3ce8d39815c463090a5f6 |
L1 | import torch
import numpy as np
import torch.nn as nn
class L1(nn.Module):
def __init__(self):
nn.Module.__init__(self)
def forward(self, s, t):
if isinstance(s, np.ndarray):
s = torch.from_numpy(s).float()
if isinstance(t, np.ndarray):
t = torch.from_numpy(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.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | mrernst/rl_robotics_research | L1 | false | 10,613 | [
"MIT"
] | 0 | 0bc446cfb69591cb4ee3ce8d39815c463090a5f6 | https://github.com/mrernst/rl_robotics_research/tree/0bc446cfb69591cb4ee3ce8d39815c463090a5f6 |
SingleDeconv3DBlock | import torch
from torch import nn
import torch._utils
class SingleDeconv3DBlock(nn.Module):
def __init__(self, in_planes, out_planes):
super().__init__()
self.block = nn.ConvTranspose3d(in_planes, out_planes, kernel_size=
2, stride=2, padding=0, output_padding=0)
def forward(self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch._utils
assert_size_stride = torch._C._dynamo.g... | ilcessadecalcular/segmentation | SingleDeconv3DBlock | false | 10,614 | [
"MIT"
] | 0 | 24ba499a399efdba212ec5e2235b72ed8270cc24 | https://github.com/ilcessadecalcular/segmentation/tree/24ba499a399efdba212ec5e2235b72ed8270cc24 |
QNetwork | import torch
import torch.nn.functional as F
import torch.nn as nn
class QNetwork(nn.Module):
def __init__(self, state_size, action_size, hidden_layer1=64,
hidden_layer2=64):
super(QNetwork, self).__init__()
self.fc1 = nn.Linear(state_size, hidden_layer1)
self.fc2 = nn.Linear(hidd... | 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_... | pardi/DRL_navigation | QNetwork | false | 10,615 | [
"Apache-2.0"
] | 0 | 4b66edf696c34a53686c02ff91264f5d6b32dc02 | https://github.com/pardi/DRL_navigation/tree/4b66edf696c34a53686c02ff91264f5d6b32dc02 |
convBlock | import torch
import torch.nn as nn
class convBlock(nn.Module):
"""
A convolutional block including conv, BN, nonliear activiation, residual connection
"""
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1, bias=True, batchnorm=False, residual=False, nonlinear=nn... | 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... | norveclibalikci/easyreg-mirror | convBlock | false | 10,616 | [
"Apache-2.0"
] | 0 | a16254733fe957cc4024923f8dce91412966a189 | https://github.com/norveclibalikci/easyreg-mirror/tree/a16254733fe957cc4024923f8dce91412966a189 |
NCCLoss | import torch
import torch.nn as nn
class NCCLoss(nn.Module):
"""
A implementation of the normalized cross correlation (NCC)
"""
def forward(self, input, target):
input = input.view(input.shape[0], -1)
target = target.view(target.shape[0], -1)
input_minus_mean = input - torch.m... | import torch
import triton
import triton.language 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_... | norveclibalikci/easyreg-mirror | NCCLoss | false | 10,617 | [
"Apache-2.0"
] | 0 | a16254733fe957cc4024923f8dce91412966a189 | https://github.com/norveclibalikci/easyreg-mirror/tree/a16254733fe957cc4024923f8dce91412966a189 |
LocalResponseNormLayer | import torch
import torch.nn as nn
import torch.nn.functional as F
class LocalResponseNormLayer(nn.Module):
def forward(self, tensor, size=5, alpha=9.999999747378752e-05, beta=
0.75, k=1.0):
return F.local_response_norm(tensor, size=size, alpha=alpha, beta=
beta, k=k)
def get_inputs... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | ndey96/lucent | LocalResponseNormLayer | false | 10,618 | [
"Apache-2.0"
] | 0 | d868d8ca52520bd245c1e5fcf3b026782f77e561 | https://github.com/ndey96/lucent/tree/d868d8ca52520bd245c1e5fcf3b026782f77e561 |
JointsCELoss | import torch
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
class JointsCELoss(nn.Module):
def __init__(self):
super(JointsCELoss, self).__init__()
self.criterion = nn.MSELoss(reduction='mean')
def forward(self, o... | import torch
import 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.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
assert_size_st... | nuguziii/deep-high-resolution-net.pytorch | JointsCELoss | false | 10,619 | [
"MIT"
] | 0 | 3c053e97201fbeb35ff48cbc567ffb37b5e0b436 | https://github.com/nuguziii/deep-high-resolution-net.pytorch/tree/3c053e97201fbeb35ff48cbc567ffb37b5e0b436 |
JointsDistLoss | import torch
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
class JointsDistLoss(nn.Module):
def __init__(self):
super(JointsDistLoss, self).__init__()
self.criterion = nn.MSELoss(reduction='mean')
def forward(sel... | import torch
import 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.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn as nn
assert_size_st... | nuguziii/deep-high-resolution-net.pytorch | JointsDistLoss | false | 10,620 | [
"MIT"
] | 0 | 3c053e97201fbeb35ff48cbc567ffb37b5e0b436 | https://github.com/nuguziii/deep-high-resolution-net.pytorch/tree/3c053e97201fbeb35ff48cbc567ffb37b5e0b436 |
Bottleneck | import torch
from torch import nn
from collections import OrderedDict
class Bottleneck(nn.Module):
def __init__(self, in_channels, out_channels):
super(Bottleneck, self).__init__()
m = OrderedDict()
m['conv1'] = nn.Conv2d(in_channels, out_channels, kernel_size=1,
bias=False)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from col... | nivedk/SPANet | Bottleneck | false | 10,621 | [
"BSD-3-Clause"
] | 0 | 1bd84ae67732f9885af65dcbd286075008d46e91 | https://github.com/nivedk/SPANet/tree/1bd84ae67732f9885af65dcbd286075008d46e91 |
Attention | import torch
from torch import nn
class Attention(nn.Module):
def __init__(self, in_channels):
super(Attention, self).__init__()
self.out_channels = int(in_channels / 2)
self.conv1 = nn.Conv2d(in_channels, self.out_channels, kernel_size=
3, padding=1, stride=1)
self.re... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | nivedk/SPANet | Attention | false | 10,623 | [
"BSD-3-Clause"
] | 0 | 1bd84ae67732f9885af65dcbd286075008d46e91 | https://github.com/nivedk/SPANet/tree/1bd84ae67732f9885af65dcbd286075008d46e91 |
Sparsemax | from torch.autograd import Function
import torch
import torch.nn as nn
def _make_ix_like(X, dim):
d = X.size(dim)
rho = torch.arange(1, d + 1, device=X.device, dtype=X.dtype)
view = [1] * X.dim()
view[0] = -1
return rho.view(view).transpose(0, dim)
def _roll_last(X, dim):
if dim == -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.autograd import Function
import torch.nn as nn
assert_size_stride = torch._C._... | mtreviso/entmax | Sparsemax | false | 10,624 | [
"MIT"
] | 0 | 5b029d07fe00d7aacc77c8e684a5796d29287575 | https://github.com/mtreviso/entmax/tree/5b029d07fe00d7aacc77c8e684a5796d29287575 |
Standardize | from torch.nn import Module
import torch
import torch.utils.data
from torch.nn import init
from torch.nn.parameter import Parameter
class Standardize(Module):
"""
Applies (element-wise) standardization with trainable translation parameter μ and scale parameter σ, i.e. computes
(x - μ) / σ where '/' is app... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import torch.utils.data
from torch.nn import init
from torch.nn.parameter import Parameter
assert_size_stride = ... | kevinwss/Deep-SAD-Baseline | Standardize | false | 10,625 | [
"MIT"
] | 0 | b704725cc44ab5e7aa9bb09503a4c5f244fa907b | https://github.com/kevinwss/Deep-SAD-Baseline/tree/b704725cc44ab5e7aa9bb09503a4c5f244fa907b |
ResizeConv2d | import torch
from torch import nn
import torch.nn.functional as F
class ResizeConv2d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, scale_factor,
mode='nearest'):
super().__init__()
self.scale_factor = scale_factor
self.mode = mode
self.conv = nn.Co... | 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... | neuronphysics/FEAIML | ResizeConv2d | false | 10,626 | [
"MIT"
] | 0 | a31ae0d9f526f489fca1ca4b01dd8f06115de450 | https://github.com/neuronphysics/FEAIML/tree/a31ae0d9f526f489fca1ca4b01dd8f06115de450 |
CrossLayer | import torch
import torch.nn as nn
import torch.optim
class CrossLayer(nn.Module):
def __init__(self, d, dropout):
super().__init__()
self.linear = nn.Linear(d, d)
self.dropout = nn.Dropout(dropout)
def forward(self, x0, x):
return self.dropout(x0 * self.linear(x)) + x
def ... | 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.optim
assert_size_stride = torch._C._dynamo.g... | piers-hinds/rtdl | CrossLayer | false | 10,627 | [
"Apache-2.0"
] | 0 | 66cf9b90d2269395152dabf32653bdd599ddb12e | https://github.com/piers-hinds/rtdl/tree/66cf9b90d2269395152dabf32653bdd599ddb12e |
LayerShift | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
class LayerShift(nn.Module):
def __init__(self, init=1.0):
super().__init__()
self.bias = torch.nn.Parameter(torch.zeros(1))
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
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
assert_size_st... | ptillet/Fixup | LayerShift | false | 10,628 | [
"BSD-3-Clause"
] | 0 | c36dbe7f2cce71c4308afc43ab6e8551e567be30 | https://github.com/ptillet/Fixup/tree/c36dbe7f2cce71c4308afc43ab6e8551e567be30 |
Decoder | import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
""" VAE decoder """
def __init__(self, img_channels, latent_size):
super(Decoder, self).__init__()
self.latent_size = latent_size
self.img_channels = img_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 import triton_helpers
import torch.utils.data
impor... | parthjaggi/world-models | Decoder | false | 10,629 | [
"MIT"
] | 0 | 534b3a3474761e83da6c251bce97bea527e7435f | https://github.com/parthjaggi/world-models/tree/534b3a3474761e83da6c251bce97bea527e7435f |
NgramCombined | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.cuda
import torch.distributed
class NgramCombined(nn.Module):
def __init__(self, n_gram):
super(NgramCombined, self).__init__()
self.n_gram = n_gram
def forward(self, x):
out = x
if self.n_gram > ... | import torch
import 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.cuda
import torch.distributed
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strid... | phuongnm-bkhn/OpenNMT-py | NgramCombined | false | 10,630 | [
"MIT"
] | 0 | 554a826139f1bfc55f4ea6a3e7491858c2afec4c | https://github.com/phuongnm-bkhn/OpenNMT-py/tree/554a826139f1bfc55f4ea6a3e7491858c2afec4c |
SoftDiceLoss | import torch
import torch.nn as nn
class SoftDiceLoss(nn.Module):
"""
Soft Dice Loss
"""
def __init__(self, weight=None, size_average=True):
super(SoftDiceLoss, self).__init__()
def forward(self, logits, targets):
smooth = 1.0
logits = torch.sigmoid(logits)
iflat ... | import torch
import triton
import triton.language 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... | prateekstark/unet.pytorch | SoftDiceLoss | false | 10,631 | [
"MIT"
] | 0 | b6ef6302f35ca93c6c818215c915e05b7f3055dc | https://github.com/prateekstark/unet.pytorch/tree/b6ef6302f35ca93c6c818215c915e05b7f3055dc |
HSwish | import torch
import torch.utils.data
from torch import nn
class HSwish(nn.Module):
"""Hard Swish activation function.
See: https://arxiv.org/abs/1905.02244
"""
def forward(self, x):
return x * nn.functional.relu6(x + 3).div_(6)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def g... | import torch
import triton
import triton.language 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.utils.data
from torch import nn
assert_size_stride = torch._C._dynamo.guards... | prabhum456/determined | HSwish | false | 10,632 | [
"Apache-2.0"
] | 0 | 7e8017df0f62d80d21f5483578e2d5abd0e30935 | https://github.com/prabhum456/determined/tree/7e8017df0f62d80d21f5483578e2d5abd0e30935 |
RewardEstimator | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def reset_parameters_util_x(model):
for module in model.modules():
if isinstance(module, nn.Linear):
nn.init.xavier_normal_(module.weight.data, 1)
if module.bias is not None:
module.bias.... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import math
import torch.nn a... | olipinski/MultimodalGame | RewardEstimator | false | 10,633 | [
"BSD-3-Clause"
] | 0 | cfacc66baebfadb6ed6a8b44b3dd71a298285d68 | https://github.com/olipinski/MultimodalGame/tree/cfacc66baebfadb6ed6a8b44b3dd71a298285d68 |
TextProcessor | import torch
import torch.nn as nn
import torch.nn.functional as F
def reset_parameters_util_x(model):
for module in model.modules():
if isinstance(module, nn.Linear):
nn.init.xavier_normal_(module.weight.data, 1)
if module.bias is not None:
module.bias.data.zero_()... | 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_... | olipinski/MultimodalGame | TextProcessor | false | 10,634 | [
"BSD-3-Clause"
] | 0 | cfacc66baebfadb6ed6a8b44b3dd71a298285d68 | https://github.com/olipinski/MultimodalGame/tree/cfacc66baebfadb6ed6a8b44b3dd71a298285d68 |
BinLinear | import torch
from itertools import product as product
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
class BinQuant(torch.autograd.Function):
"""BinaryConnect quantization.
Refer:
https://pytorch.org/tutorials/beginner/examples_autograd/two_layer_net_cu... | 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 itertools import product as product
from torch import nn
import torch.optim... | ninfueng/a-PyTorch-Tutorial-to-Object-Detection | BinLinear | false | 10,635 | [
"MIT"
] | 0 | fc7544720a7e939f5a56f4f7214e4965b7775f77 | https://github.com/ninfueng/a-PyTorch-Tutorial-to-Object-Detection/tree/fc7544720a7e939f5a56f4f7214e4965b7775f77 |
Actor | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, max_action):
super(Actor, self).__init__()
self.l1 = nn.Linear(state_dim, 4)
self.l2 = nn.Linear(4, 4)
self.l3 = nn.Linear(4, action_dim)
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
from torch._inductor.runtime.... | pkj415/CityLearn | Actor | false | 10,636 | [
"MIT"
] | 0 | 912d1e28270fba2d11a713dc7f0445d59d620511 | https://github.com/pkj415/CityLearn/tree/912d1e28270fba2d11a713dc7f0445d59d620511 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.