-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
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
Fix passing different PyTrees to JIT-compiled functions #165
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diegoferigo
force-pushed
the
fix_static_pytree_attributes
branch
from
June 3, 2024 16:30
fd6cde5
to
6420495
Compare
diegoferigo
changed the title
Fix passing different PyTree to JIT-compiled functions
Fix passing different PyTrees to JIT-compiled functions
Jun 3, 2024
This PR also fixes the M(N)WE provided by @flferretti in #103 (comment) (hopefully, without side effects). |
flferretti
approved these changes
Jun 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Diego, LGTM!
Co-authored-by: Filippo Luca Ferretti <102977828+flferretti@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should finally solve #103 also for models with joints, in particular:
__eq__
magic method of all classes that are used in JIT compiled functions.jaxsim.utils.wrappers.HashedNumpyArray
that can wrap NumPy and JAX NumPy array to provide them a hash and equality operators. This is necessary for alljax_dataclasses.Static
fields storing arrays.HashedNumpyArray
andHashlessObject
exposing only the underlying object through a class property.JointModel.joint_axis
attribute to properly containJointGenericAxis
objects. Before this PR (from #153 I guess), this attribute was typed to hold aJointGenericAxis
but instead it stored plain JAX numpy arrays with the 3D vector of the axis.📚 Documentation preview 📚: https://jaxsim--165.org.readthedocs.build//165/