Browse Source

!3501 fix sparse feature bug for auto parallel

Merge pull request !3501 from lirongzhen1/r0.6
tags/v0.6.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
36c2bbdbcc
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      mindspore/ops/_grad/grad_comm_ops.py

+ 2
- 2
mindspore/ops/_grad/grad_comm_ops.py View File

@@ -200,14 +200,14 @@ def get_bprop_mirror_operator(self):
float_one = F.scalar_cast(1.0, F.dtype(grad))
num = F.scalar_cast(dev_num, F.dtype(grad))
grad = mul(grad, cast(F.scalar_to_array(float_one/num), F.dtype(grad)))
dx = (indices, grad, dout.dense_shape())
dx = IndexedSlices(indices, grad, dout.dense_shape())
else:
if F.issubclass_(F.typeof(dout), mstype.tensor):
dx = all_reduce(dout)
else:
indices = all_gather(dout.indices())
grad = all_gather(dout.values())
dx = (indices, grad, dout.dense_shape())
dx = IndexedSlices(indices, grad, dout.dense_shape())

return (dx,)
return bprop


Loading…
Cancel
Save