FormatToAscendString

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"

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.

Returns

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

Restrictions

None

Example

ge::Format format = ge::Format::FORMAT_NHWC;
auto format_str = ge::TypeUtils::FormatToAscendString(format);
const char *ptr = format_str .GetString();