as_list()极简用法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Arctic_Beacon/article/details/84570054

x=tf.constant([[1,2,3],[4,5,6]])
x.get_shape().as_list()[0]   #输出:行数
x.get_shape().as_list()[1]   #输出:列数

猜你喜欢

转载自blog.csdn.net/Arctic_Beacon/article/details/84570054
今日推荐