mean

paddle.fluid.layers.mean(x, name=None)[source]

Mean Operator calculates the mean of all elements in X.

Parameters
  • x (Variable) – (Tensor) The input of mean op

  • name (basestring|None) – Name of the output.

Returns

(Tensor) The output of mean op

Return type

out(Variable)

Examples

import paddle.fluid as fluid
input = fluid.layers.data(
    name='data', shape=[2, 3], dtype='float32')
mean = fluid.layers.mean(input)