提交 72060cc5 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix case when test_values do not have shapes

上级 9defa5a2
...@@ -439,12 +439,14 @@ class FunctionGraph(utils.object2): ...@@ -439,12 +439,14 @@ class FunctionGraph(utils.object2):
except AttributeError: except AttributeError:
pass pass
else: else:
if tval.shape != new_tval.shape: tval_shape = getattr(tval, 'shape', None)
new_tval_shape = getattr(new_tval, 'shape', None)
if tval_shape != new_tval_shape:
raise AssertionError( raise AssertionError(
"The replacement variable has a test value with " "The replacement variable has a test value with "
"a shape different from the original variable's " "a shape different from the original variable's "
"test value. Original: %s, new: %s" "test value. Original: %s, new: %s"
% (tval.shape, new_tval.shape), % (tval_shape, new_tval_shape),
r, new_r, str(reason)) r, new_r, str(reason))
for node, i in list(r.clients): # copy the client list for iteration for node, i in list(r.clients): # copy the client list for iteration
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论