Best way to downsample-batch image tensors

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

Extracts sliding local blocks from an batched input tensor.

WARNING

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

See torch.nn.Unfold for details