def testVQDiscreteBottleneck(self):
   x = tf.constant([[0, 0.9, 0], [0.8, 0., 0.]], dtype=tf.float32)
   x_means_hot, _ = discretization.vq_discrete_bottleneck(x, bottleneck_bits=2)
   with self.test_session() as sess:
     tf.global_variables_initializer().run()
     x_means_hot_eval = sess.run(x_means_hot)
     self.assertEqual(np.shape(x_means_hot_eval), (2, 4))
 def testVQDiscreteBottleneck(self):
   x = tf.constant([[0, 0.9, 0], [0.8, 0., 0.]], dtype=tf.float32)
   x_means_hot, _ = discretization.vq_discrete_bottleneck(x, bottleneck_bits=2)
   with self.test_session() as sess:
     tf.global_variables_initializer().run()
     x_means_hot_eval = sess.run(x_means_hot)
     self.assertEqual(np.shape(x_means_hot_eval), (2, 4))