DataTypeToAscendString
Function Usage
Converts a value of the DataType type into a string.
To use this API, the type_utils.h header file must be included.
1 | #include "graph/utils/type_utils.h" |
Prototype
1 | static AscendString DataTypeToAscendString(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, which is of the AscendString type.
Constraints
None
Examples
1 2 3 | DataType data_type = ge::DT_UINT32; auto type_str = ge::TypeUtils::DataTypeToAscendString(data_type); // "DT_UINT32" const char *ptr = type_str.GetString(); // Obtain the char* pointer. |
Parent topic: TypeUtils