PyTorch eager
PyTorch · python · MIT
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 39 lines, MIT.
50_ConvTranspose3d_Scaling_AvgPool_BiasAdd_Scaling.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-50-convtranspose3d-scaling-avgpool-biasadd-scaling-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 Scaling AvgPool BiasAdd Scalingfp32 · [128, 3, 16, 32, 32]
NVIDIA H100
5.71ms±0.00
#2 of 2
2026-03-05
ConvTranspose3d Scaling AvgPool BiasAdd Scalingfp32 · [128, 3, 16, 32, 32]
NVIDIA H100
7.67ms±0.00
#2 of 2
2026-03-05
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:70e320dfe2e2a0a737a4c609109e6ec90f9ef30f212820b7967446ae74637ea3
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
50_ConvTranspose3d_Scaling_AvgPool_BiasAdd_Scaling.py39 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Model that performs a 3D transposed convolution, scaling, average pooling, bias addition, and scaling.
"""
def __init__(self, in_channels, out_channels, kernel_size, stride, padding, scale1, scale2, bias_shape):
super(Model, self).__init__()
self.conv_transpose = nn.ConvTranspose3d(in_channels, out_channels, kernel_size, stride=stride, padding=padding)
self.scale1 = nn.Parameter(torch.tensor(scale1))
self.avg_pool = nn.AvgPool3d(kernel_size=2)
self.bias = nn.Parameter(torch.randn(bias_shape))
self.scale2 = nn.Parameter(torch.tensor(scale2))
def forward(self, x):
x = self.conv_transpose(x)
x = x * self.scale1
x = self.avg_pool(x)
x = x + self.bias
x = x * self.scale2
return x
batch_size = 128
in_channels = 3
out_channels = 16
depth, height, width = 16, 32, 32
kernel_size = 3
stride = 2
padding = 1
scale1 = 0.5
scale2 = 1.0
bias_shape = (out_channels, 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, scale1, scale2, bias_shape]scrolls · 39 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