首页 > 其他 > 详细

验证tensorflow版本是GPU还是CPU

时间:2018-07-26 19:33:18      阅读:521      评论:0      收藏:0      [点我收藏+]

reference: https://blog.csdn.net/zlase/article/details/79261348

import numpy
import tensorflow as tf
a = tf.constant([1.0, 2.0, 3.0, 4.0], shape=[2, 2], name=‘a‘)
b = tf.constant([1.0, 2.0, 3.0, 4.0], shape=[2, 2], name=‘b‘)
c = tf.matmul(a, b)
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print(sess.run(c))

验证tensorflow版本是GPU还是CPU

原文:https://www.cnblogs.com/lion-zheng/p/9373713.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!