mindspore.ops.BatchToSpaceND

class mindspore.ops.BatchToSpaceND(block_shape, crops)[source]

Divides batch dimension with blocks and interleaves these blocks back into spatial dimensions.

Refer to mindspore.ops.batch_to_space_nd() for more details.

Supported Platforms:

Ascend GPU CPU

Examples

>>> block_size = 2
>>> crops = [[0, 0], [0, 0]]
>>> batch_to_space = ops.BatchToSpaceND(block_size, crops)
>>> input_x = Tensor(np.array([[[[1]]], [[[2]]], [[[3]]], [[[4]]]]), mindspore.float32)
>>> output = batch_to_space(input_x)
>>> print(output)
[[[[1.  2.]
   [3.  4.]]]]