We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c92f236 commit 333608fCopy full SHA for 333608f
pytorch_optimizer/utils.py
@@ -13,7 +13,7 @@ def is_valid_parameters(parameters: PARAMETERS) -> bool:
13
14
def has_overflow(grad_norm: torch.Tensor) -> bool:
15
"""Detect inf and NaN in grad_norm."""
16
- 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
17
18
19
def normalize_gradient(x: torch.Tensor, use_channels: bool = False, epsilon: float = 1e-8) -> torch.Tensor:
0 commit comments