OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON

Description

Records and reports a parameter shape error (with a cause). If an operator parameter has an incorrect shape, an error log (including the specific cause) is generated and the error code EZ0009 is reported.

Prototype

OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON(entityName, paramName, incorrectShape, reason)

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.

incorrectShape

Input

Actual shape, in the format of [1,128]. 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: Parameter indices 0th tensor of DynamicStitch has incorrect shape [2,-1,128].
//          Reason: The input indices's tensor has negative dimension.
if (hasNegativeDim) {
    OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON("DynamicStitch",
        "indices 0th tensor", "[2,-1,128]",
        "The input indices's tensor has negative dimension.");
    return ge::GRAPH_FAILED;
}