Skip to content

Commit 333608f

Browse files
committed
refactor: disable pylint, has_overflow
1 parent c92f236 commit 333608f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_optimizer/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def is_valid_parameters(parameters: PARAMETERS) -> bool:
1313

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

1818

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

0 commit comments

Comments
 (0)