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)'
160                    adam_step.add_(p.data, alpha=group['weight_decay'])
161
162                adam_norm = torch.norm(adam_step)
163                if weight_norm == 0 or adam_norm == 0:164                    trust_ratio = 1
165                else:
166                    trust_ratio = weight_norm / adam_norm