| 1279 | } |
| 1280 | |
| 1281 | void 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 | |
| 1292 | TEST_F(CApiFunctionTest, GraphToFunctionDefWithArgAttr) { |
| 1293 | std::unique_ptr<TF_Graph, decltype(&TF_DeleteGraph)> func_graph( |
no test coverage detected