Last active
February 13, 2017 11:41
-
-
Save chaser92/5e5ba955d0063a878ea59e1633fda994 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 | |
# just to verify they're installed | |
import pandas | |
import matplotlib | |
import scipy | |
import numpy | |
# With CPU | |
with tf.Session() as sess: | |
matrix1 = tf.constant([[3., 3.]]) | |
matrix2 = tf.constant([[2.],[2.]]) | |
product = tf.matmul(matrix1, matrix2) | |
result = sess.run([product]) | |
print(result) | |
# With GPU | |
with tf.Session() as sess: | |
with tf.device("/gpu:0"): | |
matrix1 = tf.constant([[3., 3.]]) | |
matrix2 = tf.constant([[2.],[2.]]) | |
product = tf.matmul(matrix1, matrix2) | |
result = sess.run([product]) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment