def METHOD_NAME(self, data_format, length_row, length_col):
    num_samples = 2
    stack_size = 2
    input_num_row = 11
    input_num_col = 12
    if data_format == "channels_first":
        inputs = np.random.rand(
            num_samples, stack_size, input_num_row, input_num_col
        )
    else:
        inputs = np.random.rand(
            num_samples, input_num_row, input_num_col, stack_size
        )
    self.run_layer_test(
        layers.UpSampling2D,
        init_kwargs={
            "size": (2, 2),
            "data_format": data_format,
            "interpolation": "bilinear",
        },
        input_shape=inputs.shape,
    )
    layer = layers.UpSampling2D(
        size=(length_row, length_col),
        data_format=data_format,
    )
    layer.build(inputs.shape)
    np_output = layer(inputs=backend.Variable(inputs))
    if data_format == "channels_first":
        self.assertEqual(np_output.shape[2], length_row * input_num_row)
        self.assertEqual(np_output.shape[3], length_col * input_num_col)
    else:
        self.assertEqual(np_output.shape[1], length_row * input_num_row)
        self.assertEqual(np_output.shape[2], length_col * input_num_col)