Rate this Page

torch.nn.functional.unfold#

torch.nn.functional.unfold(input,kernel_size,dilation=1,padding=0,stride=1)[source]#

Extract sliding local blocks from a batched input tensor.

Warning

Currently, only 4-D input tensors (batched image-like tensors) aresupported.

Warning

More than one element of the unfolded tensor may refer to a singlememory location. As a result, in-place operations (especially ones thatare vectorized) may result in incorrect behavior. If you need to writeto the tensor, please clone it first.

Seetorch.nn.Unfold for details

Return type

Tensor