OP_LOGE_FOR_INVALID_SHAPE

Description

Records and reports a parameter shape error. If the specified parameter shape of an operator is not as expected, an error log is generated and the error code EZ0008 is reported.

Prototype

OP_LOGE_FOR_INVALID_SHAPE(entityName, paramName, incorrectShape, correctShape)

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,128]. The type can be const char* or std::string.

correctShape

Input

Expected shape, in the format of [1,256,256]. 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: Parameter y of Ger has incorrect shape [128]. It should be [32,64].
if (yShape.GetDimNum() != 2) {
    std::string incorrectShape = Ops::Base::ToString(yShape);
    OP_LOGE_FOR_INVALID_SHAPE("Ger", "y", incorrectShape.c_str(), "[32,64]");
    return ge::GRAPH_FAILED;
}