提交 23665405 authored 作者: David Warde-Farley's avatar David Warde-Farley 提交者: Arnaud Bergeron

Revert weird change.

上级 5da0133d
...@@ -2653,14 +2653,9 @@ class Alloc(gof.Op): ...@@ -2653,14 +2653,9 @@ class Alloc(gof.Op):
axis_kept.append(i) axis_kept.append(i)
gx = gz.sum(axis=axis + axis_broadcasted) gx = gz.sum(axis=axis + axis_broadcasted)
if axis_broadcasted: if axis_broadcasted:
new_order = list(x.broadcastable) new_order = ['x'] * x.ndim
idx = 0 for idx, axis in enumerate(axis_kept):
for i in xrange(x.ndim): new_order[axis] = idx
if not new_order[i]:
new_order[i] = idx
idx += 1
else:
new_order[i] = 'x'
gx = gx.dimshuffle(new_order) gx = gx.dimshuffle(new_order)
# Dimshuffle to add back the broadcasted dims # Dimshuffle to add back the broadcasted dims
# The *elements* of the output are not connected to # The *elements* of the output are not connected to
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论