Commit 53c4b3ce authored by Nick Korovaiko's avatar Nick Korovaiko Committed by Scott Cyphers

set_output_size shouldn't reset existing outputs (#1694)

* set_output_size fix

* add assert

* dont run get_loop_kernels twice
parent edd3aeca
...@@ -71,7 +71,7 @@ void Node::delayed_validate_and_infer_types() ...@@ -71,7 +71,7 @@ void Node::delayed_validate_and_infer_types()
void Node::set_output_size(size_t n) void Node::set_output_size(size_t n)
{ {
m_outputs.clear(); NGRAPH_ASSERT(n >= m_outputs.size()) << "shrinking " << m_outputs.size() << " to " << n;
for (size_t i = m_outputs.size(); i < n; ++i) for (size_t i = m_outputs.size(); i < n; ++i)
{ {
auto tensor_descriptor = make_shared<descriptor::Tensor>( auto tensor_descriptor = make_shared<descriptor::Tensor>(
......
...@@ -94,7 +94,6 @@ public: ...@@ -94,7 +94,6 @@ public:
for (auto e : m_graphs) for (auto e : m_graphs)
{ {
auto& lkg = e.second; auto& lkg = e.second;
NodeVector member_outputs = ngraph::get_subgraph_outputs(lkg.m_nodes, NodeVector{}); NodeVector member_outputs = ngraph::get_subgraph_outputs(lkg.m_nodes, NodeVector{});
auto lk = std::make_shared<runtime::cpu::op::LoopKernel>( auto lk = std::make_shared<runtime::cpu::op::LoopKernel>(
lkg.m_nodes, member_outputs, lkg.m_inputs); lkg.m_nodes, member_outputs, lkg.m_inputs);
...@@ -213,5 +212,5 @@ bool ngraph::runtime::cpu::pass::CPULoopKernelFusion::run_on_function( ...@@ -213,5 +212,5 @@ bool ngraph::runtime::cpu::pass::CPULoopKernelFusion::run_on_function(
} }
} }
return !lkc.get_loop_kernels().empty(); return !loop_kernels.empty();
} }
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