Just to add my two cents:
it only works when you have registered dropout layer during initialization with nn.Dropout layers. In case one uses functional dropout F.dropout(x,training = self.training)  in the forwad() method as it is in densenet 7, such tuning off will not work. The only way to turn on the dropout during evaluation for me currently is to define the forward() method again by replacing the F.dropout(x,training = self.training) with F.dropout(x,training = True).