You can find the implementation here 60.
A quick code sample also shows that the behavior is changed in training/eval:
x = torch.randn(1, 10)
print(F.dropout(x, p=0.5, training=True))
>tensor([[-0.0000,  1.2927, -0.0000,  0.0000,  1.2973, -0.0000, -1.5645, -0.0000,
          -0.0000, -0.0000]])
print(F.dropout(x, p=0.5, training=False))
>tensor([[-0.4785,  0.6463, -0.4714,  1.4728,  0.6487, -2.0346, -0.7822, -1.0754,
          -0.7367, -0.8063]])