OP_LOGE_WITH_INVALID_INPUT_SHAPESIZE

Note: This API has been deprecated. Use OP_LOGE_FOR_INVALID_SHAPESIZE instead.

Description

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

Prototype

OP_LOGE_WITH_INVALID_INPUT_SHAPESIZE(entityName, index, incorrectSize, correctSize)

Parameters

Parameter

Input/Output

Description

entityName

Input

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

index

Input

Input tensor index (starting from 0) of int type.

incorrectSize

Input

Actual shape size. The type can be const char* or std::string.

correctSize

Input

Expected shape size. 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
// Expected output: The 0th input of MyOp has incorrect shape size 1024. It should be 2048.
if (xShape.GetShapeSize() != 2048) {
    OP_LOGE_WITH_INVALID_INPUT_SHAPESIZE("MyOp", 0,
        std::to_string(xShape.GetShapeSize()), "2048");
    return false;
}