# tf_agents.specs.tensor_spec.add_outer_dim

<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/specs/tensor_spec.py#L506-L518) |

Adds an outer dimension to the shape of input specs.

    tf_agents.specs.tensor_spec.add_outer_dim(
        specs, dim=None
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Train a Deep Q Network with TF-Agents](https://www.tensorflow.org/agents/tutorials/1_dqn_tutorial) - [REINFORCE agent](https://www.tensorflow.org/agents/tutorials/6_reinforce_tutorial) |

<br />

<br />

<br />

| ## Args ||
|---|---|
| `specs` | Nested list/tuple/dict of TensorSpecs/ArraySpecs, describing the shape of tensors. |
| `dim` | Int, representing the outer dimension to be added to the TensorSpecs in specs. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Nested TensorSpecs with outer dimensions added to the shape of input specs. ||

<br />