提交 7efba27f authored 作者: Frederic's avatar Frederic

Fix potential crash.

上级 551056b2
...@@ -1098,11 +1098,13 @@ class ShapeFeature(object): ...@@ -1098,11 +1098,13 @@ class ShapeFeature(object):
# no need for replacement. This happen for example # no need for replacement. This happen for example
# with the InputToGpuOptimizer optimizer. # with the InputToGpuOptimizer optimizer.
continue continue
if repl.owner and repl.owner.inputs[0] is shpnode.inputs[0]: if (repl.owner and
repl.owner.inputs[0] is shpnode.inputs[0] and
isinstance(repl.owner.op, Shape_i) and
repl.owner.op.i == shpnode.op.i):
# The replacement is a shape_i of the same # The replacement is a shape_i of the same
# input. So no need to do this equivalent # input. So no need to do this equivalent
# replacement. # replacement.
assert repl.owner.op.i == shpnode.op.i
continue continue
self.scheduled[shpnode] = new_r self.scheduled[shpnode] = new_r
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论