class_docstr: A container class that stores weight meta data.
  
  The class has the following attributes:
  
  Parameters
  ----------
  val: numpy.ndarray
      The weight data.
  
  sparsity: float
      The percentile of the element whose absolute value ``<= 1e-12``.
  
  unique_values: int
      Number of unique values in the weight.
  
  child_ops: list[CoreMLOpMetaData]
      A list of ``CoreMLOpMetaData`` which contains information of child ops in which the weight is feeding into.
  
      The attributes can be accessed by:
      ``child_ops[idx].op_type``: The operation type of the ``idx`` 'th child op.
      ``child_ops[idx].name``: The name of the ``idx`` 'th child op.
  
      Other op-dependant attributes also can be accessed. For instance, if ``idx`` 'th child op is a ``conv`` layer,
      ``child_ops[idx].weight`` will return its weight name.
  
      For more details, please refer to the ``CoreMLOpMetaData`` doc string.
  
  Examples
  --------
  .. sourcecode:: python
  
      import numpy as np
      from coremltools.optimize.coreml import CoreMLWeightMetaData
  
      data = np.array([[1.0, 0.0], [0.0, 6.0]], dtype=np.float32)
      meta_data = CoreMLWeightMetaData(data)
      print(meta_data)
  
  Outputs::
  
      [
          val: np.ndarray(shape=(2, 2), dtype=float32)
          sparsity: 0.5
          unique_values: 3
      ]
class_docstr_tok: ["A","container","class","that","stores","weight","meta","data",".","The","class","has","the","following","attributes",":","Parameters","--","--","--","--","--","val",":","numpy.ndarray","The","weight","data",".","sparsity",":","float","The","percentile","of","the","element","whose","absolute","value","``","<","=","1e-12","``",".","unique_values",":","int","Number","of","unique","values","in","the","weight",".","child_ops",":","list","[","CoreMLOpMetaData","]","A","list","of","``","CoreMLOpMetaData","``","which","contains","information","of","child","ops","in","which","the","weight","is","feeding","into",".","The","attributes","can","be","accessed","by",":","``","child_ops","[","idx","]",".op_type","``",":","The","operation","type","of","the","``","idx","``","'th","child","op",".","``","child_ops","[","idx","]",".name","``",":","The","name","of","the","``","idx","``","'th","child","op",".","Other","op-dependant","attributes","also","can","be","accessed",".","For","instance",",","if","``","idx","``","'th","child","op","is","a","``","conv","``","layer",",","``","child_ops","[","idx","]",".weight","``","will","return","its","weight","name",".","For","more","details",",","please","refer","to","the","``","CoreMLOpMetaData","``","doc","string",".","Examples","--","--","--","--","..","sourcecode",":",":","python","import","numpy","as","np","from","coremltools.optimize.coreml","import","CoreMLWeightMetaData","data","=","np.array","(","[","[","1.0",",","0.0","]",",","[","0.0",",","6.0","]","]",",","dtype=np.float32",")","meta_data","=","CoreMLWeightMetaData","(","data",")","print","(","meta_data",")","Outputs",":",":","[","val",":","np.ndarray","(","shape=","(","2",",","2",")",",","dtype=float32",")","sparsity",":","0.5","unique_values",":","3","]"]
code: def _get_sparsity(self):
      num_of_zeros = np.sum(np.abs(self.val) <= 1e-12)
      return num_of_zeros / self.val.size
  
imports: from collections import OrderedDict
  from typing import Callable, Dict, List, Optional
  import numpy
  from attrs import define, field, validators
  from tqdm import tqdm
  from coremltools import _SPECIFICATION_VERSION_IOS_16
  from coremltools.converters.mil.converter import mil_convert
  from coremltools.converters.mil.frontend.milproto import load
  from coremltools.converters.mil.mil.passes.defs.quantization import AbstractQuantizationPass
  from coremltools.models import MLModel
  from coremltools.optimize.coreml import OptimizationConfig
  from coremltools.optimize.coreml._config import _MetaDataDict
  from ._quantization_passes import WeightDecompressor
  from ._quantization_passes import linear_quantize_weights
  from ._quantization_passes import palettize_weights
  from ._quantization_passes import prune_weights
label_desc: Use image node_id 1 for calling the CoreMLWeightMetaData obj's underlying member method code with example usage: obj._get_sparsity() and returns: unknown