GetDataTypeLength
【免费下载链接】metadef Ascend Metadata Definition 项目地址: https://gitcode.com/cann/metadef
函数功能
获取数据类型所占内存大小。
使用该接口需要包含type_utils.h头文件。
#include "graph/utils/type_utils.h"
函数原型
static bool GetDataTypeLength(const ge::DataType data_type, uint32_t &length)
参数说明
返回值说明
获取成功时返回true;data_type不支持时返回false。
约束说明
无。
调用示例
uint32_t type_length;
ge::DataType data_type = ge::DT_INT8;
const bool ret = ge::TypeUtils::GetDataTypeLength(data_type, type_length); // type_length 1
if (!ret) {
// ...
}
【免费下载链接】metadef Ascend Metadata Definition 项目地址: https://gitcode.com/cann/metadef
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考



