mindspore.mint.nn.Fold

View Source On AtomGit
class mindspore.mint.nn.Fold(output_size, kernel_size, dilation=1, padding=0, stride=1)[source]

Combines an array of sliding local blocks into a large containing tensor.

For details, please refer to mindspore.mint.nn.functional.fold().

Supported Platforms:

Ascend

Examples

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