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

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

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