Created
February 18, 2020 13:25
-
-
Save suricactus/3293853b47ae7576f06909e3b9956f4d to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment