diff --git a/paddleslim/prune/unstructured_pruner.py b/paddleslim/prune/unstructured_pruner.py index 8c0857df48f5623d5863db5e7acd90ec8b8b7b99..b8e77c9c0abe19253de2c1ffe2ca862d24a9c07e 100644 --- a/paddleslim/prune/unstructured_pruner.py +++ b/paddleslim/prune/unstructured_pruner.py @@ -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) diff --git a/tests/test_quant_aware.py b/tests/test_quant_aware.py index a587c7692d2682e9d8bd34d8d69988650f0d79bb..8cd9e3bc9c48cc70709c1f01b98bd4482eac995e 100644 --- a/tests/test_quant_aware.py +++ b/tests/test_quant_aware.py @@ -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())