[](const std::shared_ptr<::ngraph::Node>& node, const std::map<std::string, std::string>& params) -> CNNLayerPtr {
LayerParams attrs = {node->get_friendly_name(), node->description(), details::convertPrecision(node->get_output_element_type(0))};
auto reduce_node = std::dynamic_pointer_cast<ngraph::op::util::ArithmeticReductionKeepDims>(node);
+ if (reduce_node == nullptr)
+ THROW_IE_EXCEPTION << "Node '" << node->get_name() << "' is not an instance of ArithmeticReductionKeepDims.";
auto res = std::make_shared<InferenceEngine::ReduceLayer>(attrs);
res->params = params;
res->params["keep_dims"] = reduce_node->get_keep_dims() ? "True" : "False";
addSpecificCreator({"ReduceLogicalAnd"}, [](const std::shared_ptr<::ngraph::Node>& node, const std::map<std::string, std::string>& params) -> CNNLayerPtr {
LayerParams attrs = {node->get_friendly_name(), "ReduceAnd", details::convertPrecision(node->get_output_element_type(0))};
auto reduce_node = std::dynamic_pointer_cast<ngraph::op::util::LogicalReductionKeepDims>(node);
+ if (reduce_node == nullptr)
+ THROW_IE_EXCEPTION << "Node '" << node->get_name() << "' is not an instance of LogicalReductionKeepDims.";
auto res = std::make_shared<InferenceEngine::ReduceLayer>(attrs);
res->params = params;
res->params["keep_dims"] = reduce_node->get_keep_dims() ? "True" : "False";
addSpecificCreator({"ReduceLogicalOr"}, [](const std::shared_ptr<::ngraph::Node>& node, const std::map<std::string, std::string>& params) -> CNNLayerPtr {
LayerParams attrs = {node->get_friendly_name(), "ReduceOr", details::convertPrecision(node->get_output_element_type(0))};
auto reduce_node = std::dynamic_pointer_cast<ngraph::op::util::LogicalReductionKeepDims>(node);
+ if (reduce_node == nullptr)
+ THROW_IE_EXCEPTION << "Node '" << node->get_name() << "' is not an instance of LogicalReductionKeepDims.";
auto res = std::make_shared<InferenceEngine::ReduceLayer>(attrs);
res->params = params;
res->params["keep_dims"] = reduce_node->get_keep_dims() ? "True" : "False";
IE_ASSERT(cell->insData.size() == NS + 1); // {data, state1, [state2]}
IE_ASSERT(cell->outData.size() == NS); // {state1, [state2]}
+ auto outData0InputsTo = getInputTo(cell->outData[0]);
if (getCreatorLayer(cell->insData[0].lock()).lock() != rsp1 ||
- getInputTo(cell->outData[0]).begin()->second != rsp2)
+ outData0InputsTo.empty() ||
+ outData0InputsTo.begin()->second != rsp2)
return false;
// Check port mapping
}
} else if (!casted->dim.empty()) {
int dim = casted->dim[i];
- if (firstShape[axis] < static_cast<size_t>(offset + dim)) {
+ if (firstShape[axis] < (static_cast<size_t>(offset) + dim)) {
THROW_IE_EXCEPTION << "Incorrect crop data! Offset(" << offset << ") + result size of output(" << dim
<< ") should be less then input size(" << firstShape[axis] << ") for axis(" << axis
<< ")";