Assuming you are using this code snippet, then you wouldn’t have to change anything besides assigning a different batch size to the input and view operation:
# changes needed
batch_size = 16
x = torch.randn(batch_size, 500, 500, 500)  # batch, c, h, w
...
patches_orig = patches_orig.view(batch_size, output_c, output_h, output_w)

since the code is not applying any operation on the batch dimension and thus keeps it equal.