Skip to content

Commit bd0b3c0

Browse files
Use new TestValueError when available (#4179)
Co-authored-by: Brandon T. Willard <[email protected]>
1 parent ea20703 commit bd0b3c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pymc3/distributions/multivariate.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
from .shape_utils import to_tuple
3939
from ..math import kron_dot, kron_diag, kron_solve_lower, kronecker
4040

41+
# TODO: Remove this once the theano-pymc dependency is above 1.0.9
42+
try:
43+
from theano.gof.utils import TestValueError
44+
except ImportError:
45+
TestValueError = AttributeError
46+
4147

4248
__all__ = [
4349
"MvNormal",
@@ -477,7 +483,7 @@ def __init__(self, a, transform=transforms.stick_breaking, *args, **kwargs):
477483
)
478484
try:
479485
kwargs["shape"] = np.shape(get_test_value(a))
480-
except AttributeError:
486+
except TestValueError:
481487
pass
482488

483489
super().__init__(transform=transform, *args, **kwargs)

0 commit comments

Comments
 (0)