docstr: ivy.Container static method variant of ivy.stop_gradient. This
  method simply wraps the function, and so the docstring for
  ivy.stop_gradient also applies to this method with minimal changes.
  
  Parameters
  ----------
  x
      Array or Container for which to stop the gradient.
  key_chains
      The key-chains to apply or not apply the method to. Default is ``None``.
  to_apply
      If True, the method will be applied to key_chains, otherwise key_chains
      will be skipped. Default is ``True``.
  prune_unapplied
      Whether to prune key_chains for which the function was not applied.
      Default is ``False``.
  map_sequences
      Whether to also map method to sequences (lists, tuples).
      Default is ``False``.
  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.
  
  Examples
  --------
  With one :class:`ivy.Container` inputs:
  
  >>> x = ivy.Container(a=ivy.array([0., 1., 2.]),
  ...                      b=ivy.array([3., 4., 5.]))
  >>> y = ivy.Container.static_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.Container.static_stop_gradient(x, preserve_type=True, out=x)
  >>> print(x)
  {
      a: ivy.array([0., 1., 2.]),
      b: ivy.array([3., 4., 5.])
  }
docstr_tok: ["ivy.Container","static","method","variant","of","ivy.stop_gradient",".","This","method","simply","wraps","the","function",",","and","so","the","docstring","for","ivy.stop_gradient","also","applies","to","this","method","with","minimal","changes",".","Parameters","--","--","--","--","--","x","Array","or","Container","for","which","to","stop","the","gradient",".","key_chains","The","key-chains","to","apply","or","not","apply","the","method","to",".","Default","is","``","None","``",".","to_apply","If","True",",","the","method","will","be","applied","to","key_chains",",","otherwise","key_chains","will","be","skipped",".","Default","is","``","True","``",".","prune_unapplied","Whether","to","prune","key_chains","for","which","the","function","was","not","applied",".","Default","is","``","False","``",".","map_sequences","Whether","to","also","map","method","to","sequences","(","lists",",","tuples",")",".","Default","is","``","False","``",".","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",".","Examples","--","--","--","--","With","one",":","class",":","`","ivy.Container","`","inputs",":",">",">",">","x","=","ivy.Container","(","a=ivy.array","(","[","0.",",","1.",",","2",".","]",")",",","...","b=ivy.array","(","[","3.",",","4.",",","5",".","]",")",")",">",">",">","y","=","ivy.Container.static_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.Container.static_stop_gradient","(","x",",","preserve_type=True",",","out=x",")",">",">",">","print","(","x",")","{","a",":","ivy.array","(","[","0.",",","1.",",","2",".","]",")",",","b",":","ivy.array","(","[","3.",",","4.",",","5",".","]",")","}"]
code: def _static_stop_gradient(
      x: Union[ivy.Container, ivy.Array, ivy.NativeArray],
      /,
      *,
      preserve_type: Union[bool, ivy.Container] = True,
      key_chains: Optional[
          Union[List[str], Dict[str, str], ivy.Container]
      ] = None,
      to_apply: Union[bool, ivy.Container] = True,
      prune_unapplied: Union[bool, ivy.Container] = False,
      map_sequences: Union[bool, ivy.Container] = False,
      out: Optional[ivy.Container] = None,
  ) -> ivy.Container:
      """ivy.Container static method variant of ivy.stop_gradient. This
      method simply wraps the function, and so the docstring for
      ivy.stop_gradient also applies to this method with minimal changes.
  
      Parameters
      ----------
      x
          Array or Container for which to stop the gradient.
      key_chains
          The key-chains to apply or not apply the method to. Default is ``None``.
      to_apply
          If True, the method will be applied to key_chains, otherwise key_chains
          will be skipped. Default is ``True``.
      prune_unapplied
          Whether to prune key_chains for which the function was not applied.
          Default is ``False``.
      map_sequences
          Whether to also map method to sequences (lists, tuples).
          Default is ``False``.
      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.
  
      Examples
      --------
      With one :class:`ivy.Container` inputs:
  
      >>> x = ivy.Container(a=ivy.array([0., 1., 2.]),
      ...                      b=ivy.array([3., 4., 5.]))
      >>> y = ivy.Container.static_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.Container.static_stop_gradient(x, preserve_type=True, out=x)
      >>> print(x)
      {
          a: ivy.array([0., 1., 2.]),
          b: ivy.array([3., 4., 5.])
      }
      """
      return ContainerBase.cont_multi_map_in_function(
          "stop_gradient",
          x,
          key_chains=key_chains,
          to_apply=to_apply,
          prune_unapplied=prune_unapplied,
          map_sequences=map_sequences,
          preserve_type=preserve_type,
          out=out,
      )
  
file_path: ivy/ivy/data_classes/container/gradients.py
imports: from typing import Optional, Union, List, Dict
  import ivy
  from ivy.data_classes.container.base import ContainerBase
label_desc: Use image node_id 1 for calling the _ContainerWithGradients obj's underlying member method code with example usage: obj._static_stop_gradient() and returns: ContainerBase