From 4c227810c2147bcef48c08aa126bd4c4fd766d0e Mon Sep 17 00:00:00 2001 From: hwjiaorui Date: Fri, 18 Dec 2020 15:04:18 +0800 Subject: [PATCH] reshape bug fix --- mindspore/core/abstract/prim_arrays.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/core/abstract/prim_arrays.cc b/mindspore/core/abstract/prim_arrays.cc index 445fa9510a..b318f07f93 100644 --- a/mindspore/core/abstract/prim_arrays.cc +++ b/mindspore/core/abstract/prim_arrays.cc @@ -856,7 +856,7 @@ AbstractBasePtr InferImplReshape(const AnalysisEnginePtr &, const PrimitivePtr & if (it_second != shape.end()) { MS_LOG(EXCEPTION) << "At most one component of input shape can be -1"; } - int index = std::distance(it_first, shape.begin()); + int index = std::distance(shape.begin(), it_first); int infer_value = x_num; int infer_min_value = x_min_num; int infer_max_value = x_max_num;