Function: get_output_name_by_index

C Prototype

const char *aclmdlGetOutputNameByIndex(const aclmdlDesc *modelDesc, size_t index)

Python Function

output_name = acl.mdl.get_output_name_by_index(model_desc, index)

Function Usage

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

Input 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 be obtained, starting from 0.

Return Value

output_name: str, output name.

The output operator name, operator output edge index, and top name or output name are returned. 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
    • In scenarios where the ATC tool is used to build OM models, the format of the return value is as follows, in which items are separated by colons (:):
      output operator name:operator output edge index
    • In scenarios where Ascend Graph APIs are used to build OM models, 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
  • 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 Ascend 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

Restrictions

None