Skip to content

Instantly share code, notes, and snippets.

View shuuji3's full-sized avatar
🌈
🌎 🌟 🦚 🌌 ✨

TAKAHASHI Shuuji shuuji3

🌈
🌎 🌟 🦚 🌌 ✨
View GitHub Profile
@shuuji3
shuuji3 / cannon.py
Last active July 1, 2019 10:07 — forked from Terminus-IMRC/cannon.py
Matrix-matrix multiplication: Cannon's algorithm
#!/usr/bin/env python3
import numpy as np
# Assume that P = N * N.
N = 4
A = np.arange(0, 2 * N * N, 2).reshape(N, N)
B = np.arange(1, 2 * N * N, 2).reshape(N, N)
C_gt = A.dot(B)