Skip to content

Commit f67ec3b

Browse files
committed
use a fixed value for constant
Replaces random matrix generation with a stacked matrix of zeros and ones in test_matrix_dot_performance to provide more controlled test data.
1 parent 1d0e6f5 commit f67ec3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/test_matrix_variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def test_matrix_mean():
312312
def test_matrix_dot_performance(n):
313313
model = Model()
314314
x = model.addMatrixVar((n, n))
315-
a = np.random.rand(n, n)
315+
a = np.vstack((np.zeros((n // 2, n)), np.ones((n // 2, n))))
316316

317317
number = 5
318318
matrix = timeit(lambda: a @ x, number=number) / number

0 commit comments

Comments
 (0)