Function Description
Converts a value of the DataType type into a string.
To use this API, the type_utils.h header file must be included.
#include "graph/utils/type_utils.h"
Function Prototype
static AscendString DataTypeToAscendString(const DataType &data_type);
Parameters
| Parameter | Input/Output | Description |
| data_type | Input | Data type to be converted. For details about the supported data types, see DataType. |
Return Value
Data type string after conversion, which is of the AscendString type.
Calling Example
DataType data_type = ge::DT_UINT32;
auto type_str = DataTypeToAscendString(data_type); // "DT_UINT32"
const char *ptr = type_str.GetString(); // Obtain the char* pointer.