"""Computes the gradients for log.
op: The log Operation that we are differentiating
grad: Gradient with respect to the output of the log op.
Gradients with respect to the input of log.