From 475b6a67faed90264378c3ccb9025586c97b0eb2 Mon Sep 17 00:00:00 2001
From: Guy Jacob <guy.jacob@intel.com>
Date: Sun, 6 Oct 2019 10:21:57 +0300
Subject: [PATCH] Bugfix - remove unnecessary argument from NCF quantizer
 metadata

---
 distiller/quantization/range_linear.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/distiller/quantization/range_linear.py b/distiller/quantization/range_linear.py
index e161f7f..58b4a18 100644
--- a/distiller/quantization/range_linear.py
+++ b/distiller/quantization/range_linear.py
@@ -1407,6 +1407,10 @@ class NCFQuantAwareTrainQuantizer(QuantAwareTrainRangeLinearQuantizer):
                                                           per_channel_wts=per_channel_wts,
                                                           quantize_inputs=False)
 
+        # Remove 'quantize_inputs' from the metadata dict since this quantizer hard-codes it and doesn't
+        # actually take it as an argument
+        self.model.quantizer_metadata['params'].pop('quantize_inputs')
+
         self.replacement_factory[distiller.modules.EltwiseMult] = self.activation_replace_fn
         self.replacement_factory[distiller.modules.Concat] = self.activation_replace_fn
         self.replacement_factory[nn.Linear] = self.activation_replace_fn
-- 
GitLab