# tf_agents.utils.nest_utils.get_outer_shape

<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/utils/nest_utils.py#L879-L908) |

Runtime batch dims of tensor's batch dimension `dim`.

    tf_agents.utils.nest_utils.get_outer_shape(
        nested_tensor, spec
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `nested_tensor` | Nest of tensors. |
| `spec` | The nested spec. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` containing the outer shape. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If `nested_tensor` and `spec` have different structures. |
| `TypeError` | If `nested_tensor` and `spec` structures have differing types. |

<br />