You could use model.apply to iterate all modules, check if the current module is an nn.Dropout, and change the p value as seen here:
class MyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(10, 10)
        self.drop1 = nn.Dropout(p=0.0)
        self.fc2 = nn.Linear(10, 10)
        self.drop2 = nn.Dropout(p=0.0)
        self.fc3 = nn.Linear(10, 10)
        self.drop3 = nn.Dropout(p=0.0)
        
model = MyModel()
print(model)

def set_dropout_p(m, p):
    if isinstance(m, nn.Dropout):
        m.p = p

model.apply(lambda m: set_dropout_p(m, p=0.5))
print(model)