Serialize func_ to fdef and import it back
| 366 | |
| 367 | // Serialize func_ to fdef and import it back |
| 368 | void Reincarnate() { |
| 369 | // func_ -> fdef |
| 370 | tensorflow::FunctionDef fdef; |
| 371 | ASSERT_TRUE(GetFunctionDef(func_, &fdef)); |
| 372 | TF_DeleteFunction(func_); |
| 373 | |
| 374 | // fdef -> func_ |
| 375 | string buf; |
| 376 | ASSERT_TRUE(fdef.SerializeToString(&buf)); |
| 377 | func_ = TF_FunctionImportFunctionDef(buf.data(), buf.size(), s_); |
| 378 | ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_); |
| 379 | } |
| 380 | |
| 381 | void GetAttr(const char* attr_name, AttrValue* out_attr) { |
| 382 | TF_Buffer* attr_buf = TF_NewBuffer(); |
nothing calls this directly
no test coverage detected