提交 9671ab34 authored 作者: Frederic Bastien's avatar Frederic Bastien

when a thunk fail, always print the node.inputs types.

上级 af9978ed
...@@ -114,6 +114,9 @@ def raise_with_op(node, thunk=None, exc_info=None): ...@@ -114,6 +114,9 @@ def raise_with_op(node, thunk=None, exc_info=None):
detailed_err_msg = "\nApply node that caused the error: " + str(node) detailed_err_msg = "\nApply node that caused the error: " + str(node)
types = [getattr(ipt, 'type', 'No type') for ipt in node.inputs]
detailed_err_msg += "\nInputs types: %s\n" % types
if thunk is not None: if thunk is not None:
if hasattr(thunk, 'inputs'): if hasattr(thunk, 'inputs'):
shapes = [getattr(ipt[0], 'shape', 'No shapes') shapes = [getattr(ipt[0], 'shape', 'No shapes')
...@@ -131,11 +134,8 @@ def raise_with_op(node, thunk=None, exc_info=None): ...@@ -131,11 +134,8 @@ def raise_with_op(node, thunk=None, exc_info=None):
strides = "So we can't access the strides of inputs values" strides = "So we can't access the strides of inputs values"
scalar_values = "And can't print its inputs scalar value" scalar_values = "And can't print its inputs scalar value"
types = [getattr(ipt, 'type', 'No type') detailed_err_msg += ("Inputs shapes: %s" % shapes +
for ipt in node.inputs]
detailed_err_msg += ("\nInputs shapes: %s" % shapes +
"\nInputs strides: %s" % strides + "\nInputs strides: %s" % strides +
"\nInputs types: %s" % types +
"\nInputs scalar values: %s\n" % scalar_values) "\nInputs scalar values: %s\n" % scalar_values)
else: else:
detailed_err_msg += ("\nHINT: Use another linker then the c linker to" detailed_err_msg += ("\nHINT: Use another linker then the c linker to"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论