提交 1bd8e47a authored 作者: John Salvatier's avatar John Salvatier

fixed inc_subtensor to work correctly with multiple indexes

上级 d68e9f09
...@@ -5113,11 +5113,11 @@ def inc_subtensor(x, y, inplace=False, set_instead_of_inc=False, ...@@ -5113,11 +5113,11 @@ def inc_subtensor(x, y, inplace=False, set_instead_of_inc=False,
return the_op(real_x, y, ilist) return the_op(real_x, y, ilist)
elif isinstance(x.owner.op, AdvancedSubtensor): elif isinstance(x.owner.op, AdvancedSubtensor):
real_x = x.owner.inputs[0] real_x = x.owner.inputs[0]
coordvec_0 = x.owner.inputs[1] ilist = x.owner.inputs[1:]
coordvec_1 = x.owner.inputs[2]
the_op = AdvancedIncSubtensor(inplace, the_op = AdvancedIncSubtensor(inplace,
set_instead_of_inc=set_instead_of_inc) set_instead_of_inc=set_instead_of_inc)
return the_op(real_x, y, coordvec_0, coordvec_1) return the_op(real_x, y, *ilist)
elif isinstance(x.owner.op, DimShuffle): elif isinstance(x.owner.op, DimShuffle):
inner_x = x.owner.inputs[0] inner_x = x.owner.inputs[0]
# In the dimshuffle case, there are in fact two dimshuffles: # In the dimshuffle case, there are in fact two dimshuffles:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论