We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tm.unwrap
out_vectors
import jax.numpy as jnp import tree_math as tm def f(x, y): return x, y x = y = tm.Vector(jnp.array(0.)) tm.unwrap(f, out_vectors = (True, False))(x, y) # (tree_math.Vector(DeviceArray(0., dtype=float32, weak_type=True)), DeviceArray(0., dtype=float32, weak_type=True)) tm.unwrap(f, out_vectors = [True, False])(x, y) # ValueError: Expected list, got (DeviceArray(0., dtype=float32, weak_type=True), DeviceArray(0., dtype=float32, weak_type=True)).
The text was updated successfully, but these errors were encountered:
This is definitely just due to a lack of documentation since out_vectors has to be a pytree with the same structure as the return value.
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: