IsFloatingType
Description
Checks whether the input data is of floating-point type, including Float64 (Double), Float32 (Float), BFloat16, Float16, HiFloat8, Float8E5M2, Float8E4M3FN, Float8E8M0, Float6E3M2, Float6E2M3, Float4E2M1, and Float4E1M2.
Prototype
bool IsFloatingType(const ge::DataType type)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
type |
Input |
Input data type. |
Return Value
true: floating-point; false: otherwise.
Constraints
None
Example
1 2 3 4 5 6 | // If dtype is not a floating-point type, a return statement is executed. void Func(const DataType type) { if (!IsFloatingType(type)) { return; } } |
Parent topic: data_type_utils