tf.keras.layers.UpSampling2D

Upsampling layer for 2D inputs.

Inherits From: Layer, Module

Used in the notebooks

Used in the guide

Repeats the rows and columns of the data by size[0] and size[1] respectively.

Examples:

input_shape = (2, 2, 1, 3)
x = np.arange(np.prod(input_shape)).reshape(input_shape)
print(x)
[[[[ 0  1  2]]
  [[ 3  4  5]]]
 [[[ 6  7  8]]
  [[ 9 10 11]]]]
y = tf.keras.layers.UpSampling2D(size=(1, 2))(x)
print(y)
tf.Tensor(