What is the detailed operations of `torchfunc.jvp`

Hi,

Recently, I am studying about “torchfunc.jvp” function. However, I am confused about how a list of “tangents” and a list of “gradients” obtain an output with the same size as the output of models?

To be specific, the output of the model is [batch_size, dim], and the gradients are a list. How can I get a vector-jacobian with two lists of tensors?

Are you trying to compute the vector-jacobian product or the jacobian-vector product. The jvp function produces the jacobian-vector product.

Thanks for your reply. I think I misunderstood some parts of the function. Now, it is clear. :smile: