code: def _elementwise_value_and_grad(fun, x):
      # same as autograd.elementwise_grad, but also returning ans
      vjp, ans = _autograd.differential_operators._make_vjp(fun, x)
      if _autograd.differential_operators.vspace(ans).iscomplex:
          raise TypeError(
              "Elementwise_grad only applies to real-output functions."
          )
  
      return ans, vjp(
          _autograd.differential_operators.vspace(ans).ones()
      )
  
file_path: geomstats/geomstats/_backend/autograd/autodiff.py
imports: import autograd
  import autograd.numpy
  from autograd import jacobian
label_desc: Use image node_id 3 for calling a global function with example usage: _elementwise_value_and_grad(fun, x) and returns: ans,  vjp