class_docstr: Tests parameterized embedder.
      
class_docstr_tok: ["Tests","parameterized","embedder","."]
docstr: Tests various embedders.
          
docstr_tok: ["Tests","various","embedders","."]
code: def test_embedder(self):
      """Tests various embedders."""
      # no dropout
      hparams = {"dim": 1024, "dropout_rate": 0}
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {"dim": [1024], "dropout_rate": 0}
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {"dim": [1024, 10], "dropout_rate": 0}
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      # dropout with default strategy
      hparams = {"dim": 1024, "dropout_rate": 0.3}
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {"dim": [1024], "dropout_rate": 0.3}
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {"dim": [1024, 10], "dropout_rate": 0.3}
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      # dropout with different strategies
      hparams = {
          "dim": 1024,
          "dropout_rate": 0.3,
          "dropout_strategy": "item",
      }
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {
          "dim": [1024],
          "dropout_rate": 0.3,
          "dropout_strategy": "item",
      }
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {
          "dim": [1024, 10],
          "dropout_rate": 0.3,
          "dropout_strategy": "item",
      }
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {
          "dim": 1024,
          "dropout_rate": 0.3,
          "dropout_strategy": "item_type",
      }
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {
          "dim": [1024],
          "dropout_rate": 0.3,
          "dropout_strategy": "item_type",
      }
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
      hparams = {
          "dim": [1024, 10],
          "dropout_rate": 0.3,
          "dropout_strategy": "item_type",
      }
      self._test_word_embedder(hparams)
      self._test_position_embedder(hparams)
  
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 3 for calling the EmbedderTest obj's underlying member method code with example usage: obj.test_embedder() without return types