code: def test_ids_to_embedding_correctlyEmbeds(self):
      seq_len = 6
      vocab_size = 5
      model_size = 2
  
      vocab_dim = mtf.Dimension("vocab", vocab_size)
      model_dim = mtf.Dimension("model", model_size)
      length_dim = mtf.Dimension("length", seq_len)
  
      ids = tf.constant([0, 1, 2, 3, 4, 0], dtype=tf.int32)
      mtf_ids = mtf.import_tf_tensor(
          self.mesh, ids, shape=mtf.Shape([length_dim])
      )
  
      self.initializer_mock.side_effect = initialize_by_shape(
          {
              (3, 2): [[0, 1], [2, 0], [-1000, -4000]],
              (3, 1): [[1], [2], [3]],
              (1, 2): [[1], [2]],
          }
      )
  
      vocab_embedding = adaptive_softmax.AdaptiveSoftmaxVocabEmbedding(
          self.mesh,
          vocab_dim,
          output_dim=model_dim,
          variable_dtype=self.variable_dtype,
          name="embedding",
          ensemble_dim=None,
          clusters=[
              {"token_count": 2, "embedding_size": 2},
              {"token_count": 3, "embedding_size": 1},
          ],
      )
  
      mtf_embedding = vocab_embedding.ids_to_embedding(
          mtf_ids, context=None
      )
  
      mesh_impl = mtf.placement_mesh_impl.PlacementMeshImpl(
          shape=[], layout={}, devices=[""]
      )
      lowering = mtf.Lowering(self.graph, {self.mesh: mesh_impl})
      actual_embedding = lowering.export_to_tf_tensor(mtf_embedding)
  
      self.evaluate(tf.global_variables_initializer())
      self.evaluate(lowering.copy_masters_to_slices())
      (actual,) = self.evaluate([actual_embedding])
  
      self.assertAllClose(
          actual, [[0, 1], [2, 0], [1, 2], [2, 4], [3, 6], [0, 1]]
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import mesh_tensorflow
  from mesh_tensorflow.transformer import adaptive_softmax
  import mock
  import numpy
  import scipy.special
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 7 for calling the AdaptiveSoftmaxTest obj's underlying member method code with example usage: obj.test_ids_to_embedding_correctlyEmbeds() without return types