Created
July 20, 2018 00:19
-
-
Save kalradivyanshu/407046c3ef9b928941dd0f67647ad639 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import time | |
m1 = [] | |
m2 = [] | |
result = [] | |
i = 10 | |
while i <= 10000: | |
m1.append(tf.random_uniform(shape = [i, i])) | |
m2.append(tf.random_uniform(shape = [i, i])) | |
i *= 10 | |
for t1, t2 in zip(m1, m2): | |
result.append(tf.matmul(t1, t2)) | |
sess = tf.Session() | |
for tensor in result: | |
start = time.time() | |
sess.run(tensor) | |
print(tensor.shape, time.time() - start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment