The following Add* routines are used to add a few graph nodes while functions are transformed.
| 96 | // The following Add* routines are used to add a few graph nodes while |
| 97 | // functions are transformed. |
| 98 | static Node* AddNoOp(StringPiece name, Graph* g) { |
| 99 | NodeDef ndef; |
| 100 | ndef.set_name(g->NewName(absl::StrCat(kNodeLabel, "/", name))); |
| 101 | ndef.set_op("NoOp"); |
| 102 | Status s; |
| 103 | Node* ret = g->AddNode(ndef, &s); |
| 104 | TF_CHECK_OK(s); |
| 105 | return ret; |
| 106 | } |
| 107 | |
| 108 | static Node* AddIdentity(StringPiece name, Graph* g, Endpoint input) { |
| 109 | DCHECK_LT(0, input.dtype()); |