class_docstr: Quantized layer selector allowing the user to specify some types of
  layers to skip during quantization process and the minimum size parameters
  in quantized convolution layers.
  
  Examples
  --------
  .. highlight:: python
  .. code-block:: python
  
      from coremltools.models.neural_network.quantization_utils import AdvancedQuantizedLayerSelector
      selector = AdvancedQuantizedLayerSelector(
              skip_layer_types=['batchnorm', 'bias', 'depthwiseConv'],
              minimum_conv_kernel_channels=4,
              minimum_conv_weight_count=4096)
      quantized_model = quantize_weights(model, 8, selector=selector)
class_docstr_tok: ["Quantized","layer","selector","allowing","the","user","to","specify","some","types","of","layers","to","skip","during","quantization","process","and","the","minimum","size","parameters","in","quantized","convolution","layers",".","Examples","--","--","--","--","..","highlight",":",":","python","..","code-block",":",":","python","from","coremltools.models.neural_network.quantization_utils","import","AdvancedQuantizedLayerSelector","selector","=","AdvancedQuantizedLayerSelector","(","skip_layer_types=","[","'batchnorm","'",",","'bias","'",",","'depthwiseConv","'","]",",","minimum_conv_kernel_channels=4",",","minimum_conv_weight_count=4096",")","quantized_model","=","quantize_weights","(","model",",","8",",","selector=selector",")"]
docstr: weight_param - should be name of the WeightParam field
          
code: def do_quantize(self, layer, weight_param=None):
      """weight_param - should be name of the WeightParam field"""
      ret = super(AdvancedQuantizedLayerSelector, self).do_quantize(
          layer
      )
      if not ret:
          return False
  
      layer_type = layer.WhichOneof("layer")
      if layer_type in self.skip_layer_types:
          return False
  
      if layer_type == "convolution":
          oc = layer.convolution.outputChannels
          kc = layer.convolution.kernelChannels
          kh = layer.convolution.kernelSize[0]
          kw = layer.convolution.kernelSize[1]
          groups = layer.convolution.nGroups
          counts = oc * kc * kh * kw
          has_bias = layer.convolution.hasBias
  
          if weight_param is None or weight_param == "weights":
              if (
                  "depthwiseConv" in self.skip_layer_types
                  and kc == 1
                  and groups > 1
              ):
                  return False
  
              if (
                  kc < self.minimum_conv_kernel_channels
                  or counts < self.minimum_conv_weight_count
              ):
                  return False
  
          elif weight_param == "bias":
              return not "bias" in self.skip_layer_types
          else:
              raise ValueError(
                  "Unrecognized quantization weight field {}".format(
                      weight_param
                  )
              )
  
      elif layer_type == "innerProduct" or "batchedMatmul":
          if weight_param is None or weight_param == "weights":
              return True
          if weight_param == "bias":
              return not "bias" in self.skip_layer_types
          else:
              raise ValueError(
                  "Unrecognized quantization weight field {}".format(
                      weight_param
                  )
              )
  
      return True
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  from sys import stdout
  from os import listdir
  from six import string_types
  from .optimization_utils import _optimize_nn
  from coremltools.models import _SUPPORTED_QUANTIZATION_MODES, _QUANTIZATION_MODE_DEQUANTIZE, _QUANTIZATION_MODE_LOOKUP_TABLE_LINEAR, _QUANTIZATION_MODE_LOOKUP_TABLE_KMEANS, _QUANTIZATION_MODE_CUSTOM_LOOKUP_TABLE, _QUANTIZATION_MODE_LINEAR_QUANTIZATION, _QUANTIZATION_MODE_LINEAR_SYMMETRIC, _LUT_BASED_QUANTIZATION
  from ..utils import _get_nn_layers, _wp_to_fp16wp, _get_model, _macos_version
  from ..._deps import _HAS_SKLEARN
  from ...None import _MINIMUM_QUANTIZED_MODEL_SPEC_VERSION, _MINIMUM_FP16_SPEC_VERSION, _SPECIFICATION_VERSION_IOS_14
label_desc: Use image node_id 2 for calling the AdvancedQuantizedLayerSelector obj's underlying member method code with example usage: obj.do_quantize(layer, weight_param) and returns: True, False, False, False, False, unknown, True, unknown