OP_LOGE_FOR_INVALID_TENSORNUM
Description
Records and reports a parameter tensor count error. If the specified parameter tensor count of an operator is not as expected, an error log is generated and the error code EZ0022 is reported.
Prototype
OP_LOGE_FOR_INVALID_TENSORNUM(entityName, paramName, incorrectNum, correctNum)
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. |
incorrectNum |
Input |
Actual tensor count, of int64_t type. |
correctNum |
Input |
Expected tensor count. 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 instance of Foreach has invalid tensor num 1000. // It should be within the range [1, 950]. if (tensorCount > MAX_COUNT || tensorCount <= 0) { OP_LOGE_FOR_INVALID_TENSORNUM("Foreach", "instance", static_cast<int64_t>(tensorCount), ("within the range [1, " + std::to_string(MAX_COUNT) + "]").c_str()); return ge::GRAPH_FAILED; } |
Parent topic: log