import tensorflow as tf

			rgb = tf.floor(rgb/(2**(8-n_bits)))
		rgb = rgb/(n_bins) - 0.5

		return rgb

	def post_process(self, rgb, add_dequantization_noise=True):
		n_bits = config.model.data.n_bits
		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
