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

Method memory_bytes

deepspeed/utils/static_cache.py:242–244  ·  view source on GitHub ↗

Return the bytes held by the layers' cache tensors.

(self)

Source from the content-addressed store, hash-verified

240 return self._layers
241
242 def memory_bytes(self) -> int:
243 """Return the bytes held by the layers' cache tensors."""
244 return sum(layer.memory_bytes() for layer in self._layers)
245
246 def set_write_position(self, pos: torch.Tensor):
247 """Set the write position shared by all layers.

Calls 1

memory_bytesMethod · 0.45