Skip to content

Commit

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

Fixes #67675

ghstack-source-id: 705569c1a653288aad45c624e3ab0fbeaddcb956
Pull Request resolved: #67679
  • Loading branch information
lezcano committed Nov 11, 2021
1 parent cd51d2a commit 68cc450
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 np.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 68cc450

Please sign in to comment.