@@ -703,7 +703,10 @@ class TestQr:
703
703
ids = ["r" , "raw" , "complete" , "reduced" ],
704
704
)
705
705
def test_qr (self , dtype , shape , mode ):
706
- a = numpy .random .rand (* shape ).astype (dtype )
706
+ numpy .random .seed (76 )
707
+ a = numpy .random .randn (* shape ).astype (dtype )
708
+ if numpy .issubdtype (dtype , numpy .complexfloating ):
709
+ a += 1j * numpy .random .randn (* shape )
707
710
ia = inp .array (a )
708
711
709
712
if mode == "r" :
@@ -773,7 +776,8 @@ def test_qr_empty(self, dtype, shape, mode):
773
776
ids = ["r" , "raw" , "complete" , "reduced" ],
774
777
)
775
778
def test_qr_strides (self , mode ):
776
- a = numpy .random .rand (5 , 5 )
779
+ numpy .random .seed (76 )
780
+ a = numpy .random .randn (5 , 5 )
777
781
ia = inp .array (a )
778
782
779
783
# positive strides
@@ -1130,6 +1134,7 @@ def test_svd(self, dtype, shape):
1130
1134
ids = ["(2, 2)" , "(16, 16)" ],
1131
1135
)
1132
1136
def test_svd_hermitian (self , dtype , compute_vt , shape ):
1137
+ numpy .random .seed (76 )
1133
1138
a = numpy .random .randn (* shape ).astype (dtype )
1134
1139
if numpy .issubdtype (dtype , numpy .complexfloating ):
1135
1140
a += 1j * numpy .random .randn (* shape )
@@ -1207,7 +1212,10 @@ def check_types_shapes(self, dp_B, np_B):
1207
1212
],
1208
1213
)
1209
1214
def test_pinv (self , dtype , shape ):
1210
- a = numpy .random .rand (* shape ).astype (dtype )
1215
+ numpy .random .seed (76 )
1216
+ a = numpy .random .randn (* shape ).astype (dtype )
1217
+ if numpy .issubdtype (dtype , numpy .complexfloating ):
1218
+ a += 1j * numpy .random .randn (* shape )
1211
1219
a_dp = inp .array (a )
1212
1220
1213
1221
B = numpy .linalg .pinv (a )
@@ -1232,6 +1240,7 @@ def test_pinv(self, dtype, shape):
1232
1240
ids = ["(2, 2)" , "(16, 16)" ],
1233
1241
)
1234
1242
def test_pinv_hermitian (self , dtype , shape ):
1243
+ numpy .random .seed (76 )
1235
1244
a = numpy .random .randn (* shape ).astype (dtype )
1236
1245
if numpy .issubdtype (dtype , numpy .complexfloating ):
1237
1246
a += 1j * numpy .random .randn (* shape )
@@ -1272,7 +1281,8 @@ def test_pinv_empty(self, dtype, shape):
1272
1281
assert_dtype_allclose (B_dp , B )
1273
1282
1274
1283
def test_pinv_strides (self ):
1275
- a = numpy .random .rand (5 , 5 )
1284
+ numpy .random .seed (76 )
1285
+ a = numpy .random .randn (5 , 5 )
1276
1286
a_dp = inp .array (a )
1277
1287
1278
1288
self .get_tol (a_dp .dtype )
0 commit comments