mlx_rs::transforms

Function value_and_grad

Source
pub fn value_and_grad<'a, F, Err>(
    f: F,
    argument_numbers: impl IntoOption<&'a [i32]>,
) -> impl FnMut(&[Array]) -> Result<(Vec<Array>, Vec<Array>)> + 'a
where F: IntoValueAndGrad<'a, Err> + 'a,
Expand description

Returns a function which computes the value and gradient of f.