Skip to content

Commit

Permalink
Fix failing test due to a bug in NumPy when using OpenBLAS (pytorch#6…
Browse files Browse the repository at this point in the history
…7679)

Summary:
Pull Request resolved: pytorch#67679

implementations

Fixes pytorch#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 jambayk committed Feb 14, 2022
1 parent fcb8767 commit 665f28e
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 @@ -1081,7 +1081,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 665f28e

Please sign in to comment.