Skip to content

Instantly share code, notes, and snippets.

@jayjayswal
Last active December 29, 2018 11:18
Show Gist options
  • Save jayjayswal/3b32ccb042ee033ec07dc20d6543c592 to your computer and use it in GitHub Desktop.
Save jayjayswal/3b32ccb042ee033ec07dc20d6543c592 to your computer and use it in GitHub Desktop.
teserflow gpu test
import tensorflow as tf
with tf.device('/gpu:0'):
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
with tf.Session() as sess:
print (sess.run(c))
# https://medium.com/@omar.merghany95/how-to-install-tensorflow-gpu-with-cuda-toolkit-9-0-and-cudnn-7-2-1-on-aws-ec2-ubuntu-16-04-c46b469a7358
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment