Pytorch: Mask dilation / extension
I wonder how to extend / dilate binary mask in pytorch? i.e. it should be something like cv2.dilate from opencv.

For rectangular neighborhoods, dilation is the same as max pooling.
See nn.MaxPool2d for implementation details.
