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

Method Reincarnate

tensorflow/c/c_api_function_test.cc:368–379  ·  view source on GitHub ↗

Serialize func_ to fdef and import it back

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 8

GetFunctionDefFunction · 0.85
TF_DeleteFunctionFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85
SerializeToStringMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected