check_deepsparse_install(min_version: Optional[str] = None, max_version: Optional[str] = None, raise_on_error: bool = True) → bool
Check that the deepsparse package is installed. If raise_on_error, will raise an ImportError if it is not installed or the required version range, if set, is not installed. If not raise_on_error, will return True if installed with required version and False otherwise.
min_version (str) – The minimum version for deepsparse that it must be greater than or equal to, if unset will require no minimum version
max_version (str) – The maximum version for deepsparse that it must be less than or equal to, if unset will require no maximum version.
raise_on_error (bool) – True to raise any issues such as not installed, minimum version, or maximum version as ImportError. False to return the result.
If raise_on_error, will return False if deepsparse is not installed or the version is outside the accepted bounds and True if everything is correct.
- Return type
require_deepsparse(min_version: Optional[str] = None, max_version: Optional[str] = None)
Decorator function to require use of deepsparse. Will check that deepsparse package is installed and within the bounding ranges of min_version and max_version if they are set before calling the wrapped function. See
check_deepsparse_install()for more info.
- param min_version: The minimum version for deepsparse that it must be greater than
or equal to, if unset will require no minimum version
Functionality for working with and sparsifying Models in the DeepSparse framework