import tensorflow as tf


		# crop for lsun 96
		rgb = tf.image.random_crop(rgb,size=[h,w,c])

		# crop for patch training
		crop_h = h//self.crop_factor
		crop_w = w//self.crop_factor
		rgb = tf.image.random_crop(rgb,size=[crop_h,crop_w,c])

		# cast, bit conversion, compress domain, center
		rgb = tf.cast(rgb, tf.float32)
		if n_bits < 8:
			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
