From 8af4a16d9d76c8c1ed57ddf632c122ba4813c2ea Mon Sep 17 00:00:00 2001 From: lirongzhen1 Date: Sat, 25 Jul 2020 17:26:01 +0800 Subject: [PATCH] fix sparse feature bug for auto parallel --- mindspore/ops/_grad/grad_comm_ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/ops/_grad/grad_comm_ops.py b/mindspore/ops/_grad/grad_comm_ops.py index e402973784..fb3b0ff1d6 100644 --- a/mindspore/ops/_grad/grad_comm_ops.py +++ b/mindspore/ops/_grad/grad_comm_ops.py @@ -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