Closed gdalle closed 3 months ago
It returns an nutple of "ResultType" for whatever the result type is.
For example if you had function f(x) -> [x[1], x[2] + x[3]]) then gradient on it would return ([val1, val2], [val3, val4], [val5, val6]). (assuming the input array had 3 elements).
Thus in forward mode jacobian is only a wrapper over this.
Happy to explore different designs if you have suggestions, but that's what it does atm.
It is particularly surprising for array inputs: