PyTorch eager
PyTorch · python · MIT
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 35 lines, MIT.
58_ConvTranspose3d_LogSumExp_HardSwish_Subtract_Clamp.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-58-convtranspose3d-logsumexp-hardswish-subtract-clamp-torch?include=source"interfacepython · torch_eager
symbolModel.forward
Compatibility
measured onNVIDIA H100
declared hardwaredeclared only
architectures—
dtypes
Benchmark evidence
2 measurements across 1 GPU, fastest first.
Operation / workload
Hardware
Latency
Rank
Observed
ConvTranspose3d LogSumExp HardSwish Subtract Clampfp32 · [128, 3, 16, 32, 32]
NVIDIA H100
6.84ms±0.00
#2 of 2
2026-03-05
ConvTranspose3d LogSumExp HardSwish Subtract Clampfp32 · [128, 3, 16, 32, 32]
NVIDIA H100
9.78ms±0.02
#2 of 2
2026-03-05
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:6080e85c430cb5ae15b03fcbf6dea581432578eadbf02c09686f1f46508fdc20
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
58_ConvTranspose3d_LogSumExp_HardSwish_Subtract_Clamp.py35 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Model that performs a 3D transposed convolution, LogSumExp, HardSwish, subtraction, clamp operations.
"""
def __init__(self, in_channels, out_channels, kernel_size, stride, padding, bias_shape):
super(Model, self).__init__()
self.conv_transpose = nn.ConvTranspose3d(in_channels, out_channels, kernel_size, stride=stride, padding=padding)
self.bias = nn.Parameter(torch.randn(1, 1, 1, 1))
def forward(self, x):
x = self.conv_transpose(x)
x = torch.logsumexp(x, dim=1, keepdim=True)
x = x * torch.sigmoid(x + 3) / 6
x = x - self.bias
x = torch.clamp(x, min=-1, max=1)
return x
batch_size = 128
in_channels = 3
out_channels = 16
depth, height, width = 16, 32, 32
kernel_size = 3
stride = 2
padding = 1
bias_shape = (1, 1, 1, 1)
def get_inputs():
return [torch.rand(batch_size, in_channels, depth, height, width)]
def get_init_inputs():
return [in_channels, out_channels, kernel_size, stride, padding, bias_shape]
scrolls · 35 lines total
Source code from KernelBench, © 2023 Anne Ouyang, Simon Guo, Azalia Mirhoseini (Scaling Intelligence Lab, Stanford University), MIT License · MIT
Best evidence level for this revision: reported
JSON