1 | /* |
2 | * SPDX-License-Identifier: Apache-2.0 |
3 | */ |
4 | |
5 | #pragma once |
6 | |
7 | #include <iostream> |
8 | |
9 | #include "onnx/onnx_pb.h" |
10 | |
11 | #include "onnx/defs/parser.h" |
12 | |
13 | namespace ONNX_NAMESPACE { |
14 | |
15 | std::ostream& operator<<(std::ostream& os, const TensorShapeProto_Dimension& dim); |
16 | |
17 | std::ostream& operator<<(std::ostream& os, const TensorShapeProto& shape); |
18 | |
19 | std::ostream& operator<<(std::ostream& os, const TypeProto_Tensor& tensortype); |
20 | |
21 | std::ostream& operator<<(std::ostream& os, const TypeProto& type); |
22 | |
23 | std::ostream& operator<<(std::ostream& os, const TensorProto& tensor); |
24 | |
25 | std::ostream& operator<<(std::ostream& os, const ValueInfoProto& value_info); |
26 | |
27 | std::ostream& operator<<(std::ostream& os, const ValueInfoList& vilist); |
28 | |
29 | std::ostream& operator<<(std::ostream& os, const AttributeProto& attr); |
30 | |
31 | std::ostream& operator<<(std::ostream& os, const AttrList& attrlist); |
32 | |
33 | std::ostream& operator<<(std::ostream& os, const NodeProto& node); |
34 | |
35 | std::ostream& operator<<(std::ostream& os, const NodeList& nodelist); |
36 | |
37 | std::ostream& operator<<(std::ostream& os, const GraphProto& graph); |
38 | |
39 | std::ostream& operator<<(std::ostream& os, const FunctionProto& fn); |
40 | |
41 | std::ostream& operator<<(std::ostream& os, const ModelProto& model); |
42 | |
43 | template <typename ProtoType> |
44 | std::string ProtoToString(const ProtoType& proto) { |
45 | std::stringstream ss; |
46 | ss << proto; |
47 | return ss.str(); |
48 | } |
49 | |
50 | } // namespace ONNX_NAMESPACE |