Skip to content

Commit

Permalink
Fix failing test due to a bug in NumPy when using OpenBLAS (#67679)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #67679

implementations

Fixes #67675

cc mruberry

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D32368698

Pulled By: mruberry

fbshipit-source-id: 3ea6ebc43c061af2f376cdf5da06884859bbbf53
  • Loading branch information
lezcano authored and facebook-github-bot committed Nov 15, 2021
1 parent d1c529b commit 43874d7
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 43874d7

Please sign in to comment.