OP_LOGE_FOR_INVALID_SHAPESIZES_WITH_REASON

Description

Records and reports multiple parameter shape size errors (with causes). If multiple operator parameters have incorrect shape sizes, an error log (including the specific causes) is generated and the error code EZ0016 is reported.

Prototype

OP_LOGE_FOR_INVALID_SHAPESIZES_WITH_REASON(entityName, paramNames, incorrectSizes, 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.

incorrectSizes

Input

Actual shape size 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
10
// Expected output: Parameters query, key, cos and sin of ApplyRotaryPosEmb have incorrect shape sizes
//          0, 0, 0 and 0. Reason: All inputs must be non-empty tensors.
if (qSize == 0 || kSize == 0 || cSize == 0 || sSize == 0) {
    std::string sizeMsg = std::to_string(qSize) + ", " + std::to_string(kSize) + ", " +
        std::to_string(cSize) + " and " + std::to_string(sSize);
    OP_LOGE_FOR_INVALID_SHAPESIZES_WITH_REASON("ApplyRotaryPosEmb",
        "query, key, cos and sin", sizeMsg.c_str(),
        "All inputs must be non-empty tensors.");
    return ge::GRAPH_FAILED;
}