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 function
get_conv_shape
def get_conv_shape[rank: Int, filter_packed: Bool](output: TileTensor[Storage=output.Storage, address_space=output.address_space, linear_idx_type=output.linear_idx_type], input: TileTensor[Storage=input.Storage, address_space=input.address_space, linear_idx_type=input.linear_idx_type], filter: TileTensor[Storage=filter.Storage, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type], stride: IndexList[rank], dilation: IndexList[rank], pad_d: IndexList[Int(2)], pad_h: IndexList[Int(2)], pad_w: IndexList[Int(2)], num_groups: Int) -> ConvShape[rank]
Builds a ConvShape from the output, input, and filter tile tensors.
Parameters:
- βrank (
Int): Spatial rank of the convolution (1, 2, or 3). - βfilter_packed (
Bool): Whether the filter tensor stores spatial dimensions starting at index 1 (packed) rather than index 0.
Args:
- βoutput (
TileTensor[Storage=output.Storage, address_space=output.address_space, linear_idx_type=output.linear_idx_type]): Output tile tensor in NHWC layout. - βinput (
TileTensor[Storage=input.Storage, address_space=input.address_space, linear_idx_type=input.linear_idx_type]): Input tile tensor in NHWC layout. - βfilter (
TileTensor[Storage=filter.Storage, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type]): Filter tile tensor. - βstride (
IndexList[rank]): Per-dimension stride values. - βdilation (
IndexList[rank]): Per-dimension dilation values. - βpad_d (
IndexList[Int(2)]): Depth padding as(lower, upper). - βpad_h (
IndexList[Int(2)]): Height padding as(lower, upper). - βpad_w (
IndexList[Int(2)]): Width padding as(lower, upper). - βnum_groups (
Int): Number of convolution groups.
Returns:
ConvShape[rank]: A populated ConvShape describing the convolution dimensions.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!