(tensor: Optional[torch.Tensor])
| 600 | data_tensor = tensor.detach() |
| 601 | if data_tensor.dtype == torch.bfloat16: |
| 602 | data_tensor = data_tensor.to(torch.float32) |
| 603 | data = data_tensor.contiguous().cpu().numpy().tobytes() |
| 604 | return hashlib.sha256(data).hexdigest() |
| 605 | |
| 606 | buffer_index = 0 |
| 607 | context_buf = room_buffers[buffer_index] |
| 608 | context_buf.zero_() |
| 609 | context_view = _buffer_view(context_buf, GET_DTYPE(), tuple(context.shape)) |
| 610 | context_view.copy_(context) |
| 611 | buffer_index += 1 |
| 612 | if config.get("enable_cfg", False): |