Skip to content

Commit

Permalink
detach to avoid graph expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Mamalet committed Jun 5, 2024
1 parent 432f706 commit 4583add
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deel/torchlip/modules/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def _update_mean(self, y_pred):
self.alpha_mean * self.current_mean
+ (1 - self.alpha_mean) * current_global_mean
)
self.current_mean = self.clamp_current_mean(current_global_mean)
self.current_mean = self.clamp_current_mean(current_global_mean).detach()
total_mean = current_global_mean
total_mean = torch.clamp(total_mean, self.min_margin_v, 20000)
return total_mean
Expand Down

0 comments on commit 4583add

Please sign in to comment.