import tensorflow as tf

		n_bins = 2**n_bits

		rgb_out = rgb

		# discretization noise
		if add_dequantization_noise:
			shape = tf.shape(rgb_out)
			rgb_out += tf.random_uniform(shape=shape)*(1/n_bins)

		return rgb_out
