Eager execution is enabled by default in version 2.x You can check that by using: tf.executing_eagerly()
import tensorflow.compat.v1 as tf