提交 1ca897a2 编写于 作者: Y yeliang2258

for test

上级 a87f7d3d
......@@ -59,9 +59,19 @@ def _rename_or_remove_weight(weights,
Returns:
None
'''
# if origin_name not in weights:
# raise KeyError('{} not a key in {}'.format(origin_name, weights.keys()))
# data = weights[origin_name]
# if target_name is not None:
# # rename weight
# weights[target_name] = data
if origin_name not in weights:
raise KeyError('{} not a key in {}'.format(origin_name, weights.keys()))
data = weights[origin_name]
if is_remove:
# remove weight
data = weights.pop(origin_name)
else:
data = weights[origin_name]
if target_name is not None:
# rename weight
weights[target_name] = data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册