mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Enable ruff rule E721 (#165162)
`E721` checks for object type comparisons using == and other comparison operators. This is useful because it is recommended to use `is` for type comparisons. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165162 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
220a34118f
commit
9e7c19f72b
@ -878,7 +878,7 @@ def forward(self, scores_1, mask_1, value_1):
|
||||
zip(real_out, decomp_out, real_out_double)
|
||||
):
|
||||
if not isinstance(orig, torch.Tensor):
|
||||
assert type(orig) == type(decomp)
|
||||
assert type(orig) is type(decomp)
|
||||
assert orig == decomp
|
||||
continue
|
||||
op_assert_ref(
|
||||
@ -895,7 +895,7 @@ def forward(self, scores_1, mask_1, value_1):
|
||||
else:
|
||||
for orig, decomp in zip(real_out, decomp_out):
|
||||
if not isinstance(orig, torch.Tensor):
|
||||
assert type(orig) == type(decomp)
|
||||
assert type(orig) is type(decomp)
|
||||
assert orig == decomp
|
||||
continue
|
||||
op_assert_equal(
|
||||
|
||||
Reference in New Issue
Block a user