def _any(judge_result):
    """Since built-in ``any`` works only when the element of iterable is not
    iterable, implement the function."""
    if not isinstance(judge_result, Iterable):
        return judge_result

    try:
        for element in judge_result:
            if _any(element):
                return True
    except TypeError:
        # Maybe encounter the case: torch.tensor(True) | torch.tensor(False)
        if judge_result:
            return True
    return False
Since built-in ``any`` works only when the element of iterable is not
    iterable, implement the function.
ControlNet-v1-1-nightly/annotator/uniformer/mmcv/utils/testing.py