make it warn

test=develop
fix_recordio_link
Xin Pan 7 years ago
parent ddd2225b56
commit aaeedd0ff3

@ -38,10 +38,11 @@ void CheckProgram(const ProgramDesc &program) {
visit[role_id] = true; visit[role_id] = true;
switch (role_id) { switch (role_id) {
case _INT(OpRole::kForward): case _INT(OpRole::kForward):
PADDLE_ENFORCE( if (visit.find(_INT(OpRole::kBackward)) != visit.end()) {
visit.find(_INT(OpRole::kBackward)) == visit.end(), LOG(ERROR)
"Cannot add backward operator before forward operator %s.", << "Cannot add backward operator before forward operator %s."
op->Type()); << op->Type();
}
break; break;
case _INT(OpRole::kBackward): case _INT(OpRole::kBackward):
case _INT(OpRole::kBackward) | _INT(OpRole::kLoss): case _INT(OpRole::kBackward) | _INT(OpRole::kLoss):

Loading…
Cancel
Save