Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
liuwenran committed Sep 8, 2023
1 parent 850b7e3 commit 83a30e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mmagic/models/archs/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,8 @@ def to(
torch_device: Optional[Union[str, torch.device]] = None,
torch_dtype: Optional[torch.dtype] = None,
):
self.model.to(torch_device, torch_dtype)
if torch_dtype is None:
self.model.to(torch_device)
else:
self.model.to(torch_device, torch_dtype)
return self

0 comments on commit 83a30e8

Please sign in to comment.