!38996 fix TypeError to ValueError

Merge pull request !38996 from yeyunpeng2020/master
This commit is contained in:
i-robot 2022-07-28 01:23:20 +00:00 committed by Gitee
commit 303339501f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ abstract::ShapePtr RandomCategoricalInferShape(const PrimitivePtr &primitive,
return logits_shape_ptr->cast<abstract::ShapePtr>();
}
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<int64_t> output_shape;
for (size_t i = 0; i < logits_shape.size() - 1; ++i) {