class_docstr: Tests embedding creator.
      
class_docstr_tok: ["Tests","embedding","creator","."]
docstr: Tests :func:`~texar.tf.modules.embedder.embedder_utils.get_embedding`.
          
docstr_tok: ["Tests",":","func",":","`","~texar.tf.modules.embedder.embedder_utils.get_embedding","`","."]
code: def test_get_embedding(self):
      """Tests :func:`~texar.tf.modules.embedder.embedder_utils.get_embedding`."""
      vocab_size = 100
      emb = embedder_utils.get_embedding(num_embeds=vocab_size)
      self.assertEqual(emb.shape[0].value, vocab_size)
      self.assertEqual(
          emb.shape[1].value,
          embedder_utils.default_embedding_hparams()["dim"],
      )
  
      hparams = {
          "initializer": {
              "type": tf.random_uniform_initializer(
                  minval=-0.1, maxval=0.1
              )
          },
          "regularizer": {"type": tf.keras.regularizers.L1L2(0.1, 0.1)},
      }
      emb = embedder_utils.get_embedding(
          hparams=hparams,
          num_embeds=vocab_size,
          variable_scope="embedding_2",
      )
      self.assertEqual(emb.shape[0].value, vocab_size)
      self.assertEqual(
          emb.shape[1].value,
          embedder_utils.default_embedding_hparams()["dim"],
      )
  
imports: import tensorflow
  from texar.tf.modules.embedders import embedder_utils
label_desc: Use image node_id 1 for calling the GetEmbeddingTest obj's underlying member method code with example usage: obj.test_get_embedding() without return types