| 1447 | } |
| 1448 | |
| 1449 | Status ConvertNodeDefsToGraph(const GraphConstructorOptions& opts, |
| 1450 | gtl::ArraySlice<NodeDef> nodes, Graph* g) { |
| 1451 | ShapeRefiner refiner(TF_GRAPH_DEF_VERSION, g->op_registry()); |
| 1452 | // TODO(irving): Copy will go away once NodeInfo exists |
| 1453 | std::vector<const NodeDef*> node_defs; |
| 1454 | node_defs.reserve(nodes.size()); |
| 1455 | for (const auto& n : nodes) { |
| 1456 | node_defs.push_back(&n); |
| 1457 | } |
| 1458 | return GraphConstructor::Construct(opts, node_defs, nullptr, nullptr, g, |
| 1459 | &refiner, /*return_tensors=*/nullptr, |
| 1460 | /*return_nodes=*/nullptr, |
| 1461 | /*missing_unused_input_map_keys=*/nullptr); |
| 1462 | } |
| 1463 | |
| 1464 | Status ImportGraphDef(const ImportGraphDefOptions& opts, const GraphDef& gdef, |
| 1465 | Graph* g, ShapeRefiner* refiner, |