We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
mean
1 parent 03b9388 commit 273ff65Copy full SHA for 273ff65
ivy/functional/backends/paddle/statistical.py
@@ -107,7 +107,7 @@ def max(
107
def _calculate_reduced_shape(x, axis, keepdims):
108
if axis is None:
109
axis = tuple(range(len(x.shape)))
110
- elif type(axis) not in (tuple, list):
+ elif isinstance(axis, int):
111
axis = (axis,)
112
if keepdims:
113
return [1 if i in axis else x.shape[i] for i in range(len(x.shape))]
@@ -128,7 +128,7 @@ def mean(
128
ret_dtype = x.dtype
129
if 0 in x.shape:
130
shape = _calculate_reduced_shape(x, axis, keepdims)
131
- ret = paddle.empty(shape)
+ ret = paddle.full(shape, float("nan"))
132
elif paddle.is_complex(x):
133
ret = paddle.complex(
134
paddle.mean(x.real(), axis=axis, keepdim=keepdims),
0 commit comments