Mojo function
index_tensor_shape
index_tensor_shape[input_rank: Int, indices_rank: Int, output_rank: Int, input_type: DType, indices_type: DType, batch_dims: Int, single_thread_blocking_override: Bool = True](input_buf: NDBuffer[input_type, input_rank, origin], indices_buf: NDBuffer[indices_type, indices_rank, origin]) -> Index[output_rank]
Compute the output shape of a index_tensor
operation, and assert the inputs are compatible.
Parameters:
- input_rank (
Int
): Rank of the input tensor. - indices_rank (
Int
): Rank of the indices tensor. - 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. - single_thread_blocking_override (
Bool
): If True, then reduction is run synchronously using a single thread.
Args:
- input_buf (
NDBuffer[input_type, input_rank, origin]
): The input tensor. - indices_buf (
NDBuffer[indices_type, indices_rank, origin]
): The indices tensor.
Returns:
The output shape.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!