Python API provides wrapper functions for C++ implemented library.
More...
|
| bool | maccel.model._is_valid_shape (_Shape input_shape, _Shape shape) |
| Optional[bool] | maccel.model._is_shape_hwc (List[np.ndarray] inputs, List[_Shape] shapes) |
| Tuple[int, bool] | maccel.model._find_matching_variant_idx_and_is_hwc (model, List[np.ndarray] inputs) |
| List[np.ndarray] | maccel.model._build_outputs (List[_Shape] shapes, bool is_hwc, np.dtype dtype) |
| None | maccel.model._check_output_shapes (List[np.ndarray] outputs, List[_Shape] shapes, bool is_hwc, np.dtype dtype) |
| Model | maccel.model.load (str path, Optional[ModelConfig] model_config=None) |
| | Single-step inference API.
|
| | maccel.type.set_log_level (LogLevel level) |
| bool | maccel.type.start_tracing_events (str path) |
| | Starts event tracing and prepares to save the trace log to a specified file.
|
| | maccel.type.stop_tracing_events () |
| | Stops event tracing and writes the recorded trace log.
|
| str | maccel.type.get_model_summary (str mxq_path) |
| | Generates a structured summary of the specified MXQ model.
|
Python API provides wrapper functions for C++ implemented library.
◆ _is_valid_shape()
| bool maccel.model._is_valid_shape |
( |
_Shape | input_shape, |
|
|
_Shape | shape ) |
|
protected |
◆ _is_shape_hwc()
| Optional[bool] maccel.model._is_shape_hwc |
( |
List[np.ndarray] | inputs, |
|
|
List[_Shape] | shapes ) |
|
protected |
◆ _find_matching_variant_idx_and_is_hwc()
| Tuple[int, bool] maccel.model._find_matching_variant_idx_and_is_hwc |
( |
| model, |
|
|
List[np.ndarray]
| inputs ) |
|
protected |
◆ _build_outputs()
| List[np.ndarray] maccel.model._build_outputs |
( |
List[_Shape] | shapes, |
|
|
bool | is_hwc, |
|
|
np.dtype
| dtype ) |
|
protected |
◆ _check_output_shapes()
| None maccel.model._check_output_shapes |
( |
List[np.ndarray] | outputs, |
|
|
List[_Shape] | shapes, |
|
|
bool | is_hwc, |
|
|
np.dtype
| dtype ) |
|
protected |
◆ load()
Single-step inference API.
Creates model and uploads the model into NPU immediately.
This operation performs the Accelerator declaration, Model declaration, and launch in a single step.
Definition at line 668 of file model.py.
◆ set_log_level()
| maccel.type.set_log_level |
( |
LogLevel | level | ) |
|
◆ start_tracing_events()
| bool maccel.type.start_tracing_events |
( |
str | path | ) |
|
Starts event tracing and prepares to save the trace log to a specified file.
The trace log is recorded in "Chrome Tracing JSON format," which can be viewed at https://ui.perfetto.dev/.
The trace log is not written immediately; it is saved only when stop_tracing_events() is called.
- Parameters
-
| [in] | path | The file path where the trace log should be stored. |
- Returns
- True if tracing starts successfully, False otherwise.
Definition at line 855 of file type.py.
◆ stop_tracing_events()
| maccel.type.stop_tracing_events |
( |
| ) |
|
Stops event tracing and writes the recorded trace log.
This function finalizes tracing and saves the collected trace data to the file specified when start_tracing_events() was called.
Definition at line 871 of file type.py.
◆ get_model_summary()
| str maccel.type.get_model_summary |
( |
str | mxq_path | ) |
|
Generates a structured summary of the specified MXQ model.
Returns an overview of the model contained in the MXQ file, including:
- Target NPU hardware
- Supported core modes and their associated cores
- The total number of model variants
- For each variant:
- Input and output tensor shapes
- A list of layers with their types, output shapes, and input layer indices
The summary is returned as a human-readable string in a table and is useful for inspecting model compatibility, structure, and input/output shapes.
- Parameters
-
| [in] | mxq_path | Path to the MXQ model file. |
- Returns
- A formatted string containing the model summary.
Definition at line 881 of file type.py.