code: def avoid_float16_autocast_context():
      """
      If the current autocast context is float16, cast it to bfloat16
      if available (unless we're in jit) or float32
      """
  
      if (
          torch.is_autocast_enabled()
          and torch.get_autocast_gpu_dtype() == torch.float16
      ):
          if torch.jit.is_scripting() or torch.jit.is_tracing():
              return torch.cuda.amp.autocast(dtype=torch.float32)
  
          if torch.cuda.is_bf16_supported():
              return torch.cuda.amp.autocast(dtype=torch.bfloat16)
          else:
              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 2 for calling a global function with example usage: avoid_float16_autocast_context() and returns: nullcontext, torch, torch, torch