I am attempting to add noise to a tensor that holds the greyscale pixel values of an image. I want to set a random number of the pixels values to 255.
I was thinking something along the lines of:
random = tf.random_normal(tf.shape(input))
mask = tf.where(tf.greater(random, 1))
and am then trying to figure out how to set the pixel values of input
to 255 for every index of mask
.