import tensorflow as tf


  locs, scales = tf.map_fn(loop_hyper_deocder, zs, dtype=(tf.float32, tf.float32),
                          parallel_iterations=1, back_prop=False)
  lower_bound = 1e-9# TODO
  scales = tf.maximum(scales, lower_bound)
  print("Hyper Decoder")

  ys = conditional_entropy_model.decompress(y_strings, locs, scales, y_min_v, y_max_v, y_shape)
  print("Entropy Decoder")

  def loop_synthesis(element):
    y = tf.expand_dims(element[0], 0)
    x_coori = tf.expand_dims(element[1], 0)
    x_coori= tf.cast(x_coori,tf.float32)
    x = synthesis_transform(x_coori,y)
    return tf.squeeze(x, [0])

  element=[ys,x_coori]
  xs = tf.map_fn(loop_synthesis, element, dtype=tf.float32, parallel_iterations=1, back_prop=False)
  print("Synthesis Transform")

  return xs

###################################### write & read binary files. ######################################
