-
Notifications
You must be signed in to change notification settings - Fork 421
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
axes(::ReshapedDistribution) should throw, added missing ndims #1892
Conversation
AFAIK we never intended to define or use My impression is that the problem is actually the use of |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1892 +/- ##
=======================================
Coverage 85.99% 85.99%
=======================================
Files 144 144
Lines 8666 8667 +1
=======================================
+ Hits 7452 7453 +1
Misses 1214 1214 ☔ View full report in Codecov by Sentry. |
It seems maybe the actual problem was a typo in the Turing model: https://discourse.julialang.org/t/axes-not-working-on-reshaped-array/118820/5?u=devmotion |
If you have Should probably still have |
I'm not sure, I tend to think it's fine as it is. Distributions are not arrays and therefore we don't implement the array interface (and hence I think we might also not want to implement Distributions support Apparently someone decided to implement Anyone could write generic functions that only depend on eg |
It seems odd to implement But I'm fine with removing |
AFAIK it hasn't been requested yet, so I assume therefore it's not defined. Since the API of distributions already is quite large, I would like to not add to it without clear need. Note also that So I'd suggest closing the PR, now that it has become clear that the initial problem was an incorrectly defined Turing model. |
As noted on discourse, this method was missing. Also added
ndims
.Update: from the discussion below, since
d::ReshapedDistribution
is not indexable, it seems that the actual problem is thataxes(d)
is defined at all thanks to the generic fallback inBase
. So, this PR is updated to throw aMethodError
.Update: @devmotion preferred not to have
axes(d)
throw an error, so I removed it.