目录

FormatToAscendString

Function Description

Converts a value of the Format 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 FormatToAscendString(const Format &format);

Parameters

Parameter Input/Output Description
format Input Format to be converted. For details about the supported formats, see Format.

Return Value

Format string after conversion, which is of the AscendString type.

Restrictions

None

Calling Example

ge::Format format = ge::Format::FORMAT_NHWC;
auto format_str = FormatToAscendString(format); // "NHWC"
const char *ptr = format_str.GetString(); // Obtain the char* pointer.