ai.onnx.ConvTranspose
ai.onnx · standard ONNX operator · ONNX opset ≥ 11
Description
Computes the transpose of a convolution, also known as a fractionally strided convolution or deconvolution, from input tensor X, filter weights W, and an optional bias B. Output spatial dimensions follow the stride, dilation, padding, and optional output_padding attributes. Supports grouped convolution through group.
See the ONNX ConvTranspose spec for the reference semantics.
Inputs
| Name | Bind key | Logical dtype | Rank | Shape | Description | Presence |
|---|---|---|---|---|---|---|
X |
x |
T |
— | — | Input data tensor of shape (N x C x D1 x ... x Dn), where N is batch size and C is the number of input channels. |
required |
W |
w |
T |
— | — | Filter weight tensor of shape (C x M/group x k1 x ... x kn), where M is the number of output feature maps. |
required |
B |
bias |
T |
1 |
— | Optional 1-D bias of length M added to each output channel. | optional |
Outputs
| Name | Bind key | Logical dtype | Rank | Shape | Description | Presence |
|---|---|---|---|---|---|---|
Y |
y |
T |
same as X |
derived; see description | Output tensor whose spatial dimensions are computed from the input size, kernel shape, strides, dilations, and padding. | required |
Attributes
Attributes and default values (overridable per request):
| Attribute | Default | Description |
|---|---|---|
auto_pad |
"NOTSET" |
Padding mode: NOTSET uses explicit pads; SAME_UPPER and SAME_LOWER make output spatial size equal input size times stride, with any odd extra padding added at the end or beginning respectively; VALID applies no padding. |
group |
1 |
Number of groups that input and output channels are divided into for grouped (depthwise) convolution. |
dilations |
— | Dilation factors for each spatial axis; defaults to one on every axis. |
kernel_shape |
— | Kernel dimensions for each spatial axis. When omitted, they are inferred from the spatial dimensions of W. |
output_padding |
— | Additional size on the high-index end of each output spatial axis; each value must be smaller than the corresponding stride or dilation. |
output_shape |
— | Requested output spatial dimensions. When present, it must match the declared spatial shape of Y. |
pads |
— | Padding at the beginning of every spatial axis followed by padding at the end of every spatial axis; defaults to zeros. |
strides |
— | Stride factors for each spatial axis; defaults to one on every axis. |
Type constraints
| Variable | Allowed dtypes |
|---|---|
T |
float32, float16 |
Device requirements
Some implementation variants require subgroup-matrix, shader-f16, and subgroups. These are route-specific capabilities, not package-wide requirements; availability also depends on the request shape and dtype.
Files
metadata.json— kernel metadata (id, digests, provenance)manifest.json— the op contract (source of truth)test.json— correctness casesbench.json— benchmark + tuning casesconv-1x1-gemm-tiled-reg.wgsl.jinjaconv-1x1-gemm-tiled.wgsl.jinjaconv-1x1-subgroup-matrix.wgsl.jinjaconv-transpose-empty-input.wgsl.jinjaconv-transpose1d-ncl.wgsl.jinjaconv-transpose1d-phase-tiled.wgsl.jinjaconv-transpose2d-col2im.wgsl.jinjaconv-transpose2d-grouped-stride-phase.wgsl.jinjaconv-transpose2d-nchw.wgsl.jinjaconv-transpose2d-phase-gemm-tiled.wgsl.jinjaconv-transpose2d-weight-reorder.wgsl.jinjaconv-transpose3d-col2im.wgsl.jinjaconv-transpose3d-ncdhw.wgsl.jinjaconv-transpose3d-weight-reorder.wgsl.jinja
Use with @huggingface/kernels
The loader derives every required output's shape and logical dtype from the manifest contract and this call. It then allocates the result tensors automatically.
The version: 1 option selects the published kernel contract; it is independent of any operator opset, contrib since_version, or model version.
Replace each *Data placeholder with a typed array containing the corresponding input data.
import { getKernel } from "@huggingface/kernels";
const kernel = await getKernel("webgpu-kernels/ai.onnx.ConvTranspose", { version: 1 });
const { y } = await kernel({
x: { data: xData, shape: [1, 1, 3] },
w: { data: wData, shape: [1, 2, 2] },
});
- Downloads last month
- -
Requires WebGPU support. See the compatibility table.