class_docstr: Riemannian gradient descent.
class_docstr_tok: ["Riemannian","gradient","descent","."]
code: def _handle_jac(self, fun):
      if self.jac == "autodiff":
  
          def fun_(x):
              value, grad = gs.autodiff.value_and_grad(
                  fun, to_numpy=False
              )(x)
              return value, grad
  
      else:
          raise NotImplementedError(
              "For now only working with autodiff."
          )
  
      return fun_
  
imports: import logging
  import math
  from scipy.optimize import OptimizeResult
  from sklearn.base import BaseEstimator
  import geomstats.backend
  import geomstats.errors
  from geomstats.learning.frechet_mean import FrechetMean
  from geomstats.numerics.optimizers import ScipyMinimize
label_desc: Use image node_id 2 for calling the RiemannianGradientDescent obj's underlying member method code with example usage: obj._handle_jac(fun) and returns: fun_, value,  grad