Skip to content
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

Unify backends #20

Merged
merged 30 commits into from
Mar 29, 2022
Merged

Unify backends #20

merged 30 commits into from
Mar 29, 2022

Conversation

Giulero
Copy link
Collaborator

@Giulero Giulero commented Mar 25, 2022

This PR should remove duplicate code relative to Jax and PyTorch backends.
I implemented several classes that wrap every data type, overriding several methods.

https://github.com/ami-iit/ADAM/blob/unify-backends/src/adam/core/spatial_math.py and implements spatial math methods, inheriting for an ArrayLike abstract class.
The methods of ArrayLike are then implemented in CasadiLike, JaxLike, etc, and used in the main class that implements rigid-body algorithms.

Fixes #5

@Giulero Giulero self-assigned this Mar 25, 2022
@@ -2,17 +2,9 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 17,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not intentional. I guess these lines are autogenerated when we run the jupyter notebook!

Copy link
Contributor

@traversaro traversaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment.

@Giulero
Copy link
Collaborator Author

Giulero commented Mar 29, 2022

Thanks @traversaro! :)

Copy link
Collaborator

@CarlottaSartore CarlottaSartore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good also to me!

@Giulero Giulero merged commit 68b1e36 into main Mar 29, 2022
@Giulero Giulero deleted the unify-backends branch May 17, 2022 12:58
@traversaro traversaro mentioned this pull request May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify Jax and PyTorch backends
3 participants