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

Function NodeWithAttrHelper

tensorflow/c/c_api_function_test.cc:1281–1290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1279}
1280
1281void NodeWithAttrHelper(TF_Graph* graph, TF_Status* s, const char* name,
1282 const char* attr_name, const char* attr_value,
1283 TF_Operation** op) {
1284 TF_OperationDescription* desc = TF_NewOperation(graph, "Placeholder", name);
1285 TF_SetAttrType(desc, "dtype", TF_INT32);
1286 TF_SetAttrString(desc, attr_name, attr_value, strlen(attr_value));
1287 *op = TF_FinishOperation(desc, s);
1288 ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);
1289 ASSERT_NE(*op, nullptr);
1290}
1291
1292TEST_F(CApiFunctionTest, GraphToFunctionDefWithArgAttr) {
1293 std::unique_ptr<TF_Graph, decltype(&TF_DeleteGraph)> func_graph(

Callers 1

TEST_FFunction · 0.85

Calls 6

TF_NewOperationFunction · 0.85
TF_SetAttrTypeFunction · 0.85
TF_SetAttrStringFunction · 0.85
TF_FinishOperationFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85

Tested by

no test coverage detected