code: def nano_bf16(func):
      """A decorator to realize mixed precision on customized training loop."""
  
      # todo check the func signature
      @wraps(func)
      def wrapper(*inner_args):
          new_args = []
          for arg in inner_args:
              if isinstance(arg, (tf.Tensor, np.ndarray)):
                  arg = tf.cast(arg, tf.bfloat16)
              new_args.append(arg)
          return func(*new_args)
  
      return wrapper
  
imports: import cloudpickle
  import tensorflow
  import numpy
  from functools import wraps, partial
  from tempfile import TemporaryDirectory
  import os
  import json
  from bigdl.nano.utils.common import schedule_processors
  from bigdl.nano.tf.keras.distributed_utils import _find_free_port
  from tensorflow.keras.losses import Loss
  import warnings
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 1 for calling a global function with example usage: nano_bf16(func) and returns: wrapper, func