StepContext
tf.train.MonitoredSession.StepContext
tf.train.SingularMonitoredSession.StepContext
Defined in tensorflow/python/training/monitored_session.py.
Control flow instrument for the step_fn from run_step_fn().
Users of step_fn may perform run() calls without running hooks by accessing the session. A run() call with hooks may be performed using run_with_hooks(). Computation flow can be interrupted using request_stop().
session__init____init__(
session,
run_with_hooks_fn
)
Initializes the step_context argument for a step_fn invocation.
session: An instance of tf.Session.run_with_hooks_fn: A function for running fetches and hooks.request_stoprequest_stop()
Exit the training loop by causing should_stop() to return True.
Causes step_fn to exit by raising an exception.
StopIteration
run_with_hooksrun_with_hooks(
*args,
**kwargs
)
Same as MonitoredSession.run. Accepts the same arguments.
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/train/MonitoredSession/StepContext