tensorflow 1 session example
Example: sess.run tensorflow
tf.compat.v1.Session
A class for running TensorFlow operations.
run(
fetches, feed_dict=None, options=None, run_metadata=None
)
Runs operations and evaluates tensors in fetches.
This method runs one "step" of TensorFlow computation,
by running the necessary graph fragment to execute every Operation
and evaluate every Tensor in fetches, substituting the values in
feed_dict for the corresponding input values.
The fetches argument may be a single graph element, or an arbitrarily
nested list, tuple, namedtuple, dict, or OrderedDict containing graph
elements at its leaves.
The optional feed_dict argument allows the caller to override the
value of tensors in the graph. Each value in feed_dict must be
convertible to a numpy array of the dtype of the corresponding key.
The optional options argument expects a [RunOptions] proto.
The options allow controlling the behavior of this particular step
(e.g. turning tracing on).
The optional run_metadata argument expects a [RunMetadata] proto.
When appropriate, the non-Tensor output of this step will be
collected there. For example, when users turn on tracing in options,
the profiled info will be collected into this argument and passed
back.