class_docstr: One directional RNN encoder.
  
  Args:
      cell: (RNNCell, optional) If not specified,
          a cell is created as specified in :attr:`hparams["rnn_cell"]`.
      cell_dropout_mode (optional): A Tensor taking value of
          :tf_main:`tf.estimator.ModeKeys <estimator/ModeKeys>`, which
          toggles dropout in the RNN cell (e.g., activates dropout in
          TRAIN mode). If `None`, :func:`~texar.tf.global_mode` is used.
          Ignored if :attr:`cell` is given.
      output_layer (optional): An instance of
          :tf_main:`tf.layers.Layer <layers/Layer>`. Applies to the RNN cell
          output of each step. If `None` (default), the output layer is
          created as specified in :attr:`hparams["output_layer"]`.
      hparams (dict or HParams, optional): Hyperparameters. Missing
          hyperparamerter will be set to default values. See
          :meth:`default_hparams` for the hyperparameter sturcture and
          default values.
  
  See :meth:`_build` for the inputs and outputs of the encoder.
  
  Example:
  
      .. code-block:: python
  
          # Use with embedder
          embedder = WordEmbedder(vocab_size, hparams=emb_hparams)
          encoder = UnidirectionalRNNEncoder(hparams=enc_hparams)
  
          outputs, final_state = encoder(
              inputs=embedder(data_batch['text_ids']),
              sequence_length=data_batch['length'])
  
  .. document private functions
  .. automethod:: _build
class_docstr_tok: ["One","directional","RNN","encoder",".","Args",":","cell",":","(","RNNCell",",","optional",")","If","not","specified",",","a","cell","is","created","as","specified","in",":","attr",":","`","hparams","[","``","rnn_cell","''","]","`",".","cell_dropout_mode","(","optional",")",":","A","Tensor","taking","value","of",":","tf_main",":","`","tf.estimator.ModeKeys","<","estimator\/ModeKeys",">","`",",","which","toggles","dropout","in","the","RNN","cell","(","e.g.",",","activates","dropout","in","TRAIN","mode",")",".","If","`","None","`",",",":","func",":","`","~texar.tf.global_mode","`","is","used",".","Ignored","if",":","attr",":","`","cell","`","is","given",".","output_layer","(","optional",")",":","An","instance","of",":","tf_main",":","`","tf.layers.Layer","<","layers\/Layer",">","`",".","Applies","to","the","RNN","cell","output","of","each","step",".","If","`","None","`","(","default",")",",","the","output","layer","is","created","as","specified","in",":","attr",":","`","hparams","[","``","output_layer","''","]","`",".","hparams","(","dict","or","HParams",",","optional",")",":","Hyperparameters",".","Missing","hyperparamerter","will","be","set","to","default","values",".","See",":","meth",":","`","default_hparams","`","for","the","hyperparameter","sturcture","and","default","values",".","See",":","meth",":","`","_build","`","for","the","inputs","and","outputs","of","the","encoder",".","Example",":","..","code-block",":",":","python","#","Use","with","embedder","embedder","=","WordEmbedder","(","vocab_size",",","hparams=emb_hparams",")","encoder","=","UnidirectionalRNNEncoder","(","hparams=enc_hparams",")","outputs",",","final_state","=","encoder","(","inputs=embedder","(","data_batch","[","'text_ids","'","]",")",",","sequence_length=data_batch","[","'length","'","]",")","..","document","private","functions","..","automethod",":",":","_build"]
docstr: The output layer.
          
docstr_tok: ["The","output","layer","."]
code: def output_layer(self):
      """The output layer."""
      return self._output_layer
  
imports: import functools
  import numpy
  import tensorflow
  from tensorflow.contrib.framework import nest
  from texar.tf.modules.encoders.encoder_base import EncoderBase
  from texar.tf.modules.networks.conv_networks import _to_list
  from texar.tf.core import layers
  from texar.tf.utils.mode import is_train_mode
  from texar.tf.utils.shapes import mask_sequences
  from texar.tf.hyperparams import HParams
label_desc: Use image node_id 6 for calling the UnidirectionalRNNEncoder obj's underlying member method code with example usage: obj.output_layer() and returns: self