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

Method Instantiate

tensorflow/core/framework/function_handle_cache.cc:34–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34Status FunctionHandleCache::Instantiate(
35 const string& function_name, AttrSlice attrs,
36 FunctionLibraryRuntime::InstantiateOptions options,
37 FunctionLibraryRuntime::Handle* handle) {
38 string key = Canonicalize(function_name, attrs, options);
39 FunctionLibraryRuntime::Handle h;
40 {
41 tf_shared_lock l(mu_);
42 h = gtl::FindWithDefault(handles_, key, kInvalidHandle);
43 }
44 if (h == kInvalidHandle) {
45 options.state_handle = state_handle_;
46 TF_RETURN_IF_ERROR(
47 lib_->Instantiate(function_name, attrs, options, handle));
48 mutex_lock l(mu_);
49 handles_[key] = *handle;
50 } else {
51 *handle = h;
52 }
53 return Status::OK();
54}
55
56Status FunctionHandleCache::Clear() {
57 mutex_lock l(mu_);

Callers

nothing calls this directly

Calls 1

CanonicalizeFunction · 0.70

Tested by

no test coverage detected