1.插值
import torch.nn.functional as F
//init中
self.up = nn.Upsample(size = (256, 2), mode = "nearest")
//forward中
F.interpolate(input, size=None, scale_factor=None, mode='nearest', align_corners=None, recompute_scale_factor=None) //size为输出尺寸
2.转置卷积
nn.ConvTranspose2d(kernel_size = 4,stride = 2,padding = 1) //将 8 * 8卷积成 16 * 16
标签:采样,nearest,None,scale,方式,nn,几种,factor,size
From: https://www.cnblogs.com/fly-smart/p/17790289.html