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)
一种降维方式
猜你喜欢
转载自www.cnblogs.com/tangjunjun/p/11503838.html
今日推荐
周排行