提交 568c8a08 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

tightened the condition for equal computations

This was in an attempt to fix a stochastic optimization error in DEBUG MODE.
上级 46d63ca6
...@@ -302,6 +302,11 @@ def equal_computations(xs,ys, in_xs = None, in_ys = None, strict=True): ...@@ -302,6 +302,11 @@ def equal_computations(xs,ys, in_xs = None, in_ys = None, strict=True):
if x.owner and y.owner: if x.owner and y.owner:
if x.owner.outputs.index(x) != y.owner.outputs.index(y): if x.owner.outputs.index(x) != y.owner.outputs.index(y):
return False return False
if len(in_xs) != len(in_ys):
return False
for _x,_y in zip(in_xs, in_ys):
if _x.type != _y.type:
return False
nds_x = gof.graph.io_toposort(in_xs, xs) nds_x = gof.graph.io_toposort(in_xs, xs)
nds_y = gof.graph.io_toposort(in_ys, ys) nds_y = gof.graph.io_toposort(in_ys, ys)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论