import tensorflow as tf
tf.__version__
node1 = tf.constant(100)
node2 = tf.constant([1,2,3,4,5])
node3 = tf.constant([[1,2],[3,4],[5,6]])
node4 = tf.constant([[[1],[2],[3],[4]]])
print(node1.shape)
print(node2.shape)
print(node3.shape)
print(node4.shape)
//结果
()
(5,)
(3, 2)
(1, 4, 1)
是由表及里的,例如node4最外层括号里面只有一个[[开头的。