March 2019
Intermediate to advanced
196 pages
4h 50m
English
The following is the signature of tf.reduce_mean().
Note that, in what follows, all TensorFlow operations have a name argument that can safely be left to the default of None when using eager execution as its purpose is to identify the operation in a computational graph.
Note that this is equivalent to np.mean, except that it infers the return datatype from the input tensor, whereas np.mean allows you to specify the output type (defaulting to float64):
tf.reduce_mean(input_tensor, axis=None, keepdims=None, name=None)
It is frequently necessary to find the mean value of a tensor. When this is done across a single axis, this axis is said to be reduced.
Here are some examples:
numbers = tf.constant([[4., 5.], [7., 3.]])
Read now
Unlock full access