Solved by SplitInfinity in post #2 
              
              
                torch.jit._state.disable() and torch.jit._state.enable() are not meant to be user-facing APIs and should not be called. All user-facing APIs are exposed in torch/jit/__init__.py as torch.jit.XXX. 
One thing you can do is check the type of the Module or function you have loaded. TorchScript modules a…