Solved by ptrblck in post #2 
              
              
                You can find the implementation here. 
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…