OpCodes: The opcodes.
More...
#include <opcodes.h>
|
bool | build_opcode_dict () |
| Build the opcode dictionary. This build the vector opcodes and the dictionary opcodes_idx from the content of onnx_conf.
|
|
bool | fill_op_code (OnnxOpCode &op) |
| Fill an ONNX OpCode. This completes all the fields of an OpCode other than name and version. It reads the configuration file onnx_conf and creates the necessary objects.
|
|
bool | fill_all_dict_versions () |
| Fill all versions of the dictionary.
|
|
bool | fill_tensor_types (TensorTypes &types, std::string &all_types) |
| Fill the tensor types. This fills a list of tensor types from a string with the names of the types separated by commas.
|
|
bool | fill_attribute_type (AttributeType &type, std::string &type_name) |
| Fill the attribute type. This fills an attribute type from a string with the name of the type.
|
|
|
ConfigFile | onnx_conf = ConfigFile(nullptr) |
| The ONNX opcodes reference stored as a ConfigFile.
|
|
int | ir_vers = 0 |
| Argument of model.set_ir_version() (Stored as ONNX_IR_VERSION in config.)
|
|
int | op_vers_latest = 0 |
| The latest opset version in onnx.ini.
|
|
int | op_vers_current = 0 |
| The opset version in use, set by set_opset_version() or op_vers_latest.
|
|
OnnxOpCodeDict | opcodes_idx = {} |
| The index to the opcodes.
|
|
OnnxOpCodes | opcodes = {} |
| The opcodes parsed as binary objects.
|
|
◆ OpCodes()
Bop: Start the OpCodes.
- Parameters
-
a_logger | A pointer to the logger. |
a_config | A pointer to the configuration. |
◆ start()
A simple start()/shut_down() interface (Restart is: shut_down(TRUE):start())
Start (or restart) the Service
- Returns
- SERVICE_NO_ERROR if successful, some error if not.
This method should be overriden by something that actually starts the service, possibly using the configuration file in pConf.
Reimplemented from jazz_elements::Service.
◆ shut_down()
Stop the Service
- Returns
- SERVICE_NO_ERROR if successful, some error if not.
This method should be overriden by something that actually stops the service, possibly using the configuration file in pConf.
Reimplemented from jazz_elements::Service.
◆ latest_opset_version()
int jazz_bebop::OpCodes::latest_opset_version |
( |
| ) |
|
|
inline |
Get the latest opset version.
- Returns
- The latest opset version.
◆ set_opset_version()
bool jazz_bebop::OpCodes::set_opset_version |
( |
int |
version | ) |
|
|
inline |
Set the opset version.
- Parameters
-
version | The version to set. |
- Returns
- True if the version was set. It must be between 1 and latest_opset_version().
◆ get()
Get an ONNX OpCode.
- Parameters
-
name | The name of the OpCode. |
- Returns
- The OpCode. Null if not found. The version returned is highest version smaller or equal to the one set by set_opset_version().
◆ build_opcode_dict()
bool jazz_bebop::OpCodes::build_opcode_dict |
( |
| ) |
|
|
private |
Build the opcode dictionary. This build the vector opcodes and the dictionary opcodes_idx from the content of onnx_conf.
- Returns
- True if the dictionary was built.
◆ fill_op_code()
bool jazz_bebop::OpCodes::fill_op_code |
( |
OnnxOpCode & |
op | ) |
|
|
private |
Fill an ONNX OpCode. This completes all the fields of an OpCode other than name and version. It reads the configuration file onnx_conf and creates the necessary objects.
- Parameters
-
op | The OpCode to fill. (It must have the name and version set). This method fills its inputs, outputs and attributes. |
- Returns
- True if the OpCode was filled.
◆ fill_all_dict_versions()
bool jazz_bebop::OpCodes::fill_all_dict_versions |
( |
| ) |
|
|
private |
Fill all versions of the dictionary.
This fills every non existing version of an opcode to the previous existing one. E.g., if and opcode "foo" exists for versions 7 and 13, it makes the versions 8 to 12 point to the version 7 opcode and the versions 14 to 19 (latest) point to version 13.
This simplifies the search for the opcodes for any version predefined using set_opset_version().
- Returns
- True if all versions were filled
◆ fill_tensor_types()
bool jazz_bebop::OpCodes::fill_tensor_types |
( |
TensorTypes & |
types, |
|
|
std::string & |
all_types |
|
) |
| |
|
private |
Fill the tensor types. This fills a list of tensor types from a string with the names of the types separated by commas.
- Parameters
-
types | The list of types to fill. |
all_types | The string with the names of the types separated by commas. |
- Returns
- True if all types were found.
◆ fill_attribute_type()
bool jazz_bebop::OpCodes::fill_attribute_type |
( |
AttributeType & |
type, |
|
|
std::string & |
type_name |
|
) |
| |
|
private |
Fill the attribute type. This fills an attribute type from a string with the name of the type.
- Parameters
-
type | The attribute type to fill. |
type_name | The name of the type. |
- Returns
- True if the type was found.
The documentation for this class was generated from the following files: