OP_LOGE_WITH_INVALID_INPUT_DTYPE

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

Description

Records and reports an operator input data type error. If the specified input parameter data type of an operator is not as expected, an error log is generated and the error code EZ0007 is reported.

Prototype

OP_LOGE_WITH_INVALID_INPUT_DTYPE(entityName, paramName, dataDtype, expectedDtypeList)

Parameters

Parameter

Input/Output

Description

entityName

Input

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

paramName

Input

Input parameter name. The type can be const char* or std::string.

dataDtype

Input

Actual data type (for example, INT32). The type can be const char* or std::string.

expectedDtypeList

Input

List of expected data types (for example, "FLOAT16, FLOAT"). 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: Input parameter x of SoftmaxV2 has incorrect dtype INT32. It should be FLOAT, FLOAT16 or BF16.
if (dtype_ != FLOAT && dtype_ != FLOAT16 && dtype_ != BF16) {
    OP_LOGE_WITH_INVALID_INPUT_DTYPE("SoftmaxV2", "x",
        Ops::Base::ToString(dtype_).c_str(), "FLOAT, FLOAT16 or BF16");
    return ge::GRAPH_FAILED;
}