View source on GitHub |
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]
Args | |
---|---|
image
|
The 2/3/4D input tensor. |
Returns | |
---|---|
A 4D image tensor. |
Raises | |
---|---|
TypeError if image is not a 2/3/4D tensor.
|