!45140 npu_alloc_float_status op raises error when the input is no empty

Merge pull request !45140 from Yanzhi_YI/npuallocfloatstatus
This commit is contained in:
i-robot 2022-11-07 12:30:44 +00:00 committed by Gitee
commit 4d4d50ffc6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ constexpr int64_t kFloatStatusNum = 8;
MIND_API_OPERATOR_IMPL(NPUAllocFloatStatus, BaseOperator);
AbstractBasePtr NPUAllocFloatStatusInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive,
const std::vector<AbstractBasePtr> &input_args) {
if (input_args.size() != 0) {
MS_EXCEPTION(TypeError) << "For '" << primitive->name() << "' op, input num should be 0, bug gets "
<< input_args.size();
}
ShapeVector output_shape;
output_shape.push_back(kFloatStatusNum);
return abstract::MakeAbstract(std::make_shared<abstract::Shape>(output_shape), kTensorTypeFP32);