docstr: ivy.Container instance method variant of ivy.to_device. This method
  simply wraps the function, and so the docstring for ivy.to_device also
  applies to this method with minimal changes.
  
  Parameters
  ----------
  x
     input array to be moved to the desired device
  device
      device to move the input array `x` to
  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``.
  stream
      stream object to use during copy. In addition to the types supported
      in array.__dlpack__(), implementations may choose to support any
      library-specific stream object with the caveat that any code using
      such an object would not be portable.
  out
      optional output array, for writing the result to. It must have a
      shape that the inputs broadcast to.
  
  Returns
  -------
  ret
      input array x placed on the desired device
  
  Examples
  --------
  >>> x = ivy.Container(a=ivy.array([[2, 3, 1], [3, 5, 3]]),
  ...                   b=ivy.native_array([[1, 2], [4, 5]]))
  >>> y = x.to_device('cpu')
  >>> print(y.a.device, y.b.device)
  cpu cpu
docstr_tok: ["ivy.Container","instance","method","variant","of","ivy.to_device",".","This","method","simply","wraps","the","function",",","and","so","the","docstring","for","ivy.to_device","also","applies","to","this","method","with","minimal","changes",".","Parameters","--","--","--","--","--","x","input","array","to","be","moved","to","the","desired","device","device","device","to","move","the","input","array","`","x","`","to","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","``",".","stream","stream","object","to","use","during","copy",".","In","addition","to","the","types","supported","in","array.__dlpack__","(",")",",","implementations","may","choose","to","support","any","library-specific","stream","object","with","the","caveat","that","any","code","using","such","an","object","would","not","be","portable",".","out","optional","output","array",",","for","writing","the","result","to",".","It","must","have","a","shape","that","the","inputs","broadcast","to",".","Returns","--","--","--","-","ret","input","array","x","placed","on","the","desired","device","Examples","--","--","--","--",">",">",">","x","=","ivy.Container","(","a=ivy.array","(","[","[","2",",","3",",","1","]",",","[","3",",","5",",","3","]","]",")",",","...","b=ivy.native_array","(","[","[","1",",","2","]",",","[","4",",","5","]","]",")",")",">",">",">","y","=","x.to_device","(","'cpu","'",")",">",">",">","print","(","y.a.device",",","y.b.device",")","cpu","cpu"]
code: def to_device(
      self: ivy.Container,
      device: Union[ivy.Device, ivy.NativeDevice, ivy.Container],
      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,
      *,
      stream: Optional[Union[int, Any, ivy.Container]] = None,
      out: Optional[ivy.Container] = None,
  ) -> ivy.Container:
      """ivy.Container instance method variant of ivy.to_device. This method
      simply wraps the function, and so the docstring for ivy.to_device also
      applies to this method with minimal changes.
  
      Parameters
      ----------
      x
         input array to be moved to the desired device
      device
          device to move the input array `x` to
      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``.
      stream
          stream object to use during copy. In addition to the types supported
          in array.__dlpack__(), implementations may choose to support any
          library-specific stream object with the caveat that any code using
          such an object would not be portable.
      out
          optional output array, for writing the result to. It must have a
          shape that the inputs broadcast to.
  
      Returns
      -------
      ret
          input array x placed on the desired device
  
      Examples
      --------
      >>> x = ivy.Container(a=ivy.array([[2, 3, 1], [3, 5, 3]]),
      ...                   b=ivy.native_array([[1, 2], [4, 5]]))
      >>> y = x.to_device('cpu')
      >>> print(y.a.device, y.b.device)
      cpu cpu
      """
      return self._static_to_device(
          self,
          device,
          key_chains=key_chains,
          to_apply=to_apply,
          prune_unapplied=prune_unapplied,
          map_sequences=map_sequences,
          stream=stream,
          out=out,
      )
  
file_path: ivy/ivy/data_classes/container/device.py
imports: from typing import Union, Optional, Any, List, Dict
  import ivy
  from ivy.data_classes.container.base import ContainerBase
label_desc: Use image node_id 4 for calling the _ContainerWithDevice obj's underlying member method code with example usage: obj.to_device(device, key_chains, to_apply, prune_unapplied, map_sequences) and returns: self