[BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308)

Apply parts of pyupgrade to torch (starting with the safest changes).
This PR only does two things: removes the need to inherit from object and removes unused future imports.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94308
Approved by: https://github.com/ezyang, https://github.com/albanD
This commit is contained in:
Aaron Gokaslan
2023-02-07 21:10:52 +00:00
committed by PyTorch MergeBot
parent 567e6152da
commit 8fce9a09cd
243 changed files with 487 additions and 492 deletions

View File

@ -313,7 +313,7 @@ def is_torch_jit_ignore_context_manager(stmt):
return True
return False
class Builder(object):
class Builder:
def __call__(self, ctx, node):
method = getattr(self, 'build_' + node.__class__.__name__, None)
if method is None: