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

Function NodeWithPlaceholderAttrHelper

tensorflow/c/c_api_function_test.cc:1239–1247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1237 .SetShapeFn(tensorflow::shape_inference::UnknownShape);
1238
1239void NodeWithPlaceholderAttrHelper(TF_Graph* graph, TF_Status* s,
1240 const char* name, const char* placeholder,
1241 TF_Operation** op) {
1242 TF_OperationDescription* desc = TF_NewOperation(graph, "CustomOp", name);
1243 TF_SetAttrPlaceholder(desc, "index", placeholder);
1244 *op = TF_FinishOperation(desc, s);
1245 ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);
1246 ASSERT_NE(*op, nullptr);
1247}
1248
1249TEST_F(CApiFunctionTest, GraphToFunctionDefWithPlaceholderAttr) {
1250 std::unique_ptr<TF_Graph, decltype(&TF_DeleteGraph)> func_graph(

Callers 1

TEST_FFunction · 0.85

Calls 5

TF_NewOperationFunction · 0.85
TF_SetAttrPlaceholderFunction · 0.85
TF_FinishOperationFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85

Tested by

no test coverage detected