def METHOD_NAME(item1: Any, item2: Any, path: str, rtol: float = 0.0, atol: float = 0.0):
    if item1 is None:
        assert item2 is None, f'{path} differs: {item1} != {item2}'
        return
    if isinstance(item1, (str, float, int, bool, Time, datetime.timedelta, TimeUnit)):
        assert type(item1) == type(item2)
        assert item1 == item2, f'{path} differs: {item1} != {item2}'
        return
    if isinstance(item1, torch.Tensor):
        assert isinstance(item2, torch.Tensor)
        assert item1.allclose(item2, rtol=rtol, atol=atol), f'{path} differs'
        return
    if isinstance(item1, np.ndarray):
        assert isinstance(item2, np.ndarray)
        assert np.allclose(item1, item2, rtol=0.1, atol=0.1), f'{path} differs'
        return
    if isinstance(item1, dict):
        assert isinstance(item2, dict), f'{path} differs: {item1} != {item2}'
        _check_dict_recursively(item1, item2, path, atol=atol, rtol=rtol)
        return
    if isinstance(item1, (tuple, list)):
        assert isinstance(item2, type(item1)), f'{path} differs: {item1} != {item2}'
        _check_list_recursively(item1, item2, path, atol=atol, rtol=rtol)
        return
    if isinstance(item1, torchmetrics.Metric):
        assert isinstance(item2, torchmetrics.Metric), f'{path} differs: {item1} != {item2}'
        # Increase update count so Torchmetrics doesn't throw warning when computing two metrics which haven't been updated
        item1._update_count += 1
        item2._update_count += 1
        item1_compute = item1.compute()
        item2_compute = item2.compute()
        if isinstance(item1_compute, torch.Tensor) and isinstance(item2_compute, torch.Tensor):
            assert item1_compute.allclose(item2_compute, atol=atol, rtol=rtol,
                                          equal_nan=True), f'{path} differs: {item1_compute} != {item2_compute}'
        elif isinstance(item1_compute, dict):
            assert isinstance(item2_compute, dict)
            _check_dict_recursively(item1_compute, item2_compute, path, atol, rtol)
        else:
            assert 'Torchmetric compute() returned unexpected type, please add support in `_check_item`'
        item1._update_count -= 1
        item2._update_count -= 1
        return
    raise NotImplementedError(f'Unsupported item type: {type(item1)}')