OP_LOGE_FOR_INVALID_VALUE

Description

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

Prototype

OP_LOGE_FOR_INVALID_VALUE(entityName, paramName, incorrectValue, correctValue)

Parameters

Parameter

Input/Output

Description

entityName

Input

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

paramName

Input

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

incorrectValue

Input

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

correctValue

Input

Expected parameter 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
6
// Expected output: Parameter sp of AttentionUpdate has incorrect value 17. It should be
//          in range of [1, 16].
if (sp_ < 1 || sp_ > 16) {
    OP_LOGE_FOR_INVALID_VALUE("AttentionUpdate", "sp", std::to_string(sp_), "in range of [1, 16]");
    return ge::GRAPH_FAILED;
}