entry_point stringlengths 1 65 | original_triton_code stringlengths 4.5k 619k | python_code stringlengths 208 60.9k | 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 | pytorch_code stringlengths 200 4.05k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
PatchEmbedding | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class PatchEmbedding(nn.Module):
"""Image to Patch Embedding
"""
def __init__(self, patch_size=16, embed_dim=768):
super().__init__()
self.proj = nn.Conv2d(3, embed_dim, patch_size, patch_size)
def forward(self, x: 'torch.Tensor'):
x = self.p... | 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... | sithu31296/image_classification | PatchEmbedding | false | 16,464 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 | import torch
from torch import nn
class Model(nn.Module):
"""Image to Patch Embedding
"""
def __init__(self, patch_size=16, embed_dim=768):
super().__init__()
self.proj = nn.Conv2d(3, embed_dim, patch_size, patch_size)
def forward(self, x: 'torch.Tensor'):
x = self.proj(x)
... |
PixelNorm | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.utils.data
import torch
from torch import nn
class PixelNorm(nn.Module):
def __init__(self, epsilon=1e-08):
super(PixelNorm, self).__init__()
self.epsilon = epsilon
def forward(self, x):
tmp = torch.mul(x, x)
tmp1 = torch.rsqrt(torch.mean(tmp, 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.triton_helpers import libdevice
import torch.utils.data
import torch
from torch import nn
assert_size_stride = ... | siyuhuang/PoseStylizer | PixelNorm | false | 16,465 | [
"BSD-3-Clause"
] | 75 | d1d832781ddfd3efde24bf32b36a4074fafebcc1 | https://github.com/siyuhuang/PoseStylizer/tree/d1d832781ddfd3efde24bf32b36a4074fafebcc1 | import torch
import torch.utils.data
import torch
from torch import nn
class Model(nn.Module):
def __init__(self, epsilon=1e-08):
super().__init__()
self.epsilon = epsilon
def forward(self, x):
tmp = torch.mul(x, x)
tmp1 = torch.rsqrt(torch.mean(tmp, dim=1, keepdim=True) + se... |
ApplyStyle | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
class FC(nn.Module):
def __init__(self, in_channels, out_channels, gain=2 ** 0.5, use_wscale
=False, lrmul=1.0, bias=True):
super(FC, self).__init__()
he_std = gain * in_channels ** -0.5... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch
from torch import nn
import torch.nn.functi... | siyuhuang/PoseStylizer | ApplyStyle | false | 16,466 | [
"BSD-3-Clause"
] | 75 | d1d832781ddfd3efde24bf32b36a4074fafebcc1 | https://github.com/siyuhuang/PoseStylizer/tree/d1d832781ddfd3efde24bf32b36a4074fafebcc1 | import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
class FC(nn.Module):
def __init__(self, in_channels, out_channels, gain=2 ** 0.5, use_wscale
=False, lrmul=1.0, bias=True):
super().__init__()
he_std = gain * in_channels ** -0.5
... |
PatchEmbedOverlap | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import Tensor
from torch import nn
class PatchEmbedOverlap(nn.Module):
"""Image to Patch Embedding with overlapping
"""
def __init__(self, patch_size=16, stride=16, padding=0, embed_dim=768):
super().__init__()
self.proj = nn.Conv2d(3, embed_dim, patch_size, stride... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_st... | sithu31296/image_classification | PatchEmbedOverlap | false | 16,467 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 | import torch
from torch import Tensor
from torch import nn
class Model(nn.Module):
"""Image to Patch Embedding with overlapping
"""
def __init__(self, patch_size=16, stride=16, padding=0, embed_dim=768):
super().__init__()
self.proj = nn.Conv2d(3, embed_dim, patch_size, stride, padding)
... |
DistillationLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import Tensor
from torch import nn
from typing import Union
class DistillationLoss(nn.Module):
"""Distilling the Knowledge in a Neural Network
https://arxiv.org/pdf/1503.02531.pdf
"""
def __init__(self, alpha: 'float'=0.95, temp: 'Union[float, int]'=6
) ->None:
... | import torch
import triton
import triton.language 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 ... | sithu31296/image_classification | DistillationLoss | false | 16,468 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 | import torch
from torch import Tensor
from torch import nn
from typing import Union
class Model(nn.Module):
"""Distilling the Knowledge in a Neural Network
https://arxiv.org/pdf/1503.02531.pdf
"""
def __init__(self, alpha: 'float'=0.95, temp: 'Union[float, int]'=6
) ->None:
super().__... |
DepthGTLoss | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
class DepthGTLoss(torch.nn.Module):
"""
A simple L1 loss, but restricted to the cropped center of the image.
It also does not count pixels outside of a given range of values (in target).
Additionally, there is also an L1 loss on the gradient.
"""
def __init__(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
from torch._inductor.runtime.... | simon-donne/defusr | DepthGTLoss | false | 16,469 | [
"MIT"
] | 65 | fa4275070af4024eea128e99d7c6df2358d129a5 | https://github.com/simon-donne/defusr/tree/fa4275070af4024eea128e99d7c6df2358d129a5 | import torch
import numpy as np
class Model(torch.nn.Module):
"""
A simple L1 loss, but restricted to the cropped center of the image.
It also does not count pixels outside of a given range of values (in target).
Additionally, there is also an L1 loss on the gradient.
"""
def __init__(self, c... |
FC | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
class FC(nn.Module):
def __init__(self, in_channels, out_channels, gain=2 ** 0.5, use_wscale
=False, lrmul=1.0, bias=True):
super(FC, self).__init__()
he_std = gain * in_channels ** -0.5... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch
from torch import nn
assert_size_stride = t... | siyuhuang/PoseStylizer | FC | false | 16,470 | [
"BSD-3-Clause"
] | 75 | d1d832781ddfd3efde24bf32b36a4074fafebcc1 | https://github.com/siyuhuang/PoseStylizer/tree/d1d832781ddfd3efde24bf32b36a4074fafebcc1 | import torch
import torch.utils.data
import torch
from torch import nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, in_channels, out_channels, gain=2 ** 0.5, use_wscale
=False, lrmul=1.0, bias=True):
super().__init__()
he_std = gain * in_channels ** -0.5
... |
FCUDown | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class FCUDown(nn.Module):
def __init__(self, c1, c2, dw_stride):
super().__init__()
self.conv_project = nn.Conv2d(c1, c2, 1, 1, 0)
self.sample_pooling = nn.AvgPool2d(dw_stride, dw_stride)
self.ln = nn.LayerNorm(c2)
self.act = nn.GELU()
... | 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... | sithu31296/image_classification | FCUDown | false | 16,471 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, c1, c2, dw_stride):
super().__init__()
self.conv_project = nn.Conv2d(c1, c2, 1, 1, 0)
self.sample_pooling = nn.AvgPool2d(dw_stride, dw_stride)
self.ln = nn.LayerNorm(c2)
self.act = nn.GELU()
... |
LocalNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class LocalNet(nn.Module):
def forward(self, x_in):
"""Defines a double convolution
:param x_in: input convolutional features
:returns: convolutional features
:rtype: Tensor
"""
x = self.lrelu(self.conv1(self.refpad(x_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.triton_helpers import math as tl_math
import torch.... | sjmoran/CURL | LocalNet | false | 16,472 | [
"BSD-3-Clause"
] | 125 | 919e519717b66e14d92ac6fa404c328ee3f254a5 | https://github.com/sjmoran/CURL/tree/919e519717b66e14d92ac6fa404c328ee3f254a5 | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x_in):
"""Defines a double convolution
:param x_in: input convolutional features
:returns: convolutional features
:rtype: Tensor
"""
x = self.lrelu(self.conv1(self.refpad(x_in)))
... |
MidNet4 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class MidNet4(nn.Module):
def forward(self, x_in):
"""Network with dilation rate 4
:param x_in: input convolutional features
:returns: processed convolutional features
:rtype: Tensor
"""
x = self.lrelu(self.conv1(x_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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | sjmoran/CURL | MidNet4 | false | 16,473 | [
"BSD-3-Clause"
] | 125 | 919e519717b66e14d92ac6fa404c328ee3f254a5 | https://github.com/sjmoran/CURL/tree/919e519717b66e14d92ac6fa404c328ee3f254a5 | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x_in):
"""Network with dilation rate 4
:param x_in: input convolutional features
:returns: processed convolutional features
:rtype: Tensor
"""
x = self.lrelu(self.conv1(x_in))
x ... |
XCA | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import Tensor
from torch import nn
from torch.nn import functional as F
class XCA(nn.Module):
""" Cross-Covariance Attention (XCA) operation where the channels are updated using a weighted
sum. The weights are obtained from the (softmax normalized) Cross-covariance
matrix (Q^T K \... | 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.... | sithu31296/image_classification | XCA | false | 16,474 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 | import torch
from torch import Tensor
from torch import nn
from torch.nn import functional as F
class Model(nn.Module):
""" Cross-Covariance Attention (XCA) operation where the channels are updated using a weighted
sum. The weights are obtained from the (softmax normalized) Cross-covariance
matrix (Q^T K... |
ConvBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Block(nn.Module):
def __init__(self):
"""Initialisation for a lower-level DeepLPF conv block
:returns: N/A
:rtype: N/A
"""
super(Block, self).__init__()
def conv3x3(self, in_channels, out_channels, stride=1):
"""Repre... | 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... | sjmoran/CURL | ConvBlock | false | 16,475 | [
"BSD-3-Clause"
] | 125 | 919e519717b66e14d92ac6fa404c328ee3f254a5 | https://github.com/sjmoran/CURL/tree/919e519717b66e14d92ac6fa404c328ee3f254a5 | import torch
import torch.nn as nn
class Block(nn.Module):
def __init__(self):
"""Initialisation for a lower-level DeepLPF conv block
:returns: N/A
:rtype: N/A
"""
super().__init__()
def conv3x3(self, in_channels, out_channels, stride=1):
"""Represents a con... |
PoolFormerBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import Tensor
from torch import nn
class DropPath(nn.Module):
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
Copied from timm
This is the same as the DropConnect impl I created for EfficientNet, etc networks, however,
the original na... | 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.... | sithu31296/image_classification | PoolFormerBlock | false | 16,476 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 | import torch
from torch import Tensor
from torch import nn
class DropPath(nn.Module):
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
Copied from timm
This is the same as the DropConnect impl I created for EfficientNet, etc networks, however,
the original na... |
stack_pool | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class stack_pool(nn.Module):
def __init__(self):
super(stack_pool, self).__init__()
self.pool2 = nn.MaxPool2d(2, stride=2)
self.pool2s1 = nn.MaxPool2d(2, stride=1)
self.pool3s1 = nn.MaxPool2d(3, stride=1, padding=1)
self.padding = nn.Repl... | import torch
import triton
import triton.language 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... | siyuhuang/crowdcount-stackedpool | stack_pool | false | 16,477 | [
"MIT"
] | 93 | bbba3d9e91a5a89642b4bd3638ae8e68801ea7bf | https://github.com/siyuhuang/crowdcount-stackedpool/tree/bbba3d9e91a5a89642b4bd3638ae8e68801ea7bf | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.pool2 = nn.MaxPool2d(2, stride=2)
self.pool2s1 = nn.MaxPool2d(2, stride=1)
self.pool3s1 = nn.MaxPool2d(3, stride=1, padding=1)
self.padding = nn.ReplicationPad2d((0, 1, 0... |
multi_pool | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class multi_pool(nn.Module):
def __init__(self):
super(multi_pool, self).__init__()
self.pool2 = nn.MaxPool2d(2, stride=2)
self.pool4 = nn.MaxPool2d(4, stride=2, padding=1)
self.pool8 = nn.MaxPool2d(8, stride=2, padding=3)
def forward(self, ... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | siyuhuang/crowdcount-stackedpool | multi_pool | false | 16,478 | [
"MIT"
] | 93 | bbba3d9e91a5a89642b4bd3638ae8e68801ea7bf | https://github.com/siyuhuang/crowdcount-stackedpool/tree/bbba3d9e91a5a89642b4bd3638ae8e68801ea7bf | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
self.pool2 = nn.MaxPool2d(2, stride=2)
self.pool4 = nn.MaxPool2d(4, stride=2, padding=1)
self.pool8 = nn.MaxPool2d(8, stride=2, padding=3)
def forward(self, x):
x1 = self... |
ClipLayer | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
def clip_data(data, max_norm):
norms = torch.norm(data.reshape(data.shape[0], -1), dim=-1)
scale = (max_norm / norms).clamp(max=1.0)
data *= scale.reshape(-1, 1, 1, 1)
return data
class ClipLayer(nn.Module):
def __init__(self, max_norm):
super(ClipLaye... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert... | skat00sh/Handcrafted-DP | ClipLayer | false | 16,479 | [
"MIT"
] | 48 | d1f8bc004adc240d5c424a10bdcc30fc266c8218 | https://github.com/skat00sh/Handcrafted-DP/tree/d1f8bc004adc240d5c424a10bdcc30fc266c8218 | import torch
import torch.nn as nn
def clip_data(data, max_norm):
norms = torch.norm(data.reshape(data.shape[0], -1), dim=-1)
scale = (max_norm / norms).clamp(max=1.0)
data *= scale.reshape(-1, 1, 1, 1)
return data
class Model(nn.Module):
def __init__(self, max_norm):
super().__init__()... |
MidNet2 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class MidNet2(nn.Module):
def forward(self, x_in):
"""Network with dilation rate 2
:param x_in: input convolutional features
:returns: processed convolutional features
:rtype: Tensor
"""
x = self.lrelu(self.conv1... | 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... | sjmoran/CURL | MidNet2 | false | 16,480 | [
"BSD-3-Clause"
] | 125 | 919e519717b66e14d92ac6fa404c328ee3f254a5 | https://github.com/sjmoran/CURL/tree/919e519717b66e14d92ac6fa404c328ee3f254a5 | import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x_in):
"""Network with dilation rate 2
:param x_in: input convolutional features
:returns: processed convolutional features
:rtype: Tensor
"""
x = self.lrelu(self.conv1(x... |
Actor | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Actor(nn.Module):
"""Initialize parameters and build model.
An nn.Module contains layers, and a method
forward(input)that returns the output.
Weights (learnable params) are inherently defined here.
Args:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | sofya-pugach/spot_mini_mini | Actor | false | 16,481 | [
"MIT"
] | 323 | 42770145e91ed2625ccc7e4f4d7016ce14a61464 | https://github.com/sofya-pugach/spot_mini_mini/tree/42770145e91ed2625ccc7e4f4d7016ce14a61464 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""Initialize parameters and build model.
An nn.Module contains layers, and a method
forward(input)that returns the output.
Weights (learnable params) are inherently defined here.
Args:
... |
CA | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import Tensor
from torch import nn
class CA(nn.Module):
"""ClassAttention as in CaiT
"""
def __init__(self, dim: 'int', heads: 'int'):
super().__init__()
self.num_heads = heads
self.scale = (dim // heads) ** -0.5
self.qkv = nn.Linear(dim, dim * 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 import triton_helpers
from torch._inductor.runtime.... | sithu31296/image_classification | CA | false | 16,482 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 | import torch
from torch import Tensor
from torch import nn
class Model(nn.Module):
"""ClassAttention as in CaiT
"""
def __init__(self, dim: 'int', heads: 'int'):
super().__init__()
self.num_heads = heads
self.scale = (dim // heads) ** -0.5
self.qkv = nn.Linear(dim, dim * 3... |
OutlookAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
from torch import Tensor
from torch import nn
from torch.nn import functional as F
class OutlookAttention(nn.Module):
def __init__(self, dim, num_heads, k=3, s=1, p=1):
super().__init__()
self.s = s
self.k = k
self.p = p
self.num_heads = num_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.... | sithu31296/image_classification | OutlookAttention | false | 16,483 | [
"MIT"
] | 57 | 6b8cbce96100225621cee3166a73e852ba216cc3 | https://github.com/sithu31296/image_classification/tree/6b8cbce96100225621cee3166a73e852ba216cc3 | import math
import torch
from torch import Tensor
from torch import nn
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, dim, num_heads, k=3, s=1, p=1):
super().__init__()
self.s = s
self.k = k
self.p = p
self.num_heads = num_heads
sel... |
GlobalAvgPool2d | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.utils
class GlobalAvgPool2d(nn.Module):
def __init__(self):
"""Global average pooling over the input's spatial dimensions"""
super(GlobalAvgPool2d, self).__init__()
def forward(self, inputs):
in_size = inputs.size()
inputs = inp... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dyna... | songzijiang/FasterSeg | GlobalAvgPool2d | false | 16,484 | [
"MIT"
] | 334 | 1a14ef6dd665afd229a16ab43b532b5a406512f8 | https://github.com/songzijiang/FasterSeg/tree/1a14ef6dd665afd229a16ab43b532b5a406512f8 | import torch
import torch.nn as nn
import torch.utils
class Model(nn.Module):
def __init__(self):
"""Global average pooling over the input's spatial dimensions"""
super().__init__()
def forward(self, inputs):
in_size = inputs.size()
inputs = inputs.view((in_size[0], in_size[1... |
Critic | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class Critic(nn.Module):
"""Initialize parameters and build model.
Args:
state_dim (int): Dimension of each state
action_dim (int): Dimension of each action
Return:
value output of network
"... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import ... | sofya-pugach/spot_mini_mini | Critic | false | 16,485 | [
"MIT"
] | 323 | 42770145e91ed2625ccc7e4f4d7016ce14a61464 | https://github.com/sofya-pugach/spot_mini_mini/tree/42770145e91ed2625ccc7e4f4d7016ce14a61464 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
"""Initialize parameters and build model.
Args:
state_dim (int): Dimension of each state
action_dim (int): Dimension of each action
Return:
value output of network
""... |
USConv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils
def make_divisible(v, divisor=8, min_value=1):
"""
forked from slim:
https://github.com/tensorflow/models/blob/ 0344c5503ee55e24f0de7f37336a6e08f10976fd/ research/slim/nets/mobilenet/mobilenet.py#L62-L69
"""
if min_value is None:
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils
assert_size_stride = torch._C._dynamo.g... | songzijiang/FasterSeg | USConv2d | false | 16,486 | [
"MIT"
] | 334 | 1a14ef6dd665afd229a16ab43b532b5a406512f8 | https://github.com/songzijiang/FasterSeg/tree/1a14ef6dd665afd229a16ab43b532b5a406512f8 | import torch
import torch.nn as nn
import torch.utils
def make_divisible(v, divisor=8, min_value=1):
"""
forked from slim:
https://github.com/tensorflow/models/blob/ 0344c5503ee55e24f0de7f37336a6e08f10976fd/ research/slim/nets/mobilenet/mobilenet.py#L62-L69
"""
if min_value is None:
... |
PolicyNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
class PolicyNetwork(nn.Module):
def __init__(self, num_inputs, num_actions, hidden_size, init_w=0.003,
log_std_min=-20, log_std_max=2):
super(PolicyNetwork, self).__init__()
self.log_... | 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 to... | sofya-pugach/spot_mini_mini | PolicyNetwork | false | 16,487 | [
"MIT"
] | 323 | 42770145e91ed2625ccc7e4f4d7016ce14a61464 | https://github.com/sofya-pugach/spot_mini_mini/tree/42770145e91ed2625ccc7e4f4d7016ce14a61464 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
class Model(nn.Module):
def __init__(self, num_inputs, num_actions, hidden_size, init_w=0.003,
log_std_min=-20, log_std_max=2):
super().__init__()
self.log_std_min = log_std_min
... |
SplitAndConcat | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.utils.data
class SplitAndConcat(nn.Module):
"""Split the data from split_dim and concatenate in concat_dim.
@param split_dim from which axis the data will be chunk
@param concat_dim to which axis the data will be concatenated
@param chunk size of the da... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C.... | sstsai-adl/d2go | SplitAndConcat | false | 16,488 | [
"Apache-2.0"
] | 687 | 6cff773797b14698043589afe57ea67cd76286f9 | https://github.com/sstsai-adl/d2go/tree/6cff773797b14698043589afe57ea67cd76286f9 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
"""Split the data from split_dim and concatenate in concat_dim.
@param split_dim from which axis the data will be chunk
@param concat_dim to which axis the data will be concatenated
@param chunk size of the data to be ... |
conv_head_pooling | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.utils.data
class conv_head_pooling(nn.Module):
def __init__(self, in_feature, out_feature, stride, conv_type,
padding_mode='zeros', dilation=1):
super(conv_head_pooling, self).__init__()
if conv_type == 'depthwise':
_groups = 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
import torch.nn as nn
import torch.utils.data
assert_size_stride = torch._C._dyn... | sstsai-adl/d2go | conv_head_pooling | false | 16,489 | [
"Apache-2.0"
] | 687 | 6cff773797b14698043589afe57ea67cd76286f9 | https://github.com/sstsai-adl/d2go/tree/6cff773797b14698043589afe57ea67cd76286f9 | import torch
import torch.nn as nn
import torch.utils.data
class Model(nn.Module):
def __init__(self, in_feature, out_feature, stride, conv_type,
padding_mode='zeros', dilation=1):
super().__init__()
if conv_type == 'depthwise':
_groups = in_feature
else:
_... |
GCNLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class GCNLayer(nn.Module):
def __init__(self, input_dim, output_dim, prop_depth=1, act=torch.relu,
dropout=0.0, layer_i=0):
super(GCNLayer, self).__init__()
self.prop_depth = 1
self.weight = nn.Parameter(torch.empty(input_dim, output_dim, dtype
... | 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_... | snap-stanford/distance-encoding | GCNLayer | false | 16,490 | [
"MIT"
] | 177 | b9ccb1b59422b11b40883d0284d7fc9ba88efdb6 | https://github.com/snap-stanford/distance-encoding/tree/b9ccb1b59422b11b40883d0284d7fc9ba88efdb6 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, output_dim, prop_depth=1, act=torch.relu,
dropout=0.0, layer_i=0):
super().__init__()
self.prop_depth = 1
self.weight = nn.Parameter(torch.empty(input_dim, output_dim, dtype
=torch... |
SigmoidFocalLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.utils
class SigmoidFocalLoss(nn.Module):
def __init__(self, ignore_label, gamma=2.0, alpha=0.25, reduction='mean'):
super(SigmoidFocalLoss, self).__init__()
self.ignore_label = ignore_label
self.gamma = gamma
self.alpha = alpha
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | songzijiang/FasterSeg | SigmoidFocalLoss | false | 16,491 | [
"MIT"
] | 334 | 1a14ef6dd665afd229a16ab43b532b5a406512f8 | https://github.com/songzijiang/FasterSeg/tree/1a14ef6dd665afd229a16ab43b532b5a406512f8 | import torch
import torch.nn as nn
import torch.utils
class Model(nn.Module):
def __init__(self, ignore_label, gamma=2.0, alpha=0.25, reduction='mean'):
super().__init__()
self.ignore_label = ignore_label
self.gamma = gamma
self.alpha = alpha
self.reduction = reduction
... |
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import random
import torch
import numpy as np
from torch import nn
class MLP(nn.Module):
def __init__(self, kernels, num_features, num_hiddens, normalize=True,
num_updates=3000, batch_size=128, weight_decay=0.0001, soft_preds=False
):
super().__init__()
self.kernels = kernels
... | 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.... | snipsco/tract | MLP | false | 16,492 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 588 | 7a54972764292bccf1737ff8bbcfa1e1736e3fad | https://github.com/snipsco/tract/tree/7a54972764292bccf1737ff8bbcfa1e1736e3fad | import random
import torch
import numpy as np
from torch import nn
class Model(nn.Module):
def __init__(self, kernels, num_features, num_hiddens, normalize=True,
num_updates=3000, batch_size=128, weight_decay=0.0001, soft_preds=False
):
super().__init__()
self.kernels = kernels
... |
Residual_Covolution | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class Residual_Covolution(nn.Module):
def __init__(self, icol, ocol, num_classes):
super(Residual_Covolution, self).__init__()
self.conv1 = nn.Conv2d(icol, ocol, kernel_size=3, stride=1, padding
=12, dilation=12, bias=True)
self.conv2 = 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._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | speedinghzl/Pytorch-Deeplab | Residual_Covolution | false | 16,493 | [
"MIT"
] | 310 | 14f2b81c676a6eb19f34940efb1297855f8fa05e | https://github.com/speedinghzl/Pytorch-Deeplab/tree/14f2b81c676a6eb19f34940efb1297855f8fa05e | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, icol, ocol, num_classes):
super().__init__()
self.conv1 = nn.Conv2d(icol, ocol, kernel_size=3, stride=1, padding
=12, dilation=12, bias=True)
self.conv2 = nn.Conv2d(ocol, num_classes, kernel_size=3, ... |
MyWcploss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
class MyWcploss(nn.Module):
def __init__(self):
super(MyWcploss, self).__init__()
def forward(self, pred, gt):
eposion = 1e-10
torch.sigmoid(pred)
count_pos = torch.sum(gt) * 1.0 + eposion
count_neg = torch.sum(1.0 - gt) * 1.0
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch ... | stevewongv/DSC-PyTorch | MyWcploss | false | 16,494 | [
"MIT"
] | 75 | 4318225ce4fa5343db2cc723d8bcae4c884b23f4 | https://github.com/stevewongv/DSC-PyTorch/tree/4318225ce4fa5343db2cc723d8bcae4c884b23f4 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, pred, gt):
eposion = 1e-10
torch.sigmoid(pred)
count_pos = torch.sum(gt) * 1.0 + eposion
count_neg = torch.sum(1.0 - gt) * 1.0
beta = count_neg /... |
DistanceNetwork | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class DistanceNetwork(nn.Module):
def __init__(self):
super(DistanceNetwork, self).__init__()
def forward(self, support_set, input_image):
"""
Produces pdfs over the support set classes for the target set image.
:param support_set: The embed... | 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.... | stamatiad/MatchingNetworks | DistanceNetwork | false | 16,495 | [
"MIT"
] | 316 | 07c4567c15578664a550903c222c7eaa2abfe113 | https://github.com/stamatiad/MatchingNetworks/tree/07c4567c15578664a550903c222c7eaa2abfe113 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, support_set, input_image):
"""
Produces pdfs over the support set classes for the target set image.
:param support_set: The embeddings of the support set images... |
ConvNet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.optim
import torch.nn as nn
import torch.nn.functional as F
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = 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
import torch.optim
import tor... | stanbiryukov/PyTorch-LBFGS | ConvNet | false | 16,496 | [
"MIT"
] | 451 | ea0ca553797b38d47682ce8ff553a4f53ec8c15c | https://github.com/stanbiryukov/PyTorch-LBFGS/tree/ea0ca553797b38d47682ce8ff553a4f53ec8c15c | import torch
import torch.optim
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 5 ... |
ShallowCombination | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class ShallowCombination(nn.Module):
"""This Module can be used to generate a shallow combination from two embeddings using a gate."""
def __init__(self, bertram_config: 'BertramConfig'):
super(ShallowCombination, 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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | stefan-it/bertram | ShallowCombination | false | 16,497 | [
"Apache-2.0"
] | 50 | 2e449cdc677577d1ca8b9daf852f324be4074940 | https://github.com/stefan-it/bertram/tree/2e449cdc677577d1ca8b9daf852f324be4074940 | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class Model(nn.Module):
"""This Module can be used to generate a shallow combination from two embeddings using a gate."""
def __init__(self, bertram_config: 'BertramConfig'):
super().__init__()
self.linear = nn.L... |
PEGCNLayer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class PEGCNLayer(nn.Module):
def __init__(self, input_dim, output_dim, prop_depth, act=torch.relu,
dropout=0.0, layer_i=0):
super(PEGCNLayer, self).__init__()
self.prop_depth = prop_depth
self.act = act
self.weight = nn.Parameter(torch.em... | 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.... | snap-stanford/distance-encoding | PEGCNLayer | false | 16,498 | [
"MIT"
] | 177 | b9ccb1b59422b11b40883d0284d7fc9ba88efdb6 | https://github.com/snap-stanford/distance-encoding/tree/b9ccb1b59422b11b40883d0284d7fc9ba88efdb6 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_dim, output_dim, prop_depth, act=torch.relu,
dropout=0.0, layer_i=0):
super().__init__()
self.prop_depth = prop_depth
self.act = act
self.weight = nn.Parameter(torch.empty(1, prop_depth, in... |
Predict | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class Predict(nn.Module):
def __init__(self, in_planes=32, out_planes=1, kernel_size=1):
super(Predict, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, kernel_size)
def forward(self, x):
y = self.conv(x)
return y
def get_input... | 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... | stevewongv/DSC-PyTorch | Predict | false | 16,499 | [
"MIT"
] | 75 | 4318225ce4fa5343db2cc723d8bcae4c884b23f4 | https://github.com/stevewongv/DSC-PyTorch/tree/4318225ce4fa5343db2cc723d8bcae4c884b23f4 | import torch
from torch import nn
class Model(nn.Module):
def __init__(self, in_planes=32, out_planes=1, kernel_size=1):
super().__init__()
self.conv = nn.Conv2d(in_planes, out_planes, kernel_size)
def forward(self, x):
y = self.conv(x)
return y
def get_inputs():
return... |
LearnedPositionalEmbedding1D | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
class LearnedPositionalEmbedding1D(nn.Module):
"""Adds (optionally learned) positional embeddings to the inputs."""
def __init__(self, seq_len, dim):
super().__init__()
self.pos_embedding = nn.Parameter(torch.zeros(1, seq_len, dim))
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 import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_str... | styler00dollar/Colab-animesion | LearnedPositionalEmbedding1D | false | 16,500 | [
"MIT"
] | 67 | 0fa603689fec3ed4ede098fd7c15b519dbb76a09 | https://github.com/styler00dollar/Colab-animesion/tree/0fa603689fec3ed4ede098fd7c15b519dbb76a09 | import torch
from torch import nn
class Model(nn.Module):
"""Adds (optionally learned) positional embeddings to the inputs."""
def __init__(self, seq_len, dim):
super().__init__()
self.pos_embedding = nn.Parameter(torch.zeros(1, seq_len, dim))
def forward(self, x):
"""Input has s... |
CNN | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils
class CNN(nn.Module):
def __init__(self, e_char, filters, padding=1, kernel_size=5):
super(CNN, self).__init__()
self.e_char = e_char
self.filters = filters
self.padding = padding
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
import ... | stxxllbu/CS224n-winter-together | CNN | false | 16,501 | [
"Apache-2.0"
] | 468 | eae158ed8e88dc7c8638e25bac4c4fc8eeddcc8c | https://github.com/stxxllbu/CS224n-winter-together/tree/eae158ed8e88dc7c8638e25bac4c4fc8eeddcc8c | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils
class Model(nn.Module):
def __init__(self, e_char, filters, padding=1, kernel_size=5):
super().__init__()
self.e_char = e_char
self.filters = filters
self.padding = padding
self.k = ke... |
ScoreNetwork | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch.nn import Tanh
from torch.nn import Linear
class ScoreNetwork(Module):
"""
An optimized single hidden layer neural network for attention scores.
The optimization idea behind this network is that projection of keys can
performed only once without conc... | 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... | stungkit/Copycat-abstractive-opinion-summarizer | ScoreNetwork | false | 16,502 | [
"MIT"
] | 51 | 04fe5393a7bb6883516766b762f6a0c530e95375 | https://github.com/stungkit/Copycat-abstractive-opinion-summarizer/tree/04fe5393a7bb6883516766b762f6a0c530e95375 | from torch.nn import Module
import torch
from torch.nn import Tanh
from torch.nn import Linear
class Model(Module):
"""
An optimized single hidden layer neural network for attention scores.
The optimization idea behind this network is that projection of keys can
performed only once without concatenati... |
ContrastiveLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
class ContrastiveLoss(torch.nn.Module):
"""
Contrastive loss function.
Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
"""
def __init__(self, margin=2.0):
super(ContrastiveLoss, self).__init__()
self.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
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._... | sugi-chan/project_pendragon | ContrastiveLoss | false | 16,503 | [
"MIT"
] | 56 | 267624365f25964fece1952e6dcde629bbc2ee5b | https://github.com/sugi-chan/project_pendragon/tree/267624365f25964fece1952e6dcde629bbc2ee5b | import torch
import torch.nn.functional as F
class Model(torch.nn.Module):
"""
Contrastive loss function.
Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
"""
def __init__(self, margin=2.0):
super().__init__()
self.margin = margin
def forward(self, ... |
Highway | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.utils
class Highway(nn.Module):
def __init__(self, eword_size):
super(Highway, self).__init__()
self.eword_size = eword_size
self.w_proj = nn.Linear(self.eword_size, self.eword_size, bias=True)
self.w_gate = nn.Linear(self.eword_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
import ... | stxxllbu/CS224n-winter-together | Highway | false | 16,504 | [
"Apache-2.0"
] | 468 | eae158ed8e88dc7c8638e25bac4c4fc8eeddcc8c | https://github.com/stxxllbu/CS224n-winter-together/tree/eae158ed8e88dc7c8638e25bac4c4fc8eeddcc8c | import torch
import torch.nn as nn
import torch.nn.utils
class Model(nn.Module):
def __init__(self, eword_size):
super().__init__()
self.eword_size = eword_size
self.w_proj = nn.Linear(self.eword_size, self.eword_size, bias=True)
self.w_gate = nn.Linear(self.eword_size, self.eword... |
MyKernelTorch | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class MyKernelTorch(nn.Module):
def __init__(self, n_features: 'int'):
super().__init__()
self.dense1 = nn.Linear(n_features, 20)
self.dense2 = nn.Linear(20, 2)
def forward(self, x: 'torch.Tensor') ->torch.Tensor:
x = nn.ReLU()(self.dense1(x... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | sugatoray/alibi-detect | MyKernelTorch | false | 16,505 | [
"Apache-2.0"
] | 1,227 | 66d7873c248c0be1a1d836e6fe1ef59351b802d9 | https://github.com/sugatoray/alibi-detect/tree/66d7873c248c0be1a1d836e6fe1ef59351b802d9 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, n_features: 'int'):
super().__init__()
self.dense1 = nn.Linear(n_features, 20)
self.dense2 = nn.Linear(20, 2)
def forward(self, x: 'torch.Tensor') ->torch.Tensor:
x = nn.ReLU()(self.dense1(x))
... |
S_Loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
from torch import nn
class S_Loss(nn.Module):
def __init__(self):
super(S_Loss, self).__init__()
def forward(self, x, label):
loss = F.smooth_l1_loss(x, label)
return loss
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.ran... | import torch
import triton
import triton.language 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... | suyukun666/UFO | S_Loss | false | 16,506 | [
"MIT"
] | 122 | e57016948b03cd2f75155d2958cea69b6e4b56f8 | https://github.com/suyukun666/UFO/tree/e57016948b03cd2f75155d2958cea69b6e4b56f8 | import torch
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, label):
loss = F.smooth_l1_loss(x, label)
return loss
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4... |
PtModel | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class PtModel(nn.Module):
def __init__(self, n_features, n_labels, softmax=False, dropout=False):
super().__init__()
self.dense1 = nn.Linear(n_features, 20)
self.dense2 = nn.Linear(20, n_labels)
self.dropout = nn.Dropout(0.5) if dropout else lamb... | 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_... | sugatoray/alibi-detect | PtModel | false | 16,507 | [
"Apache-2.0"
] | 1,227 | 66d7873c248c0be1a1d836e6fe1ef59351b802d9 | https://github.com/sugatoray/alibi-detect/tree/66d7873c248c0be1a1d836e6fe1ef59351b802d9 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, n_features, n_labels, softmax=False, dropout=False):
super().__init__()
self.dense1 = nn.Linear(n_features, 20)
self.dense2 = nn.Linear(20, n_labels)
self.dropout = nn.Dropout(0.5) if dropout else lambda... |
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class MLP(nn.Module):
def __init__(self):
super(MLP, self).__init__()
self.fc1 = nn.Linear(in_features=28 * 28, out_features=500)
self.fc2 = nn.Linear(in_features=500, out_features=200)
self.fc3 = nn.Linear(in_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
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | stjordanis/ml-cheatsheet | MLP | false | 16,508 | [
"MIT"
] | 1,031 | d34e096032b7ae826868be8808aee01699cec491 | https://github.com/stjordanis/ml-cheatsheet/tree/d34e096032b7ae826868be8808aee01699cec491 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(in_features=28 * 28, out_features=500)
self.fc2 = nn.Linear(in_features=500, out_features=200)
self.fc3 = nn.Linear(in_features=20... |
ToRGB | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.autograd import Function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def upsample(in_tens, out_H=64):
in_H = in_tens.shape[2]
scale_factor = 1.0 * out_H / in_H
return nn.Upsample(scale_factor=scale_factor, mode='bilinear',
align_corners=False)(in_tens)... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.autograd import Function
import math
import torch.nn as nn
import tor... | songquanpeng/BlendGAN | ToRGB | false | 16,509 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 67 | cbf7225c50c548ee955614715ae3f8fa4d68ee13 | https://github.com/songquanpeng/BlendGAN/tree/cbf7225c50c548ee955614715ae3f8fa4d68ee13 | from torch.autograd import Function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def upsample(in_tens, out_H=64):
in_H = in_tens.shape[2]
scale_factor = 1.0 * out_H / in_H
return nn.Upsample(scale_factor=scale_factor, mode='bilinear',
align_corners=False)(in_tens)... |
SoftCrossEntropyLoss2d | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils
class SoftCrossEntropyLoss2d(nn.Module):
def __init__(self):
super(SoftCrossEntropyLoss2d, self).__init__()
def forward(self, inputs, targets):
loss = 0
inputs = -F.log_softmax(inputs, dim=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.... | songzijiang/FasterSeg | SoftCrossEntropyLoss2d | false | 16,510 | [
"MIT"
] | 334 | 1a14ef6dd665afd229a16ab43b532b5a406512f8 | https://github.com/songzijiang/FasterSeg/tree/1a14ef6dd665afd229a16ab43b532b5a406512f8 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, inputs, targets):
loss = 0
inputs = -F.log_softmax(inputs, dim=1)
for index in range(inputs.size()[0]):
... |
BinaryTreeLeafModule | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class BinaryTreeLeafModule(nn.Module):
"""
local input = nn.Identity()()
local c = nn.Linear(self.in_dim, self.mem_dim)(input)
local h
if self.gate_output then
local o = nn.Sigmoid()(nn.Linear(self.in_dim, self.mem_di... | 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 ... | supunab/Lantern | BinaryTreeLeafModule | false | 16,511 | [
"BSD-3-Clause"
] | 158 | 932a031816617d71c46653f3b2245129a6a8a7c8 | https://github.com/supunab/Lantern/tree/932a031816617d71c46653f3b2245129a6a8a7c8 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Model(nn.Module):
"""
local input = nn.Identity()()
local c = nn.Linear(self.in_dim, self.mem_dim)(input)
local h
if self.gate_output then
local o = nn.Sigmoid()(nn.Linear(self.in_dim, self.mem_dim)(input))
... |
VAE | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import numpy as np
from abc import ABC
from abc import abstractmethod
import torch.nn.functional as F
from torch.functional import F
from torch import nn
from typing import *
from torch.nn import functional as F
def to_array_as(x, y):
if isinstance(x, torch.Tensor) and isinstance(y, np.ndarray):
... | import torch
from torch import device
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... | ssimonc/NeoRL | VAE | false | 16,512 | [
"Apache-2.0"
] | 50 | 098c58c8e4c3e43e67803f6384619d3bfe7fce5d | https://github.com/ssimonc/NeoRL/tree/098c58c8e4c3e43e67803f6384619d3bfe7fce5d | import torch
import numpy as np
from abc import ABC
from abc import abstractmethod
import torch.nn.functional as F
from torch.functional import F
from torch import nn
from typing import *
from torch.nn import functional as F
def to_array_as(x, y):
if isinstance(x, torch.Tensor) and isinstance(y, np.ndarray):
... |
Weighed_Bce_Loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
from torch import nn
class Weighed_Bce_Loss(nn.Module):
def __init__(self):
super(Weighed_Bce_Loss, self).__init__()
def forward(self, x, label):
x = x.view(-1, 1, x.shape[1], x.shape[2])
label = label.view(-1, 1, label.shape[1], label.sha... | import torch
import triton
import triton.language 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 ... | suyukun666/UFO | Weighed_Bce_Loss | false | 16,513 | [
"MIT"
] | 122 | e57016948b03cd2f75155d2958cea69b6e4b56f8 | https://github.com/suyukun666/UFO/tree/e57016948b03cd2f75155d2958cea69b6e4b56f8 | import torch
import torch.nn.functional as F
from torch import nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, label):
x = x.view(-1, 1, x.shape[1], x.shape[2])
label = label.view(-1, 1, label.shape[1], label.shape[2])
label_t = (label =... |
Conv2dWithConstraint | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch as th
from torch import nn
class Conv2dWithConstraint(nn.Conv2d):
def __init__(self, *args, max_norm=1, **kwargs):
self.max_norm = max_norm
super(Conv2dWithConstraint, self).__init__(*args, **kwargs)
def forward(self, x):
self.weight.data = th.renorm(self.we... | 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... | sylvchev/braindecode | Conv2dWithConstraint | false | 16,514 | [
"BSD-3-Clause"
] | 260 | c37ace8fcb90eee0d447c97d1c0a06ce58e8f6ad | https://github.com/sylvchev/braindecode/tree/c37ace8fcb90eee0d447c97d1c0a06ce58e8f6ad | import torch
import torch as th
from torch import nn
class Model(nn.Conv2d):
def __init__(self, *args, max_norm=1, **kwargs):
self.max_norm = max_norm
super().__init__(*args, **kwargs)
def forward(self, x):
self.weight.data = th.renorm(self.weight.data, p=2, dim=0, maxnorm=
... |
Unet | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, dropout=False, norm=None,
residual=True, activation='leakyrelu', in_place_activation=True,
transpose=False, reflectpad=True):
super(ConvBlock, 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
from torch._inductor.runtime.... | royerloic/aydin | Unet | false | 16,515 | [
"BSD-3-Clause"
] | 78 | f9c61a24030891d008c318b250da5faec69fcd7d | https://github.com/royerloic/aydin/tree/f9c61a24030891d008c318b250da5faec69fcd7d | import torch
from torch import nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, dropout=False, norm=None,
residual=True, activation='leakyrelu', in_place_activation=True,
transpose=False, reflectpad=True):
super().__init__()
... |
PatchMerging | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from torch import optim as optim
class PatchMerging(nn.Module):
""" Patch Merging Layer.
Args:
input_resolution (tuple[int]): Resolution of input feature.
dim (int): Number of input channels.
norm_layer (nn.Module, optional): Normalization layer. De... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | svip-lab/AS-MLP | PatchMerging | false | 16,516 | [
"MIT"
] | 66 | 5f360348583b3cac8663a392c9588b6f7e2f46b8 | https://github.com/svip-lab/AS-MLP/tree/5f360348583b3cac8663a392c9588b6f7e2f46b8 | import torch
import torch.nn as nn
from torch import optim as optim
class Model(nn.Module):
""" Patch Merging Layer.
Args:
input_resolution (tuple[int]): Resolution of input feature.
dim (int): Number of input channels.
norm_layer (nn.Module, optional): Normalization layer. Default: ... |
upconv | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from torch.nn import functional as F
import torch.utils.data.distributed
class upconv(nn.Module):
def __init__(self, in_channels, out_channels, ratio=2):
super(upconv, self).__init__()
self.elu = nn.ELU()
self.conv = nn.Conv2d(in_channels=in_channels, ou... | 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 ... | syKevinPeng/TransDepth | upconv | false | 16,517 | [
"MIT"
] | 118 | 2282039da7bc0812e19a27b2d73a25bdef97d739 | https://github.com/syKevinPeng/TransDepth/tree/2282039da7bc0812e19a27b2d73a25bdef97d739 | import torch
import torch.nn as nn
from torch.nn import functional as F
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, in_channels, out_channels, ratio=2):
super().__init__()
self.elu = nn.ELU()
self.conv = nn.Conv2d(in_channels=in_channels, out_channels=
... |
UpsamplingLinear1d | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
import torch.nn as nn
class UpsamplingLinear1d(nn.Module):
def __init__(self, scale_factor=2.0):
super().__init__()
self.scale_factor = scale_factor
def forward(self, x):
return F.interpolate(x, scale_factor=self.scale_factor, mode=
... | import torch
import triton
import triton.language 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... | tailintalent/ar-pde-cnn | UpsamplingLinear1d | false | 16,518 | [
"MIT"
] | 51 | 88c130d7296af4ef7c13ec28a287fec4af3639f7 | https://github.com/tailintalent/ar-pde-cnn/tree/88c130d7296af4ef7c13ec28a287fec4af3639f7 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, scale_factor=2.0):
super().__init__()
self.scale_factor = scale_factor
def forward(self, x):
return F.interpolate(x, scale_factor=self.scale_factor, mode=
'linear... |
NonLocal2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.transforms import functional as F
from torch.nn import functional as F
import torch.utils.data
class NonLocal2d(nn.Module):
def __init__(self, dim_in, dim_inner, dim_out, max_pool_stride=2,
use_maxpool=True, use_gn=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._inductor.runtime.... | shunya-toyokawa/qanet_human_parts_segmentatiom | NonLocal2d | false | 16,519 | [
"MIT"
] | 72 | 5527b247acd65534b455c26e3692a14b31669602 | https://github.com/shunya-toyokawa/qanet_human_parts_segmentatiom/tree/5527b247acd65534b455c26e3692a14b31669602 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.transforms import functional as F
from torch.nn import functional as F
import torch.utils.data
class Model(nn.Module):
def __init__(self, dim_in, dim_inner, dim_out, max_pool_stride=2,
use_maxpool=True, use_gn=False, use_... |
BinaryTreeComposer | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class BinaryTreeComposer(nn.Module):
"""
local lc, lh = nn.Identity()(), nn.Identity()()
local rc, rh = nn.Identity()(), nn.Identity()()
local new_gate = function()
return nn.CAddTable(){
nn.Linear(self.mem_dim, s... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | supunab/Lantern | BinaryTreeComposer | false | 16,520 | [
"BSD-3-Clause"
] | 158 | 932a031816617d71c46653f3b2245129a6a8a7c8 | https://github.com/supunab/Lantern/tree/932a031816617d71c46653f3b2245129a6a8a7c8 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx
class Model(nn.Module):
"""
local lc, lh = nn.Identity()(), nn.Identity()()
local rc, rh = nn.Identity()(), nn.Identity()()
local new_gate = function()
return nn.CAddTable(){
nn.Linear(self.mem_dim, self.mem_dim)(... |
reduction_1x1 | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import torch.nn as nn
import torch.utils.data.distributed
class reduction_1x1(nn.Sequential):
def __init__(self, num_in_filters, num_out_filters, max_depth, is_final
=False):
super(reduction_1x1, self).__init__()
self.max_depth = max_depth
self.is_final = ... | 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.... | syKevinPeng/TransDepth | reduction_1x1 | false | 16,521 | [
"MIT"
] | 118 | 2282039da7bc0812e19a27b2d73a25bdef97d739 | https://github.com/syKevinPeng/TransDepth/tree/2282039da7bc0812e19a27b2d73a25bdef97d739 | import math
import torch
import torch.nn as nn
import torch.utils.data.distributed
class Model(nn.Sequential):
def __init__(self, num_in_filters, num_out_filters, max_depth, is_final
=False):
super().__init__()
self.max_depth = max_depth
self.is_final = is_final
self.sigmo... |
SelfAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from scipy.sparse import *
class SelfAttention(nn.Module):
def __init__(self, input_size, hidden_size):
super(SelfAttention, self).__init__()
self.W1 = torch.Tensor(input_size, hidden_size)
self.W1 = nn.Parameter(nn.init.xavier_uniform_(self.W1))
... | 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.... | talha1503/RL-based-Graph2Seq-for-NQG | SelfAttention | false | 16,522 | [
"Apache-2.0"
] | 100 | 1039e0b6231ae7029ea6e4073b1e55df5ad2e928 | https://github.com/talha1503/RL-based-Graph2Seq-for-NQG/tree/1039e0b6231ae7029ea6e4073b1e55df5ad2e928 | import torch
import torch.nn as nn
from scipy.sparse import *
class Model(nn.Module):
def __init__(self, input_size, hidden_size):
super().__init__()
self.W1 = torch.Tensor(input_size, hidden_size)
self.W1 = nn.Parameter(nn.init.xavier_uniform_(self.W1))
self.W2 = torch.Tensor(hid... |
SEBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
class SEBlock(nn.Module):
def __init__(self, input_channels, internal_neurons):
super(SEBlock, self).__init__()
self.down = nn.Conv2d(in_channels=input_channels, out_channels=
internal_neurons, kernel_size=1, stride=1,... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_... | sysu-shey/ACNet | SEBlock | false | 16,523 | [
"MIT"
] | 767 | 6d967d3fff2d79a37f85799b78a21ffbd9001bd2 | https://github.com/sysu-shey/ACNet/tree/6d967d3fff2d79a37f85799b78a21ffbd9001bd2 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_channels, internal_neurons):
super().__init__()
self.down = nn.Conv2d(in_channels=input_channels, out_channels=
internal_neurons, kernel_size=1, stride=1, bias=True)
... |
FocalLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class FocalLoss(nn.Module):
def __init__(self, gamma=0, alpha=None, device=None):
super(FocalLoss, self).__init__()
self.gamma = gamma
self.alpha = alpha
if self.alpha is not None:
self.alpha = torch.FloatTensor([1 - alpha, alpha])
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert... | taconite/PTF | FocalLoss | false | 16,524 | [
"MIT"
] | 62 | a8789c9f752aea2944c2a75e04cc2aa21c7e4a00 | https://github.com/taconite/PTF/tree/a8789c9f752aea2944c2a75e04cc2aa21c7e4a00 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, gamma=0, alpha=None, device=None):
super().__init__()
self.gamma = gamma
self.alpha = alpha
if self.alpha is not None:
self.alpha = torch.FloatTensor([1 - alpha, alpha])
def forward(self... |
ResnetBlockInplaceNormShallowConv1d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class ResnetBlockInplaceNormShallowConv1d(nn.Module):
""" Fully connected ResNet Block imeplemented with group convolutions and weight/spectral normalizations.
Args:
size_in (int): input dimension
groups (int): number of groups for group convolutions
... | 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.... | taconite/MetaAvatar-release | ResnetBlockInplaceNormShallowConv1d | false | 16,525 | [
"MIT"
] | 60 | c9403a478ee82232633d25f65f108befd21d04e9 | https://github.com/taconite/MetaAvatar-release/tree/c9403a478ee82232633d25f65f108befd21d04e9 | import torch
import torch.nn as nn
class Model(nn.Module):
""" Fully connected ResNet Block imeplemented with group convolutions and weight/spectral normalizations.
Args:
size_in (int): input dimension
groups (int): number of groups for group convolutions
size_out (int): output dimens... |
ResnetBlockGroupNormConv1d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class GroupNorm1d(nn.Module):
""" Group normalization that does per-point group normalization.
Args:
groups (int): number of groups
f_dim (int): feature dimension, mush be divisible by groups
"""
def __init__(self, groups, f_dim, eps=1e-05, affine=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
from torch._inductor.runtime.... | taconite/MetaAvatar-release | ResnetBlockGroupNormConv1d | false | 16,526 | [
"MIT"
] | 60 | c9403a478ee82232633d25f65f108befd21d04e9 | https://github.com/taconite/MetaAvatar-release/tree/c9403a478ee82232633d25f65f108befd21d04e9 | import torch
import torch.nn as nn
class GroupNorm1d(nn.Module):
""" Group normalization that does per-point group normalization.
Args:
groups (int): number of groups
f_dim (int): feature dimension, mush be divisible by groups
"""
def __init__(self, groups, f_dim, eps=1e-05, affine=T... |
GatedFusion | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from scipy.sparse import *
class GatedFusion(nn.Module):
def __init__(self, hidden_size):
super(GatedFusion, self).__init__()
"""GatedFusion module"""
self.fc_z = nn.Linear(4 * hidden_size, hidden_size, bias=True)
def forward(self, h_state, input):
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from scipy.sparse import *
assert_size_stride = torch._C._... | talha1503/RL-based-Graph2Seq-for-NQG | GatedFusion | false | 16,527 | [
"Apache-2.0"
] | 100 | 1039e0b6231ae7029ea6e4073b1e55df5ad2e928 | https://github.com/talha1503/RL-based-Graph2Seq-for-NQG/tree/1039e0b6231ae7029ea6e4073b1e55df5ad2e928 | import torch
import torch.nn as nn
from scipy.sparse import *
class Model(nn.Module):
def __init__(self, hidden_size):
super().__init__()
"""GatedFusion module"""
self.fc_z = nn.Linear(4 * hidden_size, hidden_size, bias=True)
def forward(self, h_state, input):
z = torch.sigmo... |
ResnetBlockGroupNormShallowConv1d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class GroupNorm1d(nn.Module):
""" Group normalization that does per-point group normalization.
Args:
groups (int): number of groups
f_dim (int): feature dimension, mush be divisible by groups
"""
def __init__(self, groups, f_dim, eps=1e-05, affine=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
from torch._inductor.runtime.... | taconite/MetaAvatar-release | ResnetBlockGroupNormShallowConv1d | false | 16,528 | [
"MIT"
] | 60 | c9403a478ee82232633d25f65f108befd21d04e9 | https://github.com/taconite/MetaAvatar-release/tree/c9403a478ee82232633d25f65f108befd21d04e9 | import torch
import torch.nn as nn
class GroupNorm1d(nn.Module):
""" Group normalization that does per-point group normalization.
Args:
groups (int): number of groups
f_dim (int): feature dimension, mush be divisible by groups
"""
def __init__(self, groups, f_dim, eps=1e-05, affine=T... |
PatchEmbed | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
from torch import optim as optim
class PatchEmbed(nn.Module):
""" Image to Patch Embedding
"""
def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768):
super().__init__()
num_patches = img_size // patch_size * (img_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
import torch.nn as nn
from torch import optim as optim
assert_size_stride = torc... | taokong/ibot | PatchEmbed | false | 16,529 | [
"Apache-2.0"
] | 327 | a2ee1ae7495d4ea8fb9ba100434c062f1bd3d1f0 | https://github.com/taokong/ibot/tree/a2ee1ae7495d4ea8fb9ba100434c062f1bd3d1f0 | import torch
import torch.nn as nn
from torch import optim as optim
class Model(nn.Module):
""" Image to Patch Embedding
"""
def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768):
super().__init__()
num_patches = img_size // patch_size * (img_size // patch_size)
... |
silog_loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
import torch.utils.data.distributed
class silog_loss(nn.Module):
def __init__(self, variance_focus):
super(silog_loss, self).__init__()
self.variance_focus = variance_focus
def forward(self, depth_est, depth_gt, mask):
d = torch.log(depth_est[mask])... | import torch
import triton
import triton.language 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
import torch.nn as nn
import torch.utils.data.distributed
asse... | syKevinPeng/TransDepth | silog_loss | false | 16,530 | [
"MIT"
] | 118 | 2282039da7bc0812e19a27b2d73a25bdef97d739 | https://github.com/syKevinPeng/TransDepth/tree/2282039da7bc0812e19a27b2d73a25bdef97d739 | import torch
import torch.nn as nn
import torch.utils.data.distributed
class Model(nn.Module):
def __init__(self, variance_focus):
super().__init__()
self.variance_focus = variance_focus
def forward(self, depth_est, depth_gt, mask):
d = torch.log(depth_est[mask]) - torch.log(depth_gt... |
SoftDiceLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn as nn
class SoftDiceLoss(nn.Module):
def __init__(self):
super(SoftDiceLoss, self).__init__()
def forward(self, output, label):
probs = output.view(-1)
mask = label.view(-1)
smooth = 1
intersection = torch.sum(probs * mask)
den1 = ... | import torch
import triton
import triton.language 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... | tdml13/NiftyNet | SoftDiceLoss | false | 16,531 | [
"Apache-2.0"
] | 1,403 | b35fa19ca307e81d229e2fe8269a417724833da2 | https://github.com/tdml13/NiftyNet/tree/b35fa19ca307e81d229e2fe8269a417724833da2 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, output, label):
probs = output.view(-1)
mask = label.view(-1)
smooth = 1
intersection = torch.sum(probs * mask)
den1 = torch.sum(probs)
... |
PatchMerging | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
import torch.nn.functional as F
from math import sqrt
from torch import optim as optim
class PatchMerging(nn.Module):
"""Patch Merging Layer.
Args:
input_resolution (tuple[int]): Resolution of input feature.
dim (int): Number of input channels.
norm_... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | taokong/ibot | PatchMerging | false | 16,532 | [
"Apache-2.0"
] | 327 | a2ee1ae7495d4ea8fb9ba100434c062f1bd3d1f0 | https://github.com/taokong/ibot/tree/a2ee1ae7495d4ea8fb9ba100434c062f1bd3d1f0 | import torch
import torch.nn as nn
import torch.nn.functional as F
from math import sqrt
from torch import optim as optim
class Model(nn.Module):
"""Patch Merging Layer.
Args:
input_resolution (tuple[int]): Resolution of input feature.
dim (int): Number of input channels.
norm_layer (... |
ITN2D | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class ITN2D(nn.Module):
def __init__(self, input_channels):
super(ITN2D, self).__init__()
use_bias = True
self.conv11 = nn.Conv2d(input_channels, 2, kernel_size=3, padding=1,
bias=use_bias)
self.conv12 ... | 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_... | swaroopkml96/istn | ITN2D | false | 16,533 | [
"Apache-2.0"
] | 91 | 600543e071aa56907509aa090697295cdc69a6b1 | https://github.com/swaroopkml96/istn/tree/600543e071aa56907509aa090697295cdc69a6b1 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_channels):
super().__init__()
use_bias = True
self.conv11 = nn.Conv2d(input_channels, 2, kernel_size=3, padding=1,
bias=use_bias)
self.conv12 = nn.Conv2d... |
Conv_Q | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
from torch.functional import F
from torch import nn
from typing import *
from torch.nn import functional as F
class Conv_Q(nn.Module):
def __init__(self, frames, num_actions):
super(Conv_Q, self).__init__()
self.c1 = nn.Conv2d(frames, 32, kernel_size=8... | 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.... | ssimonc/NeoRL | Conv_Q | false | 16,534 | [
"Apache-2.0"
] | 50 | 098c58c8e4c3e43e67803f6384619d3bfe7fce5d | https://github.com/ssimonc/NeoRL/tree/098c58c8e4c3e43e67803f6384619d3bfe7fce5d | import torch
import torch.nn.functional as F
from torch.functional import F
from torch import nn
from typing import *
from torch.nn import functional as F
class Model(nn.Module):
def __init__(self, frames, num_actions):
super().__init__()
self.c1 = nn.Conv2d(frames, 32, kernel_size=8, stride=4)
... |
Dense | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.autograd import Function
from torch.nn import Module
import torch
from torch.nn import Parameter
class DenseFunction(Function):
@staticmethod
def forward(ctx, input, weight, bias=None):
output = input.mm(weight.t())
if bias is not None:
output += bias.unsqueeze(0).expan... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.autograd import Function
from torch.nn import Module
from torch.nn im... | tczhangzhi/pytorch-parallel | Dense | false | 16,535 | [
"MIT"
] | 117 | 8d8baf80dd48234386051d0bab616de5b55f8f5c | https://github.com/tczhangzhi/pytorch-parallel/tree/8d8baf80dd48234386051d0bab616de5b55f8f5c | from torch.autograd import Function
from torch.nn import Module
import torch
from torch.nn import Parameter
class DenseFunction(Function):
@staticmethod
def forward(ctx, input, weight, bias=None):
output = input.mm(weight.t())
if bias is not None:
output += bias.unsqueeze(0).expan... |
TripletLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch.nn.modules.distance import PairwiseDistance
class TripletLoss(torch.nn.Module):
def __init__(self, margin):
super(TripletLoss, self).__init__()
self.margin = margin
self.pdist = PairwiseDistance(2)
def forward(self, anchor, positive, negative):
pos_dis... | import torch
import triton
import triton.language 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.modules.distan... | tbmoon/facenet | TripletLoss | false | 16,536 | [
"MIT"
] | 231 | b3aec1a930f22a5a9597efa7072373c0ff93663f | https://github.com/tbmoon/facenet/tree/b3aec1a930f22a5a9597efa7072373c0ff93663f | import torch
from torch.nn.modules.distance import PairwiseDistance
class Model(torch.nn.Module):
def __init__(self, margin):
super().__init__()
self.margin = margin
self.pdist = PairwiseDistance(2)
def forward(self, anchor, positive, negative):
pos_dist = self.pdist.forward(... |
ConcatBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class ConcatBlock(nn.Module):
def __init__(self, in_channels, out_channels):
super(ConcatBlock, self).__init__()
self.in_chns = in_channels
self.out_chns = out_channels
self.conv1 = nn.Conv2d(self.in_chns, self.in_chns, kernel_size=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
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | tea321000/SSL4MIS | ConcatBlock | false | 16,537 | [
"MIT"
] | 854 | 8d1b0be08cf089943481a47877b36eb6405fffb2 | https://github.com/tea321000/SSL4MIS/tree/8d1b0be08cf089943481a47877b36eb6405fffb2 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.in_chns = in_channels
self.out_chns = out_channels
self.conv1 = nn.Conv2d(self.in_chns, self.in_chns, kernel_size=1,
padding=0)
sel... |
OutPutBlock | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn as nn
class OutPutBlock(nn.Module):
def __init__(self, in_channels, out_channels):
super(OutPutBlock, self).__init__()
self.in_chns = in_channels
self.out_chns = out_channels
self.conv1 = nn.Conv2d(self.in_chns, self.in_chns // 2, kernel_size
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | tea321000/SSL4MIS | OutPutBlock | false | 16,538 | [
"MIT"
] | 854 | 8d1b0be08cf089943481a47877b36eb6405fffb2 | https://github.com/tea321000/SSL4MIS/tree/8d1b0be08cf089943481a47877b36eb6405fffb2 | import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.in_chns = in_channels
self.out_chns = out_channels
self.conv1 = nn.Conv2d(self.in_chns, self.in_chns // 2, kernel_size
=1, padding=0)
... |
MinimalRNNCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from functools import partial
def get_initializer(name, activation):
if activation in ['id', 'identity', 'linear', 'modrelu']:
nonlinearity = 'linear'
elif activation in ['relu', 'tanh', 'sigmoid']:
nonlinearity = activation
else:
assert False, f'g... | 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... | tarepan/HiPPO | MinimalRNNCell | false | 16,539 | [
"Apache-2.0"
] | 57 | bc23e2dba13da6c307cb5a4ae248c2d2c56d465f | https://github.com/tarepan/HiPPO/tree/bc23e2dba13da6c307cb5a4ae248c2d2c56d465f | import torch
from torch import nn
from functools import partial
def get_initializer(name, activation):
if activation in ['id', 'identity', 'linear', 'modrelu']:
nonlinearity = 'linear'
elif activation in ['relu', 'tanh', 'sigmoid']:
nonlinearity = activation
else:
assert False, f'g... |
AvgPoolShortening | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class AvgPoolShortening(Module):
"""
### Average pool shortening
This down-samples by a given factor with average pooling
"""
def __init__(self, k: 'int'):
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
assert_size_stride... | techthiyanes/annotated_deep_learning_paper_implementations | AvgPoolShortening | false | 16,540 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
### Average pool shortening
This down-samples by a given factor with average pooling
"""
def __init__(self, k: 'int'):
"""
... |
MLPAutoencoder | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
def choose_nonlinearity(name):
nl = None
if name == 'tanh':
nl = torch.tanh
elif name == 'relu':
nl = torch.relu
elif name == 'sigmoid':
nl = torch.sigmoid
elif name == 'softplus':
nl = torch.nn.functional.softplus
elif name == 'selu':
nl = ... | 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 ... | tailintalent/hamiltonian-nn | MLPAutoencoder | false | 16,541 | [
"Apache-2.0"
] | 293 | 1f6dd2d58ab84977a30584f0d1dd7f8b234e4049 | https://github.com/tailintalent/hamiltonian-nn/tree/1f6dd2d58ab84977a30584f0d1dd7f8b234e4049 | import torch
def choose_nonlinearity(name):
nl = None
if name == 'tanh':
nl = torch.tanh
elif name == 'relu':
nl = torch.relu
elif name == 'sigmoid':
nl = torch.sigmoid
elif name == 'softplus':
nl = torch.nn.functional.softplus
elif name == 'selu':
nl = ... |
ClippedValueFunctionLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class ClippedValueFunctionLoss(Module):
"""
## Clipped Value Function Loss
Similarly we clip the value function update also.
egin{align}
V^{\\pi_ heta}_{CLIP}(s_t)
&= clip\\Big... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
import torch.utils.data
import torch.nn.functional
import tor... | techthiyanes/annotated_deep_learning_paper_implementations | ClippedValueFunctionLoss | false | 16,542 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## Clipped Value Function Loss
Similarly we clip the value function update also.
egin{align}
V^{\\pi_ heta}_{CLIP}(s_t)
&= clip\\Bigl(V^{\\pi_ heta}(s_... |
Loss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
import torch.nn.functional as F
from torch import nn
def _iou(pred, target):
b = pred.shape[0]
IoU = 0.0
for i in range(0, b):
Iand1 = torch.sum(target[i, :, :] * pred[i, :, :])
Ior1 = torch.sum(target[i, :, :]) + torch.sum(pred[i, :, :]) - Iand1
IoU1 = Iand1 / Ior1
... | import torch
import triton
import triton.language 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... | suyukun666/UFO | Loss | false | 16,543 | [
"MIT"
] | 122 | e57016948b03cd2f75155d2958cea69b6e4b56f8 | https://github.com/suyukun666/UFO/tree/e57016948b03cd2f75155d2958cea69b6e4b56f8 | import torch
import torch.nn.functional as F
from torch import nn
def _iou(pred, target):
b = pred.shape[0]
IoU = 0.0
for i in range(0, b):
Iand1 = torch.sum(target[i, :, :] * pred[i, :, :])
Ior1 = torch.sum(target[i, :, :]) + torch.sum(pred[i, :, :]) - Iand1
IoU1 = Iand1 / Ior1
... |
DPFP | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class DPFP(Module):
"""
## Deterministic Parameter Free Project (DPFP)
This is the new projection function $ extcolor{lightgreen}{\\phi}$ introduced in the paper.
DPF... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
from torch import nn
import torch.utils.data
import torch.nn.... | techthiyanes/annotated_deep_learning_paper_implementations | DPFP | false | 16,544 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## Deterministic Parameter Free Project (DPFP)
This is the new projection function $ extcolor{lightgreen}{\\phi}$ introduced in the paper.
DP... |
DiscriminatorLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
import torch.nn.functional as F
import torch.utils.data
import torch.nn.functional
import torch.autograd
class DiscriminatorLoss(Module):
"""
## Discriminator Loss
We want to find $w$ to maximize
$$\\mathbb{E}_{x \\sim \\mathbb{P}_r} [f_w(x)]- \\mathbb{E}_{z \... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
import torch.utils.data
import torch.nn.functional
import tor... | techthiyanes/annotated_deep_learning_paper_implementations | DiscriminatorLoss | false | 16,545 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
import torch.nn.functional as F
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## Discriminator Loss
We want to find $w$ to maximize
$$\\mathbb{E}_{x \\sim \\mathbb{P}_r} [f_w(x)]- \\mathbb{E}_{z \\sim p(z)} [... |
ITN3D | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
import torch.nn.functional as F
import torch.nn as nn
class ITN3D(nn.Module):
def __init__(self, input_channels):
super(ITN3D, self).__init__()
use_bias = True
self.conv11 = nn.Conv3d(input_channels, 2, kernel_size=3, padding=1,
bias=use_bias)
self.conv12 ... | 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_... | swaroopkml96/istn | ITN3D | false | 16,546 | [
"Apache-2.0"
] | 91 | 600543e071aa56907509aa090697295cdc69a6b1 | https://github.com/swaroopkml96/istn/tree/600543e071aa56907509aa090697295cdc69a6b1 | import torch
import torch.nn.functional as F
import torch.nn as nn
class Model(nn.Module):
def __init__(self, input_channels):
super().__init__()
use_bias = True
self.conv11 = nn.Conv3d(input_channels, 2, kernel_size=3, padding=1,
bias=use_bias)
self.conv12 = nn.Conv3d... |
CrossEntropyBayesRisk | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class CrossEntropyBayesRisk(Module):
"""
<a id="CrossEntropyBayesRisk"></a>
## Bayes Risk with Cross Entropy Loss
Bayes risk is the overall maximum cost of making incorrect estimates.
... | import torch
import triton
import 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
import torch.nn.functional
import torch.autograd
assert_size_stride = torch._C._dynamo.g... | techthiyanes/annotated_deep_learning_paper_implementations | CrossEntropyBayesRisk | false | 16,547 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
<a id="CrossEntropyBayesRisk"></a>
## Bayes Risk with Cross Entropy Loss
Bayes risk is the overall maximum cost of making incorrect estimates.
It takes a cos... |
GatedRNNCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
from functools import partial
def get_initializer(name, activation):
if activation in ['id', 'identity', 'linear', 'modrelu']:
nonlinearity = 'linear'
elif activation in ['relu', 'tanh', 'sigmoid']:
nonlinearity = activation
else:
assert False, f'g... | 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... | tarepan/HiPPO | GatedRNNCell | false | 16,548 | [
"Apache-2.0"
] | 57 | bc23e2dba13da6c307cb5a4ae248c2d2c56d465f | https://github.com/tarepan/HiPPO/tree/bc23e2dba13da6c307cb5a4ae248c2d2c56d465f | import torch
from torch import nn
from functools import partial
def get_initializer(name, activation):
if activation in ['id', 'identity', 'linear', 'modrelu']:
nonlinearity = 'linear'
elif activation in ['relu', 'tanh', 'sigmoid']:
nonlinearity = activation
else:
assert False, f'g... |
MaximumLikelihoodLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class MaximumLikelihoodLoss(Module):
"""
<a id="MaximumLikelihoodLoss"></a>
## Type II Maximum Likelihood Loss
The distribution $D(\\mathbf{p} ert extcolor{orange}{\\mathbf{lpha}})$ i... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
from torch.nn import Module
import torch.utils.data
import torch.nn.funct... | techthiyanes/annotated_deep_learning_paper_implementations | MaximumLikelihoodLoss | false | 16,549 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
<a id="MaximumLikelihoodLoss"></a>
## Type II Maximum Likelihood Loss
The distribution $D(\\mathbf{p} ert extcolor{orange}{\\mathbf{lpha}})$ is a prior on the... |
EqualizedWeight | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import math
import torch
import numpy as np
from torch import nn
import torch.utils.data
from typing import List
import torch.nn.functional
import torch.autograd
class EqualizedWeight(nn.Module):
"""
<a id="equalized_weight"></a>
## Learning-rate Equalized Weights Parameter
This is based on equalize... | import torch
import 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 numpy as np
from torch import nn
import torch.utils.data
from typing import List
import torch.nn.functional
import torch.... | techthiyanes/annotated_deep_learning_paper_implementations | EqualizedWeight | false | 16,550 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | import math
import torch
import numpy as np
from torch import nn
import torch.utils.data
from typing import List
import torch.nn.functional
import torch.autograd
class Model(nn.Module):
"""
<a id="equalized_weight"></a>
## Learning-rate Equalized Weights Parameter
This is based on equalized learning... |
MarginLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
import torch.nn.functional as F
import torch.utils.data
import torch.nn.functional
import torch.autograd
class MarginLoss(Module):
'\n ## Margin loss for class existence\n\n A separate margin loss is used for each output capsule and the total loss is the sum of them.... | import torch
import triton
import triton.language 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
... | techthiyanes/annotated_deep_learning_paper_implementations | MarginLoss | false | 16,551 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
import torch.nn.functional as F
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
'\n ## Margin loss for class existence\n\n A separate margin loss is used for each output capsule and the total loss is the sum of them.\n ... |
Conv1dCompression | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Conv1dCompression(Module):
"""
## 1D Convolution Compression $f_c$
This is a simple wrapper around
[`nn.Conv1d`](https://pytorch.org/docs/stable/generated/torch... | 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.nn import Module
from torch import nn
import torch.utils.data
import ... | techthiyanes/annotated_deep_learning_paper_implementations | Conv1dCompression | false | 16,552 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## 1D Convolution Compression $f_c$
This is a simple wrapper around
[`nn.Conv1d`](https://pytorch.org/docs/stable/generated/torch.nn.Conv1d.h... |
MLP | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
def choose_nonlinearity(name):
nl = None
if name == 'tanh':
nl = torch.tanh
elif name == 'relu':
nl = torch.relu
elif name == 'sigmoid':
nl = torch.sigmoid
elif name == 'softplus':
nl = torch.nn.functional.softplus
elif name == 'selu':
nl = ... | 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 ... | tailintalent/hamiltonian-nn | MLP | false | 16,553 | [
"Apache-2.0"
] | 293 | 1f6dd2d58ab84977a30584f0d1dd7f8b234e4049 | https://github.com/tailintalent/hamiltonian-nn/tree/1f6dd2d58ab84977a30584f0d1dd7f8b234e4049 | import torch
def choose_nonlinearity(name):
nl = None
if name == 'tanh':
nl = torch.tanh
elif name == 'relu':
nl = torch.relu
elif name == 'sigmoid':
nl = torch.sigmoid
elif name == 'softplus':
nl = torch.nn.functional.softplus
elif name == 'selu':
nl = ... |
ChannelNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class ChannelNorm(Module):
"""
## Channel Normalization
This is similar to [Group Normalization](../group_norm/index.html) but affine transform is done group wise.
""... | import torch
import triton
import triton.language 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 import Module
from torch import nn
import torch.utils.data
import... | techthiyanes/annotated_deep_learning_paper_implementations | ChannelNorm | false | 16,554 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## Channel Normalization
This is similar to [Group Normalization](../group_norm/index.html) but affine transform is done group wise.
"""
... |
KLDivLoss | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class KLDivLoss(Module):
"""
## KL-Divergence loss
This calculates the KL divergence between a given normal distribution and $\\mathcal{N}(0, 1)$
"""
def forward(self, sigma_hat: '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 math as tl_math
from torch.nn import M... | techthiyanes/annotated_deep_learning_paper_implementations | KLDivLoss | false | 16,555 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## KL-Divergence loss
This calculates the KL divergence between a given normal distribution and $\\mathcal{N}(0, 1)$
"""
def forward(self, sigma_hat: 'torch.... |
BinaryClassificationHead | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from _paritybench_helpers import _mock_config
import torch
class BinaryClassificationHead(torch.nn.Module):
def __init__(self, config):
super().__init__()
self.config = config
self.dense = torch.nn.Linear(config.hidden_size, config.hidden_size)
self.dropout = torch.nn.Dropout(conf... | 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 ... | techthiyanes/DeepPavlov | BinaryClassificationHead | false | 16,556 | [
"Apache-2.0"
] | 5,893 | 08555428388fed3c7b036c0a82a70a25efcabcff | https://github.com/techthiyanes/DeepPavlov/tree/08555428388fed3c7b036c0a82a70a25efcabcff | from _paritybench_helpers import _mock_config
import torch
class Model(torch.nn.Module):
def __init__(self, config):
super().__init__()
self.config = config
self.dense = torch.nn.Linear(config.hidden_size, config.hidden_size)
self.dropout = torch.nn.Dropout(config.hidden_dropout_p... |
MiniBatchStdDev | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class MiniBatchStdDev(nn.Module):
"""
<a id="mini_batch_std_dev"></a>
### Mini-batch Standard Deviation
Mini-batch standard deviation calculates the standard deviation
across a mini-batch (... | import torch
import triton
import triton.language 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
import torch.utils.data
import torch.nn.functional
import ... | techthiyanes/annotated_deep_learning_paper_implementations | MiniBatchStdDev | false | 16,557 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(nn.Module):
"""
<a id="mini_batch_std_dev"></a>
### Mini-batch Standard Deviation
Mini-batch standard deviation calculates the standard deviation
across a mini-batch (or a subgr... |
GroupNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class GroupNorm(Module):
"""
## Group Normalization Layer
"""
def __init__(self, groups: 'int', channels: 'int', *, eps: float=1e-05,
affine: bool=True):
... | import torch
import triton
import triton.language 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 import Module
from torch import nn
import torch.utils.data
import... | techthiyanes/annotated_deep_learning_paper_implementations | GroupNorm | false | 16,558 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## Group Normalization Layer
"""
def __init__(self, groups: 'int', channels: 'int', *, eps: float=1e-05,
affine: bool=True):
... |
SquaredReLU | # AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _al... | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class SquaredReLU(Module):
"""
## Squared ReLU activation
$$y = {\\max(x, 0)}^2$$
Squared ReLU is used as the activation function in the
[position wise feedforw... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch.nn import Module
from torch import nn
import torch.utils.data
import torch.nn.... | techthiyanes/annotated_deep_learning_paper_implementations | SquaredReLU | false | 16,559 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## Squared ReLU activation
$$y = {\\max(x, 0)}^2$$
Squared ReLU is used as the activation function in the
[position wise feedforward mo... |
LSTMCell | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class LSTMCell(Module):
"""
## Long Short-Term Memory Cell
LSTM Cell computes $c$, and $h$. $c$ is like the long-term memory,
and $h$ is like the short term memory.
... | 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... | techthiyanes/annotated_deep_learning_paper_implementations | LSTMCell | false | 16,560 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## Long Short-Term Memory Cell
LSTM Cell computes $c$, and $h$. $c$ is like the long-term memory,
and $h$ is like the short term memory.
... |
InstanceNorm | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class InstanceNorm(Module):
"""
## Instance Normalization Layer
Instance normalization layer $\\text{IN}$ normalizes the input $X$ as follows:
When input $X \\in \\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
from torch.nn import Module
from torch import nn
import torch.utils.data
import... | techthiyanes/annotated_deep_learning_paper_implementations | InstanceNorm | false | 16,561 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | from torch.nn import Module
import torch
from torch import nn
import torch.utils.data
import torch.nn.functional
import torch.autograd
class Model(Module):
"""
## Instance Normalization Layer
Instance normalization layer $\\text{IN}$ normalizes the input $X$ as follows:
When input $X \\in \\mathbb{R... |
Conv2d | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils.data
import torch.nn.functional
import torch.autograd
def weight_standardization(weight: 'torch.Tensor', eps: 'float'):
"""
## Weight Standardization
$$\\hat{W}_{i,j} = \\frac{W_{i,j} - \\mu_{W_{i,\\cdot}}} {\\sigma_{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... | techthiyanes/annotated_deep_learning_paper_implementations | Conv2d | false | 16,562 | [
"MIT"
] | 3,714 | 8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | https://github.com/techthiyanes/annotated_deep_learning_paper_implementations/tree/8af24da2dd39a9a87482a4d18c2dc829bbd3fd47 | import torch
from torch import nn
import torch.nn.functional as F
import torch.utils.data
import torch.nn.functional
import torch.autograd
def weight_standardization(weight: 'torch.Tensor', eps: 'float'):
"""
## Weight Standardization
$$\\hat{W}_{i,j} = \\frac{W_{i,j} - \\mu_{W_{i,\\cdot}}} {\\sigma_{W_{... |
SelfAttention | # AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _alig... | import torch
class SelfAttention(torch.nn.Module):
def __init__(self, num_heads, model_dim, dropout_keep_prob):
super(SelfAttention, self).__init__()
self.num_heads = num_heads
self.model_dim = model_dim
self.dropout_keep_prob = dropout_keep_prob
self.q_layer = torch.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 import triton_helpers
from torch._inductor.runtime.... | tech-srl/bottleneck | SelfAttention | false | 16,563 | [
"MIT"
] | 56 | b8c629ad25e02f53ba3389dd33a90bbeb83ea447 | https://github.com/tech-srl/bottleneck/tree/b8c629ad25e02f53ba3389dd33a90bbeb83ea447 | import torch
class Model(torch.nn.Module):
def __init__(self, num_heads, model_dim, dropout_keep_prob):
super().__init__()
self.num_heads = num_heads
self.model_dim = model_dim
self.dropout_keep_prob = dropout_keep_prob
self.q_layer = torch.nn.Linear(model_dim, model_dim *... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.