nested_any#

ivy.nested_any(nest, fn, check_nests=False, _base=True)[source]#

Check the leaf nodes of nest x via function fn, and returns True if any evaluate to True, else False.

Parameters:
  • nest (Iterable) – The nest to check the leaves of.

  • fn (Callable) – The condition function, returning True or False.

  • check_nests (bool, default: False) – Whether to also check the nests for the condition, not only nest leaves. Default is False.

  • _base (bool, default: True) – Whether the current function call is the first function call in the recursive stack. Used internally, do not set manually.

Return type:

bool

Returns:

ret – A boolean, whether the function evaluates to true for any leaf node.