docs(mm): add comment in move_model_to_device

This commit is contained in:
psychedelicious 2024-06-03 10:56:04 +10:00
parent c7f22b6a3b
commit e7513f6088

View File

@ -261,6 +261,7 @@ class ModelCache(ModelCacheBase[AnyModel]):
if torch.device(source_device).type == torch.device(target_device).type:
return
# Some models don't have a `to` method, in which case they run in RAM/CPU.
if not hasattr(cache_entry.model, "to"):
return