Revert "Enable ruff rule E721 (#165162)"

This reverts commit 9e7c19f72b6d0690915c307409c0c0a76b5a3bf0.

Reverted https://github.com/pytorch/pytorch/pull/165162 on behalf of https://github.com/pytorch-auto-revert due to Reverted automatically by pytorch's autorevert, to avoid this behaviour add the tag autorevert: disable ([comment](https://github.com/pytorch/pytorch/pull/165162#issuecomment-3393328271))
This commit is contained in:
PyTorch MergeBot
2025-10-11 13:25:40 +00:00
parent 512dd79ff0
commit 816fb7f48d
78 changed files with 164 additions and 166 deletions

View File

@ -367,7 +367,7 @@ class DeepSpeech(nn.Module):
"""
seq_len = input_length
for m in self.conv.modules():
if type(m) is nn.modules.conv.Conv2d:
if type(m) == nn.modules.conv.Conv2d:
seq_len = (
seq_len
+ 2 * m.padding[1]

View File

@ -66,7 +66,7 @@ class GroupedSetup:
def __post_init__(self) -> None:
for field in dataclasses.fields(self):
assert field.type is str
assert field.type == str
value: str = getattr(self, field.name)
object.__setattr__(self, field.name, textwrap.dedent(value))

View File

@ -113,7 +113,7 @@ class TorchBenchmarkBase(torch.nn.Module):
value = kargs[key]
test_name_str.append(
("" if key in skip_key_list else key)
+ str(value if type(value) is not bool else int(value))
+ str(value if type(value) != bool else int(value))
)
name = (self.module_name() + "_" + "_".join(test_name_str)).replace(" ", "")
return name

View File

@ -125,7 +125,7 @@ class CatBenchmark(op_bench.TorchBenchmarkBase):
random.seed(42)
inputs = []
gen_sizes = []
if type(sizes) is list and N == -1:
if type(sizes) == list and N == -1:
gen_sizes = sizes
else:
for i in range(N):

View File

@ -61,7 +61,7 @@ class StackBenchmark(op_bench.TorchBenchmarkBase):
random.seed(42)
inputs = []
gen_sizes = []
if type(sizes) is list and N == -1:
if type(sizes) == list and N == -1:
gen_sizes = sizes
else:
for i in range(N):