!48567 修复gpu并行用例算子收到undetermined类型问题

Merge pull request !48567 from 李良灿/fixpara
This commit is contained in:
i-robot 2023-02-13 06:14:16 +00:00 committed by Gitee
commit 0e6c5cf5ff
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 1 deletions

View File

@ -292,6 +292,12 @@ AbstractBasePtr MakeAbstract(const BaseShapePtr &base_shape, const TypePtr &type
if ((base_shape->isa<Shape>())) {
auto shape = base_shape->cast<ShapePtr>();
MS_EXCEPTION_IF_NULL(shape);
auto shape_vec = shape->shape();
// if the size of shape list is empty, return an scalar abstract
if (shape_vec.empty() && (!type->isa<TensorType>())) {
abstract::AbstractScalarPtr abs_scalar = std::make_shared<abstract::AbstractScalar>(kAnyValue, type);
return abs_scalar;
}
return MakeAbstractTensor(shape, type);
} else if (base_shape->isa<NoShape>() && type->isa<Number>()) {
return std::make_shared<abstract::AbstractScalar>(kAnyValue, type);

View File

@ -53,7 +53,7 @@ AbstractBasePtr LogicalNotInfer(const abstract::AnalysisEnginePtr &, const Primi
CheckAndConvertUtils::CheckInputArgs(input_args, kGreaterEqual, input_num, primitive->name());
auto infer_type = LogicalNotInferType(primitive, input_args);
auto infer_shape = LogicalNotInferShape(primitive, input_args);
return abstract::MakeAbstract(infer_shape, infer_type);
return abstract::MakeAbstractTensor(infer_shape, infer_type);
}
// AG means auto generated