-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: access overloaded inputs from preparation result #672
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #672 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 112 114 +2
Lines 5610 5623 +13
=======================================
+ Hits 5476 5489 +13
Misses 134 134
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CI failures seem not related. |
Thanks for getting this started! In terms of design, I think we should not just return an |
All tests passed now. |
Also implemented the |
I believe this PR is ready now |
thanks, I'll take a look! |
@ErikQQY I have given this some more thought and I'm not sure the abstraction we picked is the correct one. Symbolic backends also rely on operator overloading, but they will only call the function on "overloaded inputs" once, during preparation. This serves to compile a fast version of the derivative, which is then applied to In general, we have no guarantee that the function |
I tried to express this in the docstring but it may not be precise enough |
Oh we are returning the eltype of the dualized array now 👍.
So we also need the |
Not exactly, those actually are two different concepts.
I guess I'm wondering how to get this point across through a better choice of terminology. And I'm also wondering whether we can find yet another solution for this problem, because introducing something which behaves so differently across backends sounds like a footgun. |
Let's merge this, see how it goes downstream, and then solidify the interface if necessary. It's explicitly marked as not public for the time being so there's no harm |
Fix: #668
This PR only adds the
overloaded_inputs
functionalities for Jacobian preparations, not sure if the derivative, gradient and hessian preparation need this API.The tests for this feature maybe too simple, need some suggestions for better test cases.