OP_LOGE_FOR_INVALID_SHAPES_WITH_REASON

Description

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

Prototype

OP_LOGE_FOR_INVALID_SHAPES_WITH_REASON(entityName, paramNames, incorrectShapes, 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.

incorrectShapes

Input

Actual shape 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
11
// Expected output: Parameters indices 0th tensor and x 0th tensor of DynamicStitch have incorrect shapes
//          [2,3] and [4,5,6]. Reason: The shape of indices's tensor should match the shape formed by
//          the first 2 axes of x's corresponding tensor.
if (indicesShape != expectedShape) {
    std::string shapeMsg = Ops::Base::ToString(indicesShape) + " and " + Ops::Base::ToString(xShape);
    OP_LOGE_FOR_INVALID_SHAPES_WITH_REASON("DynamicStitch",
        "indices 0th tensor and x 0th tensor", shapeMsg.c_str(),
        "The shape of indices's tensor should match the shape formed by the "
        "first 2 axes of x's corresponding tensor.");
    return ge::GRAPH_FAILED;
}