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.
Returns | |
---|---|
(paddings, crops), where:
|
|
satisfying
|
paddings[i, 0] = base_paddings[i, 0].
0 <= paddings[i, 1] - base_paddings[i, 1] < block_shapei % block_shape[i] == 0
crops[i, 0] = 0 crops[i, 1] = paddings[i, 1] - base_paddings[i, 1] |
Raises: ValueError if called with incompatible shapes.