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

fix asp (#1196)

上级 9f8f1a4e
...@@ -457,10 +457,11 @@ def build_prune_program(executor, ...@@ -457,10 +457,11 @@ def build_prune_program(executor,
excluded_params_name = [] excluded_params_name = []
### TODO(ceci3): set default prune weight ### TODO(ceci3): set default prune weight
for param in train_program_info.program.global_block().all_parameters(): for param in train_program_info.program.global_block().all_parameters():
if config[ if config['prune_params_name'] is not None:
'prune_params_name'] is not None and param.name not in config[ if param.name not in config['prune_params_name']:
'prune_params_name']: excluded_params_name.append(param.name)
excluded_params_name.append(param.name) else:
pruner.add_supported_layer(param.name)
if "teacher_" in param.name: if "teacher_" in param.name:
excluded_params_name.append(param.name) excluded_params_name.append(param.name)
pruner.set_excluded_layers(train_program_info.program, pruner.set_excluded_layers(train_program_info.program,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册