Testing your tensorflow environment

作者: shaneZhang 分类: 机器学习的实践 发布时间: 2020-03-31 13:52
import tensorflow as tf

tensorflow_version = tf.__version__
gpu_info = tf.config.list_physical_devices('GPU')
cpu_info = tf.config.list_physical_devices('CPU')
print("tensorflow version:", tensorflow_version, "\tGPU info:", gpu_info,"\tCPU info:",cpu_info)

a = tf.constant([1.0, 2.0], name="a")
b = tf.constant([1.0, 2.0], name="b")
result = tf.add(a, b, name="add")
print(result)

本页面支持繁体中文友好显示:Testing your tensorflow environment

如果觉得我的文章对您有用,请随意打赏。如果有其他问题请联系博主QQ(909491009)或者下方留言!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注