code: def cached_cast(
      mod, fn, cast_fn, handle, try_caching=False, verbose=False
  ):
      if not utils.has_func(mod, fn):
          return
  
      orig_fn = utils.get_func(mod, fn)
      cast_fn = utils.verbosify(cast_fn, fn, verbose)
      wrapper = make_cast_wrapper(orig_fn, cast_fn, handle, try_caching)
      utils.set_func_save(handle, mod, fn, wrapper)
  
file_path: apex/apex/amp/wrap.py
imports: from .None import compat
  from .None import utils
  from ._amp_state import _amp_state
  from .None import rnn_compat
  import functools
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: cached_cast(mod, fn, cast_fn, handle, try_caching, verbose) without return types