MCPcopy
hub / github.com/hpcaitech/ColossalAI / get

Method get

examples/tutorial/opt/inference/cache.py:29–40  ·  view source on GitHub ↗
(self, key: Hashable)

Source from the content-addressed store, hash-verified

27 self._lock = Lock()
28
29 def get(self, key: Hashable) -> List[Any]:
30 with self.lock():
31 if key in self.fixed_cache:
32 l = self.fixed_cache[key]
33 if len(l) >= self.list_size:
34 return l
35 elif key in self.cache:
36 self.cache.move_to_end(key)
37 l = self.cache[key]
38 if len(l) >= self.list_size:
39 return l
40 raise MissCacheError()
41
42 def add(self, key: Hashable, value: Any) -> None:
43 with self.lock():

Callers 15

is_availableMethod · 0.45
set_cuda_arch_listFunction · 0.45
generateFunction · 0.45
generateFunction · 0.45
build_dataloaderFunction · 0.45
build_dataloaderFunction · 0.45
health_checkMethod · 0.45
benchmark_inferenceFunction · 0.45
inferFunction · 0.45
inferFunction · 0.45
log_imgMethod · 0.45
main.pyFile · 0.45

Calls 2

lockMethod · 0.95
MissCacheErrorClass · 0.85

Tested by

no test coverage detected