fix chunk move device (#1158)

pull/1160/head
ver217 2022-06-22 18:07:10 +08:00 committed by GitHub
parent 07f9c781f9
commit 4e67b2a890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -455,7 +455,7 @@ class ChunkManager:
chunk (Chunk): the chunk to move to target device
device (torch.device): target device
"""
if chunk.data.device == device:
if chunk.device_type == device.type:
return
if chunk.can_move_device and not chunk.is_empty:
self.total_mem[chunk.device_type] -= chunk.mem