Function: get_op_attr
C Prototype |
const char *aclmdlGetOpAttr(aclmdlDesc *modelDesc, const char *opName, const char *attr) |
|---|---|
Python Function |
attrValue = acl.mdl.get_op_attr(modelDesc, opName, attr) |
Function Usage |
Obtains the value of an operator attribute on a network. |
Input Description |
modelDesc: int, pointer address of the data of the aclmdlDesc type. Call acl.mdl.create_desc to create data of the aclmdlDesc type in advance, and then call acl.mdl.get_desc to obtain the data of the aclmdlDesc type based on the model ID. opName: str, operator name. attr: str, operator attribute. 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 |
Return Value |
attrValue: str, attribute value. If the opName or attr attribute does not exist, or the attr attribute value is empty, an empty string is returned. Failure: None. |
Restrictions |
None |