Skip to content

Commit

Permalink
Fix the randmatstat python microbenchmark (#24089)
Browse files Browse the repository at this point in the history
Fix #23741

(cherry picked from commit 8afbe45)
  • Loading branch information
ViralBShah authored and ararslan committed Nov 7, 2017
1 parent a6871be commit 1c3f1e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/perf/micro/perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1c3f1e8

Please sign in to comment.