neural_compressor.torch.utils.environ
Intel Neural Compressor PyTorch environment check.
Functions
|
Check whether intel_extension_for_pytorch is imported. |
|
Check whether transformers is imported. |
|
Check if the package exists in the environment without importing. |
Returns whether hpex is available. |
|
Return whether optimum-habana is available. |
|
Return whether optimum-habana is available. |
|
Return whether ipex is available. |
|
Return ipex version if ipex exists. |
|
Return torch version if ipex exists. |
|
|
Return the recommended accelerator based on device priority. |
|
Function decorator that calls accelerated.synchronize before and after a function call. |
Module Contents
- neural_compressor.torch.utils.environ.is_ipex_imported() bool [source]
Check whether intel_extension_for_pytorch is imported.
- neural_compressor.torch.utils.environ.is_transformers_imported() bool [source]
Check whether transformers is imported.
- neural_compressor.torch.utils.environ.is_package_available(package_name)[source]
Check if the package exists in the environment without importing.
- Parameters:
package_name (str) – package name
- neural_compressor.torch.utils.environ.is_hpex_available()[source]
Returns whether hpex is available.
- neural_compressor.torch.utils.environ.is_optimum_available()[source]
Return whether optimum-habana is available.
- neural_compressor.torch.utils.environ.is_optimum_habana_available()[source]
Return whether optimum-habana is available.
- neural_compressor.torch.utils.environ.is_ipex_available()[source]
Return whether ipex is available.
- neural_compressor.torch.utils.environ.get_ipex_version()[source]
Return ipex version if ipex exists.
- neural_compressor.torch.utils.environ.get_torch_version()[source]
Return torch version if ipex exists.