From 073d8e201509294216ba49c8607479dacfb0195d Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Tue, 10 Oct 2017 18:47:26 -0400 Subject: [PATCH] Fix the randmatstat python microbenchmark (#24089) Fix #23741 (cherry picked from commit 8afbe45b5b1f3e8bd2010f2fa85c5854e9c4fa0a) --- test/perf/micro/perf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/perf/micro/perf.py b/test/perf/micro/perf.py index b1bd40f150be9..5718d31a711e1 100644 --- a/test/perf/micro/perf.py +++ b/test/perf/micro/perf.py @@ -43,13 +43,13 @@ def randmatstat(t): n = 5 v = zeros(t) w = zeros(t) - for i in range(1,t): + for i in range(t): a = randn(n, n) b = randn(n, n) c = randn(n, n) d = randn(n, n) - P = concatenate((a, b, c, d)) - Q = concatenate((concatenate((a, b)), concatenate((c, d))),axis=1) + P = concatenate((a, b, c, d), axis=1) + Q = concatenate((concatenate((a, b), axis=1), concatenate((c, d), axis=1)), axis=0) v[i] = trace(matrix_power(dot(P.T,P), 4)) w[i] = trace(matrix_power(dot(Q.T,Q), 4)) return (std(v)/mean(v), std(w)/mean(w))