提交 38f3eba3 编写于 作者: S slf12

config cannot be None

上级 9222d1a6
...@@ -241,12 +241,10 @@ def _quant_embedding_abs_max(graph, scope, place, config): ...@@ -241,12 +241,10 @@ def _quant_embedding_abs_max(graph, scope, place, config):
graph.safe_remove_nodes(embedding_node) graph.safe_remove_nodes(embedding_node)
def quant_embedding(program, scope, place, config=None): def quant_embedding(program, scope, place, config):
if config is not None: assert isinstance(config, dict), "config must be dict"
assert isinstance(config, dict), "config must be dict" config = _merge_config(copy.deepcopy(default_config), config)
config = _merge_config(copy.deepcopy(default_config), config)
else:
config = default_config
graph = IrGraph(core.Graph(program.desc), for_test=True) graph = IrGraph(core.Graph(program.desc), for_test=True)
if config['quantize_type'] == 'abs_max': if config['quantize_type'] == 'abs_max':
_quant_embedding_abs_max(graph, scope, place, config) _quant_embedding_abs_max(graph, scope, place, config)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册