Skip to content

Commit

Permalink
device type
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Isaacson committed Jul 29, 2024
1 parent 9e36533 commit a54f7c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/beignet/func/_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class _Normal:
def sample(self):
mu, sigma = self.mean, torch.sqrt(self.var)

mu = mu.to(device=device)
sigma = sigma.to(device=device)

return mu + sigma * torch.normal(0.0, 1.0, mu.shape, dtype=mu.dtype)

def log_prob(self, x):
Expand Down

0 comments on commit a54f7c1

Please sign in to comment.