simplify matmult test code
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 11 Oct 2023 11:19:32 +0000 (12:19 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Dec 2023 19:26:21 +0000 (19:26 +0000)
src/openpower/decoder/isa/test_caller_svp64_matrix.py

index bfd404a33d1ad0928519d587597bdf5b4c3e9862..31518f44a9e7c72b7392078fb6aea4dbdb81e157 100644 (file)
@@ -15,9 +15,7 @@ from openpower.insndb.asm import SVP64Asm
 # x = [[1,2,3],[4,5,6],[7,8,9],[10,11,12]]
 # y = [[1,2],[1,2],[3,4]]
 def matmult(a, b):
-    zip_b = zip(*b)
-    # uncomment next line if python 3 :
-    zip_b = list(zip_b)
+    zip_b = list(zip(*b)) # transpose b matrix
     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]