InferenceModeΒΆ

Context manager that enables or disables inference mode (gradient isolation).

Abstract Signature:

InferenceMode(mode: bool = True)

PyTorch

API: torch.inference_mode
Strategy: Direct Mapping

JAX (Core)

API: contextlib.nullcontext
Strategy: Plugin (context_to_function_wrap)

NumPy

API: contextlib.nullcontext
Strategy: Plugin (context_to_function_wrap)

Keras

API: contextlib.nullcontext
Strategy: Plugin (context_to_function_wrap)