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

Method reset

deepspeed/utils/static_cache.py:154–157  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

152 return self.keys.nbytes + self.values.nbytes
153
154 def reset(self) -> None:
155 if self.is_initialized:
156 self.keys.zero_()
157 self.values.zero_()
158
159 def _compact_rows(self, active_indices: torch.Tensor, count: int | None = None) -> None:
160 """Compact only the row tensors; used by the multi-layer cache."""

Callers 2

_trim_leftMethod · 0.95
resetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected