Skip to content

Commit e23a672

Browse files
committed
disable broadcasting
1 parent 23753dd commit e23a672

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pymc/distributions/multivariate.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,10 @@ def dist(cls, nu, Sigma=None, mu=None, cov=None, tau=None, chol=None, lower=True
355355
return super().dist([nu, mu, cov], **kwargs)
356356

357357
def get_moment(rv, size, nu, mu, cov):
358-
if rv_size_is_none(size):
359-
moment_size = at.concatenate([nu.shape, mu.shape])
360-
else:
361-
moment_size = at.concatenate([size, nu.shape, mu.shape])
362-
moment = at.full(moment_size, mu)
358+
moment = mu
359+
if not rv_size_is_none(size):
360+
moment_size = at.concatenate([size, moment.shape])
361+
moment = at.full(moment_size, moment)
363362
return moment
364363

365364
def logp(value, nu, mu, cov):
@@ -700,7 +699,7 @@ def dist(cls, eta, cutpoints, n, *args, **kwargs):
700699

701700

702701
class OrderedMultinomial:
703-
R"""
702+
r"""
704703
Wrapper class for Ordered Multinomial distributions.
705704
706705
Useful for regression on ordinal data whose values range

pymc/tests/test_distributions_moments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,10 @@ def test_moyal_moment(mu, sigma, size, expected):
842842
(2, np.ones(1), np.eye(1), None, np.ones(1)),
843843
(2, rand1d, np.eye(2), None, rand1d),
844844
(2, rand1d, np.eye(2), 2, np.full((2, 2), rand1d)),
845-
(2, rand2d, np.eye(3), 2, np.full((2, 2, 3), rand2d)),
846845
(2, rand1d, np.eye(2), (2, 5), np.full((2, 5, 2), rand1d)),
846+
(2, rand2d, np.eye(3), None, rand2d),
847+
(2, rand2d, np.eye(3), 2, np.full((2, 2, 3), rand2d)),
847848
(2, rand2d, np.eye(3), (2, 5), np.full((2, 5, 2, 3), rand2d)),
848-
(np.array([3, 4]), np.ones(2), np.eye(2), None, np.ones((2, 2))),
849849
],
850850
)
851851
def test_mvstudentt_moment(nu, mu, cov, size, expected):

0 commit comments

Comments
 (0)