unfold

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

Extract the sliding blocks from input.

Parameters:
  • input (dragon.vm.torch.Tensor) – The input tensor.
  • kernel_size (Union[int, Sequence[int]]) – The size of sliding window.
  • dilation (Union[int, Sequence[int]], optional, default=1) – The dilated rate of sliding window.
  • padding (Union[int, Sequence[int]], optional, default=0) – The zero padding size.
  • stride (Union[int, Sequence[int]], optional, default=1) – The stride of sliding window.
Returns:

dragon.vm.torch.Tensor – The output tensor.