Open fredrikekre opened 1 year ago
So what is going wrong is we should be creating the tangent for the array as a similar array, but we are instead creating it as a NoTangent
.
So we need to fix that.
Same error when
AD.hessian(Diffractor.DiffractorForwardBackend(), (x) -> dot(x, ones(2, 2), x), zeros(2))
Simple example of taking the jacobian of the identity function, but the identity function allocates a new vector and assigns by iteration: