tf2 eager execution code example Example: tf disable eager execution import tensorflow as tf tf.compat.v1.disable_eager_execution()