-
Notifications
You must be signed in to change notification settings - Fork 62
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
Make @non_differentiable
not use ::Tuple
#653
Conversation
Why does duplicating prevent ambiguities? |
so first I tried without the duplication, and just putting in a |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #653 +/- ##
=======================================
Coverage 93.79% 93.79%
=======================================
Files 14 14
Lines 886 886
=======================================
Hits 831 831
Misses 55 55 ☔ View full report in Codecov by Sentry. |
@scalar_rule
use ::Tuple
@non_differentiable
not use ::Tuple
We needed that for #651 |
Ah I see, I guess that's what created this ambiguity problem in the first place. :( |
I would have naively thought though that it'd be better to have |
Yes, unfortunately julia does not have a way of saying "This method always loses ambiguity fights" |
Having the Or maybe we should just solve this by dealing with the rules for We currently do @non_differentiable one(::Any)
@non_differentiable zero(::Any) and @scalar_rule one(x) ZeroTangent()
@scalar_rule zero(x) ZeroTangent() Maybe we should just be manually writing the rules for these functions to instead do if x <: Number
ZeroTangent()
else
NoTangent()
end ? |
We are not. I think maybe we should just delete:
|
closing in favor of JuliaDiff/ChainRules.jl#770 |
Hoping to fix JuliaDiff/ChainRules.jl#769