import numpy as np

x = np.array([[[0], [1], [2]]])
 
print(x.shape)

numpy笔记—np.squeeze用法

d = np.squeeze(x)   # 从数组的形状中删除单维条目,即把shape中为1的维度去掉

print(d.shape)

numpy笔记—np.squeeze用法

相关文章:

  • 2021-06-28
  • 2021-06-16
  • 2021-04-04
  • 2021-05-05
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
猜你喜欢
  • 2021-08-26
  • 2021-05-23
  • 2021-12-29
  • 2022-12-23
  • 2021-06-11
  • 2021-11-04
  • 2021-05-25
相关资源
相似解决方案