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

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

上级 f24a911f
......@@ -653,10 +653,8 @@ def load_vars(executor,
continue
if isinstance(each_var, Parameter):
var_temp = paddle.fluid.global_scope().find_var(each_var.name)
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
orig_para_shape[each_var.name] = tuple(each_var.desc.get_shape(
))
new_var = _clone_var_in_block_(load_block, each_var)
if filename is None:
load_block.append_op(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册