# tf_agents.metrics.py_metric.run_summaries

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/py_metric.py#L39-L76) |

Execute summary ops for py_metrics.

    tf_agents.metrics.py_metric.run_summaries(
        metrics: Sequence[https://www.tensorflow.org/agents/api_docs/python/tf_agents/metrics/py_metric#PyMetricType],
        session: Optional[tf.compat.v1.Session] = None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `metrics` | A list of py_metric.Base objects. |
| `session` | A TensorFlow session-like object. If it is not provided, it will use the current TensorFlow session context manager. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `RuntimeError` | If .tf_summaries() was not previously called on any of the `metrics`. |
| `AttributeError` | If session is not provided and there is no default session provided by a context manager. |

<br />