class ov::frontend::NodeContext¶
Overview¶
#include <node_context.hpp>
class NodeContext
{
public:
// construction
NodeContext(const std::string& op_type);
// methods
virtual size_t get_input_size() const;
virtual size_t get_input_size(const std::string& port_name) const;
virtual Output<Node> get_input(int idx) const;
virtual Output<Node> get_input(const std::string& name, int idx) const;
virtual Output<Node> get_input(const std::string& name) const;
virtual Any get_values_from_const_input(int idx) const;
virtual const std::string& get_op_type() const;
virtual const std::string& get_name() const;
template <class T>
T get_attribute(const std::string& name) const;
template <class T>
T get_attribute(const std::string& name, const T& def) const;
bool has_attribute(const std::string& name) const;
virtual ov::Any get_attribute_as_any(const std::string& name) const = 0;
virtual size_t get_subgraph_size() const;
virtual std::shared_ptr<Model> get_subgraph(int idx) const;
};
Detailed Documentation¶
Methods¶
virtual size_t get_input_size() const
Returns a number of inputs.
virtual size_t get_input_size(const std::string& port_name) const
Returns a number of inputs.
Returns exactly one input with a given idx; throws if there is no inputs or there are more than one input.
Returns exactly one input with a given name and idx; throws if there is no inputs or there are more than one input.
Returns exactly one input with a given name; throws if there is no inputs or there are more than one input.
virtual Any get_values_from_const_input(int idx) const
Returns values from Constant input with the given index as ov::Any. Throws an exception if the input cannot be represented as Constant.
template <class T>
T get_attribute(const std::string& name) const
Returns node attribute by name.
template <class T>
T get_attribute(const std::string& name, const T& def) const
Returns node attribute by name. Returns ‘def’ value if attribute does not exist.
bool has_attribute(const std::string& name) const
Check if an attribute of a given name exist.
virtual ov::Any get_attribute_as_any(const std::string& name) const = 0
Returns node attribute by name as ov::Any.
virtual size_t get_subgraph_size() const
Returns the number of sub-graphs that can be enumerated with get_subgraph.
virtual std::shared_ptr<Model> get_subgraph(int idx) const
Returns subgraph converted on demand by the first access If there is no query for specific sub-graph it shouldn’t be converted idx should be in range 0.. get_subgraph_size() -1.