将op::DataType转换为对应的aclDataType。
aclDataType为AscendCL(Ascend Computing Language)对外提供的数据类型,op::DataType为aclnn定义的内部数据类型,实际使用的是GE定义的ge::DataType。
aclDataType ToAclDataType(DataType type)
参数 |
输入/输出 |
说明 |
||
---|---|---|---|---|
type |
输入 |
待转换的op::DataType。转换后的aclDataType定义如下:
aclDataType定义由AscendCL提供,具体参见aclDataType 。 |
返回aclDataType类型。
无
1 2 3 4 |
// 获取DT_FLOAT对应的aclDataType枚举 void Func() { aclDataType type = ToAclDataType(DT_FLOAT); } |