Hi,
PyTorch does not support same padding explicitly, but you can obviously find the proper padding size p using the exact same formula you have provided. In your case, something especial is that padding size cannot be an integer number which means you have to have one side more padded.
(2*(output-1) - input - kernel)*(1 / stride)

Will give you 70.5 as the proper padding size. So, symmetric padding is not possible but for asymmetric case you can achieve it using torch.nn.functional.pad(input, (int, int, int, int)) for `left, right, top and bottom respectively.
Here is an example with your values:
x = torch.randn(1, 526, 140, 140)
x = F.pad(x, (71, 70, 71, 70), )
x = nn.Conv2d(526, 64, 3, 2)(x)
x.shape

Bests