class_docstr: A hierarchical encoder that stacks basic RNN encoders into two layers.
  Can be used to encode long, structured sequences, e.g. paragraphs, dialog
  history, etc.
  
  Args:
      encoder_major (optional): An instance of subclass of
          :class:`~texar.tf.modules.RNNEncoderBase`
          The high-level encoder taking final
          states from low-level encoder as its
          inputs. If not specified, an encoder
          is created as specified in
          :attr:`hparams["encoder_major"]`.
      encoder_minor (optional): An instance of subclass of
          :class:`~texar.tf.modules.RNNEncoderBase`
          The low-level encoder. If not
          specified, an encoder is created as specified
          in :attr:`hparams["encoder_minor"]`.
      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.
  
  .. document private functions
  .. automethod:: _build
docstr: Tiles an initial state to be used for encoder minor.
  
  The batch dimension of :attr:`initial_state` must equal `T`. The
  state will be copied for `B` times and used to start encoding each
  low-level sequence. For example, the first utterance in each dialog
  history in the batch will have the same initial state.
  
  Args:
      initial_state: Initial state with the batch dimension of size `T`.
      order (str): The dimension order of inputs. Must be the same as
          used in :meth:`_build`.
      inputs_shape: Shape of `inputs` for :meth:`_build`. Can usually
          be Obtained with `tf.shape(inputs)`.
  
  Returns:
      A tiled initial state with batch dimension of size `B*T`
docstr_tok: ["Tiles","an","initial","state","to","be","used","for","encoder","minor",".","The","batch","dimension","of",":","attr",":","`","initial_state","`","must","equal","`","T","`",".","The","state","will","be","copied","for","`","B","`","times","and","used","to","start","encoding","each","low-level","sequence",".","For","example",",","the","first","utterance","in","each","dialog","history","in","the","batch","will","have","the","same","initial","state",".","Args",":","initial_state",":","Initial","state","with","the","batch","dimension","of","size","`","T","`",".","order","(","str",")",":","The","dimension","order","of","inputs",".","Must","be","the","same","as","used","in",":","meth",":","`","_build","`",".","inputs_shape",":","Shape","of","`","inputs","`","for",":","meth",":","`","_build","`",".","Can","usually","be","Obtained","with","`","tf.shape","(","inputs",")","`",".","Returns",":","A","tiled","initial","state","with","batch","dimension","of","size","`","B","*","T","`"]
code: def tile_initial_state_minor(initial_state, order, inputs_shape):
      """Tiles an initial state to be used for encoder minor.
  
      The batch dimension of :attr:`initial_state` must equal `T`. The
      state will be copied for `B` times and used to start encoding each
      low-level sequence. For example, the first utterance in each dialog
      history in the batch will have the same initial state.
  
      Args:
          initial_state: Initial state with the batch dimension of size `T`.
          order (str): The dimension order of inputs. Must be the same as
              used in :meth:`_build`.
          inputs_shape: Shape of `inputs` for :meth:`_build`. Can usually
              be Obtained with `tf.shape(inputs)`.
  
      Returns:
          A tiled initial state with batch dimension of size `B*T`
      """
  
      def _nest_tile(t, multiplier):
          return nest.map_structure(lambda x: tf.tile(x, multiplier), t)
  
      if order == "btu":
          return _nest_tile(initial_state, inputs_shape[0])
      elif order == "ubt":
          return _nest_tile(initial_state, inputs_shape[1])
      elif order == "utb":
          return tf.contrib.seq2seq.tile_batch(
              initial_state, inputs_shape[2]
          )
      elif order == "tbu":
          return tf.contrib.seq2seq.tile_batch(
              initial_state, inputs_shape[1]
          )
      else:
          raise ValueError("Unknown order: {}".format(order))
  
file_path: texar/texar/tf/modules/encoders/hierarchical_encoders.py
imports: import collections
  import tensorflow
  from tensorflow.contrib.rnn import LSTMStateTuple
  from tensorflow.python.util import nest
  from texar.tf.modules.encoders.encoder_base import EncoderBase
  from texar.tf.utils import utils
label_desc: Use image node_id 4 for calling the HierarchicalRNNEncoder obj's underlying member method code with example usage: obj.tile_initial_state_minor(initial_state, order, inputs_shape) and returns: nest, _nest_tile, _nest_tile, tf, tf