class_docstr: Decorator that caches the return values of a function returning `(fun, grad)`
  each time it is called. 
class_docstr_tok: ["Decorator","that","caches","the","return","values","of","a","function","returning","`","(","fun",",","grad",")","`","each","time","it","is","called","."]
code: def derivative(self, x, *args):
      self._compute_if_needed(x, *args)
      return self.jac
  
imports: import warnings
  import sys
  from numpy import atleast_1d, eye, argmin, zeros, shape, squeeze, asarray, sqrt, Inf, asfarray, isinf
  import numpy
  from .linesearch import line_search_wolfe1, line_search_wolfe2, line_search_wolfe2, LineSearchWarning
  from ._numdiff import approx_derivative
  from scipy._lib._util import getfullargspec_no_self
  from scipy._lib._util import MapWrapper
  from scipy.optimize._differentiable_functions import ScalarFunction, FD_METHODS
label_desc: Use image node_id 4 for calling the MemoizeJac obj's underlying member method code with example usage: obj.derivative(x) and returns: self