解决方法:
x2_in = nn.functional.interpolate(x2_in, scale_factor=2, mode='bilinear',align_corners=True)
#-*-coding:utf-8-*-
import torch
import torch.nn as nn
import numpy as np
# pool of non-square window
## In the simplest case, the output value of the layer
# with input size (N,C,H,W)(N, C, H, W)(N,C,H,W),
# output (N,C,Hout,Wout)(N, C, H_{out}, W_{out})(N,C,Hout,Wout) and kernel_size (kH,kW)(kH, kW)(kH,kW) can be precisely described as:
data = np.arange(64).reshape((8,8))
A = torch.Tensor(data.reshape(1,1,8,8))
print('A=',A)
## MAX POOL
maxpool = nn.MaxPool2d((2, 2), stride=(2, 2),return_indices