Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 25fe97b

Browse files
committed
add tensorflow test script
1 parent 06532a2 commit 25fe97b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_tensorflow.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import tensorflow as tf
2+
3+
print('test_tensorflow start')
4+
print('tensorflow version: %s' % tf.__version__)
5+
6+
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
7+
8+
with tf.device('/gpu:0'):
9+
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
10+
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
11+
c = tf.matmul(a, b)
12+
13+
with tf.Session() as sess:
14+
print(sess.run(c))
15+
16+
print('test_tensorflow done')

0 commit comments

Comments
 (0)