Apply several ruff SIM rules (#37283)
* Apply ruff SIM118 fix Signed-off-by: cyy <cyyever@outlook.com> * Apply ruff SIM910 fix Signed-off-by: cyy <cyyever@outlook.com> * Apply ruff SIM101 fix Signed-off-by: cyy <cyyever@outlook.com> * Format code Signed-off-by: cyy <cyyever@outlook.com> * More fixes Signed-off-by: cyy <cyyever@outlook.com> --------- Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
@@ -726,7 +726,7 @@ class BaseSerializationTest(unittest.TestCase):
|
||||
d1 = dict(model_1.named_parameters())
|
||||
self.assertTrue(d0.keys() == d1.keys())
|
||||
|
||||
for k in d0.keys():
|
||||
for k in d0:
|
||||
self.assertTrue(d0[k].shape == d1[k].shape)
|
||||
self.assertTrue(d0[k].device.type == d1[k].device.type)
|
||||
self.assertTrue(d0[k].device == d1[k].device)
|
||||
|
||||
@@ -251,7 +251,7 @@ class QuantoQuantizationTest(unittest.TestCase):
|
||||
d0 = dict(model1.named_parameters())
|
||||
d1 = dict(model2.named_parameters())
|
||||
self.assertTrue(d0.keys() == d1.keys())
|
||||
for k in d0.keys():
|
||||
for k in d0:
|
||||
self.assertTrue(d0[k].shape == d1[k].shape)
|
||||
self.assertTrue(d0[k].device.type == d1[k].device.type)
|
||||
self.assertTrue(d0[k].device == d1[k].device)
|
||||
|
||||
Reference in New Issue
Block a user