1
1
from __future__ import division
2
- from hypothesis import given , assume , reproduce_failure
3
- from math import sqrt , floor
2
+ from hypothesis import given , assume
3
+ import numpy
4
4
5
5
from blis_tests_common import *
6
6
from blis .py import dotv
7
- from blis .cy import NO_CONJUGATE , CONJUGATE
8
7
9
8
10
9
@given (
@@ -23,12 +22,6 @@ def test_memoryview_double_noconj(A, B):
23
22
assert_allclose ([numpy_result ], result , atol = 1e-3 , rtol = 1e-3 )
24
23
25
24
26
- @reproduce_failure (
27
- "6.103.5" , b"AXicY2AAggaXUAauVetzGBiBHMYGBjBgZATyGCFshhRGJgY4SGFkBmmCKmNAAgAMFQS/"
28
- )
29
- @reproduce_failure (
30
- "6.103.5" , b"AXicE2NAAGsxRiDJCOUpMzIipJQZWYDkQY6POYVSFz8h6WEAAGinBSs="
31
- )
32
25
@given (
33
26
ndarrays (min_len = 10 , max_len = 100 , min_val = - 100.0 , max_val = 100.0 , dtype = "float32" ),
34
27
ndarrays (min_len = 10 , max_len = 100 , min_val = - 100.0 , max_val = 100.0 , dtype = "float32" ),
@@ -42,4 +35,19 @@ def test_memoryview_float_noconj(A, B):
42
35
assume (B is not None )
43
36
numpy_result = A .dot (B )
44
37
result = dotv (A , B )
45
- assert_allclose ([numpy_result ], result , atol = 1e-2 , rtol = 1e-2 )
38
+ # We want to also know the true(r) answer, if one of them is off.
39
+ A_float64 = A .astype (numpy .float64 )
40
+ B_float64 = B .astype (numpy .float64 )
41
+ numpy_result64 = A_float64 .dot (B_float64 )
42
+ blis_result64 = dotv (A_float64 , B_float64 )
43
+ try :
44
+ assert_allclose (
45
+ [numpy_result ],
46
+ result ,
47
+ atol = 1e-3 ,
48
+ rtol = 1e-3 ,
49
+ )
50
+ except AssertionError as e :
51
+ print (f"Numpy 64bit result: { numpy_result64 } " )
52
+ print (f"blis 64bit result: { blis_result64 } " )
53
+ raise e
0 commit comments