Provides mathematical operations (add, multiply, etc.) on JAX pytrees, treating them as vectors. Version 0.2.1, infrequent releases, currently active.
pip install tree-mathNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Vector from a pytree of arrays and performs basic operations.
Ensure all arrays in the pytree have consistent dtypes before constructing a Vector.
Use jax.tree_util.tree_map(lambda x: x.copy(), tree) if you need independent copies.
Run 'pip install tree-math' in your virtual environment.
Convert all arrays to the same dtype, e.g., tree = jax.tree_util.tree_map(lambda x: x.astype(jnp.float32), tree).