First Thanks for the fast response.
My case is:
I’m training Variational Auto Encoder That Takes images with Size 64,128,256, etc
But instead of using pixel wise loss I’m using perceptual loss, that’s mean I take the original image and the reconstructed image and feed them respectively to a pre-trained model (ssd) and calculate the loss of it’s hidden layers values.
The problem is ssd take only 300x300 image size and I train the VAE with 128, so inorder to compute the loss via SSD I should resize the reconstructed image (which has the gradients).