ConvertToListAscendString

Applicability

Product

Supported or Not

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Header File

#include <graph/operator_reg.h>

Function Usage

Defines a template function ConvertToListAscendString to convert strings of different types to those of the AscendString type.

Prototype

1
template<typename T> std::vector<ge::AscendString> ConvertToListAscendString(T strs)

The following conversions are supported:

  • template<> inline std::vector<ge::AscendString> ConvertToListAscendString(std::vector<std::string> strs)

    Converts strings of the std::vectorstd::string type to the std::vector<const char *> type and then converts it again.

  • template<> inline std::vector<ge::AscendString> ConvertToListAscendString(std::vector<ge::AscendString> strs)

    Returns string lists of the std::vector<ge::AscendString> type directly.

Parameters

Parameter

Input/Output

Description

strs

Input

List of strings to be converted.

Returns

List of strings of the AscendString type after conversion.

Constraints

None