code: def detect_default_tf32() -> bool:
      """
      Detect if there is anything that may enable TF32 mode by default.
      If any, show a warning message.
      """
      may_enable_tf32 = False
      try:
          if not has_ampere_or_later():
              return False
  
          from monai.utils.module import pytorch_after
  
          if pytorch_after(1, 7, 0) and not pytorch_after(1, 12, 0):
              warnings.warn(
                  "torch.backends.cuda.matmul.allow_tf32 = True by default.\n"
                  "  This value defaults to True when PyTorch version in [1.7, 1.11] and may affect precision.\n"
                  "  See https://docs.monai.io/en/latest/precision_accelerating.html#precision-and-accelerating"
              )
              may_enable_tf32 = True
  
          override_tf32_env_vars = {
              "NVIDIA_TF32_OVERRIDE": "1"
          }  # TORCH_ALLOW_TF32_CUBLAS_OVERRIDE not checked #6907
          for name, override_val in override_tf32_env_vars.items():
              if os.environ.get(name) == override_val:
                  warnings.warn(
                      f"Environment variable `{name} = {override_val}` is set.\n"
                      f"  This environment variable may enable TF32 mode accidentally and affect precision.\n"
                      f"  See https://docs.monai.io/en/latest/precision_accelerating.html#precision-and-accelerating"
                  )
                  may_enable_tf32 = True
  
          return may_enable_tf32
      except BaseException:
          from monai.utils.misc import MONAIEnvVars
  
          if MONAIEnvVars.debug():
              raise
          return False
  
imports: from __future__ import annotations
  import functools
  import os
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: detect_default_tf32() and returns: may_enable_tf32, False, False