From e699f81d24c9da59d6c5b3bc86266852cfdff062 Mon Sep 17 00:00:00 2001 From: zhangbo9674 <82555433+zhangbo9674@users.noreply.github.com> Date: Thu, 6 Jul 2023 20:08:51 +0800 Subject: [PATCH] fix bug (#55200) --- paddle/fluid/ir/dialect/op_generator/op_verify_gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/ir/dialect/op_generator/op_verify_gen.py b/paddle/fluid/ir/dialect/op_generator/op_verify_gen.py index 1e7441476fe..9c1e8a8d1eb 100644 --- a/paddle/fluid/ir/dialect/op_generator/op_verify_gen.py +++ b/paddle/fluid/ir/dialect/op_generator/op_verify_gen.py @@ -97,8 +97,8 @@ OUTPUT_VECTORTYPE_CHECK_TEMPLATE = """ phi::errors::PreconditionNotMet("Type validation failed for the {index}th output.")); }}""" OUTPUT_OPTIONAL_TYPE_CHECK_TEMPLATE = """ - if (auto output_{index} = (*this)->result({index})) {{ - PADDLE_ENFORCE(output_{index}.type().isa<{standard}>(), + if (auto output_{index}_type = (*this)->result({index}).type()) {{ + PADDLE_ENFORCE(output_{index}_type.isa<{standard}>(), phi::errors::PreconditionNotMet("Type validation failed for the {index}th output.")); }}""" OUTPUT_OPTIONAL_VECTORTYPE_CHECK_TEMPLATE = """ -- GitLab