tf.compat.v1.train.SessionRunContext
Stay organized with collections
Save and categorize content based on your preferences.
Provides information about the session.run()
call being made.
tf.compat.v1.train.SessionRunContext(
original_args, session
)
Provides information about original request to Session.Run()
function.
SessionRunHook objects can stop the loop by calling request_stop()
of
run_context
. In the future we may use this object to add more information
about run without changing the Hook API.
Attributes |
original_args
|
A SessionRunArgs object holding the original arguments of run() .
If user called MonitoredSession.run(fetches=a, feed_dict=b) , then this
field is equal to SessionRunArgs(a, b).
|
session
|
A TensorFlow session object which will execute the run .
|
stop_requested
|
Returns whether a stop is requested or not.
If true, MonitoredSession stops iterations.
Returns:
A bool
|
Methods
request_stop
View source
request_stop()
Sets stop requested field.
Hooks can use this function to request stop of iterations.
MonitoredSession
checks whether this is called or not.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.train.SessionRunContext\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/training/session_run_hook.py#L210-L259) |\n\nProvides information about the `session.run()` call being made. \n\n tf.compat.v1.train.SessionRunContext(\n original_args, session\n )\n\nProvides information about original request to `Session.Run()` function.\nSessionRunHook objects can stop the loop by calling `request_stop()` of\n`run_context`. In the future we may use this object to add more information\nabout run without changing the Hook API.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `original_args` | A `SessionRunArgs` object holding the original arguments of `run()`. \u003cbr /\u003e If user called `MonitoredSession.run(fetches=a, feed_dict=b)`, then this field is equal to SessionRunArgs(a, b). |\n| `session` | A TensorFlow session object which will execute the `run`. |\n| `stop_requested` | Returns whether a stop is requested or not. \u003cbr /\u003e If true, `MonitoredSession` stops iterations. Returns: A `bool` |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `request_stop`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/training/session_run_hook.py#L253-L259) \n\n request_stop()\n\nSets stop requested field.\n\nHooks can use this function to request stop of iterations.\n`MonitoredSession` checks whether this is called or not."]]