Skip to content

Conversation

ChrisRackauckas
Copy link
Member

Fixes #821 . The key is that promote_type ends up calling promote_rule, so it always has a method. We need to check if the promotion rules exist with duals to know if this we can do the wrapping.

In the future, we can do further customization of the wrappers based on if the solver does AD or not, though that would likely increase compile times by a lot (since then there would be multiple versions of the solver), so I'm not convinced that's the right approach after. At least this is always safe, if not "too safe" in some sense.

Fixes #821 . The key is that promote_type ends up calling promote_rule, so it always has a method. We need to check if the promotion rules exist with duals to know if this we can do the wrapping.

In the future, we can do further customization of the wrappers based on if the solver does AD or not, though that would likely increase compile times by a lot (since then there would be multiple versions of the solver), so I'm not convinced that's the right approach after. At least this is always safe, if not "too safe" in some sense.
@ChrisRackauckas ChrisRackauckas merged commit e6942c3 into master Sep 9, 2022
@ChrisRackauckas ChrisRackauckas deleted the robust_wrapping branch September 9, 2022 02:09
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.

Modia with Measurements gives promote_rule ambiguity
1 participant