Skip to content

Commit

Permalink
Replace IR_THROW() with PADDLE_THROW()
Browse files Browse the repository at this point in the history
  • Loading branch information
gongshaotian committed Aug 25, 2023
1 parent 35c9390 commit da03ecb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions paddle/fluid/ir/drr/ir_operation_creator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Operation* CreateOperation(const OpCall& op_call,
op_call.outputs()[1]->name(),
std::make_shared<IrValue>(reshape_op->result(1)));
return reshape_op;

} else if (op_call.name() == "pd.transpose") {
const auto& inputs = op_call.inputs();
std::vector<Value> ir_values =
Expand All @@ -96,19 +96,16 @@ Operation* CreateOperation(const OpCall& op_call,

} else if (op_call.name() == "pd.full") {
const auto& inputs = op_call.inputs();
std::vector<Value> ir_values =
std::vector<Value> ir_values =
GetIrValuesByDrrTensors(inputs, *res_match_ctx);
Operation* full_op = rewriter.Build<paddle::dialect::FullOp>(
CreateAttributeMap(op_call, src_match_ctx)
);
res_match_ctx->BindIrValue(
op_call.outputs()[0]->name(),
std::make_shared<IrValue>(full_op->result(0)));
CreateAttributeMap(op_call, src_match_ctx));
res_match_ctx->BindIrValue(op_call.outputs()[0]->name(),
std::make_shared<IrValue>(full_op->result(0)));
return full_op;
}

LOG(ERROR) << "Unknown op " << op_call.name();
return nullptr;
PADDLE_THROW("Unknown op :" + op_call.name());
}

} // namespace drr
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/ir/drr/match_context_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct IrAttrTypeCast<std::vector<int64_t>> {
attr.dyn_cast<paddle::dialect::IntArrayAttribute>().data().GetData();
return result;
}
IR_THROW("Dynamic cast failed for IR attribute vector<int64_t>");
PADDLE_THROW("Dynamic cast failed for IR attribute vector<int64_t>");
}
};

Expand Down

0 comments on commit da03ecb

Please sign in to comment.