提交 5d485774 authored 作者: Frederic's avatar Frederic

Correctly handle the case where a thunk don't have an inputs fields.

上级 ce152cb6
...@@ -115,10 +115,15 @@ def raise_with_op(op, thunk=None, exc_info=None): ...@@ -115,10 +115,15 @@ def raise_with_op(op, thunk=None, exc_info=None):
detailed_err_msg = "\nApply node that caused the error: " + str(op) detailed_err_msg = "\nApply node that caused the error: " + str(op)
if thunk is not None: if thunk is not None:
shapes = [getattr(ipt[0], 'shape', 'No shapes') if hasattr(thunk, 'inputs'):
for ipt in thunk.inputs] shapes = [getattr(ipt[0], 'shape', 'No shapes')
strides = [getattr(ipt[0], 'strides', 'No strides') for ipt in thunk.inputs]
for ipt in thunk.inputs] strides = [getattr(ipt[0], 'strides', 'No strides')
for ipt in thunk.inputs]
else:
shapes = "The thunk don't have an inputs attributes."
strides = "So we can't access the storage inputs value"
types = [getattr(ipt, 'type', 'No type') types = [getattr(ipt, 'type', 'No type')
for ipt in op.inputs] for ipt in op.inputs]
detailed_err_msg += ("\nInputs shapes: %s" % shapes + detailed_err_msg += ("\nInputs shapes: %s" % shapes +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论