ivy.function_supported_devices(fn, recurse=True)[source]#

Return the supported devices of the current backend’s function. The function returns a dict containing the supported devices for the compositional and primary implementations in case of partial mixed functions.

  • fn (Callable) – The function to check for the supported device attribute

  • recurse (bool, default: True) – Whether to recurse into used ivy functions. Default is True.

Return type:

Union[Tuple, dict]


ret – Tuple or dict containing the supported devices of the function


>>> import ivy
>>> ivy.set_backend('numpy')
>>> print(ivy.function_supported_devices(ivy.ones))
>>> ivy.set_backend('torch')
>>> x = ivy.function_supported_devices(ivy.ones)
>>> x = sorted(x)
('cpu', 'gpu')