Function: get_output_name_by_index

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Function Usage

Obtains the output operator name, operator output edge index, top name, or output name of a model output based on the model description.

Prototype

  • C Prototype
    1
    const char *aclmdlGetOutputNameByIndex(const aclmdlDesc *modelDesc, size_t index)
    
  • Python Function
    1
    output_name = acl.mdl.get_output_name_by_index(model_desc, index)
    

Parameters

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.

index

Int, sequence number of the input to obtain, indexed starting at 0

Returns

Return Value

Description

output_name

Str, the output name.

The output operator name, operator output edge index, top name, or output name. The format of the return value obtained by calling this API varies according to the original network and modeling method.

  • Caffe
    The format of the return value is as follows, in which items are separated by colons (:). A top name is returned only when the model contains one.
    output operator name:operator output edge index:top name
  • TensorFlow
    • When the ATC tool is used to build an OM model, the return value format is as follows. The items are separated by colons (:).
      output operator name:operator output edge index
    • When the graph APIs are used to build an OM model, the return value format is as follows. The items are separated by underscores (_).
      output_network output index_output operator name_operator output edge index
  • ONNX

    The format of the return value is as follows, in which items are separated by colons (:).

    output operator name:operator output edge index:output name

    In the process of building an OM model, the output name is included in the return value in the following cases:

    • Do not specify the output operator name or output name in the network model. (The system automatically obtains the output name from the original model.)
    • Specify only the name of the output in the network model.
    During OM modeling using graph APIs, if the output operator name in the network model is specified, the format of the return value is as follows, in which items are separated by underscores (_):
    output_network output index_output operator name_operator output edge index