提交 2f910383 编写于 作者: S slf12

change scope's default value to None

上级 b80d8969
...@@ -201,7 +201,7 @@ def quant_post(program, place, config, scope=None): ...@@ -201,7 +201,7 @@ def quant_post(program, place, config, scope=None):
pass pass
def convert(program, scope, place, config, save_int8=False): def convert(program, place, config, scope=None, save_int8=False):
""" """
add quantization ops in program. the program returned is not trainable. add quantization ops in program. the program returned is not trainable.
Args: Args:
...@@ -216,7 +216,7 @@ def convert(program, scope, place, config, save_int8=False): ...@@ -216,7 +216,7 @@ def convert(program, scope, place, config, save_int8=False):
fluid.Program: freezed int8 program which can be used for inference. fluid.Program: freezed int8 program which can be used for inference.
if save_int8 is False, this value is None. if save_int8 is False, this value is None.
""" """
scope = fluid.global_scope() if not scope else scope
test_graph = IrGraph(core.Graph(program.desc), for_test=True) test_graph = IrGraph(core.Graph(program.desc), for_test=True)
# Freeze the graph after training by adjusting the quantize # Freeze the graph after training by adjusting the quantize
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册