How to add custom layers for a pytorch network?

Platform:Jetson Xavier
TensorRT version:
CUDA version: 10.0

I want to use use TensorRT with PyTorch, but some layers such as upsamples that are not supported.Can I use custom layers to implement them? If so ,what should I do to implement them?In addition, whether the tensorrt version I am currently using can support this operation?

Looking forward to your reply, thanks .