三维方向定义,适用于2维和3维0、零维张量import tensorflow as tf#零维张量const0 = tf.constant(1, tf.float16)print(const0)运行结果...事实上,tensorflow在做一些运算时,反而经常把1行N列的二维张量简化成一个长度为N的一维向量。...4、四维张量(图像仅用于理解,坐标系axis已经不再适用)#四维张量const4 = tf.constant([ #第一个3行4列深度为2的三维张量...shape=(3, 4, 2)时,表示3行4列深度为2的张量 shape=(2, 3, 4, 2)时,表示有2个 3行4列深度为2的张量 shape=(6, 2, 3, 4, 2)时,表示有6个四维张量...,这个四维张量又可以表示为2个 3行4列深度为2的张量。