OP_LOGE_WITH_INVALID_INPUT_SHAPE
Note: This API has been deprecated. Use OP_LOGE_FOR_INVALID_SHAPE instead.
Description
Records and reports an operator input shape error. If the specified input tensor shape of an operator is not as expected, an error log is generated and the error code EZ0001 is reported.
Prototype
OP_LOGE_WITH_INVALID_INPUT_SHAPE(entityName, index, incorrectShape, correctShape)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
entityName |
Input |
Operator name or aclnn API name. The type can be const char* or std::string. |
index |
Input |
Input tensor index (starting from 0) of int type. |
incorrectShape |
Input |
Actual input shape, in the format of [1,128,128]. The type can be const char* or std::string. |
correctShape |
Input |
Expected input shape, in the format of [1,256,256]. 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: The 0th input of MatMul has incorrect shape [128,128]. It should be [256,512]. const gert::Shape expectedShape({256, 512}); if (inputShape != expectedShape) { std::string incorrectShape = Ops::Base::ToString(inputShape); OP_LOGE_WITH_INVALID_INPUT_SHAPE("MatMul", 0, incorrectShape.c_str(), "[256,512]"); return ge::GRAPH_FAILED; } |
Parent topic: log