reverting generated code so that log_prob_grad matches log_prob