Package
model_navigator.package.package
Package module - structure to snapshot optimization result.
Package
Class for storing pipeline execution status.
Initialize object.
Parameters:
-
status
(
Status) –A navigator execution status
-
workspace
(
Workspace) –Workspace for package files
-
model
(
Optional[object]) –An optional model
Source code in model_navigator/package/package.py
config
property
Generate configuration from package.
Returns:
-
CommonConfig–The configuration object
framework
property
Framework for which package was created.
Returns:
-
Framework–Framework object for package
get_best_model_status
Returns ModelStatus of best model for given strategy.
Parameters:
-
strategy
(
Optional[RuntimeSearchStrategy]) –Strategy for finding the best runtime. Defaults to
MaxThroughputAndMinLatencyStrategy. -
include_source
(
bool) –Flag if Python based model has to be included in analysis
Returns:
-
ModelStatus–ModelStatus of best model for given strategy or None.
Source code in model_navigator/package/package.py
get_model_path
Return path of the model.
Parameters:
-
model_key
(
str) –Unique key of the model.
Raises:
-
ModelNavigatorNotFoundError–When model not found.
Returns:
Source code in model_navigator/package/package.py
get_runner
Get the runner according to the strategy.
Parameters:
-
strategy
(
Optional[RuntimeSearchStrategy]) –Strategy for finding the best runtime. Defaults to
MaxThroughputAndMinLatencyStrategy. -
include_source
(
bool) –Flag if Python based model has to be included in analysis
-
return_type
(
TensorType) –The type of the output tensor. Defaults to
TensorType.NUMPY. If the return_type supports CUDA tensors (e.g. TensorType.TORCH) and the input tensors are on CUDA, there will be no additional data transfer between CPU and GPU.
Returns:
-
NavigatorRunner–The optimal runner for the optimized model.
Source code in model_navigator/package/package.py
is_empty
Validate if package is empty - no models were produced.
Returns:
-
bool–True if empty package, False otherwise.
Source code in model_navigator/package/package.py
load_source_model
Load model defined in Python code.
Parameters:
-
model
(
object) –A model object