FormatToSerialString

Function Usage

Converts a value of the Format type into a string.

In GCC 5.1 and later versions, libstdc++ changes some APIs of std::string and std::list to better implement C++11 specifications. As a result, the ABI of the old and new versions are incompatible. Therefore, it is recommended that this API should be replaced with FormatToAscendString.

To use this API, the type_utils.h header file must be included.

1
#include "graph/utils/type_utils.h"

Prototype

1
static std::string FormatToSerialString(const Format format)

Parameters

Parameter

Input/Output

Description

format

Input

Format to be converted. For details about the supported formats, see Format.

Returns

Format string after conversion

Constraints

None

Examples

1
2
ge::Format format = ge::Format::FORMAT_NHWC;
auto format_str = ge::TypeUtils::FormatToSerialString(format); // "NHWC"