mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Enable ruff FURB161 rule (#164654)
This PR enables FURB161 in ruff. Pull Request resolved: https://github.com/pytorch/pytorch/pull/164654 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
5ed4270440
commit
cf0a00d4f3
@ -187,7 +187,6 @@ ignore = [
|
||||
# TODO: Remove Python-3.10 specific suppressions
|
||||
"B905",
|
||||
"UP035",
|
||||
"FURB161",
|
||||
]
|
||||
select = [
|
||||
"B",
|
||||
|
@ -235,7 +235,7 @@ class TestBitCount(TestCase):
|
||||
def test_small(self, itype):
|
||||
for a in range(max(np.iinfo(itype).min, 0), 128):
|
||||
msg = f"Smoke test for {itype}({a}).bit_count()"
|
||||
assert itype(a).bit_count() == bin(a).count("1"), msg
|
||||
assert itype(a).bit_count() == a.bit_count(), msg
|
||||
|
||||
def test_bit_count(self):
|
||||
for exp in [10, 17, 63]:
|
||||
|
Reference in New Issue
Block a user