# Example XML OpDef Configs This page outlines several example configuration files to be used with the `qnn-op-package-generator`. All examples are alterations of the example located at: ${QNN_SDK_ROOT}/examples/QNN/OpPackageGenerator/ExampleOpPackageHtp.xml Copy to clipboard Note the example configs use one Backend, while the qnn-op-package-generator currently supports only the HTP, DSP and CPU backends. ## Example Config #1 The following example defines an op package for HTP, which contains one operation named Softmax. This example config represents a case in which an operation is identical across backend and does not need any supplemental information. Softmax Computes data normalization exponentially on an input tensor given an optional positive scaling factor, beta. The computation is done element-wise per batch along the last dimension. See Softmax backend definition for supported datatypes and constraints per backend in[0] input activation true QNN_DATATYPE_UFIXED_POINT_8 QNN_DATATYPE_UFIXED_POINT_16 1 a tensor of N dimension out[0] output activation true QNN_DATATYPE_UFIXED_POINT_8 QNN_DATATYPE_UFIXED_POINT_16 1 a tensor of N dimension beta false QNN_DATATYPE_FLOAT_32 0 1.0 HTP Copy to clipboard Here, the Softmax operation defined has one input and one output. Each input and output is a vector, as indicated by the rank being 1, and is mandatory, meaning that a non-null value must be supplied for each input and output. Additionally, each input and output support QNN\_DATATYPE\_UFIXED\_POINT\_8 and QNN\_DATATYPE\_UFIXED\_POINT\_16 as datatypes for the HTP package. Note that multiple datatypes can be listed for the same tensor. In addition to the input and output, the Softmax operation has a parameter named beta. Beta is a scalar value, and unlike the activation tensors, it is not mandatory. If unspecified the default used for beta is 1.0. Beta is supported with a datatype of QNN\_DATATYPE\_FLOAT\_32. ## Example Config #2 The following example once again defines an op package for HTP, which contains one operation named Softmax. However, this example config represents a case in which an operation has some information that varies between the backends and requires supplemental information. Softmax Computes data normalization exponentially on an input tensor given an optional positive scaling factor, beta. The computation is done element-wise per batch along the last dimension. See Softmax backend definition for supported datatypes and constraints per backend in[0] input activation true BACKEND_SPECIFIC 1 a tensor of N dimension out[0] output activation true BACKEND_SPECIFIC 1 a tensor of N dimension beta false QNN_DATATYPE_FLOAT_32 0 1.0 HTP Softmax Softmax in[0] QNN_DATATYPE_UFIXED_POINT_8 QNN_DATATYPE_UFIXED_POINT_16 out[0] QNN_DATATYPE_UFIXED_POINT_8 QNN_DATATYPE_UFIXED_POINT_16 Copy to clipboard In this example, the abstract definition of the operation is the same as in the previous example. The Softmax operation contains one input, one output, and one parameter. This is different than the first example in that the datatype of the activation tensors varies across backend, as indicated with the BACKEND\_SPECIFIC field. This information is specified with the SupplementalOpDef’s. Note Backend specific information must be supplemented to use the `qnn-op-package-generator`. Here there is one SupplementalOpDefList for HTP as indicated by the Backend attribute of the SupplementalOpDefList. The HTP package supports both QNN\_DATATYPE\_UFIXED\_POINT\_8 and QNN\_DATATYPE\_UFIXED\_POINT\_16 datatypes for the activation tensors. Note that the HTP supplemental information does not specialize the parameter beta. This indicates that the HTP’s specification of beta is identical to that defined in the corresponding OpDef. Note that the backend support in this example is indicated with the SupportedOp list in the SupplementalOpDefList, instead of the BackendSupport element of the OpDef itself. Last Published: Oct 10, 2025 [Previous Topic Operation Definition Schema](https://docs.qualcomm.com/bundle/publicresource/80-63442-50/topics/op_def_schema.md) [Next Topic QNN Converter Op Package Code Generation](https://docs.qualcomm.com/bundle/publicresource/80-63442-50/topics/converter_op_package_gen_example.md)