<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/training/session_run_hook.py#L210-L259) |

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.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `original_args` | A `SessionRunArgs` object holding the original arguments of `run()`. <br /> 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. <br /> If true, `MonitoredSession` stops iterations. Returns: A `bool` |

<br />

## Methods

### `request_stop`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/training/session_run_hook.py#L253-L259)

    request_stop()

Sets stop requested field.

Hooks can use this function to request stop of iterations.
`MonitoredSession` checks whether this is called or not.