You could apply the normalization manually to avoid the dimension check:
x = torch.randn(2, 3, 4, 5)
mean = torch.tensor([0.5, 0.5, 0.5])
std = torch.tensor([0.5, 0.5, 0.5])
x.sub_(mean[None, :, None, None]).div_(std[None, :, None, None])

torchvision.transforms.functional.normalize uses a similar code as seen here 289.