Closed gdalle closed 4 weeks ago
Currently, out-of-place Jacobians and Hessians use stack to put together the batches of JVPs/VJPs/HVPs, and there is a possible resizing at the end.
stack
Is there any drawback to defining a buffer as jac = similar(x, length(y), length(x)) or hess = similar(x, length(x), length(x))?
jac = similar(x, length(y), length(x))
hess = similar(x, length(x), length(x))
The only one I see is that the operators would turn SArrays into MArrays
SArray
MArray
Closing because it would impose mutability where I've made sure to avoid it
Currently, out-of-place Jacobians and Hessians use
stack
to put together the batches of JVPs/VJPs/HVPs, and there is a possible resizing at the end.Is there any drawback to defining a buffer as
jac = similar(x, length(y), length(x))
orhess = similar(x, length(x), length(x))
?The only one I see is that the operators would turn
SArray
s intoMArray
s