tf.required_space_to_batch_paddings

View source on GitHub

Calculate padding required to make block_shape divide input_shape.

tf.required_space_to_batch_paddings(
    input_shape, block_shape, base_paddings=None, name=None
)

This function can be used to calculate a suitable paddings argument for use with space_to_batch_nd and batch_to_space_nd.

Args:

Returns:

(paddings, crops), where:

paddings and crops are int32 Tensors of rank 2 and shape [N, 2]

Raises: ValueError if called with incompatible shapes.