第一次见到Im[None],一下子就蒙了,查阅资料后知道
import numpy as np
im = np.zeros(4000, 1800, 3)
im0 = im[None]
im1 = im[:,None]
im2 = im[:,:,None]
im3 = im[...,None]
print(im0.shape)
print(im1.shape)
print(im2.shape)
print(im3.shape)
换成tensor也同理
会发现im0为(1,4000, 1800, 3),依次剩下为4000, 1,1800, 3
4000, 1800, 1,3, 4000, 1800, 3,1