Skip to content

Instantly share code, notes, and snippets.

@icemelon
Last active July 9, 2019 22:08
Show Gist options
  • Save icemelon/c7b349dcd6fd75167f2f572775436911 to your computer and use it in GitHub Desktop.
Save icemelon/c7b349dcd6fd75167f2f572775436911 to your computer and use it in GitHub Desktop.
amlc
for yo in range(128):
for xo in range(128):
C[yo*8:yo*8+8][xo*8:xo*8+8] = 0
for ko in range(128):
for yi in range(8):
for xi in range(8):
for ki in range(8):
C[yo*8+yi][xo*8+xi] +=
A[ko*8+ki][yo*8+yi] * B[ko*8+ki][xo*8+xi]
for yo in range(64):
for xo in range(64):
C[yo*16:yo*16+16][xo*16:xo*16+16] = 0
for ko in range(64):
for yi in range(16):
for xi in range(16):
for ki in range(16):
C[yo*16+yi][xo*16+xi] +=
A[ko*16+ki][yo*16+yi] * B[ko*16+ki][xo*16+xi]
for xo in range(64):
for yo in range(64):
C[yo*16:yo*16+16][xo*16:xo*16+16] = 0
for ko in range(64):
for ki in range(16):
for yi in range(16):
for xi in range(16):
C[yo*16+yi][xo*16+xi] +=
A[ko*16+ki][yo*16+yi] * B[ko*16+ki][xo*16+xi]
for y in range(1024):
for x in range(1024):
C[y][x] = 0
for k in range(1024):
C[y][x] += A[k][y] * B[k][x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment