-
Notifications
You must be signed in to change notification settings - Fork 38
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
Use return types of calculations instead of promote_type
#273
Conversation
Codecov Report
@@ Coverage Diff @@
## master #273 +/- ##
==========================================
+ Coverage 99.76% 99.88% +0.12%
==========================================
Files 5 5
Lines 836 857 +21
==========================================
+ Hits 834 856 +22
+ Misses 2 1 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Could you add some tests for this? |
I added a few tests in the last commit, but I plan to extend them a bit more. The PR seems to fix the MWE in its current form but I still have to rerun the DistributionsAD tests. To summarize:
With these fixes, optimizations, and simplifications |
I added more tests that cover the faulty I also checked locally that together with JuliaLinearAlgebra/ArrayLayouts.jl#148 this PR fixes the test failures in DistributionsAD. I also opened TuringLang/DistributionsAD.jl#250 to be sure that the PRs fix our CI tests. Edit: DistributionsAD CI passes 🙂 |
@jishnub Downstream tests pass now 🙂 |
Can you add some |
I added a few |
Looks like the inference tests are failing. Are these regressions? |
Seems Julia still has more type inference issues with closures than I had anticipated 👀 The last commit fixes them. |
Can you make a new release with this PR such that we can use this bugfix in Turing etc? |
This (or at least the last line in the diff) seems to fix the MWE in #252. I'd also argue that it is more correct since, e.g. for
Bool
promote_type(Bool, Bool) === Bool
buttrue + false isa Int
.I'm not sure what tests could be added to avoid AD regressions in the future. Maybe the boolean examples would be a start as they would have caught the incorrect types at least?
Fixes #252.