Parameters:
      mode (bool) -- Flag whether to enable or disable inference
      mode
Example::
      >>> import torch
      >>> x = torch.ones(1, 2, 3, requires_grad=True)
      >>> with torch.inference_mode():
      ...     y = x * x
      >>> y.requires_grad
      False
      >>> y._version
      Traceback (most recent call last):
      File "", line 1, in 
      RuntimeError: Inference tensors do not track version counter.
      >>> @torch.inference_mode()
      ... def func(x):
      ...     return x * x
      >>> out = func(x)
      >>> out.requires_grad
      False