data_type_utils

表1 接口列表

接口定义

功能说明

IsComplexType(const ge::DataType type)

检查返回是不是复数类型。

IsFloatingType(const ge::DataType type)

检查返回是不是浮点类型。

IsIntegralType(const ge::DataType type)

检查返回是不是整数类型。

IsIntegralType(const ge::DataType type, const bool include_bool)

参数include_bool表明是否将bool类型当做整数类型,然后返回参数type是不是整数类型。

CanCast(const ge::DataType from, const ge::DataType to)

返回参数from时候可以转换成to。

PromoteType(ge::DataType type_a, ge::DataType type_b)

推导type_a类型和type_b类型做运算,如需类型提升,理论上应该提升到什么数据类型。