Creates a placeholder representing an input to the cond or body graph. TODO(skyewm): remove these from final graph
| 1808 | // Creates a placeholder representing an input to the cond or body graph. |
| 1809 | // TODO(skyewm): remove these from final graph |
| 1810 | bool CreateInput(const TF_Output& parent_input, TF_Graph* g, const char* name, |
| 1811 | TF_Output* input, TF_Status* status) { |
| 1812 | TF_OperationDescription* desc = TF_NewOperation(g, "Placeholder", name); |
| 1813 | TF_SetAttrType(desc, "dtype", TF_OperationOutputType(parent_input)); |
| 1814 | // TODO(skyewm): set placeholder shape |
| 1815 | TF_Operation* oper = TF_FinishOperation(desc, status); |
| 1816 | if (TF_GetCode(status) != TF_OK) return false; |
| 1817 | *input = {oper, 0}; |
| 1818 | return true; |
| 1819 | } |
| 1820 | |
| 1821 | // Copies `src_graph` into `dst_graph`. Any node in `src_graph` with input |
| 1822 | // `src_inputs[i]` will have that input replaced with `dst_inputs[i]`. `prefix` |
no test coverage detected