code: def _cast_if_autocast_enabled(*args):
      if not torch.is_autocast_enabled():
          return args
      else:
          return torch.cuda.amp.autocast_mode._cast(
              args, torch.get_autocast_gpu_dtype()
          )
  
imports: from typing import Optional, Sequence
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: _cast_if_autocast_enabled() and returns: args, torch