def test_embedding_projection_value(self, value): dist = deepmac_meta_arch.embedding_projection( tf.zeros((1, 1, 1, 8)), value + tf.zeros((1, 1, 1, 8))).numpy() max_float = np.finfo(dist.dtype).max self.assertLess(dist.max(), max_float) self.assertGreater(dist.max(), -max_float)
def test_embedding_projection_prob_shape(self): dist = deepmac_meta_arch.embedding_projection(tf.ones((4, 32, 32, 8)), tf.zeros((4, 32, 32, 8))) self.assertEqual(dist.shape, (4, 32, 32, 1))