OP_LOGE_FOR_INVALID_FORMAT
Description
Records and reports a parameter format error. If the specified parameter format of an operator is not as expected, an error log is generated and the error code EZ0017 is reported.
Prototype
OP_LOGE_FOR_INVALID_FORMAT(entityName, paramName, incorrectFormat, correctFormat)
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. |
incorrectFormat |
Input |
Actual format (for example, NHWC). The type can be const char* or std::string. |
correctFormat |
Input |
Expected format (for example, NCHW). 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 | // Expected output: Parameter x of ResizeBilinearV2 has incorrect format ND. It should be // NCHW or NHWC. if (format_ != ge::FORMAT_NCHW && format_ != ge::FORMAT_NHWC) { OP_LOGE_FOR_INVALID_FORMAT("ResizeBilinearV2", "x", Ops::Base::ToString(format_).c_str(), "NCHW or NHWC"); return ge::GRAPH_FAILED; } |
Parent topic: log