ivy.all_nested_indices(nest: Iterable, include_nests: bool = False, _index: Optional[List] = None, _base: bool = True) → Union[Iterable, bool][source]

Checks the leaf nodes of nested x via function fn, and returns all nest indices where the method evaluates as True.

  • nest (nest of any) – The nest to check the leaves of.

  • include_nests (bool, optional) – Whether to also include indices of the nests themselves, not only leaves. Default is False.

  • _index (list of tuples of indices, do not set) – The indices detected so far. None at the beginning. Used internally, do not set manually.

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


A set of indices for the nest where the function evaluated as True.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty