I have a 4d tensor with a shape batch_data = (b, c, h, w).

I want to center each sample by subtracting the mean of each column (w) for every channel. That means I need to apply batch_data - batch_data.mean(dim=(???)).unsqueez(???) such that the shape of the mean data will be (b, c, h, w), and each sample’s channel will have an (h, w) tensor where, for each h, all w’s are the same.

If I understand you correctly, you wish to adjust your original tensor so that
for any b and c, the mean over the w dimension will be independent of h
(but will still depend on b and c).