code: def _check_scale_zp_shapes(input_data, scale, zero_point, axis):
      def assert_vector_size_same_as_axial_dimension(
          param, axis_dim_size, name
      ):
          if param.rank == 1 and param.shape[0] != axis_dim_size:
              raise ValueError(
                  "Parameter {}, if vector, needs to have same size as the dimension size along the parameter input".format(
                      name
                  )
              )
  
      if scale.rank == 0:
          # ios17.dequantize doesn't want axis defined for scalar quant params.
          if axis is not None:
              raise ValueError(
                  "axis should not be provided to quantize if scale/zp are scalars"
              )
          if zero_point is not None and zero_point.rank != 0:
              raise ValueError(
                  "zero_point should be a scalar if scale is a scalar"
              )
      elif scale.rank == 1:
          if axis is None or axis.val is None:
              raise ValueError(
                  "axis should be provided to quantize if scale/zp are not scalars"
              )
          if axis.val < -input_data.rank or axis.val >= input_data.rank:
              raise ValueError(
                  "Parameter axis needs to be in the range -input.rank <= axis < input.rank"
              )
  
          input_axis_dim_size = input_data.shape[axis.val]
          assert_vector_size_same_as_axial_dimension(
              scale, input_axis_dim_size, "scale"
          )
          if zero_point is not None:
              if zero_point.rank != 1:
                  raise ValueError(
                      "zero_point should be a vector if scale is a vector"
                  )
              assert_vector_size_same_as_axial_dimension(
                  zero_point, input_axis_dim_size, "zero_point"
              )
      else:
          raise ValueError(
              "Params scale & zero_point should both be scalars or vectors"
          )
  
file_path: coremltools/coremltools/converters/mil/mil/ops/defs/iOS17/quantization_ops.py
imports: import numpy
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.input_type import InputSpec, TensorInputType
  from coremltools.converters.mil.mil.operation import VALUE, Operation, precondition
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from coremltools.converters.mil.mil.ops.defs.iOS17 import _IOS17_TARGET
label_desc: Use image node_id 2 for calling a global function with example usage: _check_scale_zp_shapes(input_data, scale, zero_point, axis) without return types