!48694 [MS][[master] reduce mean grad bugfix

Merge pull request !48694 from Greatpan/reduce_mean_grad_bugfix
This commit is contained in:
i-robot 2023-02-11 02:25:28 +00:00 committed by Gitee
commit f39668bbeb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -1064,7 +1064,7 @@ def get_bprop_reduce_mean(self):
grad = _sum_grad(x, axis, dout) grad = _sum_grad(x, axis, dout)
shape_x = shape_op(x) shape_x = shape_op(x)
shape_out = shape_op(out) shape_out = shape_op(out)
if F.is_sequence_value_unknown(shape_x): if F.is_sequence_value_unknown(shape_x) or F.is_sequence_value_unknown(shape_out):
shape_x = dyn_shape_op(x) shape_x = dyn_shape_op(x)
shape_out = dyn_shape_op(out) shape_out = dyn_shape_op(out)
div_shape = reduce_prod(cast(shape_x, mstype.float32), ()) /\ div_shape = reduce_prod(cast(shape_x, mstype.float32), ()) /\