If I'm not mis-reading that, it's in the image library in TF 1.x:
tf.image.per_image_standardization
https://www.tensorflow.org/api_guides/python/image
By the way, that particular function is a little annoying in that it only takes a single image as an input (3D), but you usually have a 4D tensor representing [batch, height, width, channels]
for images. To apply that function to a batch of images you can do this:
imgs4d = tf.map_fn(tf.image.per_image_standardization, imgs4d_float32)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…