code: def gradient_descent_update(
      w: Union[ivy.Array, ivy.NativeArray],
      dcdw: Union[ivy.Array, ivy.NativeArray],
      lr: Union[float, ivy.Array, ivy.NativeArray],
      /,
      *,
      stop_gradients: bool = True,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Update weights ws of some function, given the derivatives of some cost c
      with respect to ws, [dc/dw for w in ws].
  
      Parameters
      ----------
      w
          Weights of the function to be updated.
      dcdw
          Derivates of the cost c with respect to the weights ws, [dc/dw for w in ws].
      lr
          Learning rate(s), the rate(s) at which the weights should be updated relative to
          the gradient.
      stop_gradients
          Whether to stop the gradients of the variables after each gradient step.
          Default is ``True``.
      out
          optional output array, for writing the result to. It must have a shape that the
          inputs broadcast to.
  
      Returns
      -------
      ret
          The new weights, following the gradient descent updates.
  
      Examples
      --------
      With :class:`ivy.Array` inputs:
  
      >>> w = ivy.array([[1., 2, 3],
      ...                [4, 6, 1],
      ...                [1, 0, 7]])
      >>> dcdw = ivy.array([[0.5, 0.2, 0.1],
      ...                   [0.3, 0.6, 0.4],
      ...                   [0.4, 0.7, 0.2]])
      >>> lr = ivy.array(0.1)
      >>> new_weights = ivy.gradient_descent_update(w, dcdw, lr, stop_gradients=True)
      >>> print(new_weights)
      ivy.array([[ 0.95,  1.98,  2.99],
      ...        [ 3.97,  5.94,  0.96],
      ...        [ 0.96, -0.07,  6.98]])
  
      >>> w = ivy.array([1., 2., 3.])
      >>> dcdw = ivy.array([0.5, 0.2, 0.1])
      >>> lr = ivy.array(0.3)
      >>> out = ivy.zeros_like(w)
      >>> ivy.gradient_descent_update(w, dcdw, lr, out=out)
      >>> print(out)
      ivy.array([0.85, 1.94, 2.97])
  
      With one :class:`ivy.Container` inputs:
  
      >>> w = ivy.Container(a=ivy.array([1., 2., 3.]),
      ...                   b=ivy.array([3.48, 5.72, 1.98]))
      >>> dcdw = ivy.array([0.5, 0.2, 0.1])
      >>> lr = ivy.array(0.3)
      >>> w_new = ivy.gradient_descent_update(w, dcdw, lr)
      >>> print(w_new)
      {
          a: ivy.array([0.85, 1.94, 2.97]),
          b: ivy.array([3.33, 5.66, 1.95])
      }
  
      With multiple :class:`ivy.Container` inputs:
  
      >>> w = ivy.Container(a=ivy.array([1., 2., 3.]),
      ...                   b=ivy.array([3.48, 5.72, 1.98]))
      >>> dcdw = ivy.Container(a=ivy.array([0.5, 0.2, 0.1]),
      ...                      b=ivy.array([2., 3.42, 1.69]))
      >>> lr = ivy.array(0.3)
      >>> w_new = ivy.gradient_descent_update(w, dcdw, lr)
      >>> print(w_new)
      {
          a: ivy.array([0.85, 1.94, 2.97]),
          b: ivy.array([2.88, 4.69, 1.47])
      }
      """
      return ivy.optimizer_update(
          w, dcdw, lr, stop_gradients=stop_gradients, out=out
      )
  
imports: from typing import Sequence, Union, Optional, Tuple, Callable
  import numpy
  import itertools
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, inputs_to_ivy_arrays, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 27 for calling a global function with example usage: gradient_descent_update() and returns: ivy