# tf_agents.trajectories.truncation

<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#L349-L412) |

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

#### View aliases


**Main aliases**

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

<br />

    tf_agents.trajectories.truncation(
        observation: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensorOrArray,
        reward: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensorOrArray,
        discount: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/Float = 1.0,
        outer_dims: Optional[types.Shape] = None
    ) -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/TimeStep

If `discount` is a scalar, and `observation` contains Tensors,
then `discount` will be broadcasted to match the outer dimensions.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `observation` | A NumPy array, tensor, or a nested dict, list or tuple of arrays or tensors. |
| `reward` | A NumPy array, tensor, or a nested dict, list or tuple of arrays or tensors. |
| `discount` | (optional) A scalar, or 1D NumPy array, or tensor. |
| `outer_dims` | (optional) If provided, it will be used to determine the batch dimensions. If not, the batch dimensions will be inferred by reward's shape. |

<br />

<br />

<br />

<br />

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

<br />