Skip to content

Commit

Permalink
better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Goodfellow committed Oct 2, 2013
1 parent 2e7d332 commit 0494f68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions theano/sandbox/rng_mrg.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,10 @@ def uniform(self, size, low=0.0, high=1.0, ndim=None, dtype=None,
size)

else:
msg = "size must be a tuple of int or a Theano variable"
assert isinstance(size, Variable) and size.ndim == 1, msg
if not (isinstance(size, Variable) and size.ndim == 1):
raise TypeError("size must be a tuple of int or a Theano "
"Variable with 1 dimension, got " + str(size) +
" of type " + str(type(size)))

if nstreams is None:
nstreams = self.n_streams(size)
Expand Down

0 comments on commit 0494f68

Please sign in to comment.