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

Method Lookup

tensorflow/python/eager/pywrap_tensor_conversion.cc:40–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40TFE_TensorHandle* TFE_TensorHandleCache::Lookup(
41 PyObject* value, tensorflow::DataType dtype,
42 absl::string_view device_name) const {
43 CHECK_NOTNULL(value);
44 const auto& it = cache.find(Key{PyObjectPtr{value}, dtype, device_name});
45 if (it == cache.end()) {
46 scalar_cache_misses->GetCell()->IncrementBy(1);
47 return nullptr;
48 }
49
50 scalar_cache_hits->GetCell()->IncrementBy(1);
51 auto* handle = it->second;
52 handle->Ref();
53 return new TFE_TensorHandle(handle);
54}
55
56void TFE_TensorHandleCache::Insert(PyObject* value, tensorflow::DataType dtype,
57 absl::string_view device_name,

Callers 1

ConvertToEagerTensorFunction · 0.45

Calls 5

findMethod · 0.45
endMethod · 0.45
IncrementByMethod · 0.45
GetCellMethod · 0.45
RefMethod · 0.45

Tested by

no test coverage detected