mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[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:
committed by
PyTorch MergeBot
parent
567e6152da
commit
8fce9a09cd
@ -84,7 +84,7 @@ def implements_diagonal(torch_function):
|
||||
return func
|
||||
return decorator
|
||||
|
||||
class DiagonalTensor(object):
|
||||
class DiagonalTensor:
|
||||
"""A class with __torch_function__ and a specific diagonal representation
|
||||
|
||||
This class has limited utility and is mostly useful for verifying that the
|
||||
@ -358,7 +358,7 @@ def generate_tensor_like_torch_implementations():
|
||||
|
||||
generate_tensor_like_torch_implementations()
|
||||
|
||||
class TensorLike(object):
|
||||
class TensorLike:
|
||||
"""A class that overrides the full torch API
|
||||
|
||||
This class is used to explicitly test that the full torch.tensor API
|
||||
|
Reference in New Issue
Block a user