#[autodiff_reverse]🔬This is a nightly-only experimental API. (
autodiff #124509)Expand description
This macro uses reverse-mode automatic differentiation to generate a new function. It may only be applied to a function. The new function will compute the derivative of the function to which the macro was applied.
The expected usage syntax is:
#[autodiff_reverse(NAME, INPUT_ACTIVITIES, OUTPUT_ACTIVITY)]
- NAME: A string that represents a valid function name.
- INPUT_ACTIVITIES: Specifies one valid activity for each input parameter.
- OUTPUT_ACTIVITY: Must not be set if the function implicitly returns nothing (or explicitly returns- -> ()). Otherwise, it must be set to one of the allowed activities.