Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo9674 committed Oct 13, 2023
1 parent 0aa3e05 commit ecccac6
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions paddle/fluid/pir/dialect/operator/ir/control_flow_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,18 @@ void IfOp::VerifySig() {
phi::errors::PreconditionNotMet(
"The size %d of inputs must be equal to 1.", input_size));

PADDLE_ENFORCE((*this)->operand_source(0).type().isa<pir::DenseTensorType>(),
phi::errors::PreconditionNotMet(
"Type validation failed for the 1th input, it should be a "
"DenseTensorType."));

PADDLE_ENFORCE((*this)
->operand_source(0)
.type()
.dyn_cast<pir::DenseTensorType>()
.dtype()
.isa<pir::BoolType>(),
phi::errors::PreconditionNotMet(
"Type validation failed for the 1th input, it should be a "
"bool DenseTensorType."));
if ((*this)->operand_source(0).type().isa<pir::DenseTensorType>()) {
PADDLE_ENFORCE(
(*this)
->operand_source(0)
.type()
.dyn_cast<pir::DenseTensorType>()
.dtype()
.isa<pir::BoolType>(),
phi::errors::PreconditionNotMet(
"Type validation failed for the 1th input, it should be a "
"bool DenseTensorType."));
}

PADDLE_ENFORCE_EQ((*this)->num_regions(),
2u,
Expand Down

0 comments on commit ecccac6

Please sign in to comment.