参考资料:https://blog.csdn.net/banana1006034246/article/details/78042559
1.切换到创建的虚拟环境
conda create -n nlp
source activate nlp
pip install tensorflow-gpu
2.安装结束后,进入python的编译环境
import tensorflow as tf
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)
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print(sess.run(c))