-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fix type inference of eltype(vi, spl)
(Turing#2151)
#568
Conversation
@@ -1444,7 +1444,7 @@ function getindex(vi::TypedVarInfo, spl::Sampler) | |||
# Gets the ranges as a NamedTuple | |||
ranges = _getranges(vi, spl) | |||
# Calling getfield(ranges, f) gives all the indices in `vals` of the `vn`s with symbol `f` sampled by `spl` in `vi` | |||
return vcat(_getindex(vi.metadata, ranges)...) | |||
return reduce(vcat, _getindex(vi.metadata, ranges)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the ReverseDiff issue but probably reduces performance in cases where vcat
with multiple arguments is implemented in an optimized way.
This looks good to me, but there's something weird happening with the tests; looking into this. @devmotion Could you bump patch version? |
Pull Request Test Coverage Report for Build 7583034714
💛 - Coveralls |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #568 +/- ##
==========================================
+ Coverage 79.64% 84.28% +4.63%
==========================================
Files 26 26
Lines 2938 3175 +237
==========================================
+ Hits 2340 2676 +336
+ Misses 598 499 -99 ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 7628589803
💛 - Coveralls |
I think TuringLang/Turing.jl/pull/2156 will fix the test issues. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@torfjelde The PR is ready for another round of review 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM:)
Fixes the error in TuringLang/Turing.jl#2151 on Julia 1.10 for me:
cc @sjwild