1 tf.shape( 2 input, 3 name=None, 4 out_type=tf.int32 5 )
1 import tensorflow as tf 2 import numpy as np 3 4 A = np.array([[[1, 1, 1], 5 [2, 2, 2]], 6 [[3, 3, 3], 7 [4, 4, 4]], 8 [[5, 5, 5], 9 [6, 6, 6]]]) 10 11 t = tf.shape(A) 12 with tf.Session() as sess: 13 print(sess.run(t)) 14 15 # 输出 16 [3 2 3]
转载https://blog.csdn.net/apengpengpeng/article/details/80579658
原文:https://www.cnblogs.com/Carits/p/12872503.html