# QNN HTP Op Package - Common Default Package Ops Usage Examples

- [Add](https://docs.qualcomm.com/doc/80-63442-10/topic/common_default_package_ops_usage_examples.html#native-ops-usage-add)
- [Reshape](https://docs.qualcomm.com/doc/80-63442-10/topic/common_default_package_ops_usage_examples.html#native-ops-usage-reshape)

## Add

Add two tensors element-wise

**Usage Hint**

**Syntax**

/*
     * In1             -  Input tensor1
     * In2             -  Input tensor2
     */
     Op(FROM_DEFAULT_PACKAGE("Add"), "In1", "In2")
    Copy to clipboard

**Example**

# we can combine a Matmul Op followed by an Add to a new Matmul_bias op
    DEF_PACKAGE_OPTIMIZATION(Fraph,
     Op("Add", Op("Matmul", "A", "B"), "Bias"),
     OK,
     Op("Matmul_bias", "A", "B", "Bias")
     )
    Copy to clipboard

## Reshape

Reshapes a tensor from one dimension to another

**Usage Hint**

Often used with WITH\_SIZE(gen\_Shape(X,X,X,X)) to determine the output tensor dimension

**Syntax**

/*
     * In             -  Input tensor
     *
     */
     Op(FROM_DEFAULT_PACKAGE("Reshape"), "In")
    Copy to clipboard

**Example**

# We can reshape input tensor into seme shape that Relu_1x1x1xd Op like
    DEF_PACKAGE_OPTIMIZATION(TILING,
     Op("Relu", "In"),
     OK,
     Op("Relu_1x1x1xd", WITH_SIZE(
       WITH_SIZE(gen_Shape(1,1,1,MUL(DIM_BATCH("In"),DIM_HEIGHT("In"),DIM_WIDTH("In"),DIM_DEPTH("In"))),
         Op(FROM_DEFAULT_PACKAGE("Reshape"),"In")
       )
     )
    )
    Copy to clipboard

Last Published: Jun 04, 2026

[Previous Topic
Qualcomm Hexagon Plugin Interface](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/htp_qhpi.md) [Next Topic
QNN HTP Optimization Utility Functions Usage Examples](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/common_optimization_utility_funcs_usage_examples.md)