Bug in is_test pass
Created by: hshen14
In is_test pass, the code will check the whether op has attribute or op defines is_test first and then whether op exists in the specified op_list.
for (const Node* n : graph->Nodes()) {
if (n->IsOp()) {
auto* op = n->Op();
if (op->HasAttr("is_test") || op->HasProtoAttr("is_test")) {
op->SetAttr("is_test", true);
} else if (std::find(begin(op_list), end(op_list), op->Type()) !=
end(op_list)) {
op->MutableAttrMap()->insert(
std::pair<std::string, Attribute>("is_test", true));
}
}
The right logic should check op first and then the op attribute. Please consider to fix it. @kbinias