View source on GitHub 
Calculate and return the total variation for one or more images.
tf.image.total_variation(
images, name=None
)
The total variation is the sum of the absolute differences for neighboring pixelvalues in the input images. This measures how much noise is in the images.
This can be used as a lossfunction during optimization so as to suppress
noise in images. If you have a batch of images, then you should calculate
the scalar lossvalue as the sum:
loss = tf.reduce_sum(tf.image.total_variation(images))
This implements the anisotropic 2D version of the formula described here:
https://en.wikipedia.org/wiki/Total_variation_denoising
Args  

images

4D Tensor of shape [batch, height, width, channels] or 3D Tensor
of shape [height, width, channels] .

name

A name for the operation (optional). 
Raises  

ValueError

if images.shape is not a 3D or 4D vector. 
Returns  

The total variation of images .
If 