1 | /* |
2 | * SPDX-License-Identifier: Apache-2.0 |
3 | */ |
4 | |
5 | #pragma once |
6 | |
7 | #include "onnx/onnx-operators_pb.h" |
8 | |
9 | namespace ONNX_NAMESPACE { |
10 | |
11 | AttributeProto MakeAttribute(const std::string& attr_name, const float& value); |
12 | AttributeProto MakeAttribute(const std::string& attr_name, const int64_t& value); |
13 | AttributeProto MakeAttribute(const std::string& attr_name, const std::string& value); |
14 | AttributeProto MakeAttribute(const std::string& attr_name, const TensorProto& value); |
15 | AttributeProto MakeAttribute(const std::string& attr_name, const GraphProto& value); |
16 | AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<float>& values); |
17 | AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<int64_t>& values); |
18 | AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<std::string>& values); |
19 | AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<TensorProto>& values); |
20 | AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<GraphProto>& values); |
21 | |
22 | // Make a "reference" attribute for a node in a function body. |
23 | // <attr_name> specifies the attribute name of both the function node and its |
24 | // function body node. They're using the same attribute name. |
25 | // <type> specifies the attribute type. |
26 | AttributeProto MakeRefAttribute(const std::string& attr_name, AttributeProto_AttributeType type); |
27 | |
28 | // Make a "reference" attribute for a node in a function body. |
29 | // <attr_name> specifies the attribute name of the function body node. |
30 | // <referred_attr_name> specifies the referred attribute name of the function |
31 | // node. |
32 | // <type> specifies the attribute type. |
33 | AttributeProto MakeRefAttribute( |
34 | const std::string& attr_name, |
35 | const std::string& referred_attr_name, |
36 | AttributeProto_AttributeType type); |
37 | |
38 | } // namespace ONNX_NAMESPACE |
39 | |