# tf_agents.drivers.driver.Driver

<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/drivers/driver.py#L27-L85) |

A driver that takes steps in an environment using a policy.

    tf_agents.drivers.driver.Driver(
        env, policy, observers=None, transition_observers=None, info_observers=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `env` | An environment.Base environment. |
| `policy` | A policy.Base policy. |
| `observers` | A list of observers that are updated after the driver is run. Each observer is a callable(Trajectory) that returns the input. Trajectory.time_step is a stacked batch \[N+1, batch_size, ...\] of timesteps and Trajectory.action is a stacked batch \[N, batch_size, ...\] of actions in time major form. |
| `transition_observers` | A list of observers that are updated after every step in the environment. Each observer is a callable((TimeStep, PolicyStep, NextTimeStep)). The transition is shaped just as trajectories are for regular observers. |
| `info_observers` | A list of observers that are updated after the driver is run. Each observer is a callable(info). |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `env` | <br /> <br /> |
| `info_observers` | <br /> <br /> |
| `observers` | <br /> <br /> |
| `policy` | <br /> <br /> |
| `transition_observers` | <br /> <br /> |

<br />

## Methods

### `run`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/drivers/driver.py#L83-L85)

    @abc.abstractmethod
    run()

Takes steps in the environment and updates observers.