tf.shape函数

时间:2020-05-11 22:14:30   收藏:0   阅读:67

tf.shape

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!