Sorry, that was my mistake!
From the original paper:

If a unit is retained with probability p during training, the outgoing weights of that unit are multiplied by p at test time as shown in Figure 2. This ensures that for any hidden unit the expected output (under the distribution used to drop units at training time) is the same as the actual output at test time.

Since PyTorch uses p as the drop probability (as opposed to the keep probability) you are scaling it with 1/(1-p).