braintools.tree.as_numpy#
- braintools.tree.as_numpy(tree, is_leaf=<function is_quantity>)[source]#
Convert all leaves of a PyTree to NumPy arrays.
- Parameters:
- Returns:
PyTree with
np.asarrayapplied to each leaf.- Return type:
ndarray]
Notes
This performs a best-effort conversion using
np.asarray; for JAX arrays this typically results in host NumPy arrays.