OP_LOGE_FOR_INVALID_SHAPESIZE_WITH_REASON
Description
Records and reports a parameter shape size error (with a cause). If an operator parameter has an incorrect shape size, an error log (including the specific cause) is generated and the error code EZ0015 is reported.
Prototype
OP_LOGE_FOR_INVALID_SHAPESIZE_WITH_REASON(entityName, paramName, incorrectSize, reason)
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. |
incorrectSize |
Input |
Actual shape size (total number of elements). 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: Parameter y of ResizeLinear has incorrect shape size [144,144,1]. // Reason: The linear-dimension of output y must be equal to value (256) of input parameter size. if (yShape.GetShapeSize() != expectedSize) { OP_LOGE_FOR_INVALID_SHAPESIZE_WITH_REASON("ResizeLinear", "y", Ops::Base::ToString(yShape), "The linear-dimension of output y must be equal to value (256) of input parameter size."); return ge::GRAPH_FAILED; } |
Parent topic: log