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

coalesce_nested_tuple

def coalesce_nested_tuple[t: IntTuple, out_t: IntTuple = _int_tuple_product_flatten[t]()](tuple: RuntimeTuple[t, element_type=tuple.element_type]) -> RuntimeTuple[out_t]

Coalesces a nested RuntimeTuple into a single-level RuntimeTuple, by multiplying all the values together.

Parameters:

  • โ€‹t (IntTuple): The underlying Compile-time IntTuple backing the RuntimeTuple.
  • โ€‹out_t (IntTuple): The flattened Compile-time IntTuple.

Args:

Returns:

RuntimeTuple[out_t]: A new IntTuple containing the products of each top level tuple, in a flat structure.

Was this page helpful?