MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __init__

Method __init__

deepspeed/utils/static_cache.py:46–51  ·  view source on GitHub ↗
(self, max_cache_len: int)

Source from the content-addressed store, hash-verified

44 is_sliding = False
45
46 def __init__(self, max_cache_len: int):
47 self.max_cache_len = max_cache_len
48 self.keys: torch.Tensor | None = None
49 self.values: torch.Tensor | None = None
50 self.is_initialized = False
51 self._write_position: torch.Tensor | None = None
52
53 def set_write_position(self, pos: torch.Tensor):
54 if not isinstance(pos, torch.Tensor) or pos.dim() not in (0, 1):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected