将hw方向上的size :3*3,转为4*4,5*5,6*6,有什么样式。
a=torch.arange(18,dtype=torch.float32).reshape(1,2,3,3)
aa= F.interpolate(a, size= (4,4), mode='nearest')
bb= F.interpolate(a, size= (5,5), mode='nearest')
cc= F.interpolate(a, size= (6,6), mode='nearest')
结果展示:
from torch.nn import functional as F
a=torch.arange(32,dtype=torch.float32).reshape(1,2,4,4)
cc= F.interpolate(a, size= (6,6), mode='nearest')
print(cc)