class_docstr: Tests parameterized embedder.
      
class_docstr_tok: ["Tests","parameterized","embedder","."]
docstr: Tests embedders called by multiple times.
          
docstr_tok: ["Tests","embedders","called","by","multiple","times","."]
code: def test_embedder_multi_calls(self):
      """Tests embedders called by multiple times."""
      hparams = {
          "dim": 1024,
          "dropout_rate": 0.3,
          "dropout_strategy": "item",
      }
      embedder = WordEmbedder(vocab_size=100, hparams=hparams)
      inputs = tf.ones([64, 16], dtype=tf.int32)
      outputs = embedder(inputs)
  
      emb_dim = embedder.dim
      if not isinstance(emb_dim, (list, tuple)):
          emb_dim = [emb_dim]
      self.assertEqual(outputs.shape, [64, 16] + emb_dim)
  
      # Call with inputs in a different shape
      inputs = tf.ones([64, 10, 20], dtype=tf.int32)
      outputs = embedder(inputs)
  
      emb_dim = embedder.dim
      if not isinstance(emb_dim, (list, tuple)):
          emb_dim = [emb_dim]
      self.assertEqual(outputs.shape, [64, 10, 20] + emb_dim)
  
file_path: texar/tests/modules/embedders/embedders_test.py
imports: import numpy
  import tensorflow
  from texar.tf.modules.embedders.embedders import WordEmbedder
  from texar.tf.modules.embedders.position_embedders import PositionEmbedder
  from texar.tf.context import global_mode
label_desc: Use image node_id 4 for calling the EmbedderTest obj's underlying member method code with example usage: obj.test_embedder_multi_calls() without return types