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

[WIP] Use user-defined NumPy dtypes for AutoDiffXd, Expression, etc. #8452

Conversation

EricCousineau-TRI
Copy link
Contributor

@EricCousineau-TRI EricCousineau-TRI commented Mar 24, 2018

Resolves #8116

See tracking issue for progress.

\cc @soonho-tri @RussTedrake


This change is Reviewable

@EricCousineau-TRI
Copy link
Contributor Author

@RussTedrake The main backwards-incompatible change this introduces is that np.array(..., dtype=Variable) can no longer use .dot(...), since the NumPy C API does not seem to permit returning different types for dot products (unfortunately):
617ce19#diff-81cc7ecb26961a59c2c5ecf90bcfe8faR31

Is that OK?

@RussTedrake
Copy link
Contributor

yuck, but I understand . if you think that this is the best outcome, i can live with it.

@EricCousineau-TRI
Copy link
Contributor Author

I do believe the other benefits outweigh this cost, but I've submitted numpy/numpy#10876 as a request.

@EricCousineau-TRI
Copy link
Contributor Author

EricCousineau-TRI commented Apr 14, 2018

@jwnimmer-tri This PR has an initial incantation of building NumPy from an upstream PR and using the resulting wheel in a build.
I've also submitted RussTedrake/underactuated#113, which just needed the dot product adjustments.

Do you think I should lump the NumPy repository stuff all together in this PR, or make a separate one?
(My preference is the same one, but I can separate it out if it's less to deal with.)

EDIT: Er, drake_cloc had reported what looked like ~600 LOC of changed, but this definitely indicates more. I'll split it out, then.

@EricCousineau-TRI EricCousineau-TRI force-pushed the feature/numpy_dtypes_user branch 2 times, most recently from 06eace3 to 395deab Compare May 11, 2018 18:42
@EricCousineau-TRI EricCousineau-TRI changed the title [WIP] Use user-defined NumPy dtypes for AutoDiffXd, Expression, etc. Use user-defined NumPy dtypes for AutoDiffXd, Expression, etc. May 11, 2018
@EricCousineau-TRI
Copy link
Contributor Author

+@jwnimmer-tri for feature review, if you have time.


Review status: 0 of 45 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@jwnimmer-tri
Copy link
Collaborator

Even setting aside the four commits that are from #8608, this PR seems quite large. Perhaps it makes sense just do to "autodiff: Use user-defined dtype" (+ the pybind11 bump) as the next PR in this train? (Or symbolic instead of autodiff, if that was better somehow.)

@EricCousineau-TRI
Copy link
Contributor Author

Yuppers, can do!

@EricCousineau-TRI EricCousineau-TRI changed the title Use user-defined NumPy dtypes for AutoDiffXd, Expression, etc. [WIP] Use user-defined NumPy dtypes for AutoDiffXd, Expression, etc. May 11, 2018
@jwnimmer-tri jwnimmer-tri removed their assignment May 11, 2018
@sherm1
Copy link
Member

sherm1 commented Aug 17, 2018

@EricCousineau-TRI -- last activity on this PR was in May. Do you want to keep it open?

@EricCousineau-TRI
Copy link
Contributor Author

Yes, I would like to keep this open. Once deadlines settle down here, I'd like to finish this up, especially in light of MultibodyTree, and supporting autodiff (and eventually symbolic) for them.

@SeanCurtis-TRI
Copy link
Contributor

@EricCousineau-TRI assigned to you for PR hygiene.

@EricCousineau-TRI EricCousineau-TRI force-pushed the feature/numpy_dtypes_user branch 3 times, most recently from 9de4749 to cb99c74 Compare September 30, 2018 04:57
@EricCousineau-TRI EricCousineau-TRI force-pushed the feature/numpy_dtypes_user branch 2 times, most recently from 6770690 to 8166ac3 Compare November 12, 2018 02:22
@EricCousineau-TRI EricCousineau-TRI force-pushed the feature/numpy_dtypes_user branch 3 times, most recently from 14c82df to 4937a46 Compare December 21, 2018 15:36
@EricCousineau-TRI EricCousineau-TRI force-pushed the feature/numpy_dtypes_user branch 2 times, most recently from b809fa6 to 4ef7baf Compare January 29, 2019 00:34
@EricCousineau-TRI EricCousineau-TRI force-pushed the feature/numpy_dtypes_user branch from 4ef7baf to ab1735e Compare April 26, 2019 03:33
@EricCousineau-TRI
Copy link
Contributor Author

Closing for now. Can re-open later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pydrake: Support user-defined dtype for AutoDiffXd and Expression
5 participants