tf.compat.v1.train.MonitoredSession.StepContext

View source on GitHub

Control flow instrument for the step_fn from run_step_fn().

tf.compat.v1.train.MonitoredSession.StepContext(
    session, run_with_hooks_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().

Args:

Attributes:

Methods

request_stop

View source

request_stop()

Exit the training loop by causing should_stop() to return True.

Causes step_fn to exit by raising an exception.

Raises:

StopIteration

run_with_hooks

View source

run_with_hooks(
    *args, **kwargs
)

Same as MonitoredSession.run. Accepts the same arguments.