mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[2/N] Use "is" in python type comparison (#165142)
This is follow-up of #165037. It generally recommended to use `is/is not` to compare types. Therefore this series of changes apply this suggestion in the code base, and it aims to finally enabling related linter checks. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165142 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
10a9fb641b
commit
fb64da0791
@ -889,7 +889,7 @@ class TypedStorage:
|
||||
return self._untyped_storage
|
||||
|
||||
def _new_wrapped_storage(self, untyped_storage) -> Self:
|
||||
assert type(untyped_storage) == torch.UntypedStorage
|
||||
assert type(untyped_storage) is torch.UntypedStorage
|
||||
|
||||
if type(self) is TypedStorage:
|
||||
return cast(
|
||||
|
Reference in New Issue
Block a user