forked from mindspore-Ecosystem/mindspore
fix TypeError to ValueError
This commit is contained in:
parent
aa07834bf1
commit
6918e5293a
|
@ -34,7 +34,7 @@ abstract::ShapePtr RandomCategoricalInferShape(const PrimitivePtr &primitive,
|
||||||
return logits_shape_ptr->cast<abstract::ShapePtr>();
|
return logits_shape_ptr->cast<abstract::ShapePtr>();
|
||||||
}
|
}
|
||||||
if (logits_shape.size() != kDim2) {
|
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;
|
std::vector<int64_t> output_shape;
|
||||||
for (size_t i = 0; i < logits_shape.size() - 1; ++i) {
|
for (size_t i = 0; i < logits_shape.size() - 1; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue