Skip to main content

Mojo function

coalesce_nested_tuple

coalesce_nested_tuple[t: IntTuple, out_t: IntTuple = _int_tuple_product_flatten[t]()](tuple: RuntimeTuple[t, element_type=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: A new IntTuple containing the products of each top level tuple, in a flat structure.

Was this page helpful?