diff --git a/mindspore/core/ops/ormqr.cc b/mindspore/core/ops/ormqr.cc index ac3c227df82..86fff64d3bf 100644 --- a/mindspore/core/ops/ormqr.cc +++ b/mindspore/core/ops/ormqr.cc @@ -50,7 +50,7 @@ abstract::ShapePtr OrmqrInferShape(const PrimitivePtr &primitive, const std::vec if ((x_rank - kColIndex) != tau_rank) { MS_EXCEPTION(ValueError) << "For Ormqr, tau should have one dimension less than x" - << ", while rank of x is" << x_shape.size() << " and " + << ", while rank of x is " << x_shape.size() << " and " << "rank of tau is " << tau_shape.size() << "."; } if (x_rank != other_rank) { diff --git a/mindspore/core/ops/unravel_index.cc b/mindspore/core/ops/unravel_index.cc index bf5be11c935..cf76e30aa34 100644 --- a/mindspore/core/ops/unravel_index.cc +++ b/mindspore/core/ops/unravel_index.cc @@ -32,11 +32,13 @@ namespace { abstract::ShapePtr UravelIndexInferShape(const PrimitivePtr &primitive, const std::vector &input_args) { MS_EXCEPTION_IF_NULL(primitive); + auto op_name = primitive->name(); + const int64_t input_num = 2; + (void)CheckAndConvertUtils::CheckInteger("input number", SizeToLong(input_args.size()), kEqual, input_num, op_name); if (!input_args[0]->isa() || !input_args[1]->isa()) { MS_EXCEPTION(TypeError) << "Input must be a Tensor."; } - auto op_name = primitive->name(); auto indices_shape = CheckAndConvertUtils::ConvertShapePtrToShapeMap(input_args[0]->BuildShape())[kShape]; auto dims_shape = CheckAndConvertUtils::ConvertShapePtrToShapeMap(input_args[1]->BuildShape())[kShape]; // support dynamic shape