mlx.utils.tree_unflatten#
- mlx.utils.tree_unflatten(tree)#
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}}
- Parameters:
tree (List[Tuple[str, Any]]) – The flat representation of a python tree. For instance as returned by
tree_flatten()
.- Returns:
A python tree.