From a7635ea16a9ce5088673b8c80901c839730dd4d2 Mon Sep 17 00:00:00 2001 From: Guy Jacob <guy.jacob@intel.com> Date: Mon, 20 May 2019 15:51:58 +0300 Subject: [PATCH] Fix type hint usage which breaks on Python 3.5 --- distiller/quantization/quantizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distiller/quantization/quantizer.py b/distiller/quantization/quantizer.py index 9861181..6b1c24e 100644 --- a/distiller/quantization/quantizer.py +++ b/distiller/quantization/quantizer.py @@ -262,8 +262,8 @@ class Quantizer(object): raise ValueError("Adding overrides while not quantizing is not allowed.") continue - # This hints pycharm the replace_fn is a function - replace_fn: Optional[Callable] = self.replacement_factory[type(module)] + # We use a type hint comment to let IDEs know replace_fn is a function + replace_fn = self.replacement_factory[type(module)] # type: Optional[Callable] # If the replacement function wasn't specified - continue without replacing this module. if replace_fn is not None: valid_kwargs, invalid_kwargs = distiller.filter_kwargs(self.module_overrides_map[full_name], replace_fn) -- GitLab