-
Notifications
You must be signed in to change notification settings - Fork 279
Open
Description
Usage in
neural-compressor/neural_compressor/adaptor/ox_utils/quantizer.py
Lines 969 to 978 in 4eaef0f
packed_weight_np_data = np.asarray( | |
weight.quantized_data, dtype=onnx.mapping.TENSOR_TYPE_TO_NP_TYPE[weight.qType] | |
).reshape(weight.initializer.dims) | |
packed_weight_initializer = onnx.numpy_helper.from_array(packed_weight_np_data, packed_weight_name) | |
if not self.add_qdq_pair_to_weight or self.mode != "qdq": | |
self.model.initializer().append(packed_weight_initializer) | |
if weight.axis is not None: | |
zero_scale_shape = [weight.initializer.dims[weight.axis]] | |
else: # scale and zero point must be scalar |
It is deprecated. Use helper.tensor_dtype_to_np_dtype
instead.
Metadata
Metadata
Assignees
Labels
No labels