Commit 291d927c authored by Nick Korovaiko's avatar Nick Korovaiko Committed by Adam Procter

making arg getters constant (#1121)

parent cc6f05de
...@@ -138,7 +138,7 @@ void Node::set_placement(Placement placement) ...@@ -138,7 +138,7 @@ void Node::set_placement(Placement placement)
m_placement = placement; m_placement = placement;
} }
std::shared_ptr<Node> Node::get_argument(size_t index) std::shared_ptr<Node> Node::get_argument(size_t index) const
{ {
for (auto& i : get_inputs()) for (auto& i : get_inputs())
{ {
...@@ -158,7 +158,7 @@ Node::~Node() ...@@ -158,7 +158,7 @@ Node::~Node()
} }
} }
NodeVector Node::get_arguments() NodeVector Node::get_arguments() const
{ {
NodeVector result; NodeVector result;
for (auto& i : get_inputs()) for (auto& i : get_inputs())
......
...@@ -165,9 +165,9 @@ namespace ngraph ...@@ -165,9 +165,9 @@ namespace ngraph
std::unordered_set<descriptor::Tensor*> liveness_new_list; std::unordered_set<descriptor::Tensor*> liveness_new_list;
std::unordered_set<descriptor::Tensor*> liveness_free_list; std::unordered_set<descriptor::Tensor*> liveness_free_list;
virtual NodeVector get_arguments(); //const; virtual NodeVector get_arguments() const;
std::shared_ptr<Node> get_argument(size_t index); std::shared_ptr<Node> get_argument(size_t index) const;
virtual std::shared_ptr<Node> copy_with_new_args(const NodeVector& new_args) const = 0; virtual std::shared_ptr<Node> copy_with_new_args(const NodeVector& new_args) const = 0;
......
...@@ -42,7 +42,7 @@ shared_ptr<Node> op::GetOutputElement::copy_with_new_args(const NodeVector& new_ ...@@ -42,7 +42,7 @@ shared_ptr<Node> op::GetOutputElement::copy_with_new_args(const NodeVector& new_
return make_shared<GetOutputElement>(new_args.at(0), m_n); return make_shared<GetOutputElement>(new_args.at(0), m_n);
} }
NodeVector op::GetOutputElement::get_arguments() NodeVector op::GetOutputElement::get_arguments() const
{ {
return NodeVector{get_inputs().at(0).get_output().get_node()}; return NodeVector{get_inputs().at(0).get_output().get_node()};
} }
......
...@@ -37,7 +37,7 @@ namespace ngraph ...@@ -37,7 +37,7 @@ namespace ngraph
/// \return The index of the tuple element to get. /// \return The index of the tuple element to get.
size_t get_n() const { return m_n; } size_t get_n() const { return m_n; }
virtual NodeVector get_arguments() override; virtual NodeVector get_arguments() const override;
protected: protected:
virtual void generate_adjoints(autodiff::Adjoints& adjoints, virtual void generate_adjoints(autodiff::Adjoints& adjoints,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment