You can use the formula of nn.Conv2d 12 to calculate the output shape:
out ​= ⌊(input_size​+2×padding−dilation×(kernel_size−1)−1)/stride ​+ 1⌋

Padding won’t be used, so the sizes will be floored.
If you need to pad your input, you could use F.pad on your input before applying unfold.