Skip to content

Commit

Permalink
Remove redundant code in paddleslim/prune (PaddlePaddle#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
qingqing01 authored and wanghaoshuang committed Jan 17, 2020
1 parent 405a468 commit d95da67
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 243 deletions.
2 changes: 1 addition & 1 deletion paddleslim/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .log_helper import get_logger
from .controller_server import ControllerServer
from .controller_client import ControllerClient
from .lock_utils import lock, unlock
from .lock import lock, unlock
from .cached_reader import cached_reader

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion paddleslim/common/controller_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import time
from .log_helper import get_logger
from threading import Thread
from .lock_utils import lock, unlock
from .lock import lock, unlock

__all__ = ['ControllerServer']

Expand Down
File renamed without changes.
38 changes: 0 additions & 38 deletions paddleslim/common/lock_utils.py

This file was deleted.

6 changes: 0 additions & 6 deletions paddleslim/prune/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
import pruner
from .auto_pruner import *
import auto_pruner
from .controller_server import *
import controller_server
from .controller_client import *
import controller_client
from .sensitive_pruner import *
import sensitive_pruner
from .sensitive import *
Expand All @@ -32,8 +28,6 @@

__all__ += pruner.__all__
__all__ += auto_pruner.__all__
__all__ += controller_server.__all__
__all__ += controller_client.__all__
__all__ += sensitive_pruner.__all__
__all__ += sensitive.__all__
__all__ += prune_walker.__all__
Expand Down
6 changes: 3 additions & 3 deletions paddleslim/prune/auto_pruner.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _get_range_table(self, min_ratios, max_ratios):

def _constrain_func(self, tokens):
ratios = self._tokens2ratios(tokens)
pruned_program = self._pruner.prune(
pruned_program, _, _ = self._pruner.prune(
self._program,
self._scope,
self._params,
Expand All @@ -183,7 +183,7 @@ def prune(self, program, eval_program=None):
Program: The pruned program.
"""
self._current_ratios = self._next_ratios()
pruned_program = self._pruner.prune(
pruned_program, _, _ = self._pruner.prune(
program,
self._scope,
self._params,
Expand All @@ -193,7 +193,7 @@ def prune(self, program, eval_program=None):
param_backup=self._param_backup)
pruned_val_program = None
if eval_program is not None:
pruned_val_program = self._pruner.prune(
pruned_val_program, _, _ = self._pruner.prune(
program,
self._scope,
self._params,
Expand Down
66 changes: 0 additions & 66 deletions paddleslim/prune/controller_client.py

This file was deleted.

128 changes: 0 additions & 128 deletions paddleslim/prune/controller_server.py

This file was deleted.

0 comments on commit d95da67

Please sign in to comment.