1/*
2 * SPDX-License-Identifier: Apache-2.0
3 */
4
5#pragma once
6
7#include "onnx/onnx-operators_pb.h"
8
9namespace ONNX_NAMESPACE {
10
11AttributeProto MakeAttribute(const std::string& attr_name, const float& value);
12AttributeProto MakeAttribute(const std::string& attr_name, const int64_t& value);
13AttributeProto MakeAttribute(const std::string& attr_name, const std::string& value);
14AttributeProto MakeAttribute(const std::string& attr_name, const TensorProto& value);
15AttributeProto MakeAttribute(const std::string& attr_name, const GraphProto& value);
16AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<float>& values);
17AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<int64_t>& values);
18AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<std::string>& values);
19AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<TensorProto>& values);
20AttributeProto 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.
26AttributeProto 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.
33AttributeProto MakeRefAttribute(
34 const std::string& attr_name,
35 const std::string& referred_attr_name,
36 AttributeProto_AttributeType type);
37
38} // namespace ONNX_NAMESPACE
39