fix sparse feature bug for auto parallel

This commit is contained in:
lirongzhen1 2020-07-25 17:26:01 +08:00
parent ac564a9e86
commit 8af4a16d9d
1 changed files with 2 additions and 2 deletions

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