提交 a961624d authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix bug in local_track_shape_i: we were not scheduling current node when needed.

上级 a9461657
...@@ -460,10 +460,11 @@ class ShapeFeature(object): ...@@ -460,10 +460,11 @@ class ShapeFeature(object):
# In case 1, if r has a shape_i client, we will want to replace the shape_i of r with # In case 1, if r has a shape_i client, we will want to replace the shape_i of r with
# the shape of new_r. Say that r is *scheduled*. # the shape of new_r. Say that r is *scheduled*.
for (shpnode, idx) in r.clients: # At that point, node is no longer a client of r, but of new_r
for (shpnode, idx) in (r.clients + [(node, i)]):
if isinstance(getattr(shpnode,'op', None), Shape_i): if isinstance(getattr(shpnode,'op', None), Shape_i):
self.scheduled[shpnode] = new_r self.scheduled[shpnode] = new_r
# In case 2, if new_r is a variable that we've scheduled for shape update, then we # In case 2, if r is a variable that we've scheduled for shape update, then we
# should cancel it. # should cancel it.
# TODO: store some kind of reverse index? # TODO: store some kind of reverse index?
for k,v in self.scheduled.items(): for k,v in self.scheduled.items():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论