提交 9fc78f6a authored 作者: Frederic's avatar Frederic

Better error msg.

上级 b412823a
......@@ -166,8 +166,11 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
if isinstance(updates, dict) and \
not isinstance(updates, gof.python25.OrderedDict):
warnings.warn("Expected OrderedDict, got "+str(type(updates))+ "Using "
"a standard dictionary here results in "
warnings.warn(
"The parameter 'updates' of theano.function()"
" expect an OrderedDict,"
" got " + str(type(updates)) + "Using "
"a standard dictionary here results in "
"non-deterministic behavior. You should use an OrderedDict"
" if you are using python2.7 or use a list of (shared, update)"
" pairs. Do not just convert your dictionary to this type before"
......@@ -176,7 +179,8 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
if givens is None:
givens = []
if not isinstance(inputs, (list, tuple)):
raise Exception("Inputs variable of a Theano function should be contained in a list, even when there is a single input.")
raise Exception("Inputs variable of a Theano function should be"
" contained in a list, even when there is a single input.")
# compute some features of the arguments:
uses_In = any([isinstance(i, In) for i in inputs]) # N.B. the square brackets are ncessary
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论