| 942 | } |
| 943 | |
| 944 | StatusOr<Node*> FunctionalizeCond::AddIfNode(const NodeDef& def, |
| 945 | const Node* replacee, |
| 946 | const OutputTensor& predicate) { |
| 947 | Status status; |
| 948 | Node* ret = graph_->AddNode(def, &status); |
| 949 | TF_RETURN_IF_ERROR(status); |
| 950 | VLOG(1) << "Adding If for " << replacee->name(); |
| 951 | StateMap::CondId id = state_map_.LookupCondId(replacee); |
| 952 | if (id) { |
| 953 | StateMap::CondState state = *id; |
| 954 | state.erase(predicate); |
| 955 | state_map_.ResetCondId(ret, state_map_.GetCondId(state)); |
| 956 | } else { |
| 957 | state_map_.ResetCondId(ret, nullptr); |
| 958 | } |
| 959 | |
| 960 | state_map_.ResetAncestorId(ret, state_map_.LookupAncestorId(replacee)); |
| 961 | |
| 962 | return ret; |
| 963 | } |
| 964 | |
| 965 | Status FunctionalizeCond::PropagateUpdatedState(const Node* replacee) { |
| 966 | VLOG(2) << "Propagating update state for " << replacee->name() << " " |
no test coverage detected