Skip to main content

ClikaRT::graph::OnnxExportWriter

class

Header: ClikaRT/graph/onnx_export.h

Writes one node's ONNX form, for the handler the export calls with it. It is valid for that call only: a copy kept past it refuses every call (FAILED_PRECONDITION, naming the node).

Member functions​

input()​

std::string input(int port) const

The ONNX name of the node's input on port; empty for an optional input the node leaves out between two it wires. Status::InvalidArgument for a port past its last wired input.

Declared in ClikaRT/graph/onnx_export.h, line 41

add_initializer()​

std::string add_initializer(const Tensor& value)

Write value's bytes as a model constant; returns its ONNX name.

Declared in ClikaRT/graph/onnx_export.h, line 45

add_node()​

std::vector<std::string> add_node(
    std::string_view op_type,
    const std::vector<std::string>& inputs,
    int num_outputs,
    const std::vector<io::OnnxAttr>& attrs = {},
    std::string_view domain = {}
)

Append an ONNX node, as io::OnnxModel::add_node does: inputs name the operator's positional slots (an empty name leaves an optional input out), and the names of its num_outputs outputs return in order. domain empty is the standard ai.onnx domain; a node under a domain the model does not import is refused with Status::InvalidArgument.

Declared in ClikaRT/graph/onnx_export.h, line 58

opset_version()​

std::int64_t opset_version() const

The ai.onnx opset the model imports.

Declared in ClikaRT/graph/onnx_export.h, line 65