mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Enable PLC1802 on ruff (#165813)
This PR enables ruff check `PLC1802`, which detects len calls on sequences in a boolean test context. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165813 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
aaac8cb0f5
commit
e595136187
@ -100,7 +100,7 @@ def param_search_greedy(x, bit_rate, n_bins=200, ratio=0.16):
|
||||
cur_min, cur_max, cur_loss = cur_min + stepsize, cur_max, loss1
|
||||
else:
|
||||
cur_min, cur_max, cur_loss = cur_min, cur_max - stepsize, loss2
|
||||
if len(solutions):
|
||||
if solutions:
|
||||
best = solutions[0]
|
||||
for solution in solutions:
|
||||
if solution[-1] < best[-1]:
|
||||
|
Reference in New Issue
Block a user