entry_point stringlengths 1 65 | original_triton_python_code stringlengths 208 619k | optimised_triton_code stringlengths 1.15k 275k | repo_name stringlengths 7 115 | module_name stringlengths 1 65 | synthetic bool 1
class | uuid int64 0 18.5k | licenses listlengths 1 6 | stars int64 0 19.8k | sha stringlengths 40 40 | repo_link stringlengths 72 180 |
|---|---|---|---|---|---|---|---|---|---|---|
DiceLoss | import torch
import torch.nn as nn
class DiceLoss(nn.Module):
def __init__(self):
super(DiceLoss, self).__init__()
def forward(self, input, target):
N = target.size(0)
smooth = 1
input_flat = input.view(N, -1)
target_flat = target.view(N, -1)
intersection = in... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_st... | Qsingle/MedicalImage | DiceLoss | false | 963 | [
"MIT"
] | 0 | a5020d7d2266669a4d6ffec224430e8b25cc1dfc | https://github.com/Qsingle/MedicalImage/tree/a5020d7d2266669a4d6ffec224430e8b25cc1dfc |
AdaptiveConcatPool2d | import torch
from torch import nn
from torchvision.models import *
class AdaptiveConcatPool2d(nn.Module):
def __init__(self, sz=None):
super().__init__()
sz = sz or (1, 1)
self.ap = nn.AdaptiveAvgPool2d(sz)
self.mp = nn.AdaptiveMaxPool2d(sz)
def forward(self, x):
retu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
from torchvision.models import *
assert_size_stride = torch._C._dyna... | ArcGIS/raster-deep-learning | AdaptiveConcatPool2d | false | 13,766 | [
"Apache-2.0"
] | 154 | 0af006d70c605707bab2bb11ae6393fd65ce8820 | https://github.com/ArcGIS/raster-deep-learning/tree/0af006d70c605707bab2bb11ae6393fd65ce8820 |
MNIST_Generator | import torch
import torch.nn as nn
from torch.nn import functional as F
class MNIST_Generator(nn.Module):
def __init__(self, out_channels, latent_size):
super(MNIST_Generator, self).__init__()
self.out_channels = out_channels
self.latent_size = latent_size
self.linear1 = nn.Linear... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | mdiephuis/adversarial-autoencoders | MNIST_Generator | false | 7,217 | [
"MIT"
] | 1 | a722239564362796774de21a64fd92e81dce4089 | https://github.com/mdiephuis/adversarial-autoencoders/tree/a722239564362796774de21a64fd92e81dce4089 |
BalancedL1Loss | # 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 triton
import triton.language 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 functools
impor... | AtticusJohnson/mmdetection | BalancedL1Loss | false | 11,206 | [
"Apache-2.0"
] | 0 | d8d89bafcce13d3b32b1fb3366be3bb9830546c2 | https://github.com/AtticusJohnson/mmdetection/tree/d8d89bafcce13d3b32b1fb3366be3bb9830546c2 |
BERTNextSentence | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Moymix/BERT-pytorch | BERTNextSentence | false | 5,616 | [
"Apache-2.0"
] | 1 | f0b9c3ae53e05c00adcc761e0422e4222d8b5619 | https://github.com/Moymix/BERT-pytorch/tree/f0b9c3ae53e05c00adcc761e0422e4222d8b5619 |
Masked_L1_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 triton
import triton.language 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... | bg459/gan-ensembling-loader | Masked_L1_Loss | false | 14,953 | [
"MIT"
] | 86 | 5ff6fae5fd5ced0a48ef2cd3dcb1d74aa1dadce8 | https://github.com/bg459/gan-ensembling-loader/tree/5ff6fae5fd5ced0a48ef2cd3dcb1d74aa1dadce8 |
Atten | from _paritybench_helpers import _mock_config
import torch
from torch import nn
import torch.nn.functional as F
class Atten(nn.Module):
def __init__(self, config):
super(Atten, self).__init__()
hidden_size = config.hidden_size
classifier_dropout = (config.classifier_dropout if config.
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | NTDXYG/EL-CodeBert | Atten | false | 5,639 | [
"MIT"
] | 1 | 62a2364db567f8887a339c40e2c7f7807bedfd50 | https://github.com/NTDXYG/EL-CodeBert/tree/62a2364db567f8887a339c40e2c7f7807bedfd50 |
CoordFC | import torch
import numpy as np
from torch import nn
class SinActivation(nn.Module):
def __init__(self):
super(SinActivation, self).__init__()
def forward(self, x):
return torch.sin(x)
class CoordFC(nn.Module):
def __init__(self, input_dim, hidden_dim):
super().__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import numpy ... | PeterouZh/CIPS-3D | CoordFC | false | 14,160 | [
"MIT"
] | 308 | 9b8bfa0fb23f642af042e150ccd70408f9d137c6 | https://github.com/PeterouZh/CIPS-3D/tree/9b8bfa0fb23f642af042e150ccd70408f9d137c6 |
Linear3D | import math
import torch
import torch as th
from torch.nn import Parameter
def functional_linear3d(input, weight, bias=None):
"""
Apply a linear transformation to the incoming data: :math:`y = xA^T + b`.
Shape:
- Input: :math:`(N, *, in\\_features)` where `*` means any number of
additio... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch as th
from torch.nn import Parameter
assert_size_stride... | BadrYoubiIdrissi/CausalDiscoveryToolbox | Linear3D | false | 2,023 | [
"MIT"
] | 0 | 1e729d002a64ea1942caecd21b9dc8cc217ea0e2 | https://github.com/BadrYoubiIdrissi/CausalDiscoveryToolbox/tree/1e729d002a64ea1942caecd21b9dc8cc217ea0e2 |
SinkhornKnopp | # 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 triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_str... | DonkeyShot21/cassle | SinkhornKnopp | false | 8,016 | [
"MIT"
] | 13 | d25f9c7cb5e822660dc1ef03e7fac09a33d0b1a8 | https://github.com/DonkeyShot21/cassle/tree/d25f9c7cb5e822660dc1ef03e7fac09a33d0b1a8 |
ForgetMult | # 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 triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.optim import *
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empt... | MochizukiShinichi/NeuronBlocks | ForgetMult | false | 9,331 | [
"MIT"
] | 0 | ee15beb564b35900a179fe767745d031124273e9 | https://github.com/MochizukiShinichi/NeuronBlocks/tree/ee15beb564b35900a179fe767745d031124273e9 |
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
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... | benedictquartey/modified-wm | VAE | false | 3,221 | [
"MIT"
] | 0 | bc6cab1aadff24f4be8bb7b9c183b6ef266cf8ba | https://github.com/benedictquartey/modified-wm/tree/bc6cab1aadff24f4be8bb7b9c183b6ef266cf8ba |
MultiHeadAttention | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Royeqiu/Nemo_ASR | MultiHeadAttention | false | 17,869 | [
"Apache-2.0"
] | 10 | 12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e | https://github.com/Royeqiu/Nemo_ASR/tree/12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e |
SeperableConv | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | HabilBhagat/MiniProject---Sem_6 | SeperableConv | false | 11,469 | [
"Apache-2.0"
] | 0 | bbc329a4844921cc04be58f704057bb70ad9dfe2 | https://github.com/HabilBhagat/MiniProject---Sem_6/tree/bbc329a4844921cc04be58f704057bb70ad9dfe2 |
LargeMarginCosLoss | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | alexalex222/classification_loss | LargeMarginCosLoss | false | 6,168 | [
"MIT"
] | 1 | a61617e0c0d5ecf6e0ff388305dd9f3eaa5cbf94 | https://github.com/alexalex222/classification_loss/tree/a61617e0c0d5ecf6e0ff388305dd9f3eaa5cbf94 |
JointsMSELoss | import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.nn
class JointsMSELoss(nn.Module):
def __init__(self, use_target_weight):
super(JointsMSELoss, self).__init__()
self.criterion = nn.MSELoss(size_... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torch.n... | Gerrystev/efficientnet-simple-baseline | JointsMSELoss | false | 11,444 | [
"MIT"
] | 0 | 03ae4da4e91825f73d5185d0d195dd141bd7c4f1 | https://github.com/Gerrystev/efficientnet-simple-baseline/tree/03ae4da4e91825f73d5185d0d195dd141bd7c4f1 |
LayerELU | # 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 triton
import triton.language 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 random
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guard... | dawnclaude/onnx2keras | LayerELU | false | 15,153 | [
"MIT"
] | 115 | 3d2a47c0a228b91fd434232274e216e491da36e3 | https://github.com/dawnclaude/onnx2keras/tree/3d2a47c0a228b91fd434232274e216e491da36e3 |
StackTime | # 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 triton
import triton.language 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 torchvision.models.quantization import *
assert_size_stride = torch._C._dy... | mlperf/inference | StackTime | false | 16,156 | [
"Apache-2.0"
] | 388 | b284212941bcce7a558813c31ba2d356bac71885 | https://github.com/mlperf/inference/tree/b284212941bcce7a558813c31ba2d356bac71885 |
Net | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | gg4u/cnc_2017 | Net | false | 10,118 | [
"MIT"
] | 0 | 1a5c52c3207ba131139214d14a2161af2db80a5c | https://github.com/gg4u/cnc_2017/tree/1a5c52c3207ba131139214d14a2161af2db80a5c |
BCEWithLogitsLoss2d | import torch
import torch.nn as nn
import torch.utils.data.distributed
from torch.backends import cudnn as cudnn
class BCEWithLogitsLoss2d(nn.Module):
"""Computationally stable version of 2D BCE loss.
"""
def __init__(self):
super(BCEWithLogitsLoss2d, self).__init__()
self.bce_loss = nn.B... | 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... | MIPT-Oulu/Collagen | BCEWithLogitsLoss2d | false | 17,656 | [
"MIT"
] | 4 | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | https://github.com/MIPT-Oulu/Collagen/tree/0cbc4285d60e5c9fcc89f629fcf4321e80b7452c |
AttentionPool2d | import math
import torch
import numpy as np
import torch as th
import torch.nn as nn
def conv_nd(dims, *args, **kwargs):
"""
Create a 1D, 2D, or 3D convolution module.
"""
if dims == 1:
return nn.Conv1d(*args, **kwargs)
elif dims == 2:
return nn.Conv2d(*args, **kwargs)
elif dim... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | AranKomat/Diff-DALLE | AttentionPool2d | false | 13,349 | [
"MIT"
] | 53 | 9418e98e97b599c5c65f16ee168fedf76a29095f | https://github.com/AranKomat/Diff-DALLE/tree/9418e98e97b599c5c65f16ee168fedf76a29095f |
CNNQNetwork | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNNQNetwork(nn.Module):
"""CNN Q Function, which outputs array of action values"""
def __init__(self, state_size, action_size, seed, conv1_filters=16,
conv2_filters=16, conv3_filters=16, fc1_units=200, fc2_units=200):
""... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | anindex/deepRL-projects | CNNQNetwork | false | 1,456 | [
"MIT"
] | 0 | bed03d1f985c8340fc75f715028b632bdce40641 | https://github.com/anindex/deepRL-projects/tree/bed03d1f985c8340fc75f715028b632bdce40641 |
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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | earlbabson/torchflare | TripletLoss | false | 6,638 | [
"Apache-2.0"
] | 1 | 15db06d313a53a3ec4640869335ba87730562b28 | https://github.com/earlbabson/torchflare/tree/15db06d313a53a3ec4640869335ba87730562b28 |
ReduceMaxModule | # 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 triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | MichaelZhero/nncase | ReduceMaxModule | false | 11,933 | [
"Apache-2.0"
] | 0 | 0fae6ce90d7adff386e1a286cd2b42422f4b850a | https://github.com/MichaelZhero/nncase/tree/0fae6ce90d7adff386e1a286cd2b42422f4b850a |
GCN | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | thilinicooray/pygcn | GCN | false | 10,878 | [
"MIT"
] | 0 | a7d4f12f31898a3b386736215a6d5fe5cb857387 | https://github.com/thilinicooray/pygcn/tree/a7d4f12f31898a3b386736215a6d5fe5cb857387 |
CL | # 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._inductor.select_algorithm import extern_kernels
import 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... | adamkrekorian/CI-UNet | CL | false | 1,373 | [
"MIT"
] | 0 | fab0f8806540f5d79911bd81ba54dff135f9814f | https://github.com/adamkrekorian/CI-UNet/tree/fab0f8806540f5d79911bd81ba54dff135f9814f |
DuelingQNetwork | import torch
import torch.nn.functional as F
import torch.nn as nn
class DuelingQNetwork(nn.Module):
"""Dueling Q-network (https://arxiv.org/abs/1511.06581)"""
def __init__(self, state_size, action_size, hidsize1=128, hidsize2=128):
super(DuelingQNetwork, self).__init__()
self.fc1_val = 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
import torch.nn as nn
assert_... | KantiCodes/flatland-rl | DuelingQNetwork | false | 11,620 | [
"MIT"
] | 0 | fcc10e83d2548470ebaa5540b967db0940eb30dd | https://github.com/KantiCodes/flatland-rl/tree/fcc10e83d2548470ebaa5540b967db0940eb30dd |
ModelRegressionAtac2Gex | import torch
import torch.utils.data
import torch.nn.functional as F
import torch.nn as nn
class ModelRegressionAtac2Gex(nn.Module):
def __init__(self, dim_mod1, dim_mod2):
super(ModelRegressionAtac2Gex, self).__init__()
self.input_ = nn.Linear(dim_mod1, 2048)
self.fc = nn.Linear(2048, 20... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.... | Permoment-95/neurips2021_multimodal_topmethods | ModelRegressionAtac2Gex | false | 9,489 | [
"MIT"
] | 0 | 017bc23b366a80ba9b1c2a47ea6c44124f77a7ca | https://github.com/Permoment-95/neurips2021_multimodal_topmethods/tree/017bc23b366a80ba9b1c2a47ea6c44124f77a7ca |
ResizeGatedConv2d | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dyn... | sanghiad/vae_vampprior | ResizeGatedConv2d | false | 16,363 | [
"MIT"
] | 218 | d24bc0c8781b7ee7b9570c2d560e43bceff50da4 | https://github.com/sanghiad/vae_vampprior/tree/d24bc0c8781b7ee7b9570c2d560e43bceff50da4 |
GridMixupLoss | import math
import random
import torch
import numpy as np
import typing as t
from torch import nn
class GridMixupLoss(nn.Module):
""" Implementation of GridMixup loss
:param alpha: Percent of the first image on the crop. Can be float or Tuple[float, float]
- if float: lambda parameter get... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import math
import ran... | IlyaDobrynin/GridMixup | GridMixupLoss | false | 8,327 | [
"MIT"
] | 42 | 11b741f234832c9a15b4e650e1e4fad0e79dc63b | https://github.com/IlyaDobrynin/GridMixup/tree/11b741f234832c9a15b4e650e1e4fad0e79dc63b |
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
from torch._inductor.select_algorithm import extern_kernels
import 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.... | henbucuoshanghai/crowed-count- | CNN | false | 15,504 | [
"MIT"
] | 81 | 3353c0a8011b6b83e6e0392258a88706378b443b | https://github.com/henbucuoshanghai/crowed-count-/tree/3353c0a8011b6b83e6e0392258a88706378b443b |
Attn | import torch
import torch.nn as nn
import torch.nn.functional as F
from numpy import sqrt
class Attn(nn.Module):
def __init__(self, hidden_size, batch_first=True):
super(Attn, self).__init__()
self.hidden_size = hidden_size
self.batch_first = batch_first
self.weights = nn.Paramete... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | nauhc/biLSTM-many-to-one | Attn | false | 7,322 | [
"MIT"
] | 1 | 14dab1c75b395c88bdddfe751461af7dc30e1166 | https://github.com/nauhc/biLSTM-many-to-one/tree/14dab1c75b395c88bdddfe751461af7dc30e1166 |
FSoftmaxTest | import torch
import numpy as np
import torch.nn as nn
class FSoftmaxTest(nn.Module):
"""
Test for nn.functional types
"""
def __init__(self):
super(FSoftmaxTest, self).__init__()
self.dim = np.random.randint(0, 3)
def forward(self, x):
from torch.nn import functional as F... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import numpy as np
imp... | goldbattle/onnx2keras | FSoftmaxTest | false | 12,456 | [
"MIT"
] | 0 | dcf52041299ce4216552d1132ec86eb4debd5303 | https://github.com/goldbattle/onnx2keras/tree/dcf52041299ce4216552d1132ec86eb4debd5303 |
NTN | import torch
import torch.nn as nn
import torch.nn.functional as F
class NTN(nn.Module):
def __init__(self, l_dim, r_dim, k=4, non_linear=F.tanh):
super(NTN, self).__init__()
self.u_R = nn.Linear(k, 1, bias=False)
self.f = non_linear
self.W = nn.Bilinear(l_dim, r_dim, k, bias=True... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as ... | aryaman4/TaxoExpan | NTN | false | 9,805 | [
"Apache-2.0"
] | 0 | 3d9b9a21ba7cdd872dc62181dd14ff271e20b245 | https://github.com/aryaman4/TaxoExpan/tree/3d9b9a21ba7cdd872dc62181dd14ff271e20b245 |
RegressionModel | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | YuBeomGon/pytorch_retina | RegressionModel | false | 1,278 | [
"Apache-2.0"
] | 0 | a1713ecbf99e3cf2f8f5edce3329b808b4f9dee8 | https://github.com/YuBeomGon/pytorch_retina/tree/a1713ecbf99e3cf2f8f5edce3329b808b4f9dee8 |
GCN | # 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._inductor.select_algorithm import extern_kernels
import 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... | RuijieJ/pren | GCN | false | 14,337 | [
"Apache-2.0"
] | 64 | 529d4d3366eb1885001200491d3d171d58028f6c | https://github.com/RuijieJ/pren/tree/529d4d3366eb1885001200491d3d171d58028f6c |
Invertible1x1Conv | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn.functional as F
from torch.autograd import Variable
import torch... | drostifrosti/TensorRT | Invertible1x1Conv | false | 6,620 | [
"Apache-2.0"
] | 1 | 76d673366139538fcb47a67e08734ff429306162 | https://github.com/drostifrosti/TensorRT/tree/76d673366139538fcb47a67e08734ff429306162 |
Attloss | # 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 triton
import triton.language 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.functi... | HelenGuohx/cv-ferattn-code | Attloss | false | 5,293 | [
"MIT"
] | 1 | faa9b7850fe2a0f8c08193bb129b5fec4639d616 | https://github.com/HelenGuohx/cv-ferattn-code/tree/faa9b7850fe2a0f8c08193bb129b5fec4639d616 |
wide_basic | # 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._inductor.select_algorithm import extern_kernels
import 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... | csadrian/JEM | wide_basic | false | 9,951 | [
"Apache-2.0"
] | 0 | 72d9af20126cf1410506b2c149d740a41ef04e78 | https://github.com/csadrian/JEM/tree/72d9af20126cf1410506b2c149d740a41ef04e78 |
FinalPool | import torch
import torch.utils.data
class FinalPool(torch.nn.Module):
def __init__(self):
super(FinalPool, self).__init__()
def forward(self, input):
"""
input : Tensor of shape (batch size, T, Cin)
Outputs a Tensor of shape (batch size, Cin).
"""
re... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
e... | praesc/end-to-end-SLU | FinalPool | false | 4,187 | [
"Apache-2.0"
] | 0 | c4e8a5be0ea6a8d93ea7cfd3a5bdab0560c50848 | https://github.com/praesc/end-to-end-SLU/tree/c4e8a5be0ea6a8d93ea7cfd3a5bdab0560c50848 |
ResidualFeedFowardBlock | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | bolajiy/beer | ResidualFeedFowardBlock | false | 14,976 | [
"MIT"
] | 46 | 6fe968c7ca4864437890aa6bd705755c2580696e | https://github.com/bolajiy/beer/tree/6fe968c7ca4864437890aa6bd705755c2580696e |
UpsampleConvLayer | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_s... | yuweiliandrew/openrtist | UpsampleConvLayer | false | 11,028 | [
"Apache-2.0"
] | 0 | 4b6b17e77587751593d5e529b154e60513de3236 | https://github.com/yuweiliandrew/openrtist/tree/4b6b17e77587751593d5e529b154e60513de3236 |
MSELoss | # 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 triton
import triton.language 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 functools
import torch.nn as nn
import torch.nn.functional as F
assert_size_stride... | CK-er/mmdet | MSELoss | false | 2,069 | [
"Apache-2.0"
] | 0 | 9bea4068efbcf7bf739dbe41917a68d525c29868 | https://github.com/CK-er/mmdet/tree/9bea4068efbcf7bf739dbe41917a68d525c29868 |
FC_ELU | import torch
from torch import nn
class FC_ELU(nn.Module):
def __init__(self, in_dim, hidden_units):
super(FC_ELU, self).__init__()
self.fc = nn.Linear(in_dim, hidden_units)
self.elu = nn.ELU()
def forward(self, x):
out = self.fc(x)
out = self.elu(out)
return ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | donaldo3/Neural-voice-cloning | FC_ELU | false | 3,434 | [
"MIT"
] | 0 | a67cb8d34f5674e2c613d131f18182ad56d8f32f | https://github.com/donaldo3/Neural-voice-cloning/tree/a67cb8d34f5674e2c613d131f18182ad56d8f32f |
NetEnd | import torch
import torch.nn as nn
class NetEnd(nn.Module):
def __init__(self, num_classes: 'int'):
super(NetEnd, self).__init__()
self.num_classes = num_classes
self.fc_net1 = nn.Conv2d(21, self.num_classes, kernel_size=1, stride=1)
assert self.num_classes > 0, 'The number of cla... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | EadCat/Road-Extraction | NetEnd | false | 17,238 | [
"MIT"
] | 4 | 9d4831b6c3a5ef07676cbe1c79b03045fda427ea | https://github.com/EadCat/Road-Extraction/tree/9d4831b6c3a5ef07676cbe1c79b03045fda427ea |
InnerProd | # 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._inductor.select_algorithm import extern_kernels
import 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... | TaoStarlit/Sound-of-Pixels | InnerProd | false | 11,923 | [
"MIT"
] | 0 | 06cd37a75836e22208f2e59bcc263b89938e065e | https://github.com/TaoStarlit/Sound-of-Pixels/tree/06cd37a75836e22208f2e59bcc263b89938e065e |
MultiheadAttention | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | ArkanDH/Team5-Inverse-Cooking-Stuff | MultiheadAttention | false | 2,003 | [
"MIT"
] | 0 | ec224918b25fb7a04aa09995e4d11804448df7dd | https://github.com/ArkanDH/Team5-Inverse-Cooking-Stuff/tree/ec224918b25fb7a04aa09995e4d11804448df7dd |
ScaledDotProductAttention | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | hengwei-chan/protein_transformer | ScaledDotProductAttention | false | 15,505 | [
"BSD-3-Clause"
] | 77 | 988bb0fcbb94b37e5a02071bd345ea073ad605f8 | https://github.com/hengwei-chan/protein_transformer/tree/988bb0fcbb94b37e5a02071bd345ea073ad605f8 |
GraphConvolution | from torch.nn import Module
import torch
import torch.nn as nn
from torch.nn.modules.module import Module
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __init__(self, in_features, out_features, bias=True):
super(GraphConvolution, sel... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch.nn import Module
import torch.nn as nn
from torch.nn.modules.module i... | wangzefan666/pygcn | GraphConvolution | false | 13,090 | [
"MIT"
] | 0 | 2a5e4f299e3c9d3eafe3014622e8ec3742ba365c | https://github.com/wangzefan666/pygcn/tree/2a5e4f299e3c9d3eafe3014622e8ec3742ba365c |
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
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | TranNhiem/solo-learn | Mlp | false | 1,146 | [
"MIT"
] | 0 | 7539732b68d153087d09a26a23e1edfdc49bc086 | https://github.com/TranNhiem/solo-learn/tree/7539732b68d153087d09a26a23e1edfdc49bc086 |
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
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import math
from torch import... | sfox14/butterfly | MLP | false | 16,424 | [
"Apache-2.0"
] | 52 | 13cc15cee5bdb7adaf376219aaf20fab0459e9ef | https://github.com/sfox14/butterfly/tree/13cc15cee5bdb7adaf376219aaf20fab0459e9ef |
CrossEntropyLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
... | AlphaLFC/mmdetection | CrossEntropyLoss | false | 4,834 | [
"Apache-2.0"
] | 1 | 45619c5b8aca0ca3e6ddc211210a8946c94694d8 | https://github.com/AlphaLFC/mmdetection/tree/45619c5b8aca0ca3e6ddc211210a8946c94694d8 |
Readout | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | JW9MsjwjnpdRLFw/TSFL | Readout | false | 5,363 | [
"MIT"
] | 1 | ccca391348fde270c9d43149a3397ac3cad4c6e0 | https://github.com/JW9MsjwjnpdRLFw/TSFL/tree/ccca391348fde270c9d43149a3397ac3cad4c6e0 |
BayesLinear | import math
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.nn import init
def calculate_kl(mu_p, sig_p, mu_q, sig_q):
"""
Calculates the Kullback-Leibler divergence between two univariate Gaussians (p and q)
Args:
mu_p: mean of the Gaussian p
sig_p: sta... | 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.triton_helpers import libd... | BalintHompot/uncertainty | BayesLinear | false | 140 | [
"Apache-2.0"
] | 0 | 544c6c5cf22464d69316a31f97fc87355cd10b7e | https://github.com/BalintHompot/uncertainty/tree/544c6c5cf22464d69316a31f97fc87355cd10b7e |
Attention | import torch
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
def __init__(self, model_dim, n_heads=1):
super(Attention, self).__init__()
self.model_dim = model_dim
self.dim_per_head = model_dim // n_heads
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.... | footoredo/pymarl | Attention | false | 3,520 | [
"Apache-2.0"
] | 0 | 9c62dda7a7ed984e020f2cafab93601342305af2 | https://github.com/footoredo/pymarl/tree/9c62dda7a7ed984e020f2cafab93601342305af2 |
Attention | import torch
import torch.nn as nn
class Attention(nn.Module):
def __init__(self, dims, method='general', dropout=0.0):
super().__init__()
if method not in ('dot', 'general'):
raise ValueError('Invalid attention type selected')
self.method = method
if method == 'genera... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Palem1988/NeMo | Attention | false | 2,726 | [
"Apache-2.0"
] | 0 | 56c909b4088f345bf28fe0d0730380527df584f6 | https://github.com/Palem1988/NeMo/tree/56c909b4088f345bf28fe0d0730380527df584f6 |
ncm_output | import torch
import torch.nn as nn
class ncm_output(nn.Module):
def __init__(self, indim, outdim):
super(ncm_output, self).__init__()
self.linear = nn.Linear(indim, outdim)
def forward(self, x):
return -1 * torch.norm(x.reshape(x.shape[0], 1, -1) - self.linear.
weight.tra... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | raphael-baena/clean-train | ncm_output | false | 12,933 | [
"MIT"
] | 0 | f65fcecc11203b12f27d14964944db6941b513cc | https://github.com/raphael-baena/clean-train/tree/f65fcecc11203b12f27d14964944db6941b513cc |
ForwardNet | import torch
import torch.utils.data
import torch.nn.functional as F
def masked_softmax(x, m=None, dim=-1):
"""
Softmax with mask
:param x:
:param m:
:param dim:
:return:
"""
if m is not None:
m = m.float()
x = x * m
e_x = torch.exp(x - torch.max(x, dim=dim, keepdim... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | xdong73S/Match_LSTM_v2.0 | ForwardNet | false | 4,589 | [
"MIT"
] | 0 | dfb8cfbc2a5dafc6655eecf151a7dbcf808cd729 | https://github.com/xdong73S/Match_LSTM_v2.0/tree/dfb8cfbc2a5dafc6655eecf151a7dbcf808cd729 |
GlobalAttentionGeneral | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Amritds/AttnGAN | GlobalAttentionGeneral | false | 11,261 | [
"MIT"
] | 0 | 806ae70142a699bfe384c4964be2f7fce2b83d29 | https://github.com/Amritds/AttnGAN/tree/806ae70142a699bfe384c4964be2f7fce2b83d29 |
GatedConv | import torch
import torch.nn as nn
import torch.utils.data
class GatedConv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, groups=1):
super(GatedConv, self).__init__()
self.layer_f = nn.Conv2d(in_channels, out_channels, 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
import torch.utils.data
assert_size_stride = torch._C._dyn... | ClaraBing/ffjord | GatedConv | false | 13,514 | [
"MIT"
] | 518 | a97c34ff546a063316828f53bd041555e663428d | https://github.com/ClaraBing/ffjord/tree/a97c34ff546a063316828f53bd041555e663428d |
Multi_Head_Attention | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
im... | tianjiansmile/Chinese-Text-Classification-Pytorch | Multi_Head_Attention | false | 10,887 | [
"MIT"
] | 0 | 05cc211b161f61e6bb32ab185dadcffec2f5b5de | https://github.com/tianjiansmile/Chinese-Text-Classification-Pytorch/tree/05cc211b161f61e6bb32ab185dadcffec2f5b5de |
MegatronGelu | import torch
import torch.nn
import torch.onnx
import torch.utils.checkpoint
class MegatronGelu(torch.nn.Module):
def forward(self, x):
return x * 0.5 * (torch.erf(x / 1.41421) + 1.0)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn
import torch.onnx
import torch.utils.checkpoint
assert_size_str... | almiliMSFT/onnxruntime | MegatronGelu | false | 14,799 | [
"MIT"
] | 6,036 | c002dc86a364852859ca9642698fcfc5edf22c9d | https://github.com/almiliMSFT/onnxruntime/tree/c002dc86a364852859ca9642698fcfc5edf22c9d |
DQN | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | ProfessorQu/Reinforcement-Learning | DQN | false | 2,822 | [
"MIT"
] | 0 | e1cd645fc5a7ce60248c1a96c560a38d1b9433cd | https://github.com/ProfessorQu/Reinforcement-Learning/tree/e1cd645fc5a7ce60248c1a96c560a38d1b9433cd |
HardSigmoid | import torch
from torch import nn
import torch.nn.functional as F
class HardSigmoid(nn.Module):
def __init__(self, slope=0.2, offset=0.5):
super().__init__()
self.slope = slope
self.offset = offset
def forward(self, x):
x = self.slope * x + self.offset
x = F.threshold... | 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... | Vivianyzw/Dual.DBNet.pytorch | HardSigmoid | false | 1,180 | [
"Apache-2.0",
"MIT"
] | 0 | 19d823ed7c05076c087a3f7ad1127c71c1c0d692 | https://github.com/Vivianyzw/Dual.DBNet.pytorch/tree/19d823ed7c05076c087a3f7ad1127c71c1c0d692 |
affinity_loss | import torch
from torch import nn
class affinity_loss(nn.Module):
def __init__(self):
super(affinity_loss, self).__init__()
def forward(self, pixel_affinity, sal_affinity, sal_diff):
loss = torch.mean(pixel_affinity * (1 - sal_affinity)
) + 4 * torch.mean(sal_diff * sal_affinity)... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empt... | cj4L/DeepCO3-python | affinity_loss | false | 6,453 | [
"MIT"
] | 1 | fa28ed7b43a3a236d0cc7bf31ce9fd68c01b5888 | https://github.com/cj4L/DeepCO3-python/tree/fa28ed7b43a3a236d0cc7bf31ce9fd68c01b5888 |
Intensity | import torch
import torch.nn as nn
from torch.cuda.amp import autocast as autocast
from torch.cuda.amp import GradScaler as GradScaler
class Intensity(nn.Module):
def __init__(self, scale):
super().__init__()
self.scale = scale
def forward(self, x):
r = torch.randn((x.size(0), 1, 1, ... | import torch
from torch import device
import triton
import triton.language 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 torch.cuda.amp import autocast as aut... | PeppaCat/EfficientZero | Intensity | false | 5,707 | [
"MIT"
] | 1 | b0e98197abfc36ab34faac043ecea9b756b11d54 | https://github.com/PeppaCat/EfficientZero/tree/b0e98197abfc36ab34faac043ecea9b756b11d54 |
SqueezeExcitation | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import Tensor
impo... | QLSong/cv-classify | SqueezeExcitation | false | 2,741 | [
"Apache-2.0"
] | 0 | 02f53d03868f299a08b5c97a266b50a7fdcd3f2b | https://github.com/QLSong/cv-classify/tree/02f53d03868f299a08b5c97a266b50a7fdcd3f2b |
Attention | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | appleparan/mise.py | Attention | false | 6,233 | [
"MIT"
] | 1 | a77ea51be37a739928600c66d168d69b78bc0c4b | https://github.com/appleparan/mise.py/tree/a77ea51be37a739928600c66d168d69b78bc0c4b |
ConvLayer | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
assert_size_s... | gordicaleksa/pytorch-nst-feedforward | ConvLayer | false | 15,455 | [
"MIT"
] | 50 | 00c96e8e3f1b0b7fb4c14254fd0c6f1281a29598 | https://github.com/gordicaleksa/pytorch-nst-feedforward/tree/00c96e8e3f1b0b7fb4c14254fd0c6f1281a29598 |
LNN | import math
import torch
import torch.nn.functional as F
import torch.utils.data
class LNN(torch.nn.Module):
"""A pytorch implementation of LNN layer Input shape.
- A 3D tensor with shape: ``(batch_size,field_size,embedding_size)``.
Output shape
- 2D tensor with shape:``(batch_size,LNN_dim*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.... | Fanxingye/Autotabular | LNN | false | 5,153 | [
"Apache-2.0"
] | 1 | d630c78290a52f8c73885afb16884e18135c34f6 | https://github.com/Fanxingye/Autotabular/tree/d630c78290a52f8c73885afb16884e18135c34f6 |
EncoderLayer | import math
import torch
from torch import nn
import torch.nn.functional as F
import torch.utils.data.distributed
def matmul(x, y):
if x.dim() == y.dim():
return x @ y
if x.dim() == y.dim() - 1:
return (x.unsqueeze(-2) @ y).squeeze(-2)
return (x @ y.unsqueeze(-2)).squeeze(-2)
class FeedF... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | bhubanendra-mishra/dense-video-cap | EncoderLayer | false | 14,955 | [
"BSD-3-Clause"
] | 174 | 43914e17769701b9cf98eda203ae4c465b315fab | https://github.com/bhubanendra-mishra/dense-video-cap/tree/43914e17769701b9cf98eda203ae4c465b315fab |
AlignDifferential | # 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 triton
import 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... | C-SUNSHINE/TOQ-Nets-PyTorch-Release | AlignDifferential | false | 17,119 | [
"MIT"
] | 6 | 05e06bf633fb3c6b610dda9a5126ecd7af1db02f | https://github.com/C-SUNSHINE/TOQ-Nets-PyTorch-Release/tree/05e06bf633fb3c6b610dda9a5126ecd7af1db02f |
ClassNetVideoConv | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
as... | SheffieldAI/pykale | ClassNetVideoConv | false | 16,858 | [
"MIT"
] | 324 | be7670941fb06835883c80477b26702d407017db | https://github.com/SheffieldAI/pykale/tree/be7670941fb06835883c80477b26702d407017db |
PointwiseFeedForward | import torch
import torch.nn as nn
class PointwiseFeedForward(nn.Module):
""" A two-feed-forward-layer module """
def __init__(self, d_hid, d_inner_hid=None, d_out=None, dropout=0):
super(PointwiseFeedForward, self).__init__()
if d_inner_hid is None:
d_inner_hid = d_hid
if... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | XuMayi/PyABSA | PointwiseFeedForward | false | 1,258 | [
"MIT"
] | 0 | 3d71c0cdaea7ea1eff600d9091c3c63f61c111e5 | https://github.com/XuMayi/PyABSA/tree/3d71c0cdaea7ea1eff600d9091c3c63f61c111e5 |
BinaryReg | import torch
from typing import Optional
import torch.utils.data
import torch.nn as nn
import torch.nn.parallel
class BinaryReg(nn.Module):
"""Regularization for encouraging the outputs to be binary.
Args:
pred (torch.Tensor): foreground logits.
mask (Optional[torch.Tensor], optional): weight... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.utils.dat... | devaansh100/pytorch_connectomics | BinaryReg | false | 6,555 | [
"MIT"
] | 1 | b1e4b16b0480546ea806d14876208080815ed964 | https://github.com/devaansh100/pytorch_connectomics/tree/b1e4b16b0480546ea806d14876208080815ed964 |
TVLoss | import torch
import torch.nn as nn
import torch.nn.functional as F
class TVLoss(nn.Module):
"""L2 total variation loss, as in Mahendran et al."""
def forward(self, input):
input = F.pad(input, (0, 1, 0, 1), 'replicate')
x_diff = input[..., :-1, 1:] - input[..., :-1, :-1]
y_diff = inpu... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | jayChung0302/SideProject-sudalchongbo | TVLoss | false | 6,922 | [
"MIT"
] | 1 | fb0a3d0aee53ba24d3b8ec2dd8c52d0e8f6c33d7 | https://github.com/jayChung0302/SideProject-sudalchongbo/tree/fb0a3d0aee53ba24d3b8ec2dd8c52d0e8f6c33d7 |
Concat | # 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 triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch import nn
import torch.nn
import torch.optim
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda =... | BerenLuthien/ReAgent | Concat | false | 13,389 | [
"BSD-3-Clause"
] | 1,156 | 52f666670a7fa03206812ef48949f6b934d400f7 | https://github.com/BerenLuthien/ReAgent/tree/52f666670a7fa03206812ef48949f6b934d400f7 |
DotProdAttention | import torch
import torch.nn as nn
import torch.nn.functional as F
class DotProdAttention(nn.Module):
"""Basic Dot-Production Attention"""
def __init__(self):
super().__init__()
def forward(self, output, context):
"""Basic Dot-Production Method
1. compute e = q * 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.... | Tzu-An/ml_seq2seq_attn | DotProdAttention | false | 2,901 | [
"Apache-2.0"
] | 0 | 1f29b1156c5e66e2bb5255c6d214c70162c91528 | https://github.com/Tzu-An/ml_seq2seq_attn/tree/1f29b1156c5e66e2bb5255c6d214c70162c91528 |
MS_Block | import torch
from torch import nn
from torch.nn.functional import interpolate
class MS_Block(nn.Module):
def __init__(self, in_channel, out_channel, pool_level, txt_length):
super(MS_Block, self).__init__()
self.txt_length = txt_length
pool_kernel = 5 * pool_level, 1
pool_stride =... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
assert_s... | WangGodder/deep-cross-modal-hashing | MS_Block | false | 14,588 | [
"MIT"
] | 65 | 9784397c1076c81b43ebd856cb24b8a67cf8f41e | https://github.com/WangGodder/deep-cross-modal-hashing/tree/9784397c1076c81b43ebd856cb24b8a67cf8f41e |
MLP | import torch
from torch import Tensor
from torch import nn
class MLP(nn.Module):
def __init__(self, dim, embed_dim):
super().__init__()
self.proj = nn.Linear(dim, embed_dim)
def forward(self, x: 'Tensor') ->Tensor:
x = x.flatten(2).transpose(1, 2)
x = self.proj(x)
ret... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import 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... | EmanuelNk/semantic-segmentation | MLP | false | 2,198 | [
"MIT"
] | 0 | 20ff16da49691fb407724909d9c7e84b47e2fee0 | https://github.com/EmanuelNk/semantic-segmentation/tree/20ff16da49691fb407724909d9c7e84b47e2fee0 |
AdaptiveInstanceNorm | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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... | KUMartin77/AAA738_StyleGAN_pytorch | AdaptiveInstanceNorm | false | 11,604 | [
"BSD-2-Clause"
] | 0 | ed0689102c922d336f53e374e8be2ab532a84ccd | https://github.com/KUMartin77/AAA738_StyleGAN_pytorch/tree/ed0689102c922d336f53e374e8be2ab532a84ccd |
TransformerEncoderLayer | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | Treedy2020/TransNet | TransformerEncoderLayer | false | 18,051 | [
"MIT"
] | 4 | dd0e43e1931153baea4e5fe8cb31dc5ff0cb7b09 | https://github.com/Treedy2020/TransNet/tree/dd0e43e1931153baea4e5fe8cb31dc5ff0cb7b09 |
PositionWiseFeedForward | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | DannielSilva/MMBERT | PositionWiseFeedForward | false | 18,387 | [
"MIT"
] | 4 | 2c9069b59b66b8f3fec6de2e68ec42b489a3a437 | https://github.com/DannielSilva/MMBERT/tree/2c9069b59b66b8f3fec6de2e68ec42b489a3a437 |
InputConv | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | AksultanMukhanbet/proctoring_intellectual_part | InputConv | false | 8,838 | [
"MIT"
] | 0 | f85db9d31025cb57a732f64ab22358651bc93c69 | https://github.com/AksultanMukhanbet/proctoring_intellectual_part/tree/f85db9d31025cb57a732f64ab22358651bc93c69 |
Discriminator | import math
import torch
import torch.nn as nn
import torch.utils.data
def uniform(size, tensor):
stdv = 1.0 / math.sqrt(size)
if tensor is not None:
tensor.data.uniform_(-stdv, stdv)
class Discriminator(nn.Module):
def __init__(self, hidden_dim):
super(Discriminator, self).__init__()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import math
import torch.nn as nn
import torch.utils.data
assert_size_stride = t... | Bawaw/pytorch_geometric | Discriminator | false | 13,388 | [
"MIT"
] | 62 | 868548d4396fc66e39b08e2ff19091a367ddac13 | https://github.com/Bawaw/pytorch_geometric/tree/868548d4396fc66e39b08e2ff19091a367ddac13 |
DisplacementPrediction | # 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._inductor.select_algorithm import extern_kernels
import 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... | hk19960522/2018-DL-Final | DisplacementPrediction | false | 3,602 | [
"MIT"
] | 0 | cbc70260aa22d7df366a1d28bee472f1fc5b82c7 | https://github.com/hk19960522/2018-DL-Final/tree/cbc70260aa22d7df366a1d28bee472f1fc5b82c7 |
Attn | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | nauhc/biLSTM-many-to-one | Attn | false | 7,322 | [
"MIT"
] | 1 | 14dab1c75b395c88bdddfe751461af7dc30e1166 | https://github.com/nauhc/biLSTM-many-to-one/tree/14dab1c75b395c88bdddfe751461af7dc30e1166 |
weight_quantize_fn | import torch
import torch.nn as nn
def uniform_quantize(k):
class qfn(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
if k == 32:
out = input
elif k == 1:
out = torch.sign(input)
else:
n = float... | 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... | heymesut/SJTU_microe | weight_quantize_fn | false | 6,807 | [
"BSD-3-Clause"
] | 1 | 7a862d03b4d8fe4c8608173a16082f44001f3f13 | https://github.com/heymesut/SJTU_microe/tree/7a862d03b4d8fe4c8608173a16082f44001f3f13 |
extractNet_connected | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | MNRKhan/aps360-project | extractNet_connected | false | 17,674 | [
"MIT"
] | 3 | 1d91a4262c95cd6b5610aae16e1a30f2749a4373 | https://github.com/MNRKhan/aps360-project/tree/1d91a4262c95cd6b5610aae16e1a30f2749a4373 |
UpsampleLayer | import torch
import torch.nn as nn
class UpsampleLayer(nn.Module):
"""
"""
def __init__(self, scale_factor, mode='bilinear'):
"""
:param scale_factor:
:param mode:
"""
super().__init__()
self.scale_factor = scale_factor
self.mode = mode
def f... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
emp... | jianantian/yolo3-pytorch | UpsampleLayer | false | 3,720 | [
"BSD-3-Clause"
] | 0 | 8966f04c5b514a4f60fcb63b1fc753d0b13ebdcc | https://github.com/jianantian/yolo3-pytorch/tree/8966f04c5b514a4f60fcb63b1fc753d0b13ebdcc |
qd | import torch
import torch.nn as nn
class qd(nn.Module):
def __init__(self, d_dim, zd_dim):
super(qd, self).__init__()
self.fc1 = nn.Linear(zd_dim, d_dim)
self.activation = nn.LeakyReLU(inplace=True)
torch.nn.init.xavier_uniform_(self.fc1.weight)
self.fc1.bias.data.zero_()
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | IamWangYunKai/DG-TrajGen | qd | false | 8,278 | [
"MIT"
] | 31 | 0a8aab7e1c05111a5afe43d53801c55942e9ff56 | https://github.com/IamWangYunKai/DG-TrajGen/tree/0a8aab7e1c05111a5afe43d53801c55942e9ff56 |
ContrastiveDistanceLoss | # 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 triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.distributed
from torch.nn.modules.loss import *
from t... | Ditwoo/catalyst | ContrastiveDistanceLoss | false | 5,072 | [
"Apache-2.0"
] | 1 | 3126390f9f679ebcfedbe01707b416678a2732ac | https://github.com/Ditwoo/catalyst/tree/3126390f9f679ebcfedbe01707b416678a2732ac |
ResizeConv2d | import torch
import torch.utils.data
import torch.nn as nn
class ResizeConv2d(nn.Module):
def __init__(self, input_channels, output_channels, kernel_size, stride,
padding, dilation=1, scale_factor=2, activation=None):
super(ResizeConv2d, self).__init__()
self.activation = activation
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dyn... | sanghiad/vae_vampprior | ResizeConv2d | false | 16,372 | [
"MIT"
] | 218 | d24bc0c8781b7ee7b9570c2d560e43bceff50da4 | https://github.com/sanghiad/vae_vampprior/tree/d24bc0c8781b7ee7b9570c2d560e43bceff50da4 |
CriticVanilla | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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 ... | yangfanthu/modular-rl | CriticVanilla | false | 13,136 | [
"BSD-2-Clause"
] | 0 | 25c599bab641a7e732dbaf116cd240fa2358f113 | https://github.com/yangfanthu/modular-rl/tree/25c599bab641a7e732dbaf116cd240fa2358f113 |
MultiHeadAttention | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | AlbertiPot/attention-is-all-you-need-pytorch | MultiHeadAttention | false | 35 | [
"MIT"
] | 0 | c5ec40907db281b85b3bd7a5dd8016940291add0 | https://github.com/AlbertiPot/attention-is-all-you-need-pytorch/tree/c5ec40907db281b85b3bd7a5dd8016940291add0 |
MultiHeadAttention | from torch.nn import Module
import torch
import numpy as np
from torch import nn
class ScaledDotProductAttention(nn.Module):
"""
Scaled dot-product attention
"""
def __init__(self, d_model, d_k, d_v, h):
"""
:param d_model: Output dimensionality of the model
:param d_k: Dimens... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | quanha72/mesh-memory-transformer | MultiHeadAttention | false | 12,929 | [
"BSD-3-Clause"
] | 0 | 0eeae459efdb8e85926ce8595536409fdbfc4f99 | https://github.com/quanha72/mesh-memory-transformer/tree/0eeae459efdb8e85926ce8595536409fdbfc4f99 |
HardTripletLoss | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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_... | pfe-everis/lcd | HardTripletLoss | false | 16,248 | [
"BSD-3-Clause"
] | 76 | 25f3fe7dc7e0c8ba02fb380dbcbe7752747b3fb5 | https://github.com/pfe-everis/lcd/tree/25f3fe7dc7e0c8ba02fb380dbcbe7752747b3fb5 |
MultiHeadAttention | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | superMC5657/transformer | MultiHeadAttention | false | 10,886 | [
"MIT"
] | 0 | b9d9ca3a5f307f6587330a8235e8d5a2a3650510 | https://github.com/superMC5657/transformer/tree/b9d9ca3a5f307f6587330a8235e8d5a2a3650510 |
LearnableTimeDepWeightedCost | import torch
import torch.utils.data
class LearnableTimeDepWeightedCost(torch.nn.Module):
def __init__(self, time_horizon, dim=9, weights=None):
super(LearnableTimeDepWeightedCost, self).__init__()
if weights is None:
self.weights = torch.nn.Parameter(0.01 * torch.ones([
... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_... | bechtle/LearningToLearn | LearnableTimeDepWeightedCost | false | 3,270 | [
"MIT"
] | 0 | 52eed5359e8a42bd99abe1df554a3b035dd3e2d2 | https://github.com/bechtle/LearningToLearn/tree/52eed5359e8a42bd99abe1df554a3b035dd3e2d2 |
BertSelfAttention | # 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._inductor.select_algorithm import extern_kernels
import triton
import triton.language 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.... | johnson7788/TextBrewer | BertSelfAttention | false | 6,983 | [
"Apache-2.0"
] | 1 | fa7fa4d4a2a8debde5b148d448238f3b4fa1aa9a | https://github.com/johnson7788/TextBrewer/tree/fa7fa4d4a2a8debde5b148d448238f3b4fa1aa9a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.