From b7bcb2ee29401832d5e4538bb8f93fa315aa4b9f Mon Sep 17 00:00:00 2001 From: lianliguang Date: Mon, 2 Aug 2021 17:05:06 +0800 Subject: [PATCH] fix unique shape infer bug --- 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 4b5aefeac1a..9c72ad800f2 100644 --- a/mindspore/core/abstract/prim_arrays.cc +++ b/mindspore/core/abstract/prim_arrays.cc @@ -140,7 +140,7 @@ AbstractBasePtr InferImplUnique(const AnalysisEnginePtr &, const PrimitivePtr &p auto shape = input->shape(); MS_EXCEPTION_IF_NULL(shape); - if (shape->shape().empty()) { + if (shape->shape().size() != 1) { MS_LOG(EXCEPTION) << "Rank of " << op_name << "'s input must be 1."; } ShapeVector ids_shape = {Shape::SHP_ANY};