Standing for the Jacobian-vector product, returns a tuple containing
the output of func(*primals) and the “Jacobian of evaluated at
” times . This is also known as forward-mode autodiff.
func
primals
tangents
Parameters:
func (function) – A Python function that takes one or more arguments,
one of which must be a Tensor, and returns one or more Tensors
primals (Tensors) – Positional arguments to func that must all be
Tensors. The returned function will also be computing the
derivative with respect to these arguments
tangents (Tensors) – The “vector” for which Jacobian-vector-product is
computed. Must be the same structure and sizes as the inputs to
func.
has_aux (bool) – Flag indicating that func returns a
(output,aux) tuple where the first element is the output of
the function to be differentiated and the second element is
other auxiliary objects that will not be differentiated.
Default: False.
Returns:
Returns a (output,jvp_out) tuple containing the output of func
evaluated at primals and the Jacobian-vector product.
If has_auxisTrue, then instead returns a (output,jvp_out,aux) tuple.