!48138 [OPS] fix bug of hsigmoid infer

Merge pull request !48138 from yangruoqi713/ops
This commit is contained in:
i-robot 2023-01-29 09:03:37 +00:00 committed by Gitee
commit 11787a7d12
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 0 deletions

View File

@ -26,6 +26,7 @@ namespace ops {
namespace {
abstract::ShapePtr HSigmoidInferShape(const PrimitivePtr &primitive, const std::vector<AbstractBasePtr> &input_args) {
MS_EXCEPTION_IF_NULL(primitive);
CheckAndConvertUtils::CheckInputArgs(input_args, kEqual, 1, primitive->name());
for (const auto &item : input_args) {
MS_EXCEPTION_IF_NULL(item);
}
@ -34,6 +35,8 @@ abstract::ShapePtr HSigmoidInferShape(const PrimitivePtr &primitive, const std::
}
TypePtr HSigmoidInferType(const PrimitivePtr &prim, const std::vector<AbstractBasePtr> &input_args) {
MS_EXCEPTION_IF_NULL(prim);
CheckAndConvertUtils::CheckInputArgs(input_args, kEqual, 1, prim->name());
if (std::any_of(input_args.begin(), input_args.end(), [](const AbstractBasePtr &a) { return a == nullptr; })) {
MS_LOG(EXCEPTION) << "For '" << prim->name()
<< "', the input args used for infer shape and type is necessary, but missing it.";