未验证 提交 1026858c 编写于 作者: M minghaoBD 提交者: GitHub

fix illegal usage: paddle.static.CPUPlace() (#852)

上级 8883d702
...@@ -35,7 +35,7 @@ class UnstructuredPruner(): ...@@ -35,7 +35,7 @@ class UnstructuredPruner():
'ratio', 'threshold' 'ratio', 'threshold'
], "mode must be selected from 'ratio' and 'threshold'" ], "mode must be selected from 'ratio' and 'threshold'"
self.scope = paddle.static.global_scope() if scope == None else scope self.scope = paddle.static.global_scope() if scope == None else scope
self.place = paddle.static.CPUPlace() if place is None else place self.place = paddle.CPUPlace() if place is None else place
if skip_params_func is None: skip_params_func = self._get_skip_params if skip_params_func is None: skip_params_func = self._get_skip_params
self.skip_params = skip_params_func(program) self.skip_params = skip_params_func(program)
self.masks = self._apply_masks(program) self.masks = self._apply_masks(program)
......
...@@ -108,7 +108,7 @@ class TestQuantAwareCase2(StaticCase): ...@@ -108,7 +108,7 @@ class TestQuantAwareCase2(StaticCase):
val_prog = main_prog.clone(for_test=True) val_prog = main_prog.clone(for_test=True)
place = paddle.CUDAPlace(0) if paddle.is_compiled_with_cuda( place = paddle.CUDAPlace(0) if paddle.is_compiled_with_cuda(
) else paddle.static.CPUPlace() ) else paddle.CPUPlace()
exe = paddle.static.Executor(place) exe = paddle.static.Executor(place)
exe.run(paddle.static.default_startup_program()) exe.run(paddle.static.default_startup_program())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册