Skip to content

Instantly share code, notes, and snippets.

@kalradivyanshu
Created July 20, 2018 00:19
Show Gist options
  • Save kalradivyanshu/407046c3ef9b928941dd0f67647ad639 to your computer and use it in GitHub Desktop.
Save kalradivyanshu/407046c3ef9b928941dd0f67647ad639 to your computer and use it in GitHub Desktop.
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