mindspore.mint.nn.Unfold
- class mindspore.mint.nn.Unfold(kernel_size, dilation=1, padding=0, stride=1)[源代码]
从一个batch的输入Tensor中提取滑动局部块。
更多参考详见
mindspore.mint.nn.functional.unfold()
。- 支持平台:
Ascend
样例:
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor, mint >>> input = Tensor(np.random.rand(4, 4, 32, 32), mindspore.float64) >>> unfold = mint.nn.Unfold(kernel_size=3, dilation=1, stride=1) >>> output = unfold(input) >>> print(output.shape) (4, 36, 900)