You don’t need to change anything, as nn.Linear (and all other layers) are accepting batched data.
Just pass your input as [batch_size, nb_features] to the module and the output will be [batch_size, out_features].