Thanks! I’m glad autograd is being expanded on. The functional API is a good step. Batch vectorization would make it even better! My only confusion is, the pipeline I used to make my version of the hessian function was entirely automatic: I plugged my MLP function into the matrix calculus tool above, copied and pasted the NumPy code it produced, and simply changed the NumPy calls to Pytorch. Couldn’t the same pipeline be built into Pytorch to enable even faster derivatives? Sorry if this question is naive; I know an MLP is a very basic use case and generalizing to more sophisticated architectures would probably require a lot more effort.