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

advanced_indexing_getitem_shape

def advanced_indexing_getitem_shape[input_rank: Int, index_rank: Int, //, start_axis: Int, num_index_tensors: Int](input_shape: IndexList[input_rank], index_shape: IndexList[index_rank]) -> IndexList[((input_rank + index_rank) - num_index_tensors)]

Calculate the output shape from advanced indexing.

Parameters:

  • ​input_rank (Int): The rank of the input tensor.
  • ​index_rank (Int): The rank of the indexing tensors.
  • ​start_axis (Int): The first dimension in input where the indexing tensors are applied. It is assumed the indexing tensors are applied in consecutive dimensions.
  • ​num_index_tensors (Int): The number of indexing tensors.

Args:

Returns:

IndexList[((input_rank + index_rank) - num_index_tensors)]