MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / IsGraphValid

Function IsGraphValid

tensorflow/tools/graph_transforms/transform_utils.cc:572–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572Status IsGraphValid(const GraphDef& graph_def) {
573 std::vector<std::pair<string, string>> invalid_inputs;
574 FindInvalidInputs(graph_def, &invalid_inputs);
575 if (!invalid_inputs.empty()) {
576 std::map<string, const NodeDef*> node_map;
577 MapNamesToNodes(graph_def, &node_map);
578 for (const std::pair<string, string>& invalid_input : invalid_inputs) {
579 LOG(ERROR) << "Invalid input " << invalid_input.second << " for node "
580 << invalid_input.first << " - "
581 << node_map[invalid_input.first]->DebugString();
582 }
583 return errors::Internal(
584 "Invalid graph with inputs referring to nonexistent nodes");
585 }
586 return Status::OK();
587}
588
589Status GetInOutTypes(const NodeDef& node_def, DataTypeVector* inputs,
590 DataTypeVector* outputs) {

Callers 3

TransformGraphFunction · 0.85
QuantizeNodesFunction · 0.85
TestIsGraphValidMethod · 0.85

Calls 5

FindInvalidInputsFunction · 0.85
MapNamesToNodesFunction · 0.85
InternalFunction · 0.85
emptyMethod · 0.45
DebugStringMethod · 0.45

Tested by 1

TestIsGraphValidMethod · 0.68