# Module: tf_agents.metrics.py_metric

<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) |

Base class for Python metrics.

## Classes

[`class PyMetric`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/metrics/py_metric/PyMetric): Defines the interface for metrics.

[`class PyStepMetric`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/metrics/py_metric/PyStepMetric): Defines the interface for metrics that operate on trajectories.

## Functions

[`run_summaries(...)`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/metrics/py_metric/run_summaries): Execute summary ops for py_metrics.

## Type Aliases

[`MetricType`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/metrics/py_metric/MetricType)

<br />

<br />

<br />

| ## Other Members ||
|---|---|
| PyMetricType | Instance of `typing.ForwardRef` |
| absolute_import | Instance of `__future__._Feature` |
| division | Instance of `__future__._Feature` |
| print_function | Instance of `__future__._Feature` |

<br />