0
点赞
收藏
分享

微信扫一扫

tf.squeeze

心如止水_c736 2023-01-16 阅读 152


从张量的形状中删除大小为 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,)

​​文档链接​​



举报

相关推荐

0 条评论