gradient – Symbolic Differentiation

Symbolic gradient is usually computed from gradient.grad(), which offers a more convenient syntax for the common case of wanting the gradient in some expressions with respect to a scalar cost. The grad_sources_inputs() function does the underlying work, and is more flexible, but is also more awkward to use when gradient.grad() can do the job.