| 134 | } |
| 135 | |
| 136 | static Node* AddRet(Graph* g, Endpoint input, int index) { |
| 137 | DCHECK_LT(0, input.dtype()); |
| 138 | DCHECK_LT(input.dtype(), DT_FLOAT_REF); |
| 139 | NodeDef ndef; |
| 140 | ndef.set_name(g->NewName(kNodeLabel)); |
| 141 | ndef.set_op(kRetOp); |
| 142 | ndef.add_input(input.name()); |
| 143 | AddNodeAttr("T", input.dtype(), &ndef); |
| 144 | AddNodeAttr("index", index, &ndef); |
| 145 | Status s; |
| 146 | Node* ret = g->AddNode(ndef, &s); |
| 147 | TF_CHECK_OK(s); |
| 148 | g->AddEdge(input.node, input.index, ret, 0); |
| 149 | return ret; |
| 150 | } |
| 151 | |
| 152 | // FunctionLibraryRuntime implementation that forwards all the function calls to |
| 153 | // the base runtime implementation, and only overrides FunctionLibraryDefinition |