OP_LOGE_FOR_INVALID_FORMATS_WITH_REASON
Description
Records and reports multiple parameter format errors (with causes). If multiple operator parameters have incorrect formats, an error log (including the specific causes) is generated and the error code EZ0018 is reported.
Prototype
OP_LOGE_FOR_INVALID_FORMATS_WITH_REASON(entityName, paramNames, incorrectFormats, reason)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
entityName |
Input |
Operator name or aclnn API name. The type can be const char* or std::string. |
paramNames |
Input |
Parameter name list. The type can be const char* or std::string. |
incorrectFormats |
Input |
Actual format list. The type can be const char* or std::string. |
reason |
Input |
Error cause description. 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 7 8 | // Expected output: Parameters x and y of OperatorName have incorrect formats ND and NCHW. // Reason: The formats of all inputs must match. if (xFormat != yFormat) { std::string formatMsg = Ops::Base::ToString(xFormat) + " and " + Ops::Base::ToString(yFormat); OP_LOGE_FOR_INVALID_FORMATS_WITH_REASON("OperatorName", "x and y", formatMsg.c_str(), "The formats of all inputs must match."); return ge::GRAPH_FAILED; } |
Parent topic: log