nested_any#

ivy.nested_any(nest, fn, check_nests=False, _base=True, extra_nest_types=None)[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 conditon function, returning True or False.

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

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

  • extra_nest_types (Optional[Union[type, Tuple[type]]]) – Types to recursively check when deciding whether to go deeper into the (default: None) nest or not

Return type:

bool

Returns:

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