Skip to content

Commit

Permalink
Fix failing test due to a bug in NumPy when using some BLAS
Browse files Browse the repository at this point in the history
implementations

Fixes #67675

ghstack-source-id: 684ad941ae271a5ef3a9c0553d32ab4b1bdb99b7
Pull Request resolved: #67679
  • Loading branch information
lezcano committed Nov 2, 2021
1 parent cd51d2a commit 41ccf26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/test_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,12 @@ def run_test_case(input, p):
a = torch.eye(3, dtype=dtype, device=device)
a[-1, -1] = 0 # make 'a' singular
for p in norm_types:
run_test_case(a, p)
try:
run_test_case(a, p)
except numpy.linalg.LinAlgError:
# Numpy may fail to converge for some BLAS backends (although this is very rare)
# See the discussion in https://github.com/pytorch/pytorch/issues/67675
pass

# test for 0x0 matrices. NumPy doesn't work for such input, we return 0
input_sizes = [(0, 0), (2, 5, 0, 0)]
Expand Down

0 comments on commit 41ccf26

Please sign in to comment.