For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
conv_transposed_gpu
def conv_transposed_gpu[input_type: DType, filter_type: DType, output_type: DType](output: TileTensor[output_type, Engine=output.Engine, linear_idx_type=output.linear_idx_type], input: TileTensor[input_type, Engine=input.Engine, linear_idx_type=input.linear_idx_type], filter: TileTensor[filter_type, Engine=filter.Engine, linear_idx_type=filter.linear_idx_type], stride: IndexList[(input.LayoutType.rank - Int(2))], dilation: IndexList[(input.LayoutType.rank - Int(2))], padding: IndexList[(input.LayoutType.rank - Int(2))], ctx: DeviceContext)
Runs a transposed convolution on the GPU via the cuDNN backward-data path.
Parameters:
- input_type (
DType): Element type of the input tensor. - filter_type (
DType): Element type of the filter tensor. - output_type (
DType): Element type of the output tensor.
Args:
- output (
TileTensor[output_type, Engine=output.Engine, linear_idx_type=output.linear_idx_type]): Output tensor that receives the transposed convolution result. - input (
TileTensor[input_type, Engine=input.Engine, linear_idx_type=input.linear_idx_type]): Input tensor in NHWC layout. - filter (
TileTensor[filter_type, Engine=filter.Engine, linear_idx_type=filter.linear_idx_type]): Filter tensor in RSFC layout. - stride (
IndexList[(input.LayoutType.rank - Int(2))]): Stride along each spatial axis. - dilation (
IndexList[(input.LayoutType.rank - Int(2))]): Dilation value along each spatial axis of the filter. - padding (
IndexList[(input.LayoutType.rank - Int(2))]): Padding along each spatial axis. - ctx (
DeviceContext): Device context used to access the cuDNN handle and device buffers.
def conv_transposed_gpu[EpilogueFnType: ConvSimdEpilogueFn, OutputLayoutType: TensorLayout, //, input_type: DType, filter_type: DType, output_type: DType](output_layout: OutputLayoutType, input: TileTensor[input_type, Engine=input.Engine, linear_idx_type=input.linear_idx_type], filter: TileTensor[filter_type, Engine=filter.Engine, linear_idx_type=filter.linear_idx_type], stride: IndexList[(input.LayoutType.rank - Int(2))], dilation: IndexList[(input.LayoutType.rank - Int(2))], padding: IndexList[(input.LayoutType.rank - Int(2))], elementwise_epilogue: EpilogueFnType, ctx: DeviceContext)
Runs a transposed convolution on the GPU via the cuDNN backward-data path and hands every output value to an elementwise epilogue.
The same convolution as the overload that takes output, for a caller
whose epilogue owns every write, such as a graph op whose output is fused.
cuDNN writes into a temporary buffer and a separate elementwise pass feeds
it to elementwise_epilogue. The output is given as a layout, so the
kernel never sees a pointer it could write through.
Parameters:
- EpilogueFnType (
ConvSimdEpilogueFn): Type ofelementwise_epilogue(inferred). - OutputLayoutType (
TensorLayout): Type ofoutput_layout(inferred). - input_type (
DType): Element type of the input tensor. - filter_type (
DType): Element type of the filter tensor. - output_type (
DType): Element type of the output values.
Args:
- output_layout (
OutputLayoutType): Layout of the output; only its shape is read. - input (
TileTensor[input_type, Engine=input.Engine, linear_idx_type=input.linear_idx_type]): Input tensor in NHWC layout. - filter (
TileTensor[filter_type, Engine=filter.Engine, linear_idx_type=filter.linear_idx_type]): Filter tensor in RSFC layout. - stride (
IndexList[(input.LayoutType.rank - Int(2))]): Stride along each spatial axis. - dilation (
IndexList[(input.LayoutType.rank - Int(2))]): Dilation value along each spatial axis of the filter. - padding (
IndexList[(input.LayoutType.rank - Int(2))]): Padding along each spatial axis. - elementwise_epilogue (
EpilogueFnType): Elementwise epilogue closure that receives every output value. - ctx (
DeviceContext): Device context used to access the cuDNN handle and device buffers.