class_docstr: Basic gradient-descent optimizer.
  
  Base class for other gradient-descent-based optimizers.
  
  A step of the gradient descent optimizer computes the new values via the rule
  
  .. math::
  
      x^{(t+1)} = x^{(t)} - \eta \nabla f(x^{(t)}).
  
  where :math:`\eta` is a user-defined hyperparameter corresponding to step size.
  
  Args:
      stepsize (float): the user-defined hyperparameter :math:`\eta`
  
  .. note::
  
      When using ``torch``, ``tensorflow`` or ``jax`` interfaces, refer to :doc:`Gradients and training </introduction/interfaces>` for suitable optimizers.
docstr: Update trainable arguments with one step of the optimizer.
  
  Args:
      objective_fn (function): the objective function for optimization
      *args : Variable length argument list for objective function
      grad_fn (function): optional gradient function of the
          objective function with respect to the variables ``x``.
          If ``None``, the gradient function is computed automatically.
          Must return a ``tuple[array]`` with the same number of elements as ``*args``.
          Each array of the tuple should have the same shape as the corresponding argument.
      **kwargs : variable length of keyword arguments for the objective function
  
  Returns:
      list [array]: the new variable values :math:`x^{(t+1)}`.
      If single arg is provided, list [array] is replaced by array.
docstr_tok: ["Update","trainable","arguments","with","one","step","of","the","optimizer",".","Args",":","objective_fn","(","function",")",":","the","objective","function","for","optimization","*","args",":","Variable","length","argument","list","for","objective","function","grad_fn","(","function",")",":","optional","gradient","function","of","the","objective","function","with","respect","to","the","variables","``","x","``",".","If","``","None","``",",","the","gradient","function","is","computed","automatically",".","Must","return","a","``","tuple","[","array","]","``","with","the","same","number","of","elements","as","``","*","args","``",".","Each","array","of","the","tuple","should","have","the","same","shape","as","the","corresponding","argument",".","*","*","kwargs",":","variable","length","of","keyword","arguments","for","the","objective","function","Returns",":","list","[","array","]",":","the","new","variable","values",":","math",":","`","x^","{","(","t+1",")","}","`",".","If","single","arg","is","provided",",","list","[","array","]","is","replaced","by","array","."]
code: def step(self, objective_fn, *args, grad_fn=None, **kwargs):
      """Update trainable arguments with one step of the optimizer.
  
      Args:
          objective_fn (function): the objective function for optimization
          *args : Variable length argument list for objective function
          grad_fn (function): optional gradient function of the
              objective function with respect to the variables ``x``.
              If ``None``, the gradient function is computed automatically.
              Must return a ``tuple[array]`` with the same number of elements as ``*args``.
              Each array of the tuple should have the same shape as the corresponding argument.
          **kwargs : variable length of keyword arguments for the objective function
  
      Returns:
          list [array]: the new variable values :math:`x^{(t+1)}`.
          If single arg is provided, list [array] is replaced by array.
      """
  
      g, _ = self.compute_grad(
          objective_fn, args, kwargs, grad_fn=grad_fn
      )
      new_args = self.apply_grad(g, args)
  
      # unwrap from list if one argument, cleaner return
      if len(new_args) == 1:
          return new_args[0]
  
      return new_args
  
imports: from pennylane._grad import grad
label_desc: Use image node_id 3 for calling the GradientDescentOptimizer obj's underlying member method code with example usage: obj.step(objective_fn) and returns: new_args, new_args