class_docstr: Tests HierarchicalRNNEncoder
      
code: def test_encode(self):
      encoder = HierarchicalRNNEncoder()
  
      batch_size = 16
      max_major_time = 8
      max_minor_time = 6
      dim = 10
      inputs = tf.random_uniform(
          [batch_size, max_major_time, max_minor_time, dim],
          maxval=1,
          minval=-1,
          dtype=tf.float32,
      )
      outputs, state = encoder(inputs)
  
      cell_dim = encoder.encoder_major.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(state_[0].shape, (batch_size, cell_dim))
  
file_path: texar/tests/modules/encoders/hierarchical_encoders_test.py
imports: import tensorflow
  from texar.tf.modules.encoders.hierarchical_encoders import HierarchicalRNNEncoder
label_desc: Use image node_id 2 for calling the HierarchicalRNNEncoderTest obj's underlying member method code with example usage: obj.test_encode() without return types