ir_pb_converter.h#
Defines
-
fail_convert(...)#
Throws ConvertError with a formatted message.
-
namespace ONNX_LIGHT_NAMESPACE
Functions
Serializes an IR graph into a ModelProto.
The graph content is appended to
p_mas a new graph entry and its opset imports are synchronized with graph opset versions.- Parameters:
p_m – Destination model proto.
g – Source IR graph.
-
std::unique_ptr<Graph> ImportModelProto(const ModelProto &mp)#
Converts the first graph in a ModelProto into the internal IR graph.
- Throws:
ConvertError – When protobuf content cannot be represented in the internal IR.
- Returns:
Imported graph represented as an internal IR graph.
-
ModelProto PrepareOutput(const ModelProto &mp_in)#
Produces a metadata-preserving model shell used by conversion pipelines.
This helper copies global model-level fields while leaving graphs empty so conversion passes can repopulate the graph with transformed content.
- Returns:
ModelProto containing copied model-level metadata and no graph data.
Validates that graph conversion returned a non-null graph pointer.
Triggers ONNX_ASSERTM when
gis null.
-
class ConvertError : public std::runtime_error#
- #include <ir_pb_converter.h>
Exception type used by the protobuf <-> IR conversion utilities.
The converter progressively appends context while unwinding nested conversion calls so the final error message points to the failing model location.
Public Functions
-
inline const char *what() const noexcept override#
-
inline const char *what() const noexcept override#