PyTorch eager
PyTorch · python · MIT
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 47 lines, MIT.
78_conv_transposed_2D_asymmetric_input_asymmetric_kernel___padded__.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l1-78-conv-transposed-2d-asymmetric-input-asymmetric-kernel-padded-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
conv transposed 2D asymmetric input asymmetric kernel paddedfp32 · [8, 32, 512, 1024]
NVIDIA H100
2.40ms±0.03
#2 of 2
2026-03-05
conv transposed 2D asymmetric input asymmetric kernel paddedfp32 · [8, 32, 512, 1024]
NVIDIA H100
3.19ms±0.01
#2 of 2
2026-03-05
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:33813c88de6e5ef1d6bef880903c5013eea542f875038080c1e7757022250d71
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
78_conv_transposed_2D_asymmetric_input_asymmetric_kernel___padded__.py47 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Performs a 2D transposed convolution operation with asymmetric input and kernel, with optional padding.
Args:
in_channels (int): Number of channels in the input tensor.
out_channels (int): Number of channels produced by the convolution.
kernel_size (tuple): Size of the convolution kernel (height, width).
stride (tuple, optional): Stride of the convolution (height, width). Defaults to (1, 1).
padding (tuple, optional): Padding applied to the input (height, width). Defaults to (0, 0).
bias (bool, optional): If `True`, adds a learnable bias to the output. Defaults to `False`.
"""
def __init__(self, in_channels: int, out_channels: int, kernel_size: tuple, stride: tuple = (1, 1), padding: tuple = (0, 0), bias: bool = False):
super(Model, self).__init__()
self.conv_transpose2d = nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride=stride, padding=padding, bias=bias)
def forward(self, x: torch.Tensor) -> torch.Tensor:
"""
Performs the 2D transposed convolution.
Args:
x (torch.Tensor): Input tensor of shape (batch_size, in_channels, height, width).
Returns:
torch.Tensor: Output tensor of shape (batch_size, out_channels, height_out, width_out).
"""
return self.conv_transpose2d(x)
# Test code
batch_size = 8
in_channels = 32
out_channels = 32
kernel_size = (3, 7)
height = 512
width = 1024
stride = (1, 1)
padding = (1, 3)
def get_inputs():
x = torch.rand(batch_size, in_channels, height, width)
return [x]
def get_init_inputs():
return [in_channels, out_channels, kernel_size, stride, padding]scrolls · 47 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