Skip to content

Commit

Permalink
Merge pull request #413 from d4l3k/master
Browse files Browse the repository at this point in the history
use randn on GPU instead of cpu
  • Loading branch information
mrharicot authored Jan 30, 2022
2 parents 93b9ebb + e33aef8 commit b676244
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 b676244

Please sign in to comment.