| 355 | } |
| 356 | |
| 357 | Status GetFetchNode(const MutableGraphView& graph, const GrapplerItem& item, |
| 358 | NodeDef** fetch_node) { |
| 359 | if (item.fetch.size() != 1) { |
| 360 | return errors::InvalidArgument( |
| 361 | "Expected only one fetch node but there were ", item.fetch.size(), ": ", |
| 362 | absl::StrJoin(item.fetch, ", ")); |
| 363 | } |
| 364 | |
| 365 | *fetch_node = graph.GetNode(item.fetch.at(0)); |
| 366 | |
| 367 | return Status::OK(); |
| 368 | } |
| 369 | |
| 370 | } // namespace graph_utils |
| 371 | } // namespace grappler |