code: def jvp(
      func: Callable,
      primals: Any,
      tangents: Any,
      *,
      strict: bool = False,
      has_aux: bool = False,
  ):
      """
      Standing for the Jacobian-vector product, returns a tuple containing
      the output of `func(*primals)` and the "Jacobian of ``func`` evaluated at
      ``primals``" times ``tangents``. This is also known as forward-mode autodiff.
  
      Args:
          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_aux is True``, then instead returns a ``(output, jvp_out, aux)`` tuple.
  
      .. note::
          You may see this API error out with "forward-mode AD not implemented
          for operator X". If so, please file a bug report and we will prioritize it.
  
      jvp is useful when you wish to compute gradients of a function R^1 -> R^N
  
          >>> from torch.func import jvp
          >>> x = torch.randn([])
          >>> f = lambda x: x * torch.tensor([1., 2., 3])
          >>> value, grad = jvp(f, (x,), (torch.tensor(1.),))
          >>> assert torch.allclose(value, f(x))
          >>> assert torch.allclose(grad, torch.tensor([1., 2, 3]))
  
      :func:`jvp` can support functions with multiple inputs by passing in the
      tangents for each of the inputs
  
           >>> from torch.func import jvp
           >>> x = torch.randn(5)
           >>> y = torch.randn(5)
           >>> f = lambda x, y: (x * y)
           >>> _, output = jvp(f, (x, y), (torch.ones(5), torch.ones(5)))
           >>> assert torch.allclose(output, x + y)
  
      """
  
      return _jvp_with_argnums(
          func,
          primals,
          tangents,
          argnums=None,
          strict=strict,
          has_aux=has_aux,
      )
  
imports: from typing import Callable, Union, Tuple, List, Any, Optional
  import torch
  from functools import partial, wraps
  import contextlib
  from torch.utils._pytree import tree_flatten, tree_unflatten, tree_map, tree_map_only, tree_map_, treespec_pprint
  from torch.utils import _pytree
  from torch.fx.experimental import const_fold
  from torch.fx.experimental.proxy_tensor import make_fx
  import torch.autograd.forward_ad
  from torch._subclasses.functional_tensor import FunctionalTensor
  from .vmap import doesnt_support_saved_tensors_hooks, get_chunk_sizes
  from .apis import vmap
  from torch._C._functorch import _wrap_for_grad, _unwrap_for_grad, _grad_increment_nesting, _grad_decrement_nesting, _jvp_increment_nesting, _jvp_decrement_nesting, _wrap_functional_tensor, _unwrap_functional_tensor, _func_decrement_nesting, _func_increment_nesting, _assert_wrapped_functional, _propagate_functional_input_mutation, set_inplace_requires_grad_allowed, get_inplace_requires_grad_allowed
  from torch._functorch.utils import exposed_in, argnums_t
label_desc: Use image node_id 29 for calling a global function with example usage: jvp(func, primals, tangents) and returns: _jvp_with_argnums