Like this?
    def set_to_one(self, model):
        for name, param in model.named_parameters():
            values = torch.ones(param.shape)
            param = values

Edit: I forgot to add .data
    def set_to_one(self, model):
        for name, param in model.named_parameters():
            values = torch.ones(param.shape)
            param.data = values