提交 66d8b8c4 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Merge pull request #1543 from goodfeli/master

better error message
...@@ -749,8 +749,10 @@ class MRG_RandomStreams(object): ...@@ -749,8 +749,10 @@ class MRG_RandomStreams(object):
size) size)
else: else:
msg = "size must be a tuple of int or a Theano variable" if not (isinstance(size, Variable) and size.ndim == 1):
assert isinstance(size, Variable) and size.ndim == 1, msg 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: if nstreams is None:
nstreams = self.n_streams(size) nstreams = self.n_streams(size)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论