Skip to content

Commit

Permalink
use randn on GPU instead of cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
d4l3k committed Jan 29, 2022
1 parent 93b9ebb commit e33aef8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def compute_losses(self, inputs, outputs):
if not self.opt.disable_automasking:
# add random numbers to break ties
identity_reprojection_loss += torch.randn(
identity_reprojection_loss.shape).cuda() * 0.00001
identity_reprojection_loss.shape, device=self.device) * 0.00001

combined = torch.cat((identity_reprojection_loss, reprojection_loss), dim=1)
else:
Expand Down

0 comments on commit e33aef8

Please sign in to comment.