Skip to main content

Mojo function

advanced_indexing_getitem_shape

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)]