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:
- โtuple (
RuntimeTuple): The RuntimeTuple to convert.
Returns:
RuntimeTuple: A new IntTuple containing the products of each top level tuple, in a flat structure.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!