code: def stop_gradient(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      preserve_type: bool = True,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Stop gradient computation.
  
      Parameters
      ----------
      x
          Array for which to stop the gradient.
      preserve_type
          Whether to preserve gradient computation on ivy.Array instances. 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 same array x, but with no gradient information.
  
      Both the description and the type hints above assumes an array input for simplicity,
      but this function is *nestable*, and therefore also accepts :class:`ivy.Container`
      instances in place of any of the arguments.
  
      Examples
      --------
      With :class:`ivy.Array` inputs:
  
      >>> x = ivy.array([1., 2., 3.])
      >>> y = ivy.stop_gradient(x, preserve_type=True)
      >>> print(y)
      ivy.array([1., 2., 3.])
  
      >>> x = ivy.zeros((2, 3))
      >>> ivy.stop_gradient(x, preserve_type=False, out=x)
      >>> print(x)
      ivy.array([[0., 0., 0.],
                 [0., 0., 0.]])
  
      With one :class:`ivy.Container` inputs:
  
      >>> x = ivy.Container(a=ivy.array([0., 1., 2.]),
      ...                   b=ivy.array([3., 4., 5.]))
      >>> y = ivy.stop_gradient(x, preserve_type=False)
      >>> print(y)
      {
          a: ivy.array([0., 1., 2.]),
          b: ivy.array([3., 4., 5.])
      }
  
      With multiple :class:`ivy.Container` inputs:
  
      >>> x = ivy.Container(a=ivy.array([0., 1., 2.]),
      ...                   b=ivy.array([3., 4., 5.]))
      >>> ivy.stop_gradient(x, preserve_type=True, out=x)
      >>> print(x)
      {
          a: ivy.array([0., 1., 2.]),
          b: ivy.array([3., 4., 5.])
      }
      """
      return current_backend(x).stop_gradient(
          x, preserve_type=preserve_type, 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 20 for calling a global function with example usage: stop_gradient() and returns: current_backend