Return the bytes held by the layers' cache tensors.
(self)
| 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. |