Contenuto principale

qnn.getNetworkProperties

Read values for properties defined in QNN model or QNN context binary file

Since R2025b

Description

qnn.getNetworkProperties("QNN-Model", QNNHostModel) reads values of input layer and output layer properties defined in the specified QNN host model file (which is used while creating qnn.HTP or qnn.CPU System object) and returns a structure of values. This syntax is valid for Windows and Linux host.

example

qnn.getNetworkProperties("BINARY", QNNContextBinary,Backend="HTP",ProcessorVersion=VersionNumber) reads values of input layer and output layer properties defined in QNN context binary file (which is used while creating qnn.HTP System object) for the specified HTP processor version and returns a structure of values. This syntax is valid for Linux host only.

qnn.getNetworkProperties("BINARY", QNNContextBinary,Backend="LPAI",LPAIVersion=VersionNumber) reads values of input layer and output layer properties defined in QNN context binary file (which is used while creating qnn.LPAI System object) for the specified LPAI version and returns a structure of values. This syntax is valid for Linux host only.

Examples

collapse all

Copy the QNN model (for example, LibInspection.dll) to Current Folder in MATLAB.

Use qnn.getNetworkProperties function to read the properties from that file.

qnnNet = qnn.getNetworkProperties("QNN-Model" , "LibInspection.dll")
qnnNet =

  struct with fields:

     InputLayer: [1×1 struct]    
     OutputLayer: [1×1 struct]

Read the input layer properties.

qnnNet.InputLayer
ans =

  struct with fields:

           TensorCount: 1
           TensorDimensions: {[1 299 299 3]}
           TensorDataType: {'single'}
           QuantizationScale: {[0]}
           QuantizationOffset: {[0]}

Read the output layer properties.

qnnNet.OutputLayer
ans =

  struct with fields:

           TensorCount: 1
           TensorDimensions: {[1 1001]}
           TensorDataType: {'single'}
           QuantizationScale: {[0]}
           QuantizationOffset: {[0]}

Input Arguments

collapse all

The format of deep learning network optimized to run on the specified backend on the target, specified as a string.

Data Types: string

Specify the QNN model, either compiled shared object (.so) for Linux or .dll for Windows, used for creating qnn.HTP or qnn.CPU System Objects. For details on creating an QNN model to run on device processors, refer to Qualcomm AI Engine Direct SDK documentation.

If the QNN model is not present in the Current Folder in MATLAB, specify the absolute path along with the filename.

Data Types: string

Specify the QNN context binary file (.bin) on the target used for creating qnn.HTP or qnn.LPAI System Objects. For details on creating an binary file to run on device processors, refer to Qualcomm AI Engine Direct SDK documentation.

If the QNN context binary file is not present in the Current Folder in MATLAB, specify the absolute path along with <filename>.bin

Data Types: string

QNN backend used for inference, specified as a string. The selected backend must match the type of QNN context binary generated by the QNN SDK tools.

Dependencies

To enable this argument, set the DLNetworkFormat argument to "BINARY".

Data Types: string

Version of the Hexagon processor for HTP backend, specified as a string.

Example: qnn.getNetworkProperties("BINARY","serialized.bin",Backend="HTP",ProcessorVersion="v68");

Dependencies

To enable this argument, set the DLNetworkFormat argument to "BINARY" and Backend argument to "HTP".

Data Types: string

Version of LPAI backend to perform inference, specified as a string.

Example: qnn.getNetworkProperties("BINARY","serialized.bin",Backend="LPAI",LPAIVersion="v6");

Dependencies

To enable this argument, set the DLNetworkFormat argument to "BINARY" and Backend argument to "LPAI".

Data Types: string

Version History

Introduced in R2025b