xref: /aosp_15_r20/external/pytorch/torch/cuda/amp/common.py (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1# mypy: allow-untyped-defs
2from importlib.util import find_spec
3
4import torch
5
6
7__all__ = ["amp_definitely_not_available"]
8
9
10def amp_definitely_not_available():
11    return not (torch.cuda.is_available() or find_spec("torch_xla"))
12