(axis, x)
| 211 | |
| 212 | |
| 213 | def _get_reduce_axis_with_tensor(axis, x): |
| 214 | if isinstance(axis, (Variable, paddle.pir.Value)): |
| 215 | if axis.shape != [] and axis.shape[0] == len(x.shape): |
| 216 | reduce_all = True |
| 217 | else: |
| 218 | reduce_all = False |
| 219 | else: |
| 220 | reduce_all, axis = _get_reduce_axis(axis, x) |
| 221 | if paddle.utils._contain_var(axis): |
| 222 | axis = paddle.utils._convert_to_tensor_list(axis) |
| 223 | return reduce_all, axis |
| 224 | |
| 225 | |
| 226 | @inplace_apis_in_dygraph_only |
no test coverage detected