提交 9fe35a2d authored 作者: Saizheng Zhang's avatar Saizheng Zhang

minor fix flake8

上级 a0fa399a
...@@ -1912,7 +1912,7 @@ def local_subtensor_inc_subtensor(node): ...@@ -1912,7 +1912,7 @@ def local_subtensor_inc_subtensor(node):
if x.owner.inputs[2:] == node.inputs[1:] and tuple(x.owner.op.idx_list) == tuple(node.op.idx_list): if x.owner.inputs[2:] == node.inputs[1:] and tuple(x.owner.op.idx_list) == tuple(node.op.idx_list):
# if x[idx] and y have the same ndim (and shape), directly return y # if x[idx] and y have the same ndim (and shape), directly return y
if x.owner.inputs[0].ndim-(len(node.op.idx_list)-sum([isinstance(idx, slice) for idx in node.op.idx_list])) == x.owner.inputs[1].ndim: if x.owner.inputs[0].ndim - (len(node.op.idx_list) - sum([isinstance(idx, slice) for idx in node.op.idx_list])) == x.owner.inputs[1].ndim:
return [x.owner.inputs[1]] return [x.owner.inputs[1]]
# else y is broadcastable, return alloc of broadcastable y # else y is broadcastable, return alloc of broadcastable y
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论