InitWithQuantify
API definition |
APP_ERROR InitWithQuantify(uint32_t deviceId, uint32_t dim, uint32_t tokenNum, uint64_t resources, const float *scale, AlgorithmType algType = AlgorithmType::FLAT_IP_FP16, uint32_t customAttrLen = 0, uint32_t customAttrBlockSize = 0); |
|---|---|
Function |
Initializes vectors with quantization. |
Input |
uint32_t deviceId: device ID used by the Index. uint32_t dim: vector dimension. uint32_t tokenNum: maximum number of tokens in the spatiotemporal database. The value must be the same as the number of tokens of the corresponding mask operator. uint64_t resources: size of the shared memory. const float *scale: scaling factor for vectorization. The scaling factor needs to be multiplied by the vector and then converted into the int8_t type. AlgorithmType algType: distance comparison algorithm used at the bottom layer. The default value is AlgorithmType:: FLAT_IP_FP16, indicating FP16Flat (IP distance). Currently, this algorithm is only supported. uint32_t customAttrLen: length of a custom attribute uint32_t customAttrBlockSize: block size of a custom attribute |
Output |
N/A |
Return value |
APP_ERROR: return status. For details, see Return Code Reference. |
Restrictions |
|