Function: get_output_index_by_name

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Function Usage

Obtains the index of a model output based on the output name.

Prototype

  • C Prototype
    1
    aclError aclmdlGetOutputIndexByName(const aclmdlDesc *modelDesc, const char *name, size_t *index)
    
  • Python Function
    1
    index, ret = acl.mdl.get_output_index_by_name(model_desc, name)
    

Parameter Description

Parameter

Description

model_desc

Int, pointer address of the data of the aclmdlDesc type.

Call acl.mdl.create_desc to create data of the aclmdlDesc type in advance.

name

Str, input name.

Return Value Description

Return Value

Description

index

Int, index of the output to obtain.

ret

Int, error code.