Skip to content

Commit 932895b

Browse files
committed
fix: update device placement in init method
1 parent abcf336 commit 932895b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

diffusion_models/ddpm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ def __init__(self, model, optimizer, T: int, start: float, end: float, device: t
1515
end (float): Largest variance
1616
device (torch.device, optional): Device. Defaults to torch.device('cpu')
1717
"""
18-
self.model = model
1918
self.optimizer = optimizer
2019
self.device = device
21-
22-
self.model.to(self.device)
20+
self.model = model.to(self.device)
2321

2422
self.T = T
2523
self.beta = torch.linspace(start, end, T).to(device)

0 commit comments

Comments
 (0)