TensorFlow's eager execution is an imperative programming environment that evaluates operations immediately, without building graphs: operations return concrete values instead of constructing a computational graph to run later.
Eager execution is a flexible machine learning platform for research and experimentation, providing:
To use tensorflow with eager execution, you need first upgrade tensorflow to latest version.
pip install --upgrade tensorflow
Eager execution is not included in the latest release (version 1.4) of TensorFlow. To use it, you will need to build TensorFlow from source or install the nightly builds.
In [2]:
import tensorflow as tf
from __future__ import absolute_import, division, print_function
tf.enable_eager_execution()
x = [[2.]]
m = tf.matmul(x, x)
print("hello, {}".format(m))
In [ ]: