You can try two things

Use view to change the size of tensor to that of 1d and then apply BatchNorm1d. After that again use view.
Define BatchNorm4d. batch norm internally uses torch.batch_norm and it can work on input of any size. But you might not get CUDNN speedup (I am not sure about this).