For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
reduce_shape
def reduce_shape[input_rank: Int, input_type: DType, //](input_buf: ManagedTensorSlice[static_spec=input_buf.static_spec], axis: Int) -> IndexList[input_rank]
Compute the output shape of a reduce operation, and assert the inputs are compatible.
Parameters:
- βinput_rank (
Int): Input_rank of the input tensor. - βinput_type (
DType): Type of the input tensor.
Args:
- βinput_buf (
ManagedTensorSlice[static_spec=input_buf.static_spec]): The input tensor. - βaxis (
Int): The axis tensor.
Returns:
IndexList[input_rank]: The output shape.