Skip to content

Commit

Permalink
Update ddim.py: Fix the condition of devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
microboym committed Aug 11, 2023
1 parent 17a7ae2 commit ac00e4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion audioldm2/latent_diffusion/models/ddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, model, schedule="linear", device=torch.device("cuda"), **kwar
def register_buffer(self, name, attr):
if type(attr) == torch.Tensor:
if attr.device != self.device:
if self.device == torch.device("mps") and attr.dtype==torch.float64:
if self.device == "mps" and attr.dtype==torch.float64:
attr = attr.to(self.device, dtype=torch.float32)
else:
attr = attr.to(self.device)
Expand Down

0 comments on commit ac00e4f

Please sign in to comment.