Dropout randomly deactivates a fraction of the neurons at each training pass, which prevents the network from depending too much on some of them. It acts as a regularizer. It is only active in training mode (train()) and disabled in evaluation (eval()).
Example
nn.Dropout(p=0.3)