tf.keras.metrics.MeanTensor

Computes the element-wise (weighted) mean of the given tensors.

Inherits From: Metric, Layer, Module

MeanTensor returns a tensor with the same shape of the input tensors. The mean value is updated by keeping local variables total and count. The total tracks the sum of the weighted values, and count stores the sum of the weighted counts.

name (Optional) string name of the metric instance.
dtype (Optional) data type of the metric result.
shape (Optional) A list of integers, a tuple of integers, or a 1-D Tensor of type int32. If not specified, the shape is inferred from the values at the first call of update_state.

Standalone usage