import numpy as np left = np.array( [ [2, 1, 3], [0, 4, 5], ] ) right = np.array( [ [1, 2], [3, 0], [4, 1], ] ) expected = np.array( [ [17, 7], [32, 5], ] ) product = left @ right column_scale = np.array([10, 100, 1000]) elementwise = left * column_scale print("left shape:", left.shape) print("right shape:", right.shape) print("product:") print(product) print("product shape:", product.shape) print("matches expected:", np.array_equal(product, expected)) print("matches np.matmul:", np.array_equal(product, np.matmul(left, right))) print("element-wise first row:", elementwise[0].tolist())