From 38f3eba3a006b9053d113ba2994baba75f82f980 Mon Sep 17 00:00:00 2001 From: slf12 Date: Wed, 30 Oct 2019 09:05:40 +0000 Subject: [PATCH] config cannot be None --- paddleslim/quant/quant_embedding.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/paddleslim/quant/quant_embedding.py b/paddleslim/quant/quant_embedding.py index 8db9ddf7..19c7e7f1 100755 --- a/paddleslim/quant/quant_embedding.py +++ b/paddleslim/quant/quant_embedding.py @@ -241,12 +241,10 @@ def _quant_embedding_abs_max(graph, scope, place, config): graph.safe_remove_nodes(embedding_node) -def quant_embedding(program, scope, place, config=None): - if config is not None: - assert isinstance(config, dict), "config must be dict" - config = _merge_config(copy.deepcopy(default_config), config) - else: - config = default_config +def quant_embedding(program, scope, place, config): + assert isinstance(config, dict), "config must be dict" + config = _merge_config(copy.deepcopy(default_config), config) + graph = IrGraph(core.Graph(program.desc), for_test=True) if config['quantize_type'] == 'abs_max': _quant_embedding_abs_max(graph, scope, place, config) -- GitLab