code: def maybe_half(x, name="", verbose=False):
      if is_nested(x):
          return type(x)([maybe_half(y) for y in x])
  
      if not x.is_cuda or type_string(x) == "HalfTensor":
          return x
      else:
          if verbose:
              print("Float->Half ({})".format(name))
          return x.half()
  
imports: from .None import compat
  import functools
  import itertools
  import torch
label_desc: Use image node_id 8 for calling a global function with example usage: maybe_half(x, name, verbose) and returns: type, x, x