From 4675a12c8f09fb0c1e2b0095734227203ed54466 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Fri, 5 Mar 2021 11:13:11 +0300 Subject: [PATCH] Fixed KW hits (#4638) --- ngraph/core/reference/src/runtime/reference/loop.cpp | 6 ++++-- .../reference/src/runtime/reference/tensor_iterator.cpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ngraph/core/reference/src/runtime/reference/loop.cpp b/ngraph/core/reference/src/runtime/reference/loop.cpp index 81661a3228f..2e5f7b9678f 100644 --- a/ngraph/core/reference/src/runtime/reference/loop.cpp +++ b/ngraph/core/reference/src/runtime/reference/loop.cpp @@ -194,8 +194,10 @@ namespace ngraph // Check execution condition bool body_exec_condition(false); - body_outputs[special_ports.body_condition_output_idx]->read( - &body_exec_condition, sizeof(bool)); + if (body_outputs.size() > special_ports.body_condition_output_idx && + body_outputs[special_ports.body_condition_output_idx]) + body_outputs[special_ports.body_condition_output_idx]->read( + &body_exec_condition, sizeof(bool)); if (!body_exec_condition) break; diff --git a/ngraph/core/reference/src/runtime/reference/tensor_iterator.cpp b/ngraph/core/reference/src/runtime/reference/tensor_iterator.cpp index 5488444a88e..af2e80de7ea 100644 --- a/ngraph/core/reference/src/runtime/reference/tensor_iterator.cpp +++ b/ngraph/core/reference/src/runtime/reference/tensor_iterator.cpp @@ -161,6 +161,8 @@ namespace ngraph for (size_t i = 0; i < concat_outputs.size(); ++i) { const auto& concat_desc = concat_outputs[i]; + if (!concat_desc) + continue; auto shape = func->get_results().at(concat_desc->m_body_value_index)->get_shape(); std::vector shapes_to_concat(values_to_concat[i].size(), shape);