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)
| 213 | // one cannot call ASSERT_* methods in non-void-returning functions (when |
| 214 | // exceptions are disabled during compilation) |
| 215 | void UseHelper(const std::vector<TF_Output>& inputs, TF_Operation** op) { |
| 216 | TF_OperationDescription* desc = |
| 217 | TF_NewOperation(host_graph_, func_name_, func_node_name_); |
| 218 | for (auto input : inputs) { |
| 219 | TF_AddInput(desc, input); |
| 220 | } |
| 221 | // Set device to CPU because some ops inside the function might not be |
| 222 | // available on GPU. |
| 223 | TF_SetDevice(desc, "/cpu:0"); |
| 224 | *op = TF_FinishOperation(desc, s_); |
| 225 | ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_); |
| 226 | ASSERT_NE(*op, nullptr); |
| 227 | } |
| 228 | |
| 229 | FunctionDef fdef() { |
| 230 | tensorflow::FunctionDef fdef; |
nothing calls this directly
no test coverage detected