aclmdlGetOpAttr

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

Obtains the attribute value of an operator in a model on the 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

Pointer to the attribute value string. The lifetime of the pointer is the same as that of modelDesc. If 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.

If the call fails, nullptr is returned.