torch.func.vjp
torch.func.vjp(func, *primals, has_aux=False)
Standing for the vector-Jacobian product, returns a tuple
   containing the results of "func" applied to "primals" and a
   function that, when given "cotangents", computes the reverse-mode
   Jacobian of "func" with respect to "primals" times "cotangents".
Parameters:
      * func (Callable) -- A Python function that takes one or
        more arguments. Must return 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

  * **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: