From 10b350001fb444f2494f40ce7130de10ca9c8444 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 11 Oct 2023 12:49:11 +0100 Subject: [PATCH] doh, use reduce on operator.add already --- src/openpower/decoder/isa/test_caller_svp64_matrix.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/openpower/decoder/isa/test_caller_svp64_matrix.py b/src/openpower/decoder/isa/test_caller_svp64_matrix.py index 555d9df4..3a413fef 100644 --- a/src/openpower/decoder/isa/test_caller_svp64_matrix.py +++ b/src/openpower/decoder/isa/test_caller_svp64_matrix.py @@ -19,10 +19,6 @@ def matmult(a, b): return [[sum(ele_a*ele_b for ele_a, ele_b in zip(row_a, col_b)) for col_b in zip_b] for row_a in a] -# Flatten list of lists matrix down to single list -def flatten(l): - return [item for sublist in l for item in sublist] - class DecoderTestCase(FHDLTestCase): @@ -59,12 +55,12 @@ class DecoderTestCase(FHDLTestCase): Y = Y1 expected = matmult(X, Y) - expected = flatten(expected) print("expected-matrix:") print(expected) xf = reduce(operator.add, X) yf = reduce(operator.add, Y) + expected = reduce(operator.add, expected) print("flattened X,Y,expected") print("\t", xf) print("\t", yf) -- 2.30.2