IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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

PackConvFilterShape

struct PackConvFilterShape

Implemented traits​

AnyType, ImplicitlyDestructible

Methods​

execute​

static def execute(filter_buf: ManagedTensorSlice[Input, static_spec=filter_buf.static_spec])

shape​

static def shape[rank: Int, filter_type: DType, input_shape: IntTuple, filter_shape: IntTuple, output_shape: IntTuple, strides: IntTuple, dilations: IntTuple, paddings: IntTuple, num_groups: Int](filter_buf: ManagedTensorSlice[Input, static_spec=filter_buf.static_spec]) -> IndexList[(rank + 1)]

Compute the output shape of convolution filter packing.

Parameters:

  • ​rank (Int): Rank of the un-packed filter.
  • ​filter_type (DType): Type of the filter.
  • ​input_shape (IntTuple): NHWC layout.
  • ​filter_shape (IntTuple): Filter shape.
  • ​output_shape (IntTuple): NHWC layout.
  • ​strides (IntTuple): Should be rank 1 size 2.
  • ​dilations (IntTuple): Should be rank 1 size 2.
  • ​paddings (IntTuple): Should be rank 1 size 4.
  • ​num_groups (Int): The number of groups in the convolution.

Args:

  • ​filter_buf (ManagedTensorSlice[Input, static_spec=filter_buf.static_spec]): The filter to be packed.

Returns:

IndexList[(rank + 1)]: The output shape.