Basically, I just want to linearize a model with respect to its weights to have f(w) = f(w0) + jac(w0)@(w-w0) when x is fixed.
JAX, for example, already has Jacobian and Hessian functions, and it’s quite low-lever, so it allows to set weights directly.