jettify / pytorch-optimizer

Consider using in PYL-R1714
Performance
Major
1 occurrence in this check
Consider merging these comparisons with "in" to '0 in (weight_norm, adam_norm)'
163                    adam_step.add_(p.data, alpha=group['weight_decay'])
164
165                adam_norm = torch.norm(adam_step)
166                if weight_norm == 0 or adam_norm == 0:167                    trust_ratio = 1
168                else:
169                    trust_ratio = weight_norm / adam_norm