From 56d610f681b48c82ff6da7074c75edf776f64043 Mon Sep 17 00:00:00 2001 From: Xiaoda Zhang Date: Sat, 19 Sep 2020 09:46:30 +0800 Subject: [PATCH] checking the find() return value --- .../parallel/auto_parallel/rec_core/rec_generate_strategy.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc b/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc index b519f2dc0cc..02a06c9bebc 100644 --- a/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc +++ b/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc @@ -487,6 +487,9 @@ Dimensions PrepareIncomingOperatorInputStrategy(const std::vectortype() == GATHERV2) { auto pos = ops[incoming_op_index]->name().find("Info"); + if (pos == std::string::npos) { + return s; + } auto name = ops[incoming_op_index]->name().substr(0, pos); if (name == "GatherV2") { return s;