Function Snpe_Util_Convert_TfNToFloat32

Function Documentation

bool Snpe_Util_Convert_TfNToFloat32(const void *inputBuffer, size_t inputBufferSizeBytes, float scale, uint64_t offset, float *outputBuffer, size_t outputBufferSizeBytes, unsigned bitWidth)

Converts/De-Quantizes an unsigned fixed point 8/16 bit buffer to a float32 buffer.

Parameters
  • inputBuffer[in] Pointer to the unsigned fixed point 8/16 bit buffer that the caller supplies

  • inputBufferSizeBytes[in] Input buffer size, in bytes

  • [in/out] – scale Qunatization encoding scale to be passed in by the caller

  • [in/out] – offset Qunatization encoding offset to be passed in by the caller

  • outputBuffer[in] Pointer to the float32 buffer that the caller supplies

  • outputBufferSizeBytes[in] Output buffer size, in bytes. Must be large enough for all the inputs

  • bitWidth[in] Quantization bitwidth (8 or 16)

Note

This API CANNOT in place de-quantization. The input and output buffers must have no overlap