code: def hessian_vec(func, point_ndim=1, func_out_ndim=0):
      """Return a function that returns the hessian of func.
  
      We modify the default behavior of the hessian function of torch
      to return a tensor of shape (n_points, dim, dim) when several
      points are given as inputs.
  
      Parameters
      ----------
      func : callable
          Function whose Hessian is computed.
      func_out_ndim : dim
          func output ndim.
  
      Returns
      -------
      _ : callable
          Function taking point as input and returning
          the hessian of func at point.
      """
      hessian_func = hessian(func, func_out_ndim=func_out_ndim)
  
      def _hessian(point):
          if point.ndim == point_ndim:
              return hessian_func(point)
          return _torch.stack(
              [hessian_func(one_point) for one_point in point],
              axis=0,
          )
  
      return _hessian
  
file_path: geomstats/geomstats/_backend/pytorch/autodiff.py
imports: import functools
  import numpy
  import torch
  from torch.autograd.functional import hessian
  from torch.autograd.functional import jacobian
label_desc: Use image node_id 5 for calling a global function with example usage: hessian_vec(func, point_ndim, func_out_ndim) and returns: _hessian, _torch, hessian_func