Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:20:23

0001 // Copyright (c) ONNX Project Contributors
0002 
0003 /*
0004  * SPDX-License-Identifier: Apache-2.0
0005  */
0006 
0007 #pragma once
0008 
0009 #include <string>
0010 #include <vector>
0011 
0012 #include "onnx/onnx-operators_pb.h"
0013 
0014 namespace ONNX_NAMESPACE {
0015 
0016 AttributeProto MakeAttribute(const std::string& attr_name, const float& value);
0017 AttributeProto MakeAttribute(const std::string& attr_name, const int64_t& value);
0018 AttributeProto MakeAttribute(const std::string& attr_name, const std::string& value);
0019 AttributeProto MakeAttribute(const std::string& attr_name, const TensorProto& value);
0020 AttributeProto MakeAttribute(const std::string& attr_name, const GraphProto& value);
0021 AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<float>& values);
0022 AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<int64_t>& values);
0023 AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<std::string>& values);
0024 AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<TensorProto>& values);
0025 AttributeProto MakeAttribute(const std::string& attr_name, const std::vector<GraphProto>& values);
0026 
0027 // Make a "reference" attribute for a node in a function body.
0028 // <attr_name> specifies the attribute name of both the function node and its
0029 // function body node. They're using the same attribute name.
0030 // <type> specifies the attribute type.
0031 AttributeProto MakeRefAttribute(const std::string& attr_name, AttributeProto_AttributeType type);
0032 
0033 // Make a "reference" attribute for a node in a function body.
0034 // <attr_name> specifies the attribute name of the function body node.
0035 // <referred_attr_name> specifies the referred attribute name of the function
0036 // node.
0037 // <type> specifies the attribute type.
0038 AttributeProto MakeRefAttribute(
0039     const std::string& attr_name,
0040     const std::string& referred_attr_name,
0041     AttributeProto_AttributeType type);
0042 
0043 } // namespace ONNX_NAMESPACE