In x = torch.randn([1, 32, 86]), 1 is added though unsqueeze operation, 32 represents batch-size and 86 represents number of features.
Initially, I was using interpolate as follows:
        residual1 = x
        residual1 = F.interpolate(residual1, size=[32,1024], mode='nearest', align_corners=None)
        x = F.relu(self.bn1(self.linear1(x)))
        x += residual1

But after correction by @futscdav , I changed it to
residual1 = F.interpolate(residual1, size=[1024], mode='nearest', align_corners=None)
But to be able to pass the torch variable through the Linear layer, I had to squeeze both x and residual1 again. So, my next concern was if I am performing the squeeze/unsqueeze operation several times in the forward will it affect my results?