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 function

gather_nd_shape

def gather_nd_shape[output_rank: Int, input_type: DType, indices_type: DType, batch_dims: Int](input_buf: TileTensor[input_type, address_space=input_buf.address_space, linear_idx_type=input_buf.linear_idx_type, element_size=input_buf.element_size], indices_buf: TileTensor[indices_type, address_space=indices_buf.address_space, linear_idx_type=indices_buf.linear_idx_type, element_size=indices_buf.element_size]) -> IndexList[output_rank]

Compute the output shape of a gather operation, and assert the inputs are compatible.

Parameters:

  • ​output_rank (Int): Rank of the output tensor.
  • ​input_type (DType): Type of the input tensor.
  • ​indices_type (DType): Type of the indices tensor.
  • ​batch_dims (Int): Batch dimensions.

Args:

Returns:

IndexList[output_rank]: The output shape.