OP_LOGE_FOR_INVALID_SHAPESIZE

Description

Records and reports a parameter shape size error. If the specified parameter shape size (total number of elements) of an operator is not as expected, an error log is generated and the error code EZ0014 is reported.

Prototype

OP_LOGE_FOR_INVALID_SHAPESIZE(entityName, paramName, incorrectSize, correctSize)

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.

incorrectSize

Input

Actual shape size (total number of elements). The type can be const char* or std::string.

correctSize

Input

Expected shape size (total number of elements). 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: Parameter group_index of SwigluMxQuantWithDualAxis has incorrect shape size 0.
//          It should be > 0.
if (groupIndexShape.GetShapeSize() == 0) {
    OP_LOGE_FOR_INVALID_SHAPESIZE("SwigluMxQuantWithDualAxis", "group_index",
        std::to_string(groupIndexShape.GetShapeSize()), "> 0");
    return ge::GRAPH_FAILED;
}