Hi,
We are planning to use PyTorch JIT in production and our top-level modules use JIT Script annotations. We require the JIT Scripting to turn off during training and we need to switch it back on for model export (with inference). However PYTORCH_JIT is an environment variable that is set statically.

How can we achieve this without explicitly using PYTORCH_JIT=0 statically while launching the process?
While exporting the model, we perform a correctness check and need to turn it off/on dynamically for the 2 models (with and without JIT) to be loaded. How can we achieve this?

Thanks!