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 |
|---|---|---|---|---|---|---|---|---|---|---|
Actor | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
class Actor(nn.Module):
def __init__(self, device, action_size, observation_size):
super(Actor, self).__init__()
self.device = device
self.fc1 = nn.Linear(np.array((observation_size,)).prod(), 256)
... | 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.... | faisman/deep-reinforcement-learning-projects | Actor | false | 12,361 | [
"MIT"
] | 0 | cef102ec4019069a22f95d798f6694dce73655ae | https://github.com/faisman/deep-reinforcement-learning-projects/tree/cef102ec4019069a22f95d798f6694dce73655ae |
ISAB | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class MAB(nn.Module):
def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False):
super(MAB, self).__init__()
self.dim_V = dim_V
self.num_heads = num_heads
self.fc_q = nn.Linear(dim_Q, dim_V)
... | 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.... | ernoult/set_transformer | ISAB | false | 12,362 | [
"MIT"
] | 0 | 4b380106e1f43b7eb6315624c57d4d1d38737b78 | https://github.com/ernoult/set_transformer/tree/4b380106e1f43b7eb6315624c57d4d1d38737b78 |
PMA | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class MAB(nn.Module):
def __init__(self, dim_Q, dim_K, dim_V, num_heads, ln=False):
super(MAB, self).__init__()
self.dim_V = dim_V
self.num_heads = num_heads
self.fc_q = nn.Linear(dim_Q, dim_V)
... | 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.... | ernoult/set_transformer | PMA | false | 12,363 | [
"MIT"
] | 0 | 4b380106e1f43b7eb6315624c57d4d1d38737b78 | https://github.com/ernoult/set_transformer/tree/4b380106e1f43b7eb6315624c57d4d1d38737b78 |
QNetwork | import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
class QNetwork(nn.Module):
def __init__(self, device, action_size, observation_size):
super(QNetwork, self).__init__()
self.device = device
self.fc1 = nn.Linear(np.array((observation_size,)).prod() + np.... | 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... | faisman/deep-reinforcement-learning-projects | QNetwork | false | 12,364 | [
"MIT"
] | 0 | cef102ec4019069a22f95d798f6694dce73655ae | https://github.com/faisman/deep-reinforcement-learning-projects/tree/cef102ec4019069a22f95d798f6694dce73655ae |
MultiHeadedAttention | import math
import torch
from typing import Tuple
from torch import nn
class MultiHeadedAttention(nn.Module):
"""Multi-Head Attention layer.
Args:
n_head (int): The number of heads.
n_feat (int): The number of features.
dropout_rate (float): Dropout rate.
"""
def __init__(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.... | eschmidbauer/wenet | MultiHeadedAttention | false | 12,365 | [
"Apache-2.0"
] | 0 | f0bbf6af16fa92d26a7f68ac21e0354a7500a025 | https://github.com/eschmidbauer/wenet/tree/f0bbf6af16fa92d26a7f68ac21e0354a7500a025 |
core_network | import torch
import torch.nn as nn
import torch.nn.functional as F
class core_network(nn.Module):
"""
An RNN that maintains an internal state that integrates
information extracted from the history of past observations.
It encodes the agent's knowledge of the environment through
a state vector `h_t... | 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_... | felixnon/foveated-visual-attention | core_network | false | 12,366 | [
"MIT"
] | 0 | 7e7d9a5ef24ec42eb76ba72f783bb2227bdb4851 | https://github.com/felixnon/foveated-visual-attention/tree/7e7d9a5ef24ec42eb76ba72f783bb2227bdb4851 |
PositionGenerator | import torch
import torch.nn as nn
class LayerNorm(nn.Module):
"""Construct a layernorm module (See citation for details)."""
def __init__(self, features, eps=1e-06):
super(LayerNorm, self).__init__()
self.a_2 = nn.Parameter(torch.ones(features))
self.b_2 = nn.Parameter(torch.zeros(fe... | 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 ... | eweiner/MAT_Extension | PositionGenerator | false | 12,367 | [
"MIT"
] | 0 | 505884a67f97bf54e1198077d15a48531fcac7a5 | https://github.com/eweiner/MAT_Extension/tree/505884a67f97bf54e1198077d15a48531fcac7a5 |
CausalConv2d | import torch
from torch import nn
class WNConv2d(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, stride=1,
padding=0, bias=True, activation=None):
super().__init__()
self.conv = nn.utils.weight_norm(nn.Conv2d(in_channel, out_channel,
kernel_size, stride=st... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | eric11220/vq-vae-2-pytorch | CausalConv2d | false | 12,368 | [
"MIT"
] | 0 | ac455ec8873428e16a361d49bf1dda30472ece13 | https://github.com/eric11220/vq-vae-2-pytorch/tree/ac455ec8873428e16a361d49bf1dda30472ece13 |
WNConv2d | import torch
from torch import nn
class WNConv2d(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, stride=1,
padding=0, bias=True, activation=None):
super().__init__()
self.conv = nn.utils.weight_norm(nn.Conv2d(in_channel, out_channel,
kernel_size, stride=st... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | eric11220/vq-vae-2-pytorch | WNConv2d | false | 12,369 | [
"MIT"
] | 0 | ac455ec8873428e16a361d49bf1dda30472ece13 | https://github.com/eric11220/vq-vae-2-pytorch/tree/ac455ec8873428e16a361d49bf1dda30472ece13 |
MultiHeadAttention | import math
import torch
import torch.nn as nn
class MultiHeadAttention(nn.Module):
"""
Multi-head Self-attention layers, a attention score dropout layer is introduced.
Args:
input_tensor (torch.Tensor): the input of the multi-head self-attention layer
attention_mask (torch.Tensor): the a... | 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.... | dreaming-qin/RecBole | MultiHeadAttention | false | 12,370 | [
"MIT"
] | 0 | d6de39521484ded60c387ca604abaf86310acdbe | https://github.com/dreaming-qin/RecBole/tree/d6de39521484ded60c387ca604abaf86310acdbe |
location_network | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
class location_network(nn.Module):
"""
Uses the internal state `h_t` of the core network to
produce the location coordinates `l_t` for the next
time step.
Concretely, feeds the hidden state `... | 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.... | felixnon/foveated-visual-attention | location_network | false | 12,371 | [
"MIT"
] | 0 | 7e7d9a5ef24ec42eb76ba72f783bb2227bdb4851 | https://github.com/felixnon/foveated-visual-attention/tree/7e7d9a5ef24ec42eb76ba72f783bb2227bdb4851 |
MLPAttention | import torch
from torch import nn
import torch.nn.functional as F
import torch.optim
def get_activation_fn(name):
"""Returns a callable activation function from torch."""
if name in (None, 'linear'):
return lambda x: x
elif name in ('sigmoid', 'tanh'):
return getattr(torch, name)
else:... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | fmetze/nmtpytorch | MLPAttention | false | 12,372 | [
"MIT"
] | 0 | 658a39a2c50e4e9e2fde69b520ddac7efc083257 | https://github.com/fmetze/nmtpytorch/tree/658a39a2c50e4e9e2fde69b520ddac7efc083257 |
BipolarSigmoid | import torch
import torch.nn as nn
class BipolarSigmoid(nn.Module):
def forward(self, x):
return (1.0 - torch.exp(-x)) / (1.0 + torch.exp(-x))
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | fmhoward/pysurvival | BipolarSigmoid | false | 12,373 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
InverseSqrt | import torch
import torch.nn as nn
class InverseSqrt(nn.Module):
def forward(self, x, alpha=1.0):
return x / torch.sqrt(1.0 + alpha * x * x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | fmhoward/pysurvival | InverseSqrt | false | 12,374 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
Gaussian | import torch
import torch.nn as nn
class Gaussian(nn.Module):
def forward(self, x):
return torch.exp(-x * x / 2.0)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | fmhoward/pysurvival | Gaussian | false | 12,375 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
BentIdentity | import torch
import torch.nn as nn
class BentIdentity(nn.Module):
def forward(self, x, alpha=1.0):
return x + (torch.sqrt(1.0 + x * x) - 1.0) / 2.0
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | fmhoward/pysurvival | BentIdentity | false | 12,376 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
Softmax | import torch
import torch.nn as nn
class Softmax(nn.Module):
def forward(self, x):
y = torch.exp(x)
return y / torch.sum(y, dim=0)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | fmhoward/pysurvival | Softmax | false | 12,377 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
BasicMotionEncoder | from _paritybench_helpers import _mock_config
import torch
import torch.nn.functional as F
import torch.nn as nn
class BasicMotionEncoder(nn.Module):
def __init__(self, args):
super(BasicMotionEncoder, self).__init__()
self.args = args
cor_planes = args.corr_levels * (2 * args.corr_radius... | 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_... | eyecan-ai/RAFT-Stereo | BasicMotionEncoder | false | 12,378 | [
"MIT"
] | 0 | dda04d8ca4345922947009cfc6f7deb8aaf2cb67 | https://github.com/eyecan-ai/RAFT-Stereo/tree/dda04d8ca4345922947009cfc6f7deb8aaf2cb67 |
Sinc | import torch
import torch.nn as nn
class Sinc(nn.Module):
def forward(self, x, epsilon=1e-09):
return torch.sin(x + epsilon) / (x + epsilon)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | fmhoward/pysurvival | Sinc | false | 12,379 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
SinReLU | import torch
import torch.nn as nn
class SinReLU(nn.Module):
def forward(self, x):
return torch.sin(x) + torch.relu(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 import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | fmhoward/pysurvival | SinReLU | false | 12,380 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
Atan | import torch
import torch.nn as nn
class Atan(nn.Module):
def forward(self, x):
return torch.atan(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | fmhoward/pysurvival | Atan | false | 12,381 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
CosReLU | import torch
import torch.nn as nn
class CosReLU(nn.Module):
def forward(self, x):
return torch.cos(x) + torch.relu(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 import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | fmhoward/pysurvival | CosReLU | false | 12,382 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
CoAttention | import torch
from torch import nn
import torch.nn.functional as F
import torch.optim
def get_activation_fn(name):
"""Returns a callable activation function from torch."""
if name in (None, 'linear'):
return lambda x: x
elif name in ('sigmoid', 'tanh'):
return getattr(torch, name)
else:... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | fmetze/nmtpytorch | CoAttention | false | 12,383 | [
"MIT"
] | 0 | 658a39a2c50e4e9e2fde69b520ddac7efc083257 | https://github.com/fmetze/nmtpytorch/tree/658a39a2c50e4e9e2fde69b520ddac7efc083257 |
ExpMSE | import torch
from torch import nn
def _assert_no_grad(tensor):
assert not tensor.requires_grad
class ExpMSE(nn.Module):
def __init__(self, lam):
super().__init__()
self.lam = lam
def forward(self, output, target):
_assert_no_grad(target)
loss = (output - target).pow(2)
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | dattientran/attorch | ExpMSE | false | 12,384 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
LogLog | import torch
import torch.nn as nn
class LogLog(nn.Module):
def forward(self, x):
return 1.0 - torch.exp(-torch.exp(x))
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | fmhoward/pysurvival | LogLog | false | 12,385 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
AdjustedElu | import torch
from torch import nn
from torch.nn import functional as F
class AdjustedElu(nn.Module):
"""
Elu activation function that's adjusted to:
1) ensure that all outputs are positive and
2) f(x) = x for x >= 1
"""
def forward(self, x):
return F.elu(x - 1.0) + 1.0
def get_input... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | dattientran/attorch | AdjustedElu | false | 12,386 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
Log1Exp | import torch
from torch import nn
def log1exp(x):
return torch.log(1.0 + torch.exp(x))
class Log1Exp(nn.Module):
def forward(self, x):
return log1exp(x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_... | dattientran/attorch | Log1Exp | false | 12,387 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
ExponentialMSE | import torch
from torch import nn
def _assert_no_grad(tensor):
assert not tensor.requires_grad
class ExponentialMSE(nn.Module):
def __init__(self, lam):
super().__init__()
self.lam = lam
def forward(self, output, target):
_assert_no_grad(target)
loss = (output - target)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
a... | dattientran/attorch | ExponentialMSE | false | 12,388 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
LogCosh | import torch
from torch import nn
def _assert_no_grad(tensor):
assert not tensor.requires_grad
class LogCosh(nn.Module):
def __init__(self, bias=1e-12):
super().__init__()
self.bias = bias
def forward(self, output, target):
_assert_no_grad(target)
return torch.mean(torc... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | dattientran/attorch | LogCosh | false | 12,389 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
GroupSort | import torch
from torch import nn
def process_group_size(x, group_size, axis=-1):
size = list(x.size())
num_channels = size[axis]
if num_channels % group_size:
raise ValueError(
'number of features({}) is not a multiple of group_size({})'.
format(num_channels, num_units))
... | import torch
import triton
import triton.language 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... | dattientran/attorch | GroupSort | false | 12,390 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
AvgCorr | import torch
from torch import nn
def _assert_no_grad(tensor):
assert not tensor.requires_grad
class AvgCorr(nn.Module):
def __init__(self, eps=1e-12):
self.eps = eps
super().__init__()
def forward(self, output, target):
_assert_no_grad(target)
delta_out = output - outp... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | dattientran/attorch | AvgCorr | false | 12,391 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
Elu1 | import torch
from torch import nn
from torch.nn import functional as F
def elu1(x):
return F.elu(x, inplace=True) + 1.0
class Elu1(nn.Module):
"""
Elu activation function shifted by 1 to ensure that the
output stays positive. That is:
Elu1(x) = Elu(x) + 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
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
from torch.nn import functional as F
assert_size_stride = ... | dattientran/attorch | Elu1 | false | 12,392 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
XSigmoid | import torch
def _assert_no_grad(tensor):
assert not tensor.requires_grad
class XSigmoid(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, output, target):
_assert_no_grad(target)
error = target - output
return torch.mean(2 * error / (1 + torch.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_stride = t... | dattientran/attorch | XSigmoid | false | 12,393 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
ycbcr_to_rgb_jpeg | import torch
import numpy as np
import torch.nn as nn
class ycbcr_to_rgb_jpeg(nn.Module):
""" Converts YCbCr image to RGB JPEG
Input:
image(tensor): batch x height x width x 3
Outpput:
result(tensor): batch x 3 x height x width
"""
def __init__(self):
super(ycbcr_to_rgb_jp... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import numpy as np
import torch.nn as nn
assert_size_stride = torch._C._dynamo.g... | foxtrotmike/DiffJPEG | ycbcr_to_rgb_jpeg | false | 12,394 | [
"MIT"
] | 0 | 7dbc44b1e921f20a213a7206a8578d6a1c8131b4 | https://github.com/foxtrotmike/DiffJPEG/tree/7dbc44b1e921f20a213a7206a8578d6a1c8131b4 |
Corr | import torch
from torch import nn
def _assert_no_grad(tensor):
assert not tensor.requires_grad
class Corr(nn.Module):
def __init__(self, eps=1e-12):
self.eps = eps
super().__init__()
def forward(self, output, target):
_assert_no_grad(target)
delta_out = output - output.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | dattientran/attorch | Corr | false | 12,395 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
chroma_subsampling | import torch
import torch.nn as nn
class chroma_subsampling(nn.Module):
""" Chroma subsampling on CbCv channels
Input:
image(tensor): batch x height x width x 3
Output:
y(tensor): batch x height x width
cb(tensor): batch x height/2 x width/2
cr(tensor): batch x height/2 x w... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | foxtrotmike/DiffJPEG | chroma_subsampling | false | 12,396 | [
"MIT"
] | 0 | 7dbc44b1e921f20a213a7206a8578d6a1c8131b4 | https://github.com/foxtrotmike/DiffJPEG/tree/7dbc44b1e921f20a213a7206a8578d6a1c8131b4 |
idct_8x8 | import itertools
import torch
import numpy as np
import torch.nn as nn
class idct_8x8(nn.Module):
""" Inverse discrete Cosine Transformation
Input:
dcp(tensor): batch x height x width
Output:
image(tensor): batch x height x width
"""
def __init__(self):
super(idct_8x8, sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import itertools
import numpy as np
import torch.nn as nn
assert_size_stride = t... | foxtrotmike/DiffJPEG | idct_8x8 | false | 12,397 | [
"MIT"
] | 0 | 7dbc44b1e921f20a213a7206a8578d6a1c8131b4 | https://github.com/foxtrotmike/DiffJPEG/tree/7dbc44b1e921f20a213a7206a8578d6a1c8131b4 |
WidthXHeightXFeatureLinear | import torch
from torch import nn
from torch.nn import Parameter
def positive(weight, cache=None):
weight.data *= weight.data.ge(0).float()
return cache
class WidthXHeightXFeatureLinear(nn.Module):
"""
Factorized fully connected layer. Weights are a sum of outer products between three vectors over w... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | dattientran/attorch | WidthXHeightXFeatureLinear | false | 12,398 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
SpatialTransformerXPooled3d | import torch
from torch import nn
from torch.nn import Parameter
from torch.nn import functional as F
def positive(weight, cache=None):
weight.data *= weight.data.ge(0).float()
return cache
class SpatialTransformerXPooled3d(nn.Module):
def __init__(self, in_shape, outdims, pool_steps=1, positive=False,... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from torch.nn import Parameter
assert_size_stride = torch._C._dynamo... | dattientran/attorch | SpatialTransformerXPooled3d | false | 12,399 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
GAT | import torch
import torch.nn as nn
import torch.nn.functional as F
class GraphAttentionLayer(nn.Module):
"""
Simple GAT layer, similar to https://arxiv.org/abs/1710.10903
"""
def __init__(self, in_features, out_features, dropout, alpha, concat=True):
super(GraphAttentionLayer, self).__init__(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | dzb1998/pyGAT | GAT | false | 12,400 | [
"MIT"
] | 0 | b794c65683bd12d3211e62b97732a905a24b9940 | https://github.com/dzb1998/pyGAT/tree/b794c65683bd12d3211e62b97732a905a24b9940 |
FullAttention | from torch.nn import Module
import torch
from torch.nn import Dropout
class FullAttention(Module):
def __init__(self, use_dropout=False, attention_dropout=0.1):
super().__init__()
self.use_dropout = use_dropout
self.dropout = Dropout(attention_dropout)
def forward(self, queries, keys... | 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.... | francescodisalvo05/LoFTR | FullAttention | false | 12,401 | [
"Apache-2.0"
] | 0 | 66372ebbe1ea97d57fe6cb8b5acf5cd92a87ef8d | https://github.com/francescodisalvo05/LoFTR/tree/66372ebbe1ea97d57fe6cb8b5acf5cd92a87ef8d |
SpatialTransformerPooled2d | import torch
from torch import nn
from torch.nn import Parameter
from torch.nn import functional as F
def positive(weight, cache=None):
weight.data *= weight.data.ge(0).float()
return cache
class SpatialTransformerPooled2d(nn.Module):
def __init__(self, in_shape, outdims, pool_steps=1, positive=False,
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from torch.nn import Parameter
assert_size_stride = torch._C._dynamo... | dattientran/attorch | SpatialTransformerPooled2d | false | 12,402 | [
"MIT"
] | 0 | 469b225846c6d8a7d833ebac19d040c7a407a0ff | https://github.com/dattientran/attorch/tree/469b225846c6d8a7d833ebac19d040c7a407a0ff |
DeepHeadModule | import torch
import torch.nn as nn
import torch.nn.functional as F
from math import sqrt as sqrt
from itertools import product as product
class DeepHeadModule(nn.Module):
def __init__(self, input_channels, output_channels):
super(DeepHeadModule, self).__init__()
self._input_channels = input_chann... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
from ma... | fuankarion/FaceDetection-DSFD | DeepHeadModule | false | 12,403 | [
"Apache-2.0"
] | 0 | f1e464ec5c9d95c2fe73edf44e4d414a464839b1 | https://github.com/fuankarion/FaceDetection-DSFD/tree/f1e464ec5c9d95c2fe73edf44e4d414a464839b1 |
LeCunTanh | import torch
import torch.nn as nn
class LeCunTanh(nn.Module):
def forward(self, x):
return 1.7159 * torch.tanh(2.0 / 3 * x)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | fmhoward/pysurvival | LeCunTanh | false | 12,404 | [
"Apache-2.0"
] | 0 | 3fea55f09477e9f0844845e09d6ea60434436e2e | https://github.com/fmhoward/pysurvival/tree/3fea55f09477e9f0844845e09d6ea60434436e2e |
CausalConv1d | import torch
from torch import nn
class CausalConv1d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=2, dilation=2):
super(CausalConv1d, self).__init__()
self.padding = dilation
self.causal_conv = nn.Conv1d(in_channels, out_channels, kernel_size,
padding=... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | gaetangate/FewRel | CausalConv1d | false | 12,405 | [
"MIT"
] | 0 | 150199d1060571315b1f370b3b3352d7a7c72dd5 | https://github.com/gaetangate/FewRel/tree/150199d1060571315b1f370b3b3352d7a7c72dd5 |
LinearAttention | from torch.nn import Module
import torch
def elu_feature_map(x):
return torch.nn.functional.elu(x) + 1
class LinearAttention(Module):
def __init__(self, eps=1e-06):
super().__init__()
self.feature_map = elu_feature_map
self.eps = eps
def forward(self, queries, keys, values, q_m... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn impor... | francescodisalvo05/LoFTR | LinearAttention | false | 12,406 | [
"Apache-2.0"
] | 0 | 66372ebbe1ea97d57fe6cb8b5acf5cd92a87ef8d | https://github.com/francescodisalvo05/LoFTR/tree/66372ebbe1ea97d57fe6cb8b5acf5cd92a87ef8d |
BPRLoss | import torch
from torch import nn
from torch.nn.modules.loss import *
from torch.nn.modules import *
from torch.optim import *
from torch.optim.lr_scheduler import *
import torch.backends
class PairwiseLoss(nn.Module):
"""Base class for pairwise loss functions.
Pairwise approached looks at a pair of document... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch import nn
f... | gavrin-s/catalyst | BPRLoss | false | 12,407 | [
"Apache-2.0"
] | 0 | 81087d8348b359e501d899f7a8350e0bedfc2b7d | https://github.com/gavrin-s/catalyst/tree/81087d8348b359e501d899f7a8350e0bedfc2b7d |
HuEtAl | import math
import torch
import torch.utils
import torch.utils.data
import torch.nn as nn
from torch.nn import init
class HuEtAl(nn.Module):
"""
Deep Convolutional Neural Networks for Hyperspectral Image Classification
Wei Hu, Yangyu Huang, Li Wei, Fan Zhang and Hengchao Li
Journal of Sensors, Volume ... | 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 ... | dikers/DeepHyper | HuEtAl | false | 12,408 | [
"Apache-2.0"
] | 0 | 827a8f3077e18b71cf448a2e56e49670428b1bfd | https://github.com/dikers/DeepHyper/tree/827a8f3077e18b71cf448a2e56e49670428b1bfd |
Lookahead | import torch
import torch.utils.data.distributed
import torch.nn as nn
import torch.nn.functional as F
class Lookahead(nn.Module):
def __init__(self, n_features, context):
super(Lookahead, self).__init__()
assert context > 0
self.context = context
self.n_features = n_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
import torch.utils.data.distributed
import torch.nn as nn
assert_size_stride = t... | gbaril/End-to-end-E2E-Named-Entity-Recognition-from-English-Speech | Lookahead | false | 12,409 | [
"Apache-2.0"
] | 0 | 9760a4ec3ba1c55bb4740c12c4542f13dd028695 | https://github.com/gbaril/End-to-end-E2E-Named-Entity-Recognition-from-English-Speech/tree/9760a4ec3ba1c55bb4740c12c4542f13dd028695 |
DenseBlock | import torch
from torch import nn
from torch.nn import functional as F
class CausalConv1d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=2, dilation=2):
super(CausalConv1d, self).__init__()
self.padding = dilation
self.causal_conv = nn.Conv1d(in_channels, out_channe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | gaetangate/FewRel | DenseBlock | false | 12,410 | [
"MIT"
] | 0 | 150199d1060571315b1f370b3b3352d7a7c72dd5 | https://github.com/gaetangate/FewRel/tree/150199d1060571315b1f370b3b3352d7a7c72dd5 |
MinibatchStd | import torch
import torch.nn as nn
import torch.utils.tensorboard
class MinibatchStd(nn.Module):
"""
Adds the aveage std of each data point over a
slice of the minibatch to that slice as a new
feature map. This gives an output with one extra
channel.
Arguments:
group_size (int): Number... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
import torch.utils.tensorboard
assert_size_stride = torch... | allenbao64/jamm-bandit | MinibatchStd | false | 12,411 | [
"Apache-2.0"
] | 0 | 06c9d8815ce907a68b0bc4ecf8bee4a2465c6a9e | https://github.com/allenbao64/jamm-bandit/tree/06c9d8815ce907a68b0bc4ecf8bee4a2465c6a9e |
SimpleSliceModel | import torch
import torch.onnx
import torch.nn
class SimpleSliceModel(torch.nn.Module):
def __init__(self):
super(SimpleSliceModel, self).__init__()
def forward(self, tensor):
other = (tensor + tensor)[1:]
return other[0][1:]
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.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | geoffberry/glow | SimpleSliceModel | false | 12,412 | [
"Apache-2.0"
] | 0 | 24b2827c830eb58af56a0704e899968026832e9c | https://github.com/geoffberry/glow/tree/24b2827c830eb58af56a0704e899968026832e9c |
HamidaEtAl | import torch
import torch.utils
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
class HamidaEtAl(nn.Module):
"""
3-D Deep Learning Approach for Remote Sensing Image Classification
Amina Ben Hamida, Alexandre Benoit, Patrick Lambert, Chokri Ben Amar
... | 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
import tor... | dikers/DeepHyper | HamidaEtAl | false | 12,413 | [
"Apache-2.0"
] | 0 | 827a8f3077e18b71cf448a2e56e49670428b1bfd | https://github.com/dikers/DeepHyper/tree/827a8f3077e18b71cf448a2e56e49670428b1bfd |
BarlowTwinsLoss | import torch
from torch import nn
from torch.nn.modules.loss import *
from torch.nn.modules import *
from torch.optim import *
from torch.optim.lr_scheduler import *
import torch.backends
class BarlowTwinsLoss(nn.Module):
"""The Contrastive embedding loss.
It has been proposed in `Barlow Twins:
Self-Supe... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | gavrin-s/catalyst | BarlowTwinsLoss | false | 12,414 | [
"Apache-2.0"
] | 0 | 81087d8348b359e501d899f7a8350e0bedfc2b7d | https://github.com/gavrin-s/catalyst/tree/81087d8348b359e501d899f7a8350e0bedfc2b7d |
Bar | import torch
import torch.onnx
import torch.nn
class Bar(torch.nn.Module):
def __init__(self, x):
super(Bar, self).__init__()
self.x = x
def forward(self, a, b):
return a * b + self.x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | geoffberry/glow | Bar | false | 12,415 | [
"Apache-2.0"
] | 0 | 24b2827c830eb58af56a0704e899968026832e9c | https://github.com/geoffberry/glow/tree/24b2827c830eb58af56a0704e899968026832e9c |
SimpleStackModel | import torch
import torch.onnx
import torch.nn
class SimpleStackModel(torch.nn.Module):
def __init__(self):
super(SimpleStackModel, self).__init__()
def forward(self, a, b):
c = torch.stack((a, b), 0)
d = torch.stack((c, c), 1)
return torch.stack((d, d), 2)
def get_inputs()... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | geoffberry/glow | SimpleStackModel | false | 12,416 | [
"Apache-2.0"
] | 0 | 24b2827c830eb58af56a0704e899968026832e9c | https://github.com/geoffberry/glow/tree/24b2827c830eb58af56a0704e899968026832e9c |
Baz | import torch
import torch.onnx
import torch.nn
class Baz(torch.nn.Module):
def __init__(self, x):
super(Baz, self).__init__()
self.x = x
def forward(self, a, b):
return a + b * self.x
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.onnx
import torch.nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guar... | geoffberry/glow | Baz | false | 12,417 | [
"Apache-2.0"
] | 0 | 24b2827c830eb58af56a0704e899968026832e9c | https://github.com/geoffberry/glow/tree/24b2827c830eb58af56a0704e899968026832e9c |
Conditional_Contrastive_loss_plus | import torch
import numpy as np
class Conditional_Contrastive_loss_plus(torch.nn.Module):
def __init__(self, device, batch_size, pos_collected_numerator):
super(Conditional_Contrastive_loss_plus, self).__init__()
self.device = device
self.batch_size = batch_size
self.pos_collected... | import torch
import triton
import triton.language 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 nump... | fywang0327/PyTorch-ECGAN | Conditional_Contrastive_loss_plus | false | 12,418 | [
"MIT"
] | 0 | 7c7c8c28c609b1bd2d3aecaeec4bffeb4c9cda6c | https://github.com/fywang0327/PyTorch-ECGAN/tree/7c7c8c28c609b1bd2d3aecaeec4bffeb4c9cda6c |
MLP | import torch
import torch.nn as nn
class MLP(nn.Module):
def __init__(self, input_size, output_size, hidden_size=500,
weight_decay=0.0):
super(MLP, self).__init__()
self.i2h = nn.Linear(in_features=input_size, out_features=hidden_size)
self.Dropout = nn.Dropout(p=0.5)
self... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | gchrupala/lyz | MLP | false | 12,419 | [
"MIT"
] | 0 | e1e99899af65f6c4cb1fd77485f6fa61ba3500f5 | https://github.com/gchrupala/lyz/tree/e1e99899af65f6c4cb1fd77485f6fa61ba3500f5 |
RWKV_ChannelMix | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
from torch.nn import functional as F
class RWKV_ChannelMix(nn.Module):
def __init__(self, config, layer_id):
super().__init__()
self.layer_id = layer_id
self.time_shift = nn.ZeroPad2d((0, 0, 1, -1))
h... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | gdtool/AI-Writer | RWKV_ChannelMix | false | 12,420 | [
"BSD-3-Clause"
] | 0 | 25582175376a1feb09aab9079f7e32bba30d0519 | https://github.com/gdtool/AI-Writer/tree/25582175376a1feb09aab9079f7e32bba30d0519 |
PSNRLoss | import torch
import torch.nn as nn
from torch.nn.functional import mse_loss
def psnr_loss(input: 'torch.Tensor', target: 'torch.Tensor', max_val: 'float'
) ->torch.Tensor:
"""Function that computes PSNR
See :class:`~kornia.losses.PSNRLoss` for details.
"""
if not torch.is_tensor(input) or not tor... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
from t... | gf0507033/kornia | PSNRLoss | false | 12,421 | [
"ECL-2.0",
"Apache-2.0"
] | 0 | 2624f40a62d3639e6d946f3ca41fd1ce4b9de82d | https://github.com/gf0507033/kornia/tree/2624f40a62d3639e6d946f3ca41fd1ce4b9de82d |
FEM | import torch
import torch.nn as nn
import torch.nn.functional as F
from math import sqrt as sqrt
from itertools import product as product
class FEM(nn.Module):
def __init__(self, channel_size):
super(FEM, self).__init__()
self.cs = channel_size
self.cpm1 = nn.Conv2d(self.cs, 256, kernel_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
from ma... | fuankarion/FaceDetection-DSFD | FEM | false | 12,422 | [
"Apache-2.0"
] | 0 | f1e464ec5c9d95c2fe73edf44e4d414a464839b1 | https://github.com/fuankarion/FaceDetection-DSFD/tree/f1e464ec5c9d95c2fe73edf44e4d414a464839b1 |
AgentNN | import torch
class AgentNN(torch.nn.Module):
""" Simple network. """
def __init__(self, D_in, D_out):
super(AgentNN, self).__init__()
self.linear1 = torch.nn.Linear(D_in, 20)
self.h1 = torch.nn.Linear(20, 15)
self.linear2 = torch.nn.Linear(15, D_out)
self.activation = ... | 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 ... | gimait/DaDSbot | AgentNN | false | 12,423 | [
"MIT"
] | 0 | 6ee6fea2339faa9a9a2fce29c3b00def378d88d3 | https://github.com/gimait/DaDSbot/tree/6ee6fea2339faa9a9a2fce29c3b00def378d88d3 |
AE_3D_small | import torch
import torch.nn as nn
import torch.utils.data
class AE_3D_small(nn.Module):
def __init__(self, n_features=4):
super(AE_3D_small, self).__init__()
self.en1 = nn.Linear(n_features, 3)
self.de1 = nn.Linear(3, n_features)
self.tanh = nn.Tanh()
def encode(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 torch.nn as ... | gitter-badger/HEPAutoencoders | AE_3D_small | false | 12,424 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_3D_50 | import torch
import torch.nn as nn
import torch.utils.data
class AE_3D_50(nn.Module):
def __init__(self, n_features=4):
super(AE_3D_50, self).__init__()
self.en1 = nn.Linear(n_features, 50)
self.en2 = nn.Linear(50, 50)
self.en3 = nn.Linear(50, 20)
self.en4 = nn.Linear(20, ... | 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 ... | gitter-badger/HEPAutoencoders | AE_3D_50 | false | 12,425 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
HuEtAl | import math
import torch
import torch.utils
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
class HuEtAl(nn.Module):
"""
Deep Convolutional Neural Networks for Hyperspectral Image Classification
Wei Hu, Yangyu Huang, Li Wei, Fan Zhang and Hengchao Li... | 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.... | giorgosouz/HSI-classification-using-state-of-the-art-models | HuEtAl | false | 12,426 | [
"MIT"
] | 0 | a925972ffe02c2cd1e5dde2b163e1faa854a4966 | https://github.com/giorgosouz/HSI-classification-using-state-of-the-art-models/tree/a925972ffe02c2cd1e5dde2b163e1faa854a4966 |
AE_3D_100 | import torch
import torch.nn as nn
import torch.utils.data
class AE_3D_100(nn.Module):
def __init__(self, n_features=4):
super(AE_3D_100, self).__init__()
self.en1 = nn.Linear(n_features, 100)
self.en2 = nn.Linear(100, 100)
self.en3 = nn.Linear(100, 50)
self.en4 = nn.Linea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_3D_100 | false | 12,427 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
Net | import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv2 = nn.Conv2d(3, 64, 8, 2, 3)
self.conv3 = nn.Conv2d(64, 128, 6, 2, 2)
self.conv4 = nn.Conv2d(128, 256, 4, 2, 1)
self.conv5 = 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.... | eric-yoo/HairNet | Net | false | 12,428 | [
"MIT"
] | 0 | 15725328709f3f0e63d122914f8e55d18c4fa1fa | https://github.com/eric-yoo/HairNet/tree/15725328709f3f0e63d122914f8e55d18c4fa1fa |
RMSELoss | import torch
import torch.nn as nn
import torch.utils.data
class RMSELoss(torch.nn.Module):
def __init__(self):
super(RMSELoss, self).__init__()
def forward(self, x, y):
criterion = nn.MSELoss()
loss = torch.sqrt(criterion(x, y))
return loss
def get_inputs():
return [to... | import torch
import triton
import triton.language 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.utils.data
asse... | gitter-badger/HEPAutoencoders | RMSELoss | false | 12,429 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AuxiliaryConvolutions | import torch
import torch.nn.functional as F
from torch import nn
import torch.optim
import torch.utils.data
class AuxiliaryConvolutions(nn.Module):
"""
Additional convolutions to produce higher-level feature maps.
"""
def __init__(self):
super(AuxiliaryConvolutions, self).__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import t... | doduythao/ssd | AuxiliaryConvolutions | false | 12,430 | [
"MIT"
] | 0 | 170064a3edef05d3274b08ea7f622eb3238b5c5c | https://github.com/doduythao/ssd/tree/170064a3edef05d3274b08ea7f622eb3238b5c5c |
AE_2D_v50 | import torch
import torch.nn as nn
import torch.utils.data
class AE_2D_v50(nn.Module):
def __init__(self, n_features=4):
super(AE_2D_v50, self).__init__()
self.en1 = nn.Linear(n_features, 50)
self.en2 = nn.Linear(50, 50)
self.en3 = nn.Linear(50, 50)
self.en4 = nn.Linear(50... | 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 ... | gitter-badger/HEPAutoencoders | AE_2D_v50 | false | 12,431 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_3D_200 | import torch
import torch.nn as nn
import torch.utils.data
class AE_3D_200(nn.Module):
def __init__(self, n_features=4):
super(AE_3D_200, self).__init__()
self.en1 = nn.Linear(n_features, 200)
self.en2 = nn.Linear(200, 100)
self.en3 = nn.Linear(100, 50)
self.en4 = nn.Linea... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_3D_200 | false | 12,432 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_3D_small_v2 | import torch
import torch.nn as nn
import torch.utils.data
class AE_3D_small_v2(nn.Module):
def __init__(self, n_features=4):
super(AE_3D_small_v2, self).__init__()
self.en1 = nn.Linear(n_features, 8)
self.en2 = nn.Linear(8, 3)
self.de1 = nn.Linear(3, 8)
self.de2 = 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.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_3D_small_v2 | false | 12,433 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_3D_50cone | import torch
import torch.nn as nn
import torch.utils.data
class AE_3D_50cone(nn.Module):
def __init__(self, n_features=4):
super(AE_3D_50cone, self).__init__()
self.en1 = nn.Linear(n_features, 50)
self.en2 = nn.Linear(50, 30)
self.en3 = nn.Linear(30, 20)
self.en4 = nn.Lin... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_3D_50cone | false | 12,434 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_2D_v3 | import torch
import torch.nn as nn
import torch.utils.data
class AE_2D_v3(nn.Module):
def __init__(self, n_features=4):
super(AE_2D_v3, self).__init__()
self.en1 = nn.Linear(n_features, 100)
self.en2 = nn.Linear(100, 200)
self.en3 = nn.Linear(200, 100)
self.en4 = nn.Linear... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_2D_v3 | false | 12,435 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_2D_v2 | import torch
import torch.nn as nn
import torch.utils.data
class AE_2D_v2(nn.Module):
def __init__(self, n_features=4):
super(AE_2D_v2, self).__init__()
self.en1 = nn.Linear(n_features, 50)
self.en2 = nn.Linear(50, 20)
self.en3 = nn.Linear(20, 10)
self.en4 = nn.Linear(10, ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_2D_v2 | false | 12,436 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_2D | import torch
import torch.nn as nn
import torch.utils.data
class AE_2D(nn.Module):
def __init__(self, n_features=4):
super(AE_2D, self).__init__()
self.en1 = nn.Linear(n_features, 20)
self.en2 = nn.Linear(20, 10)
self.en3 = nn.Linear(10, 6)
self.en4 = nn.Linear(6, 2)
... | 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 ... | gitter-badger/HEPAutoencoders | AE_2D | false | 12,437 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_2D_v100 | import torch
import torch.nn as nn
import torch.utils.data
class AE_2D_v100(nn.Module):
def __init__(self, n_features=4):
super(AE_2D_v100, self).__init__()
self.en1 = nn.Linear(n_features, 100)
self.en2 = nn.Linear(100, 100)
self.en3 = nn.Linear(100, 100)
self.en4 = nn.Li... | 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 ... | gitter-badger/HEPAutoencoders | AE_2D_v100 | false | 12,438 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_3D_50_no_last_bias | import torch
import torch.nn as nn
import torch.utils.data
class AE_3D_50_no_last_bias(nn.Module):
def __init__(self, n_features=4):
super(AE_3D_50_no_last_bias, self).__init__()
self.en1 = nn.Linear(n_features, 50)
self.en2 = nn.Linear(50, 50)
self.en3 = nn.Linear(50, 20)
... | 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 ... | gitter-badger/HEPAutoencoders | AE_3D_50_no_last_bias | false | 12,439 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_big_no_last_bias | import torch
import torch.nn as nn
import torch.utils.data
class AE_big_no_last_bias(nn.Module):
def __init__(self, n_features=4):
super(AE_big_no_last_bias, self).__init__()
self.en1 = nn.Linear(n_features, 8)
self.en2 = nn.Linear(8, 6)
self.en3 = nn.Linear(6, 4)
self.en4... | 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 ... | gitter-badger/HEPAutoencoders | AE_big_no_last_bias | false | 12,440 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
GeneralizedMeanPooling | import torch
from torch import nn
class GeneralizedMeanPooling(nn.Module):
"""Applies a 2D power-average adaptive pooling over an input signal composed of several input planes.
The function computed is: :math:`f(X) = pow(sum(pow(X, p)), 1/p)`
- At p = infinity, one gets Max Pooling
- At p = 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
from torch import nn
assert_... | gmt710/fast-reid | GeneralizedMeanPooling | false | 12,441 | [
"Apache-2.0"
] | 0 | 44a609280013eb6928f67c418c7212d67e40fb5d | https://github.com/gmt710/fast-reid/tree/44a609280013eb6928f67c418c7212d67e40fb5d |
AE_2D_v4 | import torch
import torch.nn as nn
import torch.utils.data
class AE_2D_v4(nn.Module):
def __init__(self, n_features=4):
super(AE_2D_v4, self).__init__()
self.en1 = nn.Linear(n_features, 500)
self.en2 = nn.Linear(500, 200)
self.en3 = nn.Linear(200, 100)
self.en4 = nn.Linear... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_2D_v4 | false | 12,442 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
ResBlock | import torch
import torch.nn as nn
class Mfm(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1, f_type=1):
super(Mfm, self).__init__()
self.out_channels = out_channels
if f_type == 1:
self.filter = nn.Conv2d(in_channels, 2 * o... | 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_... | githubhjx/Deep-Learning- | ResBlock | false | 12,443 | [
"Apache-2.0"
] | 0 | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | https://github.com/githubhjx/Deep-Learning-/tree/5a22fb5696d930ed334aa1cbf2b213956b1c7026 |
TLU | import torch
from torch import nn
from torch.nn import Parameter
from torch.nn.parameter import Parameter
class TLU(nn.Module):
def __init__(self, num_features):
"""max(y, tau) = max(y - tau, 0) + tau = ReLU(y - tau) + tau"""
super(TLU, self).__init__()
self.num_features = num_features
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from torch.nn import Parameter
from torch.nn.parameter import Parame... | gmt710/fast-reid | TLU | false | 12,444 | [
"Apache-2.0"
] | 0 | 44a609280013eb6928f67c418c7212d67e40fb5d | https://github.com/gmt710/fast-reid/tree/44a609280013eb6928f67c418c7212d67e40fb5d |
FReLU6Test | import torch
import torch.nn as nn
class FReLU6Test(nn.Module):
"""
Test for nn.functional types
"""
def __init__(self):
super(FReLU6Test, self).__init__()
def forward(self, x):
from torch.nn import functional as F
return F.relu6(x)
def get_inputs():
return [torch.r... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | goldbattle/onnx2keras | FReLU6Test | false | 12,445 | [
"MIT"
] | 0 | dcf52041299ce4216552d1132ec86eb4debd5303 | https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303 |
AE_big | import torch
import torch.nn as nn
import torch.utils.data
class AE_big(nn.Module):
def __init__(self, n_features=4):
super(AE_big, self).__init__()
self.en1 = nn.Linear(n_features, 8)
self.en2 = nn.Linear(8, 6)
self.en3 = nn.Linear(6, 4)
self.en4 = nn.Linear(4, 3)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_big | false | 12,446 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
Mfm | import torch
import torch.nn as nn
class Mfm(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1, f_type=1):
super(Mfm, self).__init__()
self.out_channels = out_channels
if f_type == 1:
self.filter = nn.Conv2d(in_channels, 2 * o... | 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_... | githubhjx/Deep-Learning- | Mfm | false | 12,447 | [
"Apache-2.0"
] | 0 | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | https://github.com/githubhjx/Deep-Learning-/tree/5a22fb5696d930ed334aa1cbf2b213956b1c7026 |
AE_2D_v1000 | import torch
import torch.nn as nn
import torch.utils.data
class AE_2D_v1000(nn.Module):
def __init__(self, n_features=4):
super(AE_2D_v1000, self).__init__()
self.en1 = nn.Linear(n_features, 1000)
self.en2 = nn.Linear(1000, 400)
self.en3 = nn.Linear(400, 100)
self.en4 = 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.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_2D_v1000 | false | 12,448 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
AE_2D_v5 | import torch
import torch.nn as nn
import torch.utils.data
class AE_2D_v5(nn.Module):
def __init__(self, n_features=4):
super(AE_2D_v5, self).__init__()
self.en1 = nn.Linear(n_features, 200)
self.en2 = nn.Linear(200, 100)
self.en3 = nn.Linear(100, 50)
self.en4 = nn.Linear(... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_2D_v5 | false | 12,449 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
FLogSigmoidTest | import torch
import torch.nn as nn
class FLogSigmoidTest(nn.Module):
"""
Test for nn.functional types
"""
def __init__(self):
super(FLogSigmoidTest, self).__init__()
def forward(self, x):
from torch.nn import functional as F
return F.logsigmoid(x)
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 import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import torc... | goldbattle/onnx2keras | FLogSigmoidTest | false | 12,450 | [
"MIT"
] | 0 | dcf52041299ce4216552d1132ec86eb4debd5303 | https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303 |
AE_big_2D_v3 | import torch
import torch.nn as nn
import torch.utils.data
class AE_big_2D_v3(nn.Module):
def __init__(self, n_features=4):
super(AE_big_2D_v3, self).__init__()
self.en1 = nn.Linear(n_features, 8)
self.en2 = nn.Linear(8, 6)
self.en3 = nn.Linear(6, 2)
self.de1 = nn.Linear(2... | 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 ... | gitter-badger/HEPAutoencoders | AE_big_2D_v3 | false | 12,451 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
FNormTest | import torch
import torch.nn as nn
class FNormTest(nn.Module):
"""
Test for nn.functional types
"""
def __init__(self):
super(FNormTest, self).__init__()
def forward(self, x):
x = torch.norm(x, p=2, dim=[1, 2])
return x
def get_inputs():
return [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_... | goldbattle/onnx2keras | FNormTest | false | 12,452 | [
"MIT"
] | 0 | dcf52041299ce4216552d1132ec86eb4debd5303 | https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303 |
Group | import torch
import torch.nn as nn
class Mfm(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1, f_type=1):
super(Mfm, self).__init__()
self.out_channels = out_channels
if f_type == 1:
self.filter = nn.Conv2d(in_channels, 2 * o... | 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_... | githubhjx/Deep-Learning- | Group | false | 12,453 | [
"Apache-2.0"
] | 0 | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | https://github.com/githubhjx/Deep-Learning-/tree/5a22fb5696d930ed334aa1cbf2b213956b1c7026 |
AE_big_2D_v1 | import torch
import torch.nn as nn
import torch.utils.data
class AE_big_2D_v1(nn.Module):
def __init__(self, n_features=4):
super(AE_big_2D_v1, self).__init__()
self.en1 = nn.Linear(n_features, 8)
self.en2 = nn.Linear(8, 6)
self.en3 = nn.Linear(6, 4)
self.en4 = nn.Linear(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.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_big_2D_v1 | false | 12,454 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
LayerReLU6Test | import torch
import torch.nn as nn
class LayerReLU6Test(nn.Module):
"""
Test for nn.layers based types
"""
def __init__(self):
super(LayerReLU6Test, self).__init__()
self.relu = nn.ReLU6()
def forward(self, x):
x = self.relu(x)
return x
def get_inputs():
ret... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | goldbattle/onnx2keras | LayerReLU6Test | false | 12,455 | [
"MIT"
] | 0 | dcf52041299ce4216552d1132ec86eb4debd5303 | https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303 |
FSoftmaxTest | import torch
import numpy as np
import torch.nn as nn
class FSoftmaxTest(nn.Module):
"""
Test for nn.functional types
"""
def __init__(self):
super(FSoftmaxTest, self).__init__()
self.dim = np.random.randint(0, 3)
def forward(self, x):
from torch.nn import functional as F... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import numpy as np
imp... | goldbattle/onnx2keras | FSoftmaxTest | false | 12,456 | [
"MIT"
] | 0 | dcf52041299ce4216552d1132ec86eb4debd5303 | https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303 |
LayerNorm | import torch
import torch.nn as nn
class LayerNorm(nn.Module):
def __init__(self, num_features, eps=1e-05, affine=True):
super(LayerNorm, self).__init__()
self.num_features = num_features
self.affine = affine
self.eps = eps
if self.affine:
self.gamma = nn.Param... | import torch
import triton
import triton.language 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_... | gntoni/pytorch-ddpg-naf | LayerNorm | false | 12,457 | [
"MIT"
] | 0 | d208d0c0c38a9d2d2041f1e7e95695359eba430e | https://github.com/gntoni/pytorch-ddpg-naf/tree/d208d0c0c38a9d2d2041f1e7e95695359eba430e |
MyElementwiseModule | import torch
import torch.nn.parallel
import torch.utils.data
import torch.onnx
import torch.fx
import torch.optim
import torch.utils.data.distributed
class MyElementwiseModule(torch.nn.Module):
def forward(self, x, y):
return x * y + y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.parallel
import torch.utils.data
import torch.onnx
import torch.fx
import torch.optim
import torch.utils.data.distributed
as... | goytoom/examples | MyElementwiseModule | false | 12,458 | [
"BSD-3-Clause"
] | 0 | 50b2a74dba897a1a98c8276043a3f5c6910c453a | https://github.com/goytoom/examples/tree/50b2a74dba897a1a98c8276043a3f5c6910c453a |
AE_big_2D_v2 | import torch
import torch.nn as nn
import torch.utils.data
class AE_big_2D_v2(nn.Module):
def __init__(self, n_features=4):
super(AE_big_2D_v2, self).__init__()
self.en1 = nn.Linear(n_features, 8)
self.en2 = nn.Linear(8, 6)
self.en3 = nn.Linear(6, 4)
self.en4 = nn.Linear(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.triton_helpers import libdevice
import torch.nn as ... | gitter-badger/HEPAutoencoders | AE_big_2D_v2 | false | 12,459 | [
"Apache-2.0"
] | 0 | 43010cd66fa4335a04b30b87926148e1c8d92de9 | https://github.com/gitter-badger/HEPAutoencoders/tree/43010cd66fa4335a04b30b87926148e1c8d92de9 |
Foo | import torch
import torch.nn.parallel
import torch.utils.data
import torch.onnx
import torch.fx
import torch.optim
import torch.utils.data.distributed
def add_lowp(a: 'torch.Tensor', b: 'torch.Tensor'):
a, b = a.float(), b.float()
c = a + b
return c.half()
def sigmoid_lowp(x: 'torch.Tensor'):
x = 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.parallel
import torch.utils.data
import torch.onnx
import torch.fx
import torch.optim
import torch.utils.data.distributed
as... | goytoom/examples | Foo | false | 12,460 | [
"BSD-3-Clause"
] | 0 | 50b2a74dba897a1a98c8276043a3f5c6910c453a | https://github.com/goytoom/examples/tree/50b2a74dba897a1a98c8276043a3f5c6910c453a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.