JIT enabled indicator

is there any method that can show model are using JIT or not? i mean, with this call torch.jit._state.disable() it will disable jit model initialization after that.

Just want to make sure model are loaded using JIT.

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 are of type RecursiveScriptModule in Python, and functions are of type ScriptFunction. In addition, the serialization formats used by regular Pytorch and TorchScript are not the same, so if a model is successfully loaded using torch.jit.load, then it is a TorchScript model.