mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE]: Update flake8 to v6.1.0 and fix lints (#116591)
Updates flake8 to v6.1.0 and fixes a few lints using sed and some ruff tooling. - Replace `assert(0)` with `raise AssertionError()` - Remove extraneous parenthesis i.e. - `assert(a == b)` -> `assert a == b` - `if(x > y or y < z):`->`if x > y or y < z:` - And `return('...')` -> `return '...'` Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/116591 Approved by: https://github.com/albanD, https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
09ee96b69d
commit
3fe437b24b
@ -217,7 +217,7 @@ class SubTensor(torch.Tensor):
|
||||
"""
|
||||
@classmethod
|
||||
def __torch_function__(cls, func, types, args=(), kwargs=None):
|
||||
if(kwargs is None):
|
||||
if kwargs is None:
|
||||
kwargs = {}
|
||||
|
||||
if func not in HANDLED_FUNCTIONS_SUB:
|
||||
@ -368,7 +368,7 @@ class TensorLike:
|
||||
"""
|
||||
@classmethod
|
||||
def __torch_function__(cls, func, types, args=(), kwargs=None):
|
||||
if(kwargs is None):
|
||||
if kwargs is None:
|
||||
kwargs = {}
|
||||
|
||||
if func not in HANDLED_FUNCTIONS_TENSOR_LIKE:
|
||||
|
Reference in New Issue
Block a user