mlx.utils.tree_unflatten#
- tree_unflatten(tree: List[Tuple[str, Any]] | Dict[str, Any]) Any #
Recreate a Python tree from its flat representation.
from mlx.utils import tree_unflatten d = tree_unflatten([("hello.world", 42)]) print(d) # {"hello": {"world": 42}} d = tree_unflatten({"hello.world": 42}) print(d) # {"hello": {"world": 42}}