返回张量的维度
with tf.Session() as sess:
x=np.asarray([1,2,3,4,5,6,7,8,9,10],dtype=np.float32)
tensor_x = tf.convert_to_tensor(x, tf.float32)
# Tensor("Shape:0", shape=(1,), dtype=int32)
print(array_ops.shape(tensor_x))
# 10
print(array_ops.shape(tensor_x).eval())