IsComplexType

Function Usage

Checks whether the input data is of complex type, including Complex128, Complex64, and Complex32.

Prototype

bool IsComplexType(const DataType dtype)

Parameters

Parameter

Input/Output

Description

dtype

Input

Input data type.

Returns

true: complex; false: otherwise.

Constraints

None

Example

1
2
3
4
5
6
// If dtype is not a complex number, a return statement is executed.
void Func(const DataType dtype) {
    if (!IsComplexType(dtype)) {
        return;
    }
}