def backward(self, grad_output): a, b = self.saved_tensors return grad_output.mul(b).mul_(a.pow(b-1)), grad_output.mul(a.pow(b)).mul_(a.log())