Skip to content

Commit

Permalink
refactor: disable pylint, has_overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kozistr committed Nov 15, 2021
1 parent c92f236 commit 333608f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_optimizer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def is_valid_parameters(parameters: PARAMETERS) -> bool:

def has_overflow(grad_norm: torch.Tensor) -> bool:
"""Detect inf and NaN in grad_norm."""
return grad_norm == float('inf') or grad_norm != grad_norm
return grad_norm == float('inf') or grad_norm != grad_norm # pylint: disable=comparison-with-itself


def normalize_gradient(x: torch.Tensor, use_channels: bool = False, epsilon: float = 1e-8) -> torch.Tensor:
Expand Down

0 comments on commit 333608f

Please sign in to comment.