We currently don’t support this. This sounds like a reasonable feature request that is important for deployment. Please open a feature request over at https://github.com/pytorch/pytorch 1 (or voice your support on a current issue if it exists) !