torch.nn.functional.
fold
(input, output_size, kernel_size, dilation=1, padding=0, stride=1)
将一组滑动局部块张量组合成一个包含这些张量的大张量。
注意:
Currently, only 4-D output tensors (batched image-like tensors) are supported.
假设一组3D,其大小为:
fold操作将这个3D张量转化为另一个张量,其大小为:(N,C,output_size[0],output_size[1],…),且L必须满足
就收unfold的逆操作,没啥可说的。