| 50 | } |
| 51 | |
| 52 | Status BackEdgeHelper::Replace() { |
| 53 | if (graph_ == nullptr) { |
| 54 | return errors::Internal("BackEdgeHelper Replace called before Remove."); |
| 55 | } |
| 56 | if (replaced_) { |
| 57 | return errors::Internal("BackEdgeHelper Replace called more than once."); |
| 58 | } |
| 59 | replaced_ = true; |
| 60 | for (const BackEdge& be : back_edges_) { |
| 61 | graph_->AddEdge(be.src, be.src_output, be.dst, be.dst_input); |
| 62 | } |
| 63 | return Status::OK(); |
| 64 | } |
| 65 | |
| 66 | } // namespace tensorflow |
no test coverage detected