mindspore.ops.BatchToSpaceND
- class mindspore.ops.BatchToSpaceND(block_shape, crops)[源代码]
用块划分批次维度,并将这些块交错回空间维度。
更多参考详见
mindspore.ops.batch_to_space_nd()
。- 支持平台:
Ascend
GPU
CPU
样例:
>>> 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.]]]]