从张量的形状中删除大小为 1 的维度
import tensorflow as tf
a=tf.constant([[[1,2,3,1]]])
print(a.shape)
a1=tf.squeeze(a)
print(a1.shape)
(1, 1, 4)
(4,)
文档链接
微信扫一扫
从张量的形状中删除大小为 1 的维度
import tensorflow as tf
a=tf.constant([[[1,2,3,1]]])
print(a.shape)
a1=tf.squeeze(a)
print(a1.shape)
(1, 1, 4)
(4,)
文档链接
相关推荐