Return whether inference mode is active on the calling thread.
Reports the flag that inference_mode toggles. It is
independent of is_grad_enabled: inference_mode(False)
clears this flag and turns gradient tracking back on, while
set_grad_enabled never touches it.
Returns
boolTrue inside an inference_mode(True) scope, False
otherwise.
Examples
>>> import lucid
>>> lucid.is_inference_mode_enabled()
False
>>> with lucid.inference_mode():
... lucid.is_inference_mode_enabled()
TrueUsed by 2
- lucid
- lucid.autograd