The linear layer will be applied to the additional input dimensions (the * in [batch_size, *, in_features]) as if you would pass the input sequentially in dim*.
The batchnorm layer will work differently, since you are currently using the batch size as the feature dimension, which sounds wrong.