OP_LOGE_FOR_INVALID_TENSORNUMS_WITH_REASON

Description

Records and reports multiple parameter tensor count errors (with causes). If multiple operator parameters have incorrect tensor counts, an error log (including the specific causes) is generated and the error code EZ0023 is reported.

Prototype

OP_LOGE_FOR_INVALID_TENSORNUMS_WITH_REASON(entityName, paramNames, incorrectNums, reason)

Parameters

Parameter

Input/Output

Description

entityName

Input

Operator name or aclnn API name. The type can be const char* or std::string.

paramNames

Input

Parameter name list. The type can be const char* or std::string.

incorrectNums

Input

Actual tensor count list. 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
9
// Expected output: Parameters lse and go of AttentionUpdate have invalid tensor nums 4 and 4.
//          Reason: The number of tensors in input lse and go should be twice the attr sp, where sp is 2.
if (lseCount != sp * 2 || goCount != sp * 2) {
    std::string numMsg = std::to_string(lseCount) + " and " + std::to_string(goCount);
    OP_LOGE_FOR_INVALID_TENSORNUMS_WITH_REASON("AttentionUpdate", "lse and go",
        numMsg.c_str(),
        "The number of tensors in input lse and go should be twice the attr sp, where sp is 2.");
    return ge::GRAPH_FAILED;
}