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

Function NextIterationName

tensorflow/cc/ops/while_loop.cc:55–62  ·  view source on GitHub ↗

Manually generates the name of the `loop_var_idx`-th NextIteration node of a loop being constructed with `scope`. This is used to define the backedge before the NextIteration node is created.

Source from the content-addressed store, hash-verified

53// loop being constructed with `scope`. This is used to define the backedge
54// before the NextIteration node is created.
55string NextIterationName(const Scope& scope, int loop_var_idx) {
56 string result;
57 const string& prefix = scope.impl()->name();
58 if (!prefix.empty()) strings::StrAppend(&result, prefix, "/");
59 strings::StrAppend(&result, "NextIteration");
60 if (loop_var_idx > 0) strings::StrAppend(&result, "_", loop_var_idx);
61 return result;
62}
63
64// Creates the `loop_var_idx`-th Merge node of a loop being constructed with
65// `scope`. `enter_output` is the `loop_var_idx`-th Enter node's output.

Callers 2

CreateMergeFunction · 0.85
BuildWhileLoopFunction · 0.85

Calls 4

nameMethod · 0.65
StrAppendFunction · 0.50
implMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected