Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed KW warning and review issues #2262

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ngraph/core/include/ngraph/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ namespace ngraph

protected:
/// \brief Construct an unitialized Node
Node() {}
Node() = default;
/// \brief Copying a node
Node(const Node&);
/// \brief Assignment operator
Node& operator=(const Node&);

/// \brief Construct an unitialized Node
/// \param output_size Number of outputs for this node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,17 @@ namespace ngraph
auto out_outer_coord_iter = out_outer_transform.begin();
for (const Coordinate& params_outer_coord : params_outer_transform)
{
if (out_outer_coord_iter == out_outer_transform.end())
break;
const T* params_prime =
&params[params_outer_transform.index(params_outer_coord)];
T* out_outer = &out[out_outer_transform.index(*out_outer_coord_iter)];

auto out_inner_coord_iter = out_inner_transform.begin();
for (const Coordinate& indices_outer_coord : indices_outer_transform)
{
if (out_inner_coord_iter == out_inner_transform.end())
break;
const U* indices_prime =
&indices[indices_outer_transform.index(indices_outer_coord)];
T* out_prime = &out_outer[out_inner_transform.index(*out_inner_coord_iter)];
Expand Down
20 changes: 20 additions & 0 deletions ngraph/core/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ Node::Node(const Node& node)
}
}

Node& Node::operator=(const Node& node)
{
this->m_control_dependents = node.m_control_dependents;
this->m_control_dependencies = node.m_control_dependencies;
this->m_instance_id = m_next_instance_id.fetch_add(1);
this->m_friendly_name = node.m_friendly_name;
this->m_provenance_tags = node.m_provenance_tags;
this->m_provenance_group = node.m_provenance_group;
this->m_inputs = node.m_inputs;
this->m_op_annotations = node.m_op_annotations;
this->m_rt_info = node.m_rt_info;
// cannot do it without copying node.m_inputs first due to too limiting const qualifiers
for (auto& input : m_inputs)
{
input = descriptor::Input(this, input.get_index(), input.get_output());
input.get_output().add_input(&input);
}
return *this;
}

Node::Node(size_t output_size)
: Node()
{
Expand Down