Function: create_feature_info

Applicable Products

Product

Supported (√/x)

Ascend 950PR&950DT products

x

Atlas A3 products

x

Atlas A2 products

x

Atlas training products

x

Atlas inference products

√

Atlas 200I/500 A2 inference products

x

Description

Creates data of the aclfvFeatureInfo type as a feature description.

To destroy data of the aclfvFeatureInfo type, call Function: destroy_feature_info.

This API is not supported for Atlas inference accelerator modules in Atlas inference products.

Prototype

  • C Prototype
    1
    aclfvFeatureInfo *aclfvCreateFeatureInfo(uint32_t id0, uint32_t id1, uint32_t offset, uint32_t featureLen,uint32_t featureCount, uint8_t *featureData, uint32_t featureDataLen)
    
  • Python Function
    1
    feature_info = acl.fv.create_feature_info(id0, id1, offset, feature_len, feature_count, feature_data, feature_len)
    

Parameters

Parameter

Description

id0

Int, repository 0 ID. Must be within [0, 1023]. Defaults to 0 in N:M mode. id0 and id1 together identify a repository.

id1

Int, repository 1 ID. Must be within [0, 1023]. Defaults to 0 in N:M mode. id0 and id1 together identify a repository.

offset

Int, offset of the first feature to be added in the repository. The offset value must be the same as the number of features added to the repository. Defaults to 0 in N:M mode.

feature_len

Int, feature length, fixed at 36 bytes. The system verifies the length internally.

feature_count

Int, number of features, up to 1 million in 1:N mode or up to 10 million in N:M mode.

feature_data

Int, feature values, which are stored contiguously based on the feature length. The first 4 bytes of each feature are 0.

feature_len

Int, length of the memory allocated to featureData, which is used for verification.

Return Values

Return Value

Description

feature_info

Int, pointer address.

  • Data of the aclfvFeatureInfo type: success
  • 0: failure

Reference

For details about the API call sequence and sample code, see Feature Vector Search.