parameters: (function, x)
return_statement: return np.vstack(
          [y.derivatives() for y in y_ad.flat]).reshape(y_ad.shape + (-1,))
docstring: Compute the jacobian of the function evaluated at the vector input x
      using Eigen's automatic differentiation. The dimension of the jacobian will
      be one more than the output of ``function``.
  
      ``function`` should be vector-input, and can be any dimension output, and
      must return an array with AutoDiffXd elements.
docstring_summary: Compute the jacobian of the function evaluated at the vector input x
      using Eigen's automatic differentiation. The dimension of the jacobian will
      be one more than the output of ``function``.
docstring_tokens: Compute the jacobian of the function evaluated at the vector input x using Eigen s automatic differentiation . The dimension of the jacobian will be one more than the output of function .
function: def jacobian(function, x):
      """Compute the jacobian of the function evaluated at the vector input x
      using Eigen's automatic differentiation. The dimension of the jacobian will
      be one more than the output of ``function``.
  
      ``function`` should be vector-input, and can be any dimension output, and
      must return an array with AutoDiffXd elements.
      """
      x = np.asarray(x)
      assert x.ndim == 1, "x must be a vector"
      x_ad = np.empty(x.shape, dtype=np.object)
      for i in range(x.size):
          der = np.zeros(x.size)
          der[i] = 1
          x_ad.flat[i] = AutoDiffXd(x.flat[i], der)
      y_ad = np.asarray(function(x_ad))
      return np.vstack(
          [y.derivatives() for y in y_ad.flat]).reshape(y_ad.shape + (-1,))
function_tokens: def jacobian ( function , x ) : x = np . asarray ( x ) assert x . ndim == 1 , "x must be a vector" x_ad = np . empty ( x . shape , dtype = np . object ) for i in range ( x . size ) : der = np . zeros ( x . size ) der [ i ] = 1 x_ad . flat [ i ] = AutoDiffXd ( x . flat [ i ] , der ) y_ad = np . asarray ( function ( x_ad ) ) return np . vstack ( [ y . derivatives ( ) for y in y_ad . flat ] ) . reshape ( y_ad . shape + ( - 1 , ) )