I am still in shock:

import torch.nn.functional as F

x = torch.randn(1, 10)
print(F.dropout(x, p=0.5, training=True))

print(F.dropout(x, p=0.5, training=False))

# tensor([[ 0.0000, -2.0286, -2.6529,  0.0000,  0.6054,  0.0000, -0.0000, -0.5667,
#           0.3148,  1.6862]])
# tensor([[ 0.2737, -1.0143, -1.3264,  0.0609,  0.3027,  0.0464, -1.5175, -0.2833,
#           0.1574,  0.8431]])

Apparently on my end I don’t get 5/10 zeros, but sometime 1/10 (read: just one zero). Is this strange or OK. Here I showed 4 zero output.