Skip to content

Commit

Permalink
fix nas in python3 (PaddlePaddle#21)
Browse files Browse the repository at this point in the history
* fix py3

* fix
  • Loading branch information
ceci3 authored Jan 2, 2020
1 parent 479e10d commit cc1cd6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion paddleslim/common/sa_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def next_tokens(self, control_token=None):
_logger.debug("change index[{}] from {} to {}".format(
index, tokens[index], new_tokens[index]))

if self._searched.has_key(str(new_tokens)):
if str(new_tokens) in self._searched.keys():
_logger.debug('get next tokens including searched tokens: {}'.
format(new_tokens))
continue
Expand Down
4 changes: 2 additions & 2 deletions paddleslim/nas/sa_nas.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(self,
premax_reward = scene['_max_reward']
prebest_tokens = scene['_best_tokens']
preiter = scene['_iter']
psearched = screen['_searched']
psearched = scene['_searched']
else:
preinit_tokens = init_tokens
prereward = -1
Expand All @@ -114,7 +114,7 @@ def __init__(self,
best_tokens=prebest_tokens,
constrain_func=None,
checkpoints=save_checkpoint,
searched = psearched)
searched=psearched)

max_client_num = 100
self._controller_server = ControllerServer(
Expand Down

0 comments on commit cc1cd6f

Please sign in to comment.