class_docstr: Tests RNN cell creator.
      
docstr: Tests dropout mode.
          
docstr_tok: ["Tests","dropout","mode","."]
code: def test_switch_dropout(self):
      """Tests dropout mode."""
      emb_dim = 4
      num_units = 64
      hparams = {
          "kwargs": {"num_units": num_units},
          "num_layers": 2,
          "dropout": {
              "input_keep_prob": 0.8,
          },
      }
      mode = tf.placeholder(tf.string)
      hparams_ = HParams(hparams, layers.default_rnn_cell_hparams())
      cell = layers.get_rnn_cell(hparams_, mode)
  
      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())
          output_train, _ = sess.run(
              [output, state],
              feed_dict={mode: tf.estimator.ModeKeys.TRAIN},
          )
          self.assertEqual(output_train.shape[0], batch_size)
          output_test, _ = sess.run(
              [output, state],
              feed_dict={mode: tf.estimator.ModeKeys.EVAL},
          )
          self.assertEqual(output_test.shape[0], batch_size)
  
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 2 for calling the GetRNNCellTest obj's underlying member method code with example usage: obj.test_switch_dropout() without return types