Created
June 19, 2018 15:10
-
-
Save salehjg/aa1fd5e66322dabb685af091e82dd9cc to your computer and use it in GitHub Desktop.
Simple test script for TF GPU with python 3.x
This file contains 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 | |
mat1 = [0,1,2] | |
mat2 = [2,1,0] | |
with tf.device('/gpu:0'): | |
tn1 = tf.placeholder(dtype= tf.int32, shape=[3]) | |
tn2 = tf.placeholder(dtype= tf.int32, shape=[3]) | |
tn3 = tn1 + tn2 | |
with tf.Session() as sess: | |
result = sess.run(tn3,{tn1:mat1,tn2:mat2}) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for JIT version use: