OP_LOGE_WITH_INVALID_ATTR

Note: This API has been deprecated. Use OP_LOGE_FOR_INVALID_VALUE instead.

Description

Records and reports an operator attribute value error. If the specified attribute value of an operator is not as expected, an error log is generated and the error code EZ0002 is reported.

Prototype

OP_LOGE_WITH_INVALID_ATTR(entityName, attrName, incorrectVal, correctVal)

Parameters

Parameter

Input/Output

Description

entityName

Input

Operator name or aclnn API name. The type can be const char* or std::string.

attrName

Input

Attribute name. The type can be const char* or std::string.

incorrectVal

Input

Actual attribute value. The type can be const char* or std::string.

correctVal

Input

Expected attribute value. The type can be const char* or std::string.

Return Value

None.

Constraints

None.

Example

The following sample code is for reference only. Do not copy and run it.

1
2
3
4
5
// Expected output: Attribute axis of MyOp has incorrect value 3. It should be 0 or 1.
if (axis_ != "0" && axis_ != "1") {
    OP_LOGE_WITH_INVALID_ATTR("MyOp", "axis", std::to_string(axis_), "0 or 1");
    return false;
}