未验证 提交 19ffd27d 编写于 作者: zhenhailiu's avatar zhenhailiu 提交者: GitHub

python/paddle/framework/io.py (#54801)

上级 98bf4e95
......@@ -1071,11 +1071,18 @@ def load(path, **configs):
# paddle2.0: paddle.save/load
if "StructuredToParameterName@@" in load_result:
for key in load_result["StructuredToParameterName@@"]:
for (key, name) in load_result[
"StructuredToParameterName@@"
].items():
if isinstance(load_result[key], np.ndarray):
load_result[key] = _ndarray_to_tensor(
load_result[key], config.return_numpy
)
# default name is "generated_xxx" which is set in Tensor init, if not set
if not config.return_numpy and getattr(
load_result[key], "name", ""
):
load_result[key].name = name
if (
not config.keep_name_table
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册