Tensor

2018-10-23  本文已影响0人  猴子喜

简介

简单理解为多维数组,零阶张量是一个属,一阶张量是向量vector
tensorflow 用 3 种方式描述一个 tensor 的维数:
rank, shape, 以及 dimension number (维数)


#shape

t = tf.constant([[[1, 1, 1], [2, 2, 2]],
         [[3, 3, 3], [4, 4, 4]]])
tf.shape(t)  # [2, 2, 3]
        #[]内层层数,分别有2,2,3个元素
Tensor(“add:0”,     shape=(2,),     dtype=float32)

//Tensor(name,     shape维度,    type)

//当前张量是计算节点add的第0个输出,二维张量,32位浮点数

上一篇下一篇

猜你喜欢

热点阅读