Both ForwardDiff and ReverseDiff source solve a different problem (taking 
the derivative of a user-supplied function f(x)).  The Matlab and NumPy 
gradient functions, instead, take an array (not a function) and compute 
differences of adjacent elements of the array, returning a new array.

Reply via email to