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

Function LookupOrCreate

tensorflow/core/framework/resource_mgr_test.cc:64–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63template <typename T>
64string LookupOrCreate(ResourceMgr* rm, const string& container,
65 const string& name, const string& label) {
66 T* r;
67 TF_CHECK_OK(rm->LookupOrCreate<T>(container, name, &r, [&label](T** ret) {
68 *ret = new T(label);
69 return Status::OK();
70 }));
71 const string ret = r->DebugString();
72 r->Unref();
73 return ret;
74}
75
76static void HasError(const Status& s, const string& substr) {
77 EXPECT_TRUE(absl::StrContains(s.ToString(), substr))

Callers 4

GetOrCreateMaxMethod · 0.85
GetOrCreateMinMethod · 0.85
GetOrCreateAddMethod · 0.85
GetOrCreateMulMethod · 0.85

Calls 2

DebugStringMethod · 0.45
UnrefMethod · 0.45

Tested by

no test coverage detected