Since you are using the functional API for F.dropout, it will be always set to training, i.e. it’ll always drop your activations.
You could use the module API nn.Dropout(p=0.5) or alternatively pass the self.training flag to your current code:
x = F.dropout(x, training=self.training)