From: Luke Kenneth Casson Leighton Date: Wed, 11 Oct 2023 11:49:11 +0000 (+0100) Subject: doh, use reduce on operator.add already X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=122be59b27a0af5f5bc7a7fff065e887c2a7c0ca;p=openpower-isa.git doh, use reduce on operator.add already --- 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)