Indeed, training with dropout needs to account for scaling, so the strategy is to divide the weights by 1/p after training or multiply the weights by 1/p during training (I don’t know which one PyTorch uses).
If you need to apply Dropout during inference, you therefore need to compensate for the missing nodes in the network by dividing the weights by 1/p on the affected layers. It will obviously produce wrong results, but that is what you want to measure.
E.g: if p = 1/5, you multiply the weights by 5, and this simulates having all nodes active in the layer. See this answer 16 for more details.