Context¶
Global Mode¶
global_mode¶
-
texar.tf.
global_mode
()[source]¶ Returns the Tensor of global mode.
This is a placeholder with default value of tf.estimator.ModeKeys.TRAIN.
Example
mode = session.run(global_mode()) # mode == tf.estimator.ModeKeys.TRAIN mode = session.run( global_mode(), feed_dict={tf.global_mode(): tf.estimator.ModeKeys.PREDICT}) # mode == tf.estimator.ModeKeys.PREDICT
global_mode_train¶
-
texar.tf.
global_mode_train
()[source]¶ Returns a bool Tensor indicating whether the global mode is TRAIN.
Example
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