I wanted to learn about the use of the up sampling API, so I built a matrix, and I sampled it up:
This is my code:

model=torch.nn.Sequential()
model.add_module('upsamling2d-1',torch.nn.Upsample(size=(4,4)))

Input=np.asarray([[1,2],[3,4]])
Input=Input.reshape(1,1,2,2)
Input=torch.from_numpy(Input)
print(Input)

yhat=model(Input)
yhat=yhat.reshape((4,4))
print(yhat)

And this is the error:

捕获1238×515 29.4 KB

how should i handle it