import tensorflow as tf

        .. code-block:: python

            is_train = session.run(global_mode_train())
            # is_train == True

            is_train = session.run(
                global_mode_train()
                feed_dict={tf.global_mode(): tf.estimator.ModeKeys.PREDICT})
            # is_train == False
    """
    mode = global_mode()
    return tf.equal(mode, tf.estimator.ModeKeys.TRAIN)


def global_mode_eval():
    """Returns a bool Tensor indicating whether the global mode is EVAL.
    """
    mode = global_mode()
    return tf.equal(mode, tf.estimator.ModeKeys.EVAL)


def global_mode_predict():
