pub fn grad<F>(f: F) -> Grad<F>Expand description
Returns a function that computes the gradient of f(params, args) with
respect to params, like jax.grad. See value_and_grad for what f
takes and returns (auxiliary outputs are dropped).
ยงExamples
use ruxla_core::{F32, Trace, grad};
let g = grad(|x: F32<Trace>, (): ()| x.sin());
assert_eq!(g.call(&F32::new(0.0), &()).value(), 1.0);