Try to permute your input so that it has the shape [batch_size, seq_len, features] and rerun the code again.
nn.Linear and nn.BatchNorm*d expect the batch dimension to be in dim0, which might yield the error you are seeing.