class_docstr: Tests utility functions.
      
class_docstr_tok: ["Tests","utility","functions","."]
docstr: Tests mode related utilities.
          
docstr_tok: ["Tests","mode","related","utilities","."]
code: def test_mode(self):
      """Tests mode related utilities."""
      training = mode.is_train_mode(None)
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          training_ = sess.run(training)
          self.assertTrue(training_)
  
          training_ = sess.run(
              training,
              feed_dict={
                  context.global_mode(): tf.estimator.ModeKeys.TRAIN
              },
          )
          self.assertTrue(training_)
  
          training_ = sess.run(
              training,
              feed_dict={
                  context.global_mode(): tf.estimator.ModeKeys.EVAL
              },
          )
          self.assertFalse(training_)
  
      training = mode.is_train_mode(tf.estimator.ModeKeys.TRAIN)
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          training_ = sess.run(training)
          self.assertTrue(training_)
  
imports: import tensorflow
  from texar.tf.utils import mode
  from texar.tf import context
label_desc: Use image node_id 1 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_mode() without return types