将Format类型值转化为字符串表达。
使用该接口需要包含type_utils.h头文件。
1 | #include "graph/utils/type_utils.h" |
1 | static AscendString FormatToAscendString(const Format &format) |
参数 |
输入/输出 |
说明 |
---|---|---|
format |
输入 |
待转换的Format,支持的Format请参考Format。 |
转换后的Format字符串,AscendString类型。
无。
1 2 3 | ge::Format format = ge::Format::FORMAT_NHWC; auto format_str = ge::TypeUtils::FormatToAscendString(format); const char *ptr = format_str.GetString(); |