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).
Python function
unflatten
unflatten()
max.experimental.tree_utils.unflatten(treedef, leaves)
Rebuilds a tree from a structure and its leaves.
The inverse of flatten(), always building a fresh tree.
-
Parameters:
-
Returns:
-
The rebuilt tree.
-
Raises:
-
- TypeError – If a cycle closes through a node whose class declares no
__tree_empty__. - ValueError – If the leaf count does not match the structure, or if
treedefdid not come fromflatten().
- TypeError – If a cycle closes through a node whose class declares no
-
Return type: