Skip to content

Commit

Permalink
Fix style: Black
Browse files Browse the repository at this point in the history
  • Loading branch information
abdalazizrashid committed Oct 19, 2020
1 parent f926b0a commit 5c21d15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/tensor/test_nlinalg.py
Expand Up @@ -552,7 +552,7 @@ def test_non_square_matrix(self):
a = rng.rand(4, 3).astype(theano.config.floatX)
with pytest.raises(ValueError):
f(a)

def test_negative_matrix(self):
rng = np.random.RandomState(utt.fetch_seed())
A = tensor.matrix("A", dtype=theano.config.floatX)
Expand Down
8 changes: 4 additions & 4 deletions theano/tensor/nlinalg.py
Expand Up @@ -665,9 +665,9 @@ def perform(self, node, inputs, outputs):
def matrix_power(M, n):
r"""
Raise a square matrix to the (integer) power n.
This implementation uses exponentiation by squaring which is
This implementation uses exponentiation by squaring which is
significantly faster than the naive implementation.
The time complexity for exponentiation by squaring is
The time complexity for exponentiation by squaring is
:math: `\mathcal{O}((n \log M)^k`
Parameters
Expand All @@ -676,8 +676,8 @@ def matrix_power(M, n):
n : Python int
"""
if n < 0:
M = pinv(M)
n = abs(n)
M = pinv(M)
n = abs(n)

# Shortcuts when 0 < n <= 3
if n == 0:
Expand Down

0 comments on commit 5c21d15

Please sign in to comment.