提交 ee36f15b 编写于 作者: L LI Yunxiang 提交者: Bo Zhou

Update common.py (#173)

上级 4c98e3fd
......@@ -35,6 +35,10 @@ def fetch_framework_var(attr_name):
scope = fluid.executor.global_scope()
core_var = scope.find_var(attr_name)
if core_var == None:
raise KeyError(
"Unable to find the variable:{}. Synchronize paramsters before initialization or attr_name does not exist."
.format(attr_name))
shape = core_var.get_tensor().shape()
framework_var = fluid.layers.create_parameter(
shape=shape, dtype='float32', attr=fluid.ParamAttr(name=attr_name))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册