Skip to content

Instantly share code, notes, and snippets.

@aleozlx
Created August 16, 2021 00:10
Show Gist options
  • Save aleozlx/742eb7392595711c80da882a547794f2 to your computer and use it in GitHub Desktop.
Save aleozlx/742eb7392595711c80da882a547794f2 to your computer and use it in GitHub Desktop.
C = np.zeros((3, 4), dtype=int)
for k in range(A.shape[1]):
C += np.outer(A[:, k], B[k, :])
print("C =\n", C)
"""
OUTPUT
=============
C =
[[42 29 26 21]
[22 14 16 10]
[11 9 4 5]]
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment