Obtain mask from F.dropout

Is it possible to obtain the specific mask used in F.dropout explicitly? Originally, I tried to simply check what became zero after dropout, but this will clearly fail when there are zeros in the original input that are not dropped out.

I don’t think it’s currently possible to get the mask from F.dropout.
If you need it for debugging reasons, you could write a custom nn.Module and apply your own mask on the input.