You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- from ..logger import get_module_logger
-
- logger = get_module_logger("import_utils")
-
-
- def is_torch_available(verbose=False):
- try:
- import torch # noqa: F401
- except ModuleNotFoundError as err:
- if verbose is True:
- logger.warning("ModuleNotFoundError: torch is not installed, please install pytorch!")
- return False
- return True
|