Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
pomonam committed Jul 10, 2024
1 parent 223dc18 commit b8b1851
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kronfluence/module/tracked_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ def forward(self, inputs: torch.Tensor, *args: Any, **kwargs: Any) -> torch.Tens
The output of the forward pass.
"""
outputs = self.original_module(inputs, *args, **kwargs)
# if outputs.requires_grad:
# return outputs
if outputs.requires_grad and self.gradient_scale == 1.0:
return outputs
return outputs + self._constant

def prepare_storage(self, device: torch.device) -> None:
Expand Down

0 comments on commit b8b1851

Please sign in to comment.