mindspore.ops.BatchToSpaceND
- class mindspore.ops.BatchToSpaceND(block_shape, crops)[源代码]
mindspore.ops.BatchToSpaceND
从2.0版本开始已被弃用,并将在未来版本中被移除,建议使用mindspore.ops.batch_to_space_nd()
代替。- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor, ops >>> 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.]]]]