Skip to content
Joris Gillis edited this page Apr 4, 2023 · 2 revisions

Standard documentation for Function.reverse:

 [INTERNAL] 

::

 reverse(self, int nadj) -> Function

Get a function that calculates nadj adjoint derivatives.

::

    Returns a function with <tt>n_in + n_out + n_out</tt> inputs
    and <tt>n_in</tt> outputs.
    The first <tt>n_in</tt> inputs correspond to nondifferentiated inputs.
    The next <tt>n_out</tt> inputs correspond to nondifferentiated outputs.
    and the last <tt>n_out</tt> inputs correspond to adjoint seeds,
    stacked horizontally
    The  <tt>n_in</tt> outputs correspond to adjoint sensitivities,
    stacked horizontally.     *
    <tt>(n_in = n_in(), n_out = n_out())</tt>

    <tt>(n_in = n_in(), n_out = n_out())</tt>

   The functions returned are cached, meaning that if called multiple timed
   with the same value, then multiple references to the same function will be returned.

Extra doc: https://github.com/casadi/casadi/wiki/L_1wr

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/function.hpp#L820

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/function.cpp#L1087-L1093

Extra documentation

To edit, see writing tips.

Clone this wiki locally