22 #include "ngraph/except.hpp"
23 #include "ngraph/node.hpp"
24 #include "onnx_import/utils/onnx_importer_visibility.hpp"
26 namespace ONNX_NAMESPACE
43 :
ngraph_error{
"Node (" + node +
"): unknown attribute \'" + name +
"\'"}
57 class ONNX_IMPORTER_API
Node
61 Node(
const ONNX_NAMESPACE::NodeProto& node_proto,
const Graph& graph);
66 Node& operator=(
Node&&) noexcept =
delete;
67 Node& operator=(
const Node&) =
delete;
69 OutputVector get_ng_inputs()
const;
70 OutputVector get_ng_nodes()
const;
71 const std::string& domain()
const;
72 const std::string& op_type()
const;
73 const std::string& get_name()
const;
80 const std::vector<std::reference_wrapper<const std::string>>& get_output_names()
const;
81 const std::string& output(
int index)
const;
82 std::size_t get_outputs_size()
const;
84 bool has_attribute(
const std::string& name)
const;
87 T get_attribute_value(
const std::string& name, T default_value)
const;
90 T get_attribute_value(
const std::string& name)
const;
98 std::unique_ptr<Impl, void (*)(Impl*)> m_pimpl;
102 ONNX_IMPORTER_API
float Node::get_attribute_value(
const std::string& name,
103 float default_value)
const;
106 ONNX_IMPORTER_API
double Node::get_attribute_value(
const std::string& name,
107 double default_value)
const;
110 ONNX_IMPORTER_API std::int64_t Node::get_attribute_value(
const std::string& name,
111 std::int64_t default_value)
const;
114 ONNX_IMPORTER_API std::string Node::get_attribute_value(
const std::string& name,
115 std::string default_value)
const;
118 ONNX_IMPORTER_API Tensor Node::get_attribute_value(
const std::string& name,
119 Tensor default_value)
const;
122 ONNX_IMPORTER_API Graph Node::get_attribute_value(
const std::string& name,
123 Graph default_value)
const;
126 ONNX_IMPORTER_API std::vector<float>
127 Node::get_attribute_value(
const std::string& name,
128 std::vector<float> default_value)
const;
131 ONNX_IMPORTER_API std::vector<double>
132 Node::get_attribute_value(
const std::string& name,
133 std::vector<double> default_value)
const;
136 ONNX_IMPORTER_API std::vector<std::int64_t>
137 Node::get_attribute_value(
const std::string& name,
138 std::vector<std::int64_t> default_value)
const;
141 ONNX_IMPORTER_API std::vector<std::size_t>
142 Node::get_attribute_value(
const std::string& name,
143 std::vector<std::size_t> default_value)
const;
146 ONNX_IMPORTER_API std::vector<std::string>
147 Node::get_attribute_value(
const std::string& name,
148 std::vector<std::string> default_value)
const;
151 ONNX_IMPORTER_API std::vector<Tensor>
152 Node::get_attribute_value(
const std::string& name,
153 std::vector<Tensor> default_value)
const;
156 ONNX_IMPORTER_API std::vector<Graph>
157 Node::get_attribute_value(
const std::string& name,
158 std::vector<Graph> default_value)
const;
161 ONNX_IMPORTER_API
float Node::get_attribute_value(
const std::string& name)
const;
164 ONNX_IMPORTER_API
double Node::get_attribute_value(
const std::string& name)
const;
167 ONNX_IMPORTER_API std::int64_t Node::get_attribute_value(
const std::string& name)
const;
170 ONNX_IMPORTER_API std::size_t Node::get_attribute_value(
const std::string& name)
const;
173 ONNX_IMPORTER_API std::string Node::get_attribute_value(
const std::string& name)
const;
176 ONNX_IMPORTER_API Tensor Node::get_attribute_value(
const std::string& name)
const;
179 ONNX_IMPORTER_API Subgraph Node::get_attribute_value(
const std::string& name)
const;
182 ONNX_IMPORTER_API std::vector<float>
183 Node::get_attribute_value(
const std::string& name)
const;
186 ONNX_IMPORTER_API std::vector<double>
187 Node::get_attribute_value(
const std::string& name)
const;
190 ONNX_IMPORTER_API std::vector<std::int64_t>
191 Node::get_attribute_value(
const std::string& name)
const;
194 ONNX_IMPORTER_API std::vector<std::size_t>
195 Node::get_attribute_value(
const std::string& name)
const;
198 ONNX_IMPORTER_API std::vector<std::string>
199 Node::get_attribute_value(
const std::string& name)
const;
202 ONNX_IMPORTER_API std::vector<Tensor>
203 Node::get_attribute_value(
const std::string& name)
const;
206 ONNX_IMPORTER_API std::vector<Graph>
207 Node::get_attribute_value(
const std::string& name)
const;
209 inline std::ostream& operator<<(std::ostream& outs,
const Node& node)
211 return (outs <<
"<Node(" << node.op_type() <<
"): " << node.
get_description() <<
">");
Base error for ngraph runtime errors.
Definition: except.hpp:28
const std::string & get_description() const
Describe the ONNX Node to make debugging graphs easier Function will return the Node's name if it has...
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28