1.Tensor是什么?
在 TensorFlow 中,数据不是以整数,浮点数或者字符串形式存在的,而是被封装在一个叫做 tensor 的对象中。Tensor是张量的意思,张量包含了0到任意维度的量,其中,0维的叫做常数,1维的叫做向量,二维叫做矩阵,多维度的就直接叫张量量。在 hello_constant = tf.constant(‘Hello World!’) 代码中,hello_constant是一个 0 维度的字符串 tensor,tensors 还有很多不同大小:
# tensor1 是一个0维的 int32 tensor
tensor1 = tf.constant(1234)
# tensor2 是一个1维的 int32 tensor
tensor2 = tf.constant([123,456,789])
基本使用 使用 tensorflow, 你必须明白 tensorflow: 使用图 (graph) 来表示计算任务. 在被称之为 会话 (session) 的上下文 (context) 中执行图. 使用 tensor 表示数据. 通过 变量 (variable) 维护状态. 使用 feed 和 fetch 可以为任意的操作
Hadoop|
Apache Pig|
Apache Kafka|
Apache Storm|
Impala|
Zookeeper|
SAS|
TensorFlow|
人工智能基础|
Apache Kylin|
Openstack|
Flink|
MapReduce|
大数据|
云计算|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....