code: def convert_model(
      sym,
      arg_params,
      aux_params,
      input_dtypes,
      target_dtype,
      target_dtype_ops=None,
      fp32_ops=None,
      conditional_fp32_ops=None,
      excluded_sym_names=[],
      cast_params_offline=False,
  ):
      """API for converting a model from FP32 model to a mixed precision model.
      MXNet tries to convert the FP32 model to mixed precision model by adding
      cast layers using amp_cast and amp_multicast operators which can be used for inference use cases.
      The decision on which cast layer to add is based on hardcoded lists for Automatic Mixed Precision
      in MXNet. These lists can be overridden by the user by providing their own lists
      using : targe_precision_ops, fp32_ops, widest_precision_ops, conditional_fp32_ops
  
      arg_params : dict
          Dictionary of name to `NDArray`.
      aux_params : dict
          Dictionary of name to `NDArray`.
      input_dtypes: dict
          Dictionary mapping names of model inputs to their dtypes
      target_dtype : str
          Currently only supports float16 and bfloat 16. The target dtype indicates to add cast layers
          when possible so that lower precision computation can be leveraged.
      target_dtype_ops : list of strs
          Override the list of operator names casted to target_dtype.
          If None, uses the framework's default list to be casted to target dtype.
      fp32_ops : list of strs
          Override the lists of operator names casted to FP32.
          If None, uses the framework's default list to be casted to FP32.
      widest_dtype_ops : list of strs
          A list of op names provided by user which should run in widest precision among its inputs.
          If None, uses the framework's default list of widest_precision_ops.
      conditional_fp32_ops : list of (string, string, list of string)
          Override the list of operators to be casted to FP32.
          The format of the list is
          (name of the function, name of the parameter,
           list of values of the parameter that make the operator to be casted to
          fp32)
      excluded_sym_names : list of strs
          A list of strings that represent the names of symbols that users want to exclude
          from being executed in lower precision.
      cast_params_offline : bool, default False
          Whether to cast arg_params and aux_params now, instead of doing it every time at runtime.
      """
      assert isinstance(
          sym, Symbol
      ), "First argument to convert_model should be a Symbol"
      assert isinstance(
          arg_params, dict
      ), "Second argument to convert_model should be a dict of name to ndarray"
      assert isinstance(
          aux_params, dict
      ), "Third argument to convert_model should be a dict of name to ndarray"
  
      arg_params = arg_params.copy()
      aux_params = aux_params.copy()
      param_dtypes = {
          name: data.dtype for name, data in arg_params.items()
      }
      param_dtypes.update(
          {name: data.dtype for name, data in aux_params.items()}
      )
      sym = convert_symbol(
          sym,
          input_dtypes,
          param_dtypes,
          target_dtype,
          target_dtype_ops,
          fp32_ops,
          conditional_fp32_ops,
          excluded_sym_names,
          cast_params_offline,
      )
  
      # If dtype is set for params, cast the param to that dtype
      attr_dict = sym.attr_dict()
      for sym_name in sym.list_arguments():
          if (
              attr_dict.get(sym_name, {}).get(
                  OFFLINE_CAST_DTYPE_ATTR, ""
              )
              != ""
              and sym_name in arg_params
          ):
              typ = get_dtype_type(
                  attr_dict[sym_name][OFFLINE_CAST_DTYPE_ATTR]
              )
              if arg_params[sym_name].dtype != typ:
                  arg_params[sym_name] = arg_params[sym_name].astype(
                      typ
                  )
  
      for sym_name in sym.list_auxiliary_states():
          if (
              attr_dict.get(sym_name, {}).get(
                  OFFLINE_CAST_DTYPE_ATTR, ""
              )
              != ""
              and sym_name in aux_params
          ):
              typ = get_dtype_type(
                  attr_dict[sym_name][OFFLINE_CAST_DTYPE_ATTR]
              )
              if aux_params[sym_name].dtype != typ:
                  aux_params[sym_name] = aux_params[sym_name].astype(
                      typ
                  )
  
      # Return the converted symbol and casted params
      return sym, arg_params, aux_params
  
imports: from array import array
  import ctypes
  import inspect
  import logging
  import contextlib
  import sys
  import numpy
  from mxnet import numpy
  from ..None import symbol
  from ..device import gpu
  from ..symbol import Symbol
  from ..symbol import contrib
  from ..None import ndarray
  from ..ndarray import NDArray, dtype_np_to_mx, get_dtype_type, get_dtype_name, bfloat16
  from .None import lists
  from ..gluon import Block, HybridBlock, trainer
  from ..None import base
  from ..base import _NP_OP_PREFIX, _NP_OP_SUBMODULE_LIST, _NP_EXT_OP_PREFIX, _NP_EXT_OP_SUBMODULE_LIST, _NP_INTERNAL_OP_PREFIX, c_str_array, c_str, c_array_buf, SymbolHandle, check_call, _LIB
  from ..None import optimizer
  from .loss_scaler import LossScaler
  from ..operator import get_all_registered_operators_grouped
  from ..util import wrap_ctx_to_device_func
label_desc: Use image node_id 12 for calling a global function with example usage: convert_model(sym, arg_params, aux_params, input_dtypes, target_dtype, target_dtype_ops, fp32_ops, conditional_fp32_ops, excluded_sym_names, cast_params_offline) and returns: sym,  arg_params,  aux_params