This is an internal call to torch._C._get_tracing_state() to check, if you are currently trying to trace the model with the JIT.
It’s used internally to e.g. use workarounds for methods, which are currently not supported for tracing.