I think you could reuse the already computed kernel size and stride.
Padding is not supported in this method and you could add the padding via F.pad beforehand.
In case you are using a dilation other than 1, I don’t think you could use tensor.unfold directly, unfortunately.