# tf_agents.trajectories.to_transition_spec

<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/trajectory.py#L853-L875) |

Create a transition spec from a trajectory spec.

#### View aliases


**Main aliases**

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

<br />

    tf_agents.trajectories.to_transition_spec(
        trajectory_spec: https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/Trajectory
    ) -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/Transition

> [!NOTE]
> **Note:** since trajectories do not include the policy step's state (except in special cases where the policy chooses to store this in the info field), the returned `transition.action_spec.state` field will be an empty tuple.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `trajectory_spec` | An instance of `Trajectory` representing trajectory specs. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tuple `(time_steps, policy_steps, next_time_steps)` specs. ||

<br />