# tf_agents.trajectories.restart

<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/time_step.py#L135-L194) |

Returns a `TimeStep` with `step_type` set equal to [`StepType.FIRST`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/StepType#FIRST).

#### View aliases


**Main aliases**

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

<br />

    tf_agents.trajectories.restart(
        observation: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensorOrArray,
        batch_size: Optional[types.Int] = None,
        reward_spec: Optional[types.NestedSpec] = None
    ) -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/TimeStep

### Used in the notebooks

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

<br />

<br />

<br />

| ## Args ||
|---|---|
| `observation` | A NumPy array, tensor, or a nested dict, list or tuple of arrays or tensors. |
| `batch_size` | (Optional) A python or tensorflow integer scalar. If not provided, the environment will not be considered as a batched environment. |
| `reward_spec` | If provided, the reward in the returned `TimeStep` will be compatible with the provided `reward_spec`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `TimeStep`. ||

<br />