class_docstr: Ivy Device Class.
class_docstr_tok: ["Ivy","Device","Class","."]
docstr: Exit the runtime context related to the specified device.
  
  Parameters
  ----------
  exc_type
      The type of the exception that was raised.
  exc_val
      The exception that was raised.
  exc_tb
      The traceback of the exception that was raised.
  
  Returns
  -------
  ret
      If no exception was raised, returns an instance of the same class.
  
  Examples
  --------
  A "gpu" as device:
  
  >>> with ivy.DefaultDevice("gpu") as device:
  >>>     pass
  >>> # after with block device.__exit__() is called
  >>> print(device._dev)
  "cpu"
code: def __exit__(
      self,
      exc_type: Optional[Type[BaseException]],
      exc_val: Optional[Type[BaseException]],
      exc_tb: Optional[types.TracebackType],
  ) -> Union[ivy.Device, str]:
      """Exit the runtime context related to the specified device.
  
      Parameters
      ----------
      exc_type
          The type of the exception that was raised.
      exc_val
          The exception that was raised.
      exc_tb
          The traceback of the exception that was raised.
  
      Returns
      -------
      ret
          If no exception was raised, returns an instance of the same class.
  
      Examples
      --------
      A "gpu" as device:
  
      >>> with ivy.DefaultDevice("gpu") as device:
      >>>     pass
      >>> # after with block device.__exit__() is called
      >>> print(device._dev)
      "cpu"
      """
      ivy.unset_default_device()
      ivy.unset_soft_device_mode()
      if self and (exc_type is not None):
          raise exc_val
      return self
  
imports: import os
  import gc
  import abc
  import math
  import psutil
  import warnings
  import types
  from typing import Type, Optional, Tuple
  from typing import Union, Callable, Iterable, Any
  import ivy
  from ivy.func_wrapper import handle_out_argument, to_native_arrays_and_back, inputs_to_native_arrays, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 3 for calling the DefaultDevice obj's underlying member method code with example usage: obj.__exit__(exc_type, exc_val, exc_tb) and returns: self