| 740 | } |
| 741 | |
| 742 | xla::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 | |
| 762 | Status PropagateConstIntoFunctionalNodes( |
| 763 | Graph* g, const FunctionLibraryDefinition* lookup_fld, |
nothing calls this directly
no test coverage detected