<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/vision/ops/augment.py#L51-L80) |

Converts an input Tensor to 4 dimensions.

    tfm.vision.augment.to_4d(
        image: tf.Tensor
    ) -> tf.Tensor

4D image =\> \[N, H, W, C\] or \[N, C, H, W\]
3D image =\> \[1, H, W, C\] or \[1, C, H, W\]
2D image =\> \[1, H, W, 1\]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `image` | The 2/3/4D input tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A 4D image tensor. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` if `image` is not a 2/3/4D tensor. ||

<br />