# tf_agents.trajectories.PolicyStep

<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/trajectories/policy_step.py#L31-L73) |

Returned with every call to `policy.action()` and `policy.distribution()`.

#### View aliases


**Main aliases**

[`tf_agents.trajectories.policy_step.PolicyStep`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/PolicyStep)

<br />

    tf_agents.trajectories.PolicyStep(
        action=(), state=(), info=()
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Tutorial on Multi Armed Bandits in TF-Agents](https://www.tensorflow.org/agents/tutorials/bandits_tutorial) |

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `action` | An action tensor or action distribution for `TFPolicy`, or numpy array for `PyPolicy`. |
| `state` | During inference, it will hold the state of the policy to be fed back into the next call to policy.action() or policy.distribution(), e.g. an RNN state. During the training, it will hold the state that is input to policy.action() or policy.distribution() For stateless policies, this will be an empty tuple. |
| `info` | Auxiliary information emitted by the policy, e.g. log probabilities of the actions. For policies without info this will be an empty tuple. |

<br />

## Methods

### `replace`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/trajectories/policy_step.py#L57-L73)

    replace(
        **kwargs
    ) -> 'PolicyStep'

Exposes as namedtuple._replace.

#### Usage:

      new_policy_step = policy_step.replace(action=())

This returns a new policy step with an empty action.

<br />

<br />

<br />

| Args ||
|---|---|
| `**kwargs` | key/value pairs of fields in the policy step. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A new `PolicyStep`. ||

<br />