src/transformers/utils/import_utils.py/is_torchdynamo_available
def is_torchdynamo_available():
    if not is_torch_available():
        return False
    try:
        import torch._dynamo as dynamo  # noqa: F401

        return True
    except Exception:
        return False