code: def avoid_bfloat16_autocast_context():
      """
      If the current autocast context is bfloat16,
      cast it to float32
      """
  
      if (
          torch.is_autocast_enabled()
          and torch.get_autocast_gpu_dtype() == torch.bfloat16
      ):
          return torch.cuda.amp.autocast(dtype=torch.float32)
      else:
          return nullcontext()
  
file_path: NeMo/nemo/utils/cast_utils.py
imports: from contextlib import nullcontext
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: avoid_bfloat16_autocast_context() and returns: torch, nullcontext