OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON

Description

Records and reports multiple parameter data type errors (with causes). If multiple operator parameters have incorrect data types, an error log (including the specific causes) is generated and the error code EZ0021 is reported.

Prototype

OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON(entityName, paramNames, incorrectDtypes, 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.

incorrectDtypes

Input

Actual data type 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
// Expected output: Parameters cos and dy of RotaryPositionEmbeddingGrad have incorrect dtypes
//          FLOAT16 and FLOAT32. Reason: The dtypes of input cos and input dy should be the same.
if (cosDtype != dyDtype) {
    std::string dtypeMsg = Ops::Base::ToString(cosDtype) + " and " + Ops::Base::ToString(dyDtype);
    OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON("RotaryPositionEmbeddingGrad", "cos and dy",
        dtypeMsg.c_str(), "The dtypes of input cos and input dy should be the same.");
    return ge::GRAPH_FAILED;
}