DataTypeToSerialString

Description

Converts a value of the DataType 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 DataTypeToAscendString.

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

#include "graph/utils/type_utils.h"

Prototype

static std::string DataTypeToSerialString(const DataType data_type)

Parameters

Parameter

Input/Output

Description

data_type

Input

DataType to be converted. For details about the supported DataTypes, see DataType.

Returns

DataType string after conversion

Restrictions

None

Example

DataType data_type = ge::DT_UINT32;
auto type_str = ge::TypeUtils::DataTypeToSerialString(data_type); // "DT_UINT32"