!49815 fix scale_and_translate dynamic shape

Merge pull request !49815 from yeyunpeng2020/master_ops
This commit is contained in:
i-robot 2023-03-07 01:19:45 +00:00 committed by Gitee
commit 9da9e67ef5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,13 @@ abstract::ShapePtr ScaleAndTranslateInferShape(const PrimitivePtr &primitive,
IsDynamicRank(translation_shape)) {
return std::make_shared<abstract::Shape>(ShapeVector({abstract::Shape::kShapeRankAny}));
}
// support dynamic shape
if (IsDynamicShape(images_shape) || IsDynamicShape(size_shape) || IsDynamicShape(scale_shape) ||
IsDynamicShape(translation_shape)) {
return std::make_shared<abstract::Shape>(
ShapeVector({abstract::Shape::kShapeDimAny, abstract::Shape::kShapeDimAny, abstract::Shape::kShapeDimAny,
abstract::Shape::kShapeDimAny}));
}
const int64_t kShapeSize = 1;
const int64_t kElementsNumber = 2;