Unfold
class torch.nn.Unfold(kernel_size, dilation=1, padding=0, stride=1)
Extracts sliding local blocks from a batched input tensor.
Consider a batched "input" tensor of shape (N, C, *), where N is
   the batch dimension, C is the channel dimension, and * represent
   arbitrary spatial dimensions. This operation flattens each sliding
   "kernel_size"-sized block within the spatial dimensions of "input"
   into a column (i.e., last dimension) of a 3-D "output" tensor of
   shape (N, C \times \prod(\text{kernel_size}), L), where C \times
   \prod(\text{kernel_size}) is the total number of values within
   each block (a block has \prod(\text{kernel_size}) spatial
   locations each containing a C-channeled vector), and L is the total
   number of such blocks:
  L = \prod_d \left\lfloor\frac{\text{spatial\_size}[d] + 2 \times
  \text{padding}[d] %     - \text{dilation}[d] \times
  (\text{kernel\_size}[d] - 1) - 1}{\text{stride}[d]} +
  1\right\rfloor,
