from tensorflow.contrib.learn.python.learn import ops

    ids = np.random.randint(0, n_embed, ids_shape)
    with self.cached_session():
      embed_np = embeds[ids]
      embed_tf = ops.embedding_lookup(embeds, ids).eval()
    self.assertEqual(embed_np.shape, embed_tf.shape)
    self.assertAllClose(embed_np, embed_tf)
