PyTorch provide the powerful function unfold, through both torch.nn.functional.unfold 52 and the builtin function for tensor torch.Tensor.unfold 30. It seems the latter is easier to use, and it is more general as it is not restricted to 4D tensor. However, the former implementation support dilation, while the latter does not.
Does anyone has method to augment the builtin function implementation to make it support dilation?