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
pad_shape
def pad_shape[input_type: DType, paddings_type: DType](input_buf: TileTensor[input_type, Storage=input_buf.Storage, address_space=input_buf.address_space, linear_idx_type=input_buf.linear_idx_type, element_size=input_buf.element_size], paddings_buf: TileTensor[paddings_type, Storage=paddings_buf.Storage, address_space=paddings_buf.address_space, linear_idx_type=paddings_buf.linear_idx_type, element_size=paddings_buf.element_size]) -> IndexList[input_buf.LayoutType.rank]
Compute the output shape of a pad operation, and assert the inputs are compatible.
Parameters:
- βinput_type (
DType): Type of the input tensor. - βpaddings_type (
DType): Type of the padding tensor.
Args:
- βinput_buf (
TileTensor[input_type, Storage=input_buf.Storage, address_space=input_buf.address_space, linear_idx_type=input_buf.linear_idx_type, element_size=input_buf.element_size]): The tensor to pad. - βpaddings_buf (
TileTensor[paddings_type, Storage=paddings_buf.Storage, address_space=paddings_buf.address_space, linear_idx_type=paddings_buf.linear_idx_type, element_size=paddings_buf.element_size]): The paddings tensor, of shape (input_rank, 2).
Returns:
IndexList[input_buf.LayoutType.rank]: The output shape.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!