I am trying to do upsampling in UNet, but while concatenating the encoder matrix with the decoder matrix I am getting a different matrix, and here I don’t want to downsize the decoded matrix.

You cannot reshape a tensor of the shape `[1, 1, 3, 50]`

into `[1, 1, 3, 75]`

as the number of elements differ.

Depending on your use case you could either repeat a subset of the original tensor or use an interpolation method to increase the number of elements e.g. via `out = F.interpolate(torch.randn([1, 1, 3, 50]), (3, 75))`

.

Thanks, it worked.

Ya, I used the wrong word “reshape”.