a=np.ones((4,2,2,3))
print(a.shape)
b=a[...,0]*a[...,2] # 这样可以降维度
print(b.shape)
c=a[...,0:1]*a[...,1:2] # 若0:1这里为这样就不会降维度
print(c.shape)

 

 

一种降维方式

 

相关文章:

  • 2022-12-23
  • 2021-06-20
  • 2021-11-15
  • 2022-12-23
  • 2021-08-10
  • 2023-02-10
  • 2021-06-15
  • 2022-12-23
猜你喜欢
  • 2021-05-26
  • 2021-11-25
  • 2021-12-02
  • 2021-10-24
  • 2021-12-18
  • 2023-04-07
相关资源
相似解决方案