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

Function DedupControlInputs

tensorflow/core/grappler/utils.cc:421–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void DedupControlInputs(NodeDef* node) {
422 std::unordered_set<string> inputs;
423 int pos = 0;
424 while (pos < node->input_size()) {
425 const string& input = node->input(pos);
426 if (!inputs.insert(NodeName(input)).second && IsControlInput(input)) {
427 node->mutable_input()->SwapElements(pos, node->input_size() - 1);
428 node->mutable_input()->RemoveLast();
429 } else {
430 ++pos;
431 }
432 }
433}
434
435namespace {
436

Callers 7

TEST_FFunction · 0.85
ForwardInputsMethod · 0.85
MergeConcatMethod · 0.85
OptimizeNodeMethod · 0.85
CleanControlInputsMethod · 0.85

Calls 6

NodeNameFunction · 0.85
IsControlInputFunction · 0.85
input_sizeMethod · 0.45
inputMethod · 0.45
insertMethod · 0.45
mutable_inputMethod · 0.45

Tested by 1

TEST_FFunction · 0.68