提交 dc7dad1c authored 作者: Frederic's avatar Frederic

small fix to problem introduced in this PR.

上级 4d471ab8
...@@ -829,6 +829,8 @@ class ShapeFeature(object): ...@@ -829,6 +829,8 @@ class ShapeFeature(object):
# that will return the right index. # that will return the right index.
idx = theano.tensor.subtensor.get_idx_list(s_i.owner.inputs, idx = theano.tensor.subtensor.get_idx_list(s_i.owner.inputs,
s_i.owner.op.idx_list) s_i.owner.op.idx_list)
assert len(idx) == 1
idx = idx[0]
try: try:
i = get_scalar_constant_value(idx) i = get_scalar_constant_value(idx)
s_i = Shape_i(i)(s_i.owner.inputs[0].owner.inputs[0]) s_i = Shape_i(i)(s_i.owner.inputs[0].owner.inputs[0])
...@@ -1750,6 +1752,8 @@ def local_useless_inc_subtensor(node): ...@@ -1750,6 +1752,8 @@ def local_useless_inc_subtensor(node):
return return
if not node.fgraph.shape_feature.same_shape(node.inputs[0], if not node.fgraph.shape_feature.same_shape(node.inputs[0],
node.inputs[1]): node.inputs[1]):
node.fgraph.shape_feature.same_shape(node.inputs[0],
node.inputs[1])
return return
# There is no reverse, so we don't need a replacement. # There is no reverse, so we don't need a replacement.
if all(e.step is None if all(e.step is None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论