Python wrappers
Public Python APIs implemented by this engine symbols.- py
lucid.nn.ConvTranspose1dclass - py
lucid.nn.quantized.ConvTranspose1dclass - py
lucid.nn.functional.conv_transpose1dfunction - py
lucid.nn.ConvTranspose2dclass - py
lucid.nn.quantized.ConvTranspose2dclass - py
lucid.nn.functional.conv_transpose2dfunction - py
lucid.nn.ConvTranspose3dclass - py
lucid.nn.quantized.ConvTranspose3dclass - py
lucid.nn.functional.conv_transpose3dfunction
Autograd node for the N-dimensional transposed convolution.
Backward of this op is itself a regular convolution against the same
weights, so the implementation reuses the ConvNdBackward kernels
for dx and the matching im2col path for dW.
Attributes
schema_v1OpSchemaRegistered op schema (
"conv_transpose1d" / "conv_transpose2d" / "conv_transpose3d") with AmpPolicy::Promote.stride_int[N]Per-axis upsampling factor. Stride
> 1 interleaves implicit zeros between input elements.pad_int[N]Per-axis
dilation * (K - 1) - padding zero-padding removed from the output.opad_int[N]Per-axis output padding added to one side of the output to disambiguate the inverse-stride shape. Must be less than
stride along each axis.Static methods
1static
forward
→TensorImplPtrint forward(const int & x, const int & W, const int & b, const int (&)[N] stride, const int (&)[N] pad, const int (&)[N] opad)Run the forward transposed convolution and attach the backward node.
Parameters
xTensorImplPtrInput batch of shape
(B, C_in, S_0, ..., S_{N-1}).WTensorImplPtrFilter bank of shape
(C_in, C_out, K_0, ..., K_{N-1}). The leading axis is C_in — this is the transposed layout relative to ConvNdBackward.bTensorImplPtrBias of shape
(C_out,) or empty for bias-less variants.stridearray<int, N>Per-axis upsampling factor.
padarray<int, N>Per-axis input padding effectively subtracted from each output extent.
opadarray<int, N>Per-axis output padding added to one side. Must satisfy
opad[i] < stride[i].Returns
TensorImplPtrOutput of shape (B, C_out, O_0, ..., O_{N-1}) where each extent is (or with dilation included as instead of ).
Raises
ShapeMismatchIf the input rank disagrees with
N + 2, if W's leading axis does not match C_in, if b is not 1-D of length C_out, or if a computed output extent is non-positive.DeviceMismatchIf
x, W, b do not all live on the same device.Methods
1Backward — compute [dx, dW, db] for the three saved inputs.
The gradient w.r.t. x is a regular ConvNd against W
(the transposed-conv's adjoint is a forward conv). dW is
obtained via the matching im2col path against the saved input,
and db via a channel-wise reduction.
Parameters
grad_outStorageUpstream gradient with the forward output shape.
Returns
vector<Storage>Gradients in declaration order: dx, dW, db.