class_docstr: Tests :class:`~texar.tf.modules.UnidirectionalRNNEncoder` class.
      
class_docstr_tok: ["Tests",":","class",":","`","~texar.tf.modules.UnidirectionalRNNEncoder","`","class","."]
docstr: Tests encoding companioned with :mod:`texar.tf.modules.embedders`.
          
docstr_tok: ["Tests","encoding","companioned","with",":","mod",":","`","texar.tf.modules.embedders","`","."]
code: def test_encode_with_embedder(self):
      """Tests encoding companioned with :mod:`texar.tf.modules.embedders`."""
      embedder = WordEmbedder(vocab_size=20, hparams={"dim": 100})
      inputs = tf.ones([64, 16], dtype=tf.int32)
  
      encoder = UnidirectionalRNNEncoder()
      outputs, state = encoder(embedder(inputs))
  
      cell_dim = encoder.hparams.rnn_cell.kwargs.num_units
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          outputs_, state_ = sess.run([outputs, state])
          self.assertEqual(outputs_.shape, (64, 16, cell_dim))
          self.assertEqual(state_[0].shape, (64, cell_dim))
  
file_path: texar/tests/modules/encoders/rnn_encoders_test.py
imports: import tensorflow
  from texar.tf.modules.encoders.rnn_encoders import UnidirectionalRNNEncoder
  from texar.tf.modules.encoders.rnn_encoders import BidirectionalRNNEncoder
  from texar.tf.modules.embedders.embedders import WordEmbedder
label_desc: Use image node_id 3 for calling the UnidirectionalRNNEncoderTest obj's underlying member method code with example usage: obj.test_encode_with_embedder() without return types