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_padding_output_shape
def get_padding_output_shape[rank: Int](input_shape: IndexList[rank], paddings: TileTensor[DType.int, Storage=paddings.Storage, address_space=paddings.address_space, linear_idx_type=paddings.linear_idx_type]) -> IndexList[rank]
Computes the output shape produced by padding input_shape with the before/after amounts given in paddings.
paddings is a flat one-dimensional tensor of length 2 * rank ordered
as (before_axis0, after_axis0, before_axis1, after_axis1, ...), and the
returned shape has each axis i set to before[i] + input_shape[i] + after[i].
Args:
- input_shape (
IndexList[rank]): Shape of the tensor before padding. - paddings (
TileTensor[DType.int, Storage=paddings.Storage, address_space=paddings.address_space, linear_idx_type=paddings.linear_idx_type]): Flat(before, after)padding sizes for each axis.
Returns:
IndexList[rank]: The padded output shape with the same rank as input_shape.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!