From e5b108c8f3fe5d60decb6a43b57c994909c8d3a8 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Sat, 16 Jan 2016 13:53:20 -0500 Subject: [PATCH] BENCH: Add some benchmarks for `matmul`. --- benchmarks/benchmarks/bench_linalg.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/benchmarks/benchmarks/bench_linalg.py b/benchmarks/benchmarks/bench_linalg.py index 6cccf74f8218..a65d510be276 100644 --- a/benchmarks/benchmarks/bench_linalg.py +++ b/benchmarks/benchmarks/bench_linalg.py @@ -51,6 +51,24 @@ def time_inner_trans_a_a(self): def time_inner_trans_a_ac(self): np.inner(self.a, self.ac) + def time_matmul_a_b(self): + np.matmul(self.a, self.b) + + def time_matmul_d_matmul_b_c(self): + np.matmul(self.d, np.matmul(self.b, self.c)) + + def time_matmul_trans_a_at(self): + np.matmul(self.a, self.at) + + def time_matmul_trans_a_atc(self): + np.matmul(self.a, self.atc) + + def time_matmul_trans_at_a(self): + np.matmul(self.at, self.a) + + def time_matmul_trans_atc_a(self): + np.matmul(self.atc, self.a) + def time_tensordot_a_b_axes_1_0_0_1(self): np.tensordot(self.a3, self.b3, axes=([1, 0], [0, 1]))