未验证 提交 a1f54a89 编写于 作者: H hong 提交者: GitHub

get shape from var desc to avoid run startup program; test=develop (#20499)

上级 eb526e3f
...@@ -653,10 +653,8 @@ def load_vars(executor, ...@@ -653,10 +653,8 @@ def load_vars(executor,
continue continue
if isinstance(each_var, Parameter): if isinstance(each_var, Parameter):
var_temp = paddle.fluid.global_scope().find_var(each_var.name) orig_para_shape[each_var.name] = tuple(each_var.desc.get_shape(
assert var_temp != None, "can't not find var: " + each_var.name ))
orig_para_shape[each_var.name] = (
np.array(var_temp.get_tensor())).shape
new_var = _clone_var_in_block_(load_block, each_var) new_var = _clone_var_in_block_(load_block, each_var)
if filename is None: if filename is None:
load_block.append_op( load_block.append_op(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册