MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _get_reduce_axis_with_tensor

Function _get_reduce_axis_with_tensor

python/paddle/tensor/math.py:213–223  ·  view source on GitHub ↗
(axis, x)

Source from the content-addressed store, hash-verified

211
212
213def _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

Callers 4

meanFunction · 0.85
maxFunction · 0.85
minFunction · 0.85
prodFunction · 0.85

Calls 1

_get_reduce_axisFunction · 0.85

Tested by

no test coverage detected