OP_LOGE_FOR_INVALID_SHAPEDIM
Description
Records and reports a parameter shape dimension error. If the specified parameter shape dimension of an operator is not as expected, an error log is generated and the error code EZ0011 is reported.
Prototype
OP_LOGE_FOR_INVALID_SHAPEDIM(entityName, paramName, incorrectDim, correctDim)
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. |
incorrectDim |
Input |
Actual dimension (for example, 3D). The type can be const char* or std::string. |
correctDim |
Input |
Expected dimension (for example, 4D). 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 x of SoftmaxV2 has incorrect shape dim 5D. It should be less than // or equal to 4. if (xShape.GetDimNum() > 4) { std::string dimStr = std::to_string(xShape.GetDimNum()) + "D"; OP_LOGE_FOR_INVALID_SHAPEDIM("SoftmaxV2", "x", dimStr.c_str(), "less than or equal to 4"); return ge::GRAPH_FAILED; } |
Parent topic: log