Function QnnTensor_updateGraphTensors

Function Documentation

Qnn_ErrorHandle_t QnnTensor_updateGraphTensors(Qnn_GraphHandle_t graph, const Qnn_Tensor_t **tensor, uint64_t numTensors)

Update a graph tensor with the new provided tensor information. Tensors provided here are associated with the tensor in the backend through the ID field. Valid fields to update are: data and quantization parameters for UPDATEABLE_STATIC tensors, quantization parameters for UPDATEABLE_NATIVE, UPDATEABLE_APP_READ, UPDATEABLE_APP_WRITE, and UPDATEABLE_APP_READWRITE tensors. Multiple calls to QnnTensor_updateGraphTensors() can be made, but the updates will not take effect until QnnGraph_finalize() is called. Backends may support a subset of updateable tensor types.

Returns

Error code:

  • QNN_SUCCESS: Successfully updated the graph tensors

  • QNN_TENSOR_ERROR_INVALID_HANDLE: Provided graph handle is invalid

  • QNN_TENSOR_ERROR_INVALID_TENSOR_PARAM: One or more tensor parameters is invalid

  • QNN_TENSOR_ERROR_UNSUPPORTED_TENSOR_PARAM: One or more tensor parameters are unsupported

  • QNN_GRAPH_ERROR_GRAPH_NOT_FINALIZED: graph needs to be finalized before updating graph tensors.

  • QNN_COMMON_ERROR_MEM_ALLOC: Failure in creating tensor due to issues with memory allocation

  • QNN_TENSOR_ERROR_INCOMPATIBLE_TENSOR_UPDATE: provided tensor is invalid and cannot be applied as an update.

  • QNN_TENSOR_ERROR_UNSUPPORTED_FEATURE: some API feature is not supported yet