Problem when moving model to cuda

@ptrblck Could you inspect some similar code here? https://github.com/NathanUA/U-2-Net/blob/b77cd6da3204efcb03e18e15dd3b9eb24d47f969/model/u2net.py#L24

_upsample_like is called only in the forward pass just like OP’s self.upsampling

I wonder if this is the cause of my libtorch module.forward() not working even though my python jit trace saves and imports in libtorch without errors.

If you think it is the cause, what is a concise fix considering _upsample_like is written a lot in all the forward implementations?

My other thread is here Debugging runtime error module->forward(inputs) libtorch 1.4