I need to have access to the gradient before the weights are updated.
In particular I need to modify it by multiplying it for another function.
 loss.backward()
 # Here i need to access the gradients and modified it.
 optimizer.step()