From 193246e5b2709376aba26f90d97c36d5395ab39c Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Thu, 12 Dec 2024 16:23:22 -0800 Subject: [PATCH] disable transpose function if the output is a scalar --- aha/util/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aha/util/test.py b/aha/util/test.py index 5bc1e497..87836ffb 100644 --- a/aha/util/test.py +++ b/aha/util/test.py @@ -182,7 +182,9 @@ def dispatch(args, extra_args=None): rearrng_axis = [] for reorder_tup in output_mode_map: rearrng_axis.append(reorder_tup[0]) - sim_matrix = numpy.transpose(sim_matrix, rearrng_axis) + is_scalar = (rearrng_axis == []) + if not is_scalar: + sim_matrix = numpy.transpose(sim_matrix, rearrng_axis) # Set up numpy so it doesn't print in scientific notation numpy.set_printoptions(suppress=True)