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

Function CreateInput

tensorflow/c/c_api.cc:1810–1819  ·  view source on GitHub ↗

Creates a placeholder representing an input to the cond or body graph. TODO(skyewm): remove these from final graph

Source from the content-addressed store, hash-verified

1808// Creates a placeholder representing an input to the cond or body graph.
1809// TODO(skyewm): remove these from final graph
1810bool 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`

Callers 1

TF_NewWhileFunction · 0.70

Calls 5

TF_NewOperationFunction · 0.85
TF_SetAttrTypeFunction · 0.85
TF_OperationOutputTypeFunction · 0.85
TF_FinishOperationFunction · 0.85
TF_GetCodeFunction · 0.85

Tested by

no test coverage detected