aclmdlGetOpAttr

Description

Obtains the value of an operator attribute on a network.

Prototype

const char *aclmdlGetOpAttr(aclmdlDesc *modelDesc, const char *opName, const char *attr)

Parameters

Parameter

Input/Output

Description

modelDesc

Input

Pointer to data of the aclmdlDesc type.

Call aclmdlCreateDesc to create data of the aclmdlDesc type in advance, and then call aclmdlGetDesc to obtain the data of the aclmdlDesc type based on the model ID.

opName

Input

Pointer to the operator name.

attr

Input

Pointer to the operator attributes.

Currently, only the _datadump_original_op_names attribute is supported, which records the base operators before fusion. The API return is formatted as [opName1_len]opName1...[opNameN_len]opNameN, where opNameN_len indicates the length of the operator name string.

In the following example of the _datadump_original_op_names attribute, the base operators are scale2c_branch2c, bn2c_branch2c, res2c_branch2c, res2c, and res2c_relu and the lengths of the operator name strings are 16, 13, 14, 5, and 10.

[16]scale2c_branch2c[13]bn2c_branch2c[14]res2c_branch2c[5]res2c[10]res2c_relu

Returns

Success: a pointer to the string of the attribute value. The pointer has the same lifetime as modelDesc. When modelDesc is destroyed, the content to which the pointer points is automatically destroyed. If the opName or attr attribute does not exist, or the value of the attr attribute is empty, a pointer to a null string is returned.

Failure: nullptr.