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

Function EraseNodesFromGraphImpl

tensorflow/core/grappler/utils.cc:438–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436
437template <typename UniqueContainer>
438void EraseNodesFromGraphImpl(const UniqueContainer& nodes_to_delete,
439 GraphDef* graph) {
440 static_assert(std::is_same<typename UniqueContainer::value_type, int>::value,
441 "Need to pass container of ints");
442
443 int last = graph->node_size() - 1;
444 for (auto it = nodes_to_delete.rbegin(); it != nodes_to_delete.rend(); ++it) {
445 const int index = *it;
446 graph->mutable_node()->SwapElements(index, last);
447 last--;
448 }
449 graph->mutable_node()->DeleteSubrange(last + 1, nodes_to_delete.size());
450}
451
452template <typename T>
453inline void STLSortAndRemoveDuplicates(T* v) {

Callers 1

EraseNodesFromGraphFunction · 0.85

Calls 3

rbeginMethod · 0.80
rendMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected