Skip to content

Commit 579c619

Browse files
committed
lint
1 parent 7d8236b commit 579c619

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

torch_np/_funcs.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -1911,19 +1911,23 @@ def bartlett(M):
19111911
return torch.bartlett_window(M, periodic=False, dtype=dtype)
19121912

19131913

1914-
19151914
# ### Dtype routines ###
19161915

19171916
# vendored from https://github.com/numpy/numpy/blob/v1.24.0/numpy/lib/type_check.py#L666
19181917

19191918

1920-
array_type = [[torch.float16, torch.float32, torch.float64],
1921-
[None, torch.complex64, torch.complex128]]
1922-
array_precision = {torch.float16: 0,
1923-
torch.float32: 1,
1924-
torch.float64: 2,
1925-
torch.complex64: 1,
1926-
torch.complex128: 2,}
1919+
array_type = [
1920+
[torch.float16, torch.float32, torch.float64],
1921+
[None, torch.complex64, torch.complex128],
1922+
]
1923+
array_precision = {
1924+
torch.float16: 0,
1925+
torch.float32: 1,
1926+
torch.float64: 2,
1927+
torch.complex64: 1,
1928+
torch.complex128: 2,
1929+
}
1930+
19271931

19281932
@normalizer
19291933
def common_type(*tensors: ArrayLike):
@@ -1936,7 +1940,7 @@ def common_type(*tensors: ArrayLike):
19361940
t = a.dtype
19371941
if iscomplexobj(a):
19381942
is_complex = True
1939-
if not(t.is_floating_point or t.is_complex):
1943+
if not (t.is_floating_point or t.is_complex):
19401944
p = 2 # array_precision[_nx.double]
19411945
else:
19421946
p = array_precision.get(t, None)
@@ -1947,5 +1951,3 @@ def common_type(*tensors: ArrayLike):
19471951
return array_type[1][precision]
19481952
else:
19491953
return array_type[0][precision]
1950-
1951-

torch_np/linalg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def matrix_power(a: ArrayLike, n):
4343

4444

4545
@normalizer
46-
def multi_dot(inputs : Sequence[ArrayLike], *, out=None):
46+
def multi_dot(inputs: Sequence[ArrayLike], *, out=None):
4747
return torch.linalg.multi_dot(inputs)
4848

4949

0 commit comments

Comments
 (0)