Skip to content

Commit aaeedd0

Browse files
committed
make it warn
test=develop
1 parent ddd2225 commit aaeedd0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

paddle/fluid/framework/ir/graph.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ void CheckProgram(const ProgramDesc &program) {
3838
visit[role_id] = true;
3939
switch (role_id) {
4040
case _INT(OpRole::kForward):
41-
PADDLE_ENFORCE(
42-
visit.find(_INT(OpRole::kBackward)) == visit.end(),
43-
"Cannot add backward operator before forward operator %s.",
44-
op->Type());
41+
if (visit.find(_INT(OpRole::kBackward)) != visit.end()) {
42+
LOG(ERROR)
43+
<< "Cannot add backward operator before forward operator %s."
44+
<< op->Type();
45+
}
4546
break;
4647
case _INT(OpRole::kBackward):
4748
case _INT(OpRole::kBackward) | _INT(OpRole::kLoss):

0 commit comments

Comments
 (0)