tensorflow开发 之 hello world

论坛 期权论坛 脚本     
匿名技术用户   2020-12-23 01:25   11   0


点击查看 (人工智能) 系列文章


进入虚拟环境

cd demo/venv
.\Scripts\activate

进入python开发环境

python

在这里插入图片描述

编写第一个程序

import tensorflow as tf;
tmpString = tf.constant("hello world")
sess = tf.Session()
sess.run(tmpString)
#输出
#b'hello world'

在这里插入图片描述

输出说明

字符串前面的“b”表示byte,sess.run执行结果的带编码的字符串,在python中是通过bytes来表示的,所以前面的b只是数据类型的标识。
在这里插入图片描述

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP