Table of Contents
Shortcuts

# torch.nn.functional.unfold

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

  Extracts sliding local blocks from a batched input tensor.

  Warning

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

  Warning

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

  See `torch.nn.Unfold` for details

  Return type:

    Tensor

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.