def METHOD_NAME(self, c):
    """Multiplies grads by a constant *c*."""
    for p in self.params:
        if p.grad is not None:
            if torch.is_tensor(c):
                c = c.to(p.grad.device)
            p.grad.data.mul_(c)