code: def function_unsupported_devices(
      fn: Callable, recurse: bool = True
  ) -> Union[Tuple, dict]:
      """Return the unsupported devices of the current backend's function. The
      function returns a dict containing the unsupported devices for the
      compositional and primary implementations in case of partial mixed
      functions.
  
      Parameters
      ----------
      fn
          The function to check for the unsupported device attribute
      recurse
          Whether to recurse into used ivy functions. Default is ``True``.
  
      Returns
      -------
      ret
          Tuple or dict containing the unsupported devices of the function
  
      Examples
      --------
      >>> print(ivy.function_unsupported_devices(ivy.ones))
      ('tpu',)
      """
      ivy.utils.assertions.check_true(
          _is_valid_devices_attributes(fn),
          "supported_devices and unsupported_devices attributes cannot both "
          "exist in a particular backend",
      )
      if hasattr(fn, "partial_mixed_handler"):
          return {
              "compositional": function_unsupported_devices(
                  fn.compos, recurse=recurse
              ),
              "primary": _get_devices(fn, complement=True),
          }
      else:
          unsupported_devices = set(_get_devices(fn, complement=True))
          if recurse:
              unsupported_devices = (
                  ivy.functional.data_type._nested_get(
                      fn,
                      unsupported_devices,
                      set.union,
                      function_unsupported_devices,
                  )
              )
      return (
          unsupported_devices
          if isinstance(unsupported_devices, dict)
          else tuple(unsupported_devices)
      )
  
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 31 for calling a global function with example usage: function_unsupported_devices(fn, recurse) and returns: unknown, dict