We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

AscendStringToFormat

Function Description

Converts a string into a value of the Format type.

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

Collapse
Word wrap
Dark theme
Copy code
  1. #include "graph/utils/type_utils.h"

Function Prototype

Collapse
Word wrap
Dark theme
Copy code
  1. static Format AscendStringToFormat(const AscendString &str);

Parameter Description

Expand
Parameters Input/Output Description
str Input Format string to be converted, which is of the AscendString type.

Return Value

If the input is valid, the Format enum value after conversion is returned. For details about the enumeration definition, see Format. If the input is invalid, FORMAT_RESERVED is returned and an error message is printed.

Restrictions

None

Calling Example

Collapse
Word wrap
Dark theme
Copy code
  1. ge::AscendString format_str("NHWC");
  2. auto format = AscendStringToFormat(format_str); // 1
Search in Guides
Enter a keyword.