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
tensor of shape , where is the batch dimension, is the channel dimension, and represent arbitrary spatial dimensions. This operation flattens each sliding -sized block within the spatial dimensions of into a column (i.e., last dimension) of a 3-D tensor of shape , where is the total number of values within each block (a block has spatial locations each containing a -channeled vector), and is the total number of such blocks: