def torchvision_transforms_v2_available() -> bool:
    """Checks if torchvision supports the v2 transforms API with the `tv_tensors`
    module. Checking for the availability of the `transforms.v2` is not sufficient
    since it is available in torchvision >= 0.15.1, but the `tv_tensors` module is
    only available in torchvision >= 0.16.0.

    Returns:
        True if transforms.v2 are available, False otherwise
    """
    try:
        from torchvision import tv_tensors
    except ImportError:
        return False
    return True
Checks if torchvision supports the v2 transforms API with the `tv_tensors`
    module. Checking for the availability of the `transforms.v2` is not sufficient
    since it is available in torchvision >= 0.15.1, but the `tv_tensors` module is
    only available in torchvision >= 0.16.0.

    Returns:
        True if transforms.v2 are available, False otherwise
    
lightly/utils/dependency.py