op_def

The APIs described in this section are reserved and may be changed or deprecated in the future. They do not need your attention.

Table 1 API list

API Definition

Description

ToOpImplMode(const std::string &implModeStr)

Converts implModeStr to OpImplMode.

ToString(OpImplMode implMode)

Converts OpImplMode to a string.

ImplModeToString(OpImplMode implMode)

Converts implModeStr to OpImplMode.

Add(uint32_t &id, const char *opName)

Registers opName with OpTypeDict and returns the operator ID.

ToOpType(const std::string &opName)

Finds the operator ID from OpTypeDict based on opName.

ToString(uint32_t opType)

Finds the operator name from OpTypeDict based on the operator ID.

GetAllOpTypeSize()

Obtains the number of registered operators in OpTypeDict.

ToOpTypeByConfigJson(const std::string &op_config_json)

Searches for the operator ID based on the operator JSON file name.

UpdateConfigJsonPath(uint32_t opType, const std::string &opFile)

Updates the JSON file name of an operator with the specified operator ID.

ReadFile2String(const char *filename, std::string &content)

Reads filename to content.

ReadDirBySuffix(const std::string &dir, const std::string &suffix, std::vector<std::string> &paths)

Obtain all files with suffix in the dir directory.

ToIndex(OpImplMode implMode)

Obtains the index of OpImplMode.

ToIndexChar(OpImplMode implMode)

Obtains the index of OpImplMode in character format.

GetOpConfigJsonFileName(uint32_t opType)

Obtains the .json configuration file name based on the operator ID.