printer.h#
Printing helpers for ONNX protobuf objects, including operator<< overloads
for graphs, nodes, attributes, and tensors, as well as
onnx::ProtoToString().
Declares stream-formatting helpers for ONNX protobuf structures.
This header exposes ostream operator overloads that render ONNX protobuf objects in a compact textual form for diagnostics and debugging, plus a helper template to convert supported protobuf objects to std::string.
-
namespace ONNX_LIGHT_NAMESPACE
Functions
-
std::ostream &operator<<(std::ostream &os, const TensorShapeProto_Dimension &dim)#
Formats and writes a TensorShapeProto_Dimension to an output stream.
- Parameters:
os – The destination stream.
dim – Dimension to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const TensorShapeProto &shape)#
Formats and writes a TensorShapeProto to an output stream.
- Parameters:
os – The destination stream.
shape – Shape to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const TypeProto_Tensor &tensortype)#
Formats and writes a TypeProto_Tensor to an output stream.
- Parameters:
os – The destination stream.
tensortype – Tensor type to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const TypeProto &type)#
Formats and writes a TypeProto to an output stream.
- Parameters:
os – The destination stream.
type – Type to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const TensorProto &tensor)#
Formats and writes a TensorProto to an output stream.
- Parameters:
os – The destination stream.
tensor – Tensor to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const ValueInfoProto &value_info)#
Formats and writes a ValueInfoProto to an output stream.
- Parameters:
os – The destination stream.
value_info – Value info to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const ValueInfoList &vilist)#
Formats and writes a ValueInfoList to an output stream.
- Parameters:
os – The destination stream.
vilist – Value info list to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const AttributeProto &attr)#
Formats and writes an AttributeProto to an output stream.
- Parameters:
os – The destination stream.
attr – Attribute to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const AttrList &attrlist)#
Formats and writes an AttrList to an output stream.
- Parameters:
os – The destination stream.
attrlist – Attribute list to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const NodeProto &node)#
Formats and writes a NodeProto to an output stream.
- Parameters:
os – The destination stream.
node – Node to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const NodeList &nodelist)#
Formats and writes a NodeList to an output stream.
- Parameters:
os – The destination stream.
nodelist – Node list to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const GraphProto &graph)#
Formats and writes a GraphProto to an output stream.
- Parameters:
os – The destination stream.
graph – Graph to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const FunctionProto &fn)#
Formats and writes a FunctionProto to an output stream.
- Parameters:
os – The destination stream.
fn – Function to format.
- Returns:
A reference to os.
-
std::ostream &operator<<(std::ostream &os, const ModelProto &model)#
Formats and writes a ModelProto to an output stream.
- Parameters:
os – The destination stream.
model – Model to format.
- Returns:
A reference to os.
-
template<typename ProtoType>
std::string ProtoToString(const ProtoType &proto)# Converts a streamable ONNX protobuf object to its textual representation.
- Template Parameters:
ProtoType – Type supporting the corresponding stream operator.
- Parameters:
proto – Object to format.
- Returns:
The formatted textual representation of proto.
-
std::ostream &operator<<(std::ostream &os, const TensorShapeProto_Dimension &dim)#