code: def set_default_device(
      device: Union[ivy.Device, ivy.NativeDevice], /
  ) -> None:
      """Set the default device to given device instance.
  
      Parameters
      ----------
      device
          The device to set as the default device
  
      Examples
      --------
      >>> ivy.set_default_device("cpu")
      >>> ivy.default_device()
      'cpu'
  
      >>> ivy.set_backend("torch")
      >>> ivy.set_default_device("gpu:0")
      >>> ivy.default_device(as_native=True)
      device(type='cuda', index=0)
  
      >>> import torch
      >>> ivy.set_backend("torch")
      >>> device = torch.device("cuda")
      >>> ivy.set_default_device(device)
      >>> ivy.default_device(as_native=True)
      device(type='cuda')
      """
      global default_device_stack
      default_device_stack.append(device)
  
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 22 for calling a global function with example usage: set_default_device() without return types