import tensorflow as tf

    z = tf.expand_dims(z, 0)
    loc, scale = hyper_decoder(z)
    return tf.squeeze(loc, [0]), tf.squeeze(scale, [0])

  locs, scales = tf.map_fn(loop_hyper_deocder, z_hats, 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")

  z_strings, z_min_v, z_max_v = entropy_bottleneck.compress(zs)
  z_shape = tf.shape(zs)[:]
  print("Entropy Encode (Hyper)")

