Thank you @ptrblck for your detailed answer. It has clarified a lot for me.
It’s clear that for nn.Conv1d, nn.Conv2d, nn.Batchnorm2d and nn.Batchnorm1d (with a 3D input of shape (B, C, L)):

The letter C denotes the number of channels which is the same as the number of features.
The letter L denotes the length of signal sequence (as described in the nn.Conv1d documentation).
The letters H and W denote the height and width of image respectively. This is consistent with the 1d because we could flatten an HxW image to a sequence of length L = H*W.

The confusion arises in the case of a 2D input for nn.Batchnorm1d. I agree that the shape of a 2D input should be changed to (B, L) in the shape section of the documentation, however in this case the meaning of L changes automatically from “length of a signal sequence” to “number of features” (and the notion of channels doesn’t exist anymore). In my opinion, a different letter should be used for this case, e.g. (B, H_in) as in nn.Linear, to avoid confusion.
In conclusion, the 2D input and the 3D input to nn.Batchnorm1d are two different things. The first is a mini-batch of 1D vectors of features, the second is a mini-batch of signal sequences each of length L and with C channels/features. We cannot say that the first is equivalent to the second with shape (B, C=1, L). So in my opinion the shape of the first should be denoted by (B, H_in) and of the second by (B, C, L).