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_buf: T, axis: Int) -> IndexList[T.rank]

Compute the output shape of a reduce operation, and assert the inputs are compatible.

Args:

  • ​input_buf (T): The input tensor.
  • ​axis (Int): The axis tensor.

Returns:

IndexList[T.rank]: The output shape.

Was this page helpful?