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

Method MutableGraphView

tensorflow/core/grappler/utils/graph_view.cc:458–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456} // namespace
457
458MutableGraphView::MutableGraphView(GraphDef* graph, Status* status)
459 : GraphViewInternal(graph), mutation_(Mutation(this)) {
460 const int num_nodes = graph->node_size();
461 node_index_by_name_.reserve(num_nodes);
462 nodes_.reserve(num_nodes);
463 for (NodeDef& node : *graph->mutable_node()) {
464 if (!AddUniqueNodeInternal(&node)) {
465 *status = errors::InvalidArgument(
466 kMutableGraphViewError, "graph has multiple nodes with the name '",
467 node.name(), "'.");
468 Reset();
469 return;
470 }
471 }
472 std::vector<std::vector<TensorId>> fanins;
473 Status s = CheckFaninsInternal(&fanins);
474 if (!s.ok()) {
475 *status = s;
476 Reset();
477 return;
478 }
479 AddFaninsInternal(&fanins);
480 mutation_.ResetInternal();
481 *status = Status::OK();
482}
483
484Mutation* MutableGraphView::GetMutationBuilder() { return &mutation_; }
485

Callers

nothing calls this directly

Calls 7

MutationClass · 0.85
InvalidArgumentFunction · 0.85
ResetInternalMethod · 0.80
ResetFunction · 0.70
nameMethod · 0.65
reserveMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected