IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /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:

Returns:

IndexList[input_rank]: The output shape.