class_docstr: Tests RNN cell creator.
      
docstr: Tests :func:`texar.tf.core.layers.get_rnn_cell`.
          
docstr_tok: ["Tests",":","func",":","`","texar.tf.core.layers.get_rnn_cell","`","."]
code: def test_get_rnn_cell(self):
      """Tests :func:`texar.tf.core.layers.get_rnn_cell`."""
      emb_dim = 4
      num_units = 64
  
      # Given instance
      hparams = {"type": rnn.LSTMCell(num_units)}
      cell = layers.get_rnn_cell(hparams)
      self.assertTrue(isinstance(cell, rnn.LSTMCell))
  
      # Given class
      hparams = {"type": rnn.LSTMCell, "kwargs": {"num_units": 10}}
      cell = layers.get_rnn_cell(hparams)
      self.assertTrue(isinstance(cell, rnn.LSTMCell))
  
      # Given string, and complex hyperparameters
      keep_prob_x = tf.placeholder(
          name="keep_prob", shape=[], dtype=tf.float32
      )
      hparams = {
          "type": "tensorflow.contrib.rnn.GRUCell",
          "kwargs": {"num_units": num_units},
          "num_layers": 2,
          "dropout": {
              "input_keep_prob": 0.8,
              "state_keep_prob": keep_prob_x,
              "variational_recurrent": True,
              "input_size": [emb_dim, num_units],
          },
          "residual": True,
          "highway": True,
      }
  
      hparams_ = HParams(hparams, layers.default_rnn_cell_hparams())
      cell = layers.get_rnn_cell(hparams_)
  
      batch_size = 16
      inputs = tf.zeros([batch_size, emb_dim], dtype=tf.float32)
      output, state = cell(
          inputs, cell.zero_state(batch_size, dtype=tf.float32)
      )
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
  
          feed_dict = {
              keep_prob_x: 1.0,
              context.global_mode(): tf.estimator.ModeKeys.TRAIN,
          }
          output_, state_ = sess.run(
              [output, state], feed_dict=feed_dict
          )
  
          self.assertEqual(output_.shape[0], batch_size)
          if isinstance(state_, (list, tuple)):
              self.assertEqual(state_[0].shape[0], batch_size)
              self.assertEqual(
                  state_[0].shape[1], hparams_.kwargs.num_units
              )
          else:
              self.assertEqual(state_.shape[0], batch_size)
              self.assertEqual(
                  state_.shape[1], hparams_.kwargs.num_units
              )
  
imports: import numpy
  import tensorflow
  import tensorflow.contrib.rnn
  import texar.tf
  from texar.tf import context
  from texar.tf.hyperparams import HParams
  from texar.tf.core import layers
label_desc: Use image node_id 1 for calling the GetRNNCellTest obj's underlying member method code with example usage: obj.test_get_rnn_cell() without return types