提交 7f0fcc44 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

make sure there is only one element in the list

上级 b86dd2d6
......@@ -41,6 +41,8 @@ def format_as(use_list, use_tuple, outputs):
else:
return (outputs,)
elif not (use_list or use_tuple) and isinstance(outputs, (list, tuple)):
assert len(outputs) == 1, \
"Wrong arguments. Expected a one element list"
return outputs[0]
elif use_list or use_tuple:
if use_list:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论