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) {