code: def _convert_neural_network_spec_weights_to_fp16(fp_spec):
      from .neural_network.quantization_utils import (
          _QUANTIZATION_MODE_LINEAR_QUANTIZATION,
          _quantize_spec_weights,
      )
  
      qspec = _quantize_spec_weights(
          fp_spec, 16, _QUANTIZATION_MODE_LINEAR_QUANTIZATION
      )
      return qspec
  
imports: from collections.abc import Iterable
  from functools import lru_cache
  import math
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  from typing import Optional, Union
  import warnings
  import numpy
  import coremltools
  from coremltools import ComputeUnit
  from coremltools.converters.mil.mil.passes.defs.preprocess import NameSanitizer
  from coremltools.proto import Model_pb2
  import coremltools.proto.MIL_pb2
  from .._deps import _HAS_SCIPY
label_desc: Use image node_id 10 for calling a global function with example usage: _convert_neural_network_spec_weights_to_fp16(fp_spec) and returns: qspec