All the *Helper methods are used as a workaround for the restrictions that one cannot call ASSERT_* methods in non-void-returning functions (when exceptions are disabled during compilation)
| 106 | // one cannot call ASSERT_* methods in non-void-returning functions (when |
| 107 | // exceptions are disabled during compilation) |
| 108 | void PlaceholderHelper(TF_Graph* graph, TF_Status* s, const char* name, |
| 109 | TF_DataType dtype, const std::vector<int64_t>& dims, |
| 110 | TF_Operation** op) { |
| 111 | TF_OperationDescription* desc = TF_NewOperation(graph, "Placeholder", name); |
| 112 | TF_SetAttrType(desc, "dtype", dtype); |
| 113 | if (!dims.empty()) { |
| 114 | TF_SetAttrShape(desc, "shape", dims.data(), dims.size()); |
| 115 | } |
| 116 | *op = TF_FinishOperation(desc, s); |
| 117 | ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s); |
| 118 | ASSERT_NE(*op, nullptr); |
| 119 | } |
| 120 | |
| 121 | TF_Operation* Placeholder(TF_Graph* graph, TF_Status* s, const char* name, |
| 122 | TF_DataType dtype, const std::vector<int64_t>& dims) { |
no test coverage detected