提交 0494f689 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

better error message

上级 2e7d332f
......@@ -749,8 +749,10 @@ class MRG_RandomStreams(object):
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)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论