Skip to content

Commit 48b9072

Browse files
committed
Handle two attribute errors in draw_value
1 parent 4ea0715 commit 48b9072

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pymc3/distributions/distribution.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,11 @@ def draw_value(param, point=None, givens=()):
248248
if hasattr(param, 'shape'):
249249
try:
250250
shape = param.shape.tag.test_value
251-
except:
252-
shape = param.shape.eval()
251+
except AttributeError:
252+
try:
253+
shape = param.shape.eval()
254+
except AttributeError:
255+
shape = param.shape
253256
if len(shape) == 0 and len(value) == 1:
254257
value = value[0]
255258
return value

0 commit comments

Comments
 (0)