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

Function AddIdentity

tensorflow/core/common_runtime/function.cc:108–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108static Node* AddIdentity(StringPiece name, Graph* g, Endpoint input) {
109 DCHECK_LT(0, input.dtype());
110 NodeDef ndef;
111 ndef.set_name(g->NewName(absl::StrCat(kNodeLabel, "/", name)));
112 ndef.set_op("Identity");
113 ndef.add_input(input.name());
114 AddNodeAttr("T", BaseType(input.dtype()), &ndef);
115 Status s;
116 Node* ret = g->AddNode(ndef, &s);
117 TF_CHECK_OK(s);
118 g->AddEdge(input.node, input.index, ret, 0);
119 return ret;
120}
121
122static Node* AddArg(Graph* g, DataType dtype, int index) {
123 DCHECK_LT(0, dtype);

Callers 2

RemoveListArrayConverterFunction · 0.85
InlineFunctionBodyFunction · 0.85

Calls 11

BaseTypeFunction · 0.85
set_opMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50
AddNodeAttrFunction · 0.50
dtypeMethod · 0.45
set_nameMethod · 0.45
NewNameMethod · 0.45
add_inputMethod · 0.45
AddNodeMethod · 0.45
AddEdgeMethod · 0.45

Tested by

no test coverage detected