Function: repo_add

Applicable Products

Product

Supported (√/x)

Ascend 950PR / Ascend 950DT

x

Atlas A3 training products / Atlas A3 inference products

x

Atlas A2 training products / Atlas A2 inference products

x

Atlas training products

x

Atlas inference products

√

Atlas 200I/500 A2 inference products

x

Function Usage

Adds a repository, or adds features to an existing repository. In this section, 1:N indicates the number of search requests divided by the number of base libraries. N:M is used to compare the similarity between two libraries.

The Atlas inference accelerator module in the Atlas inference products does not support this API.

Prototype

  • C Prototype
    1
    aclError aclfvRepoAdd(aclfvSearchType type, aclfvFeatureInfo *featureInfo)
    
  • Python Function
    1
    ret = acl.fv.repo_add(type, feature_info)
    

Parameter Description

Parameter

Description

type

Int, search type. For details, see aclfvSearchType.

feature_info

Int, address of the pointer that points to feature description. Call acl.fv.create_feature_info to create data of the aclfvFeatureInfo type in advance.

Return Value Description

Return Value

Description

ret

Int, error code.

Restrictions

  • In 1:N mode, ensure that the offsets in the aclfvFeatureInfo dictionary are consecutive for each repository. In N:M mode, if the offset is not 0, an error is reported.
  • This API is not thread-safe. In N:M mode, multithreaded adding, search, or deletion is not allowed.
  • This API call automatically creates a stream for synchronous task execution within the API. When the tasks are complete, the stream is automatically destroyed.

    Hardware has restrictions on the total number of streams. For details, see Function: create_stream.

Reference

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