Skip to content

Commit

Permalink
model.py: extra check to deal with test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpitkin authored Jan 10, 2019
1 parent 1c49083 commit 80fd703
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymc3/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,9 @@ def __init__(self, cost, grad_vars, extra_vars=None, dtype=None,
# manually set the TensorType for length 1 arrays due to a
# theano conversion problem
if isinstance(var.tag.test_value, np.ndarray):
if len(var.tag.test_value) == 1:
shared.type = theano.tensor.TensorType(var.dtype, (True,))
if var.tag.test_value.ndim == 1:
if len(var.tag.test_value) == 1:
shared.type = theano.tensor.TensorType(var.dtype, (True,))
self._extra_vars_shared[var.name] = shared
givens.append((var, shared))

Expand Down

0 comments on commit 80fd703

Please sign in to comment.