forked from mindspore-Ecosystem/mindspore
!48583 [MS][LITE][master] support reduce prod axis0
Merge pull request !48583 from Greatpan/reduce_prod_axi0_bugfix
This commit is contained in:
commit
f85bbf7d63
|
@ -920,6 +920,8 @@ def get_bprop_reduceprod(self):
|
||||||
"""Grad definition for `Product` operation."""
|
"""Grad definition for `Product` operation."""
|
||||||
# Expand dout to full input shape
|
# Expand dout to full input shape
|
||||||
input_shape = shape_op(x)
|
input_shape = shape_op(x)
|
||||||
|
if input_shape == ():
|
||||||
|
return Tensor(1, x.dtype), zeros_like(axis)
|
||||||
if F.is_sequence_value_unknown(input_shape):
|
if F.is_sequence_value_unknown(input_shape):
|
||||||
input_shape = dyn_shape_op(x)
|
input_shape = dyn_shape_op(x)
|
||||||
input_shape = P.Cast()(input_shape, ms.int64)
|
input_shape = P.Cast()(input_shape, ms.int64)
|
||||||
|
|
Loading…
Reference in New Issue