-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Revert size
kwarg behaviour and make it work with Ellipsis
#4667
Conversation
@@ -274,11 +274,11 @@ def test_chain_jacob_det(): | |||
|
|||
|
|||
class TestElementWiseLogp(SeededTest): | |||
def build_model(self, distfam, params, *, size=None, shape=None, transform=None, testval=None): | |||
def build_model(self, distfam, params, *, size=None, transform=None, testval=None): |
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.
All changes in this file are now back to pre-#4625
ac78af4
to
69e7f91
Compare
@@ -427,27 +426,6 @@ def _distr_parameters_for_repr(self): | |||
return ["a"] | |||
|
|||
|
|||
class MultinomialRV(MultinomialRV): | |||
"""Aesara's `MultinomialRV` doesn't broadcast; this one does.""" |
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.
The Aesara MultinomialRV
can do broadcasting since v2.0.4.
# of the Op, hence the broadcasted p must be included in `size`. | ||
support_shape = (p.shape[-1],) | ||
assert support_shape == (4,) | ||
assert m.eval().shape == size + support_shape |
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.
The parametrization sizes
were changed such that the support shape (4,)
does not occur in the size
which should exclude the support. This way the test parametrization is slightly less confusing.
The broadcasting of the MultinomialRV
does not change the fact that it has ndim_supp == 1
.
The broadcasting of multivariate RVs is very weird already at the Aesara level:
The above parametrization apparently gave it a 2-dimensional support? That's a problem, because the I noticed this when I tried to refactor the |
And don't use np.atleast_1d on things that can be tensors.
Corresponding tests were reverted, or edited to use other parametrization flavors. The Ellipsis feature now works with all three dimensionality kwargs. The MultinomialRV implementation was removed, because the broadcasting behavior was implemented in Aesara. Closes pymc-devs#4662
69e7f91
to
d4894a7
Compare
This can be rebased onto #4693 and, instead, re-introduce a non-breaking version of the |
Closing in favor of #4696. |
See #4662 for more information.
I will comment key changes in the diff.