提交 86343762 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Avoid useless warning in theano.function()

If the dictionary has <= 1 element in it, then we do not care if it's unsorted.
上级 02f48c14
......@@ -164,8 +164,9 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
if updates is None:
updates = []
if isinstance(updates, dict) and \
not isinstance(updates, gof.python25.OrderedDict):
if (isinstance(updates, dict) and
not isinstance(updates, gof.python25.OrderedDict) and
len(updates) > 1):
warnings.warn(
"The parameter 'updates' of theano.function()"
" expects an OrderedDict,"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论