For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
ConvTransposedPacked
struct ConvTransposedPacked[input_linear_idx_type: DType, input_storage: TensorStorage, filter_linear_idx_type: DType, filter_storage: TensorStorage, output_linear_idx_type: DType, output_storage: TensorStorage, InputLayoutType: TensorLayout, FilterLayoutType: TensorLayout, OutputLayoutType: TensorLayout, conv_attr_rank: Int, //, input_origin: ImmOrigin, filter_origin: ImmOrigin, output_origin: MutOrigin, input_type: DType, filter_type: DType, output_type: DType, conv_attr: ConvInfoStatic[conv_attr_rank], elementwise_epilogue: Optional[def[rank: Int](coords: IndexList[rank], f_size: Int) capturing thin -> None] = None]
Holds the packed tensors and partition state for one task of a direct transposed convolution.
Encapsulates the output, input, and packed filter tile tensors along with the convolution shape and the partition assigned to a single parallel task, and drives the tiled batch, channel, and feature loops that accumulate the result.
Parametersβ
- βinput_linear_idx_type (
DType): Linear index dtype of the input tensor (inferred). - βinput_storage (
TensorStorage): Storage backing the input tile tensor (inferred). - βfilter_linear_idx_type (
DType): Linear index dtype of the filter tensor (inferred). - βfilter_storage (
TensorStorage): Storage backing the filter tile tensor (inferred). - βoutput_linear_idx_type (
DType): Linear index dtype of the output tensor (inferred). - βoutput_storage (
TensorStorage): Storage backing the output tile tensor (inferred). - βInputLayoutType (
TensorLayout): Compile-time layout of the input tensor (inferred). - βFilterLayoutType (
TensorLayout): Compile-time layout of the filter tensor (inferred). - βOutputLayoutType (
TensorLayout): Compile-time layout of the output tensor (inferred). - βconv_attr_rank (
Int): Number of spatial dimensions in the convolution (inferred). - βinput_origin (
ImmOrigin): Immutable memory origin of the input tile tensor. - βfilter_origin (
ImmOrigin): Immutable memory origin of the filter tile tensor. - βoutput_origin (
MutOrigin): Mutable memory origin of the output tile tensor. - β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. - βconv_attr (
ConvInfoStatic[conv_attr_rank]): Static convolution attributes carrying strides, pads, dilations, and group count. - βelementwise_epilogue (
Optional[def[rank: Int](coords: IndexList[rank], f_size: Int) capturing thin -> None]): Optional elementwise epilogue applied to the output after accumulation (defaults toNone).
Fieldsβ
- βoutput (
TileTensor[output_type, OutputLayoutType, output_origin, Storage=output_storage, linear_idx_type=output_linear_idx_type]): - βinput (
TileTensor[input_type, InputLayoutType, input_origin, Storage=input_storage, linear_idx_type=input_linear_idx_type]): - βfilter (
TileTensor[filter_type, FilterLayoutType, filter_origin, Storage=filter_storage, linear_idx_type=filter_linear_idx_type]): - βconv_shape (
ConvShape[conv_attr_rank]): - βpartition (
ConvPartition): - βcf_tile_size (
IndexList[Int(2)]):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable
Methodsβ
runβ
static def run(output: TileTensor[output_type, OutputLayoutType, output_origin, Storage=output_storage, linear_idx_type=output_linear_idx_type], input: TileTensor[input_type, InputLayoutType, input_origin, Storage=input_storage, linear_idx_type=input_linear_idx_type], filter: TileTensor[filter_type, FilterLayoutType, filter_origin, Storage=filter_storage, linear_idx_type=filter_linear_idx_type], conv_shape: ConvShape[conv_attr_rank], ctx: Optional[DeviceContext] = None)
input_space_loopβ
def input_space_loop[micro_kernel_height: Int, micro_kernel_width: Int, has_residual: Bool, last_c_tile: Bool](self, n: Int, f_tile_offset: Int, f_tile_size: Int, c_tile_offset: Int, c_tile_size: Int)
input_space_loop_2dβ
def input_space_loop_2d[output_dt: DType, input_dt: DType, filter_dt: DType, //, micro_kernel_height: Int, micro_kernel_width: Int, has_residual: Bool, last_c_tile: Bool](self, output: Pointer[Scalar[output_dt], _safe=False], input: Pointer[Scalar[input_dt], _safe=False], filter: Pointer[Scalar[filter_dt], _safe=False], n: Int, first_c_tile_in_group: Bool, c_tile_size: Int, f_tile_offset: Int, f_tile_size: Int, left_pad_impact_end: Int, right_pad_impact_start: Int)
input_space_loop_3dβ
def input_space_loop_3d[micro_kernel_height: Int, micro_kernel_width: Int, has_residual: Bool, last_c_tile: Bool, output_dt: DType, input_dt: DType, filter_dt: DType](self, output: Pointer[Scalar[output_dt], _safe=False], input: Pointer[Scalar[input_dt], _safe=False], filter: Pointer[Scalar[filter_dt], _safe=False], n: Int, first_c_tile_in_group: Bool, c_tile_size: Int, f_tile_offset: Int, f_tile_size: Int, left_pad_impact_end: Int, right_pad_impact_start: Int)
apply_epilogueβ
def apply_epilogue(self, n: Int, g: Int)
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!