I have a tensor, pred which has a .size of torch.Size([8, 28, 161]). I want it to match the shape of outputs, which has a .size of torch.Size([8, 27, 161]), so I’m doing:
pred = torch.nn.functional.interpolate(outputs, size=outputs.size())

But this gives me an error:
  File "train_reconstruction.py", line 204, in main
    pred = torch.nn.functional.interpolate(outputs, size=outputs.size())
  File "/home/shamoon/.local/share/virtualenvs/pytorch-lstm-audio-o2htQyti/lib/python3.6/site-packages/torch/nn/functional.py", line 2510, in interpolate
    return torch._C._nn.upsample_nearest1d(input, _output_size(1))
RuntimeError: It is expected output_size equals to 1, but got size 3

What am I doing incorrectly?