# tf_agents.utils.composite.squeeze

<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/composite.py#L49-L91) |

Squeeze composite tensor along axis `axis`.

    tf_agents.utils.composite.squeeze(
        t, axis
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `t` | A `Tensor` or `SparseTensor`. |
| `axis` | A python integer. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The tensor with dimension `axis` removed. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `InvalidArgumentError` | If `t` is a `SparseTensor` and has more than one index stored along `axis`. |

<br />