Tree Utils#
In MLX we consider a python tree to be an arbitrarily nested collection of
dictionaries, lists and tuples without cycles. Functions in this module that
return python trees will be using the default python dict, list and
tuple but they can usually process objects that inherit from any of these.
Note
Dictionaries should have keys that are valid python identifiers.
|
Flattens a Python tree to a list of key, value tuples. |
|
Recreate a Python tree from its flat representation. |
|
Applies |
|
Applies |
|
Applies a reduction to the leaves of a Python tree. |