code: def err_if_arg0_half(mod, fn, handle, verbose=False):
      if not utils.has_func(mod, fn):
          return
  
      orig_fn = utils.get_func(mod, fn)
  
      @functools.wraps(orig_fn)
      def wrapper(arg0, *args, **kwargs):
          assert compat.is_tensor_like(arg0)
          if utils.type_string(arg0) == "HalfTensor":
              raise NotImplementedError(
                  "Cannot call in-place method "
                  + "{} on fp16 Tensors.".format(fn)
              )
          else:
              cast_fn = utils.verbosify(utils.maybe_float, fn, verbose)
              new_args = utils.casted_args(cast_fn, args, kwargs)
              return orig_fn(arg0, *new_args, **kwargs)
  
      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 8 for calling a global function with example usage: err_if_arg0_half(mod, fn, handle, verbose) and returns: orig_fn