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

Method memory_bytes

deepspeed/utils/static_cache.py:319–321  ·  view source on GitHub ↗

Return the bytes held by the layers' cache tensors.

(self)

Source from the content-addressed store, hash-verified

317 return self._layers
318
319 def memory_bytes(self) -> int:
320 """Return the bytes held by the layers' cache tensors."""
321 return sum(layer.memory_bytes() for layer in self._layers)
322
323 def set_write_position(self, pos: torch.Tensor):
324 """Set the write position shared by all layers.

Calls 1

memory_bytesMethod · 0.45