bugfix & update doc

This commit is contained in:
Artiprocher
2025-12-04 10:35:14 +08:00
parent 4a15618080
commit 7747f38561
6 changed files with 768 additions and 23 deletions

View File

@@ -62,7 +62,7 @@ class DiskMap:
param = self.files[file_id].get_tensor(name)
if self.torch_dtype is not None and isinstance(param, torch.Tensor):
param = param.to(self.torch_dtype)
if param.device == "cpu":
if isinstance(param, torch.Tensor) and param.device == "cpu":
param = param.clone()
if isinstance(param, torch.Tensor):
self.num_params += param.numel()