mindspore.mint.nn.Fold

查看源文件
class mindspore.mint.nn.Fold(output_size, kernel_size, dilation=1, padding=0, stride=1)[源代码]

将提取出的滑动局部区域块还原成更大的输出Tensor。

更多参考详见 mindspore.mint.nn.functional.fold()

支持平台:

Ascend

样例:

>>> import numpy as np
>>> from mindspore import Tensor, mint
>>> from mindspore import dtype as mstype
>>> fold = mint.nn.Fold([8, 8], [2, 2], [2, 2], [2, 2], [2, 2])
>>> input = Tensor(input_data=np.random.rand(16, 64, 25), dtype=mstype.float32)
>>> output = fold(input)
>>> print(output.shape)
(16, 16, 8, 8)