From 6918e5293a87db2ae4fb1407205e353cd315a87d Mon Sep 17 00:00:00 2001 From: yeyunpeng2020 Date: Wed, 27 Jul 2022 17:20:01 +0800 Subject: [PATCH] fix TypeError to ValueError --- mindspore/core/ops/random_categorical.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/core/ops/random_categorical.cc b/mindspore/core/ops/random_categorical.cc index 69796a185c0..5d72adad97e 100644 --- a/mindspore/core/ops/random_categorical.cc +++ b/mindspore/core/ops/random_categorical.cc @@ -34,7 +34,7 @@ abstract::ShapePtr RandomCategoricalInferShape(const PrimitivePtr &primitive, return logits_shape_ptr->cast(); } if (logits_shape.size() != kDim2) { - MS_EXCEPTION(TypeError) << "logits shape size only support 2D"; + MS_EXCEPTION(ValueError) << "logits shape size only support 2D"; } std::vector output_shape; for (size_t i = 0; i < logits_shape.size() - 1; ++i) {