Last active
January 5, 2017 23:38
-
-
Save ProGamerGov/b1550e5f6b7bf6e032378597262b88d8 to your computer and use it in GitHub Desktop.
Tests whether or not Tensorflow sees your GPU or CPU
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 | |
# Creates a graph. | |
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) | |
# Creates a session with log_device_placement set to True. | |
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) | |
# Runs the op. | |
print sess.run(c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment