19 #include "ngraph/op/op.hpp"
20 #include "ngraph/op/util/variable.hpp"
29 NGRAPH_RTTI_DECLARATION;
48 virtual std::shared_ptr<ngraph::Variable>
get_variable()
const {
return m_variable; }
52 virtual void set_variable(
const std::shared_ptr<ngraph::Variable>& variable)
54 m_variable = variable;
58 std::shared_ptr<ngraph::Variable> m_variable;
67 NGRAPH_RTTI_DECLARATION;
79 clone_with_new_inputs(
const OutputVector& new_args)
const override;
86 m_variable_id = variable_id;
90 std::string m_variable_id;
101 NGRAPH_RTTI_DECLARATION;
111 const std::shared_ptr<Variable>& variable);
115 void revalidate_and_infer_types()
override;
117 std::shared_ptr<Node>
118 clone_with_new_inputs(
const OutputVector& new_args)
const override;
124 NGRAPH_CHECK(m_variable,
125 "Variable is not initialized. Variable_id is unavailable");
126 return m_variable->get_info().variable_id;
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:71
A handle for one of a node's outputs.
Definition: node_output.hpp:42
Root of all actual ops.
Definition: op.hpp:29
Definition: read_value.hpp:27
virtual void set_variable(const std::shared_ptr< ngraph::Variable > &variable)
Sets a new variable to be connected to this node.
Definition: read_value.hpp:52
virtual std::string get_variable_id() const =0
Returns the identifier of corresponding variable.
ReadValueBase(const OutputVector &arguments)
Constructs an AssignBase operation.
Definition: read_value.hpp:34
virtual std::shared_ptr< ngraph::Variable > get_variable() const
Returns variable connected to this node.
Definition: read_value.hpp:48
virtual void set_variable_id(const std::string &variable_id)
Sets the identifier of corresponding variable.
Definition: read_value.hpp:42
ReadValue operation creates the variable with variable_id and returns value of this variable.
Definition: read_value.hpp:65
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
std::string get_variable_id() const override
Returns the identifier of corresponding variable.
Definition: read_value.hpp:83
void set_variable_id(const std::string &variable_id) override
Sets the identifier of corresponding variable.
Definition: read_value.hpp:84
ReadValue(const Output< Node > &init_value, const std::string &variable_id)
Constructs a ReadValue operation.
ReadValue operation gets an input value from the variable with variable_id and returns it as an outpu...
Definition: read_value.hpp:99
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
std::string get_variable_id() const override
Returns the identifier of corresponding variable.
Definition: read_value.hpp:122
ReadValue(const Output< Node > &init_value, const std::shared_ptr< Variable > &variable)
Constructs a ReadValue operation.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28