提交 082f352a authored 作者: Frederic's avatar Frederic

Make debugprint() support int, long, float and ndarray.

This easy debugging as we don't always know the object type.
上级 2688f9f8
......@@ -94,6 +94,8 @@ def debugprint(obj, depth=-1, print_type=False,
elif isinstance(obj, gof.FunctionGraph):
results_to_print.extend(obj.outputs)
order = obj.toposort()
elif isinstance(obj, (int, long, float, numpy.ndarray)):
print obj
else:
raise TypeError("debugprint cannot print an object of this type", obj)
for r in results_to_print:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论