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

Function BuildIdentityNode

tensorflow/compiler/tf2xla/tf2xla_util.cc:742–760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740}
741
742xla::StatusOr<Node*> BuildIdentityNode(
743 Graph* graph, const string& node_name, DataType dtype, const Node* input,
744 absl::optional<string> requested_device) {
745 // Create identity node.
746 NodeDef ndef;
747 ndef.set_name(node_name);
748 ndef.set_op("Identity");
749 if (input) {
750 ndef.add_input(input->name());
751 }
752 if (requested_device) {
753 ndef.set_device(*requested_device);
754 }
755 AddNodeAttr("T", dtype, &ndef);
756 Status s;
757 Node* id_node = graph->AddNode(ndef, &s);
758 TF_RETURN_IF_ERROR(s);
759 return id_node;
760}
761
762Status PropagateConstIntoFunctionalNodes(
763 Graph* g, const FunctionLibraryDefinition* lookup_fld,

Callers

nothing calls this directly

Calls 7

set_opMethod · 0.80
nameMethod · 0.65
AddNodeAttrFunction · 0.50
set_nameMethod · 0.45
add_inputMethod · 0.45
set_deviceMethod · 0.45
AddNodeMethod · 0.45

Tested by

no test coverage detected