未验证 提交 d8dbf834 编写于 作者: D dawn1206 提交者: GitHub

fix backslash misunderstood as escape character when generating code in Windows (#706)

* fix escape character

* Delete .idea directory

* delete space behind "prim.list_unpack"
上级 132fc6cf
...@@ -109,7 +109,7 @@ class PaddleGraph(object): ...@@ -109,7 +109,7 @@ class PaddleGraph(object):
layer = PaddleLayer( layer = PaddleLayer(
layer_id, kernel, inputs, outputs, scope_name=scope_name, **kwargs) layer_id, kernel, inputs, outputs, scope_name=scope_name, **kwargs)
self.layers[layer_id] = layer self.layers[layer_id] = layer
if layer.kernel in ["prim.list_unpack" , "prim.tuple_unpack"]: if layer.kernel in ["prim.list_unpack", "prim.tuple_unpack"]:
self.has_unpack = True self.has_unpack = True
return layer_id return layer_id
...@@ -388,7 +388,7 @@ class PaddleGraph(object): ...@@ -388,7 +388,7 @@ class PaddleGraph(object):
gen_codes( gen_codes(
[ [
"paddle.disable_static()", "paddle.disable_static()",
"params = paddle.load('{}')".format( "params = paddle.load(r'{}')".format(
osp.join(osp.abspath(code_dir), "model.pdparams")), osp.join(osp.abspath(code_dir), "model.pdparams")),
"model = {}()".format(self.name), "model = {}()".format(self.name),
"model.set_dict(params, use_structured_name={})".format( "model.set_dict(params, use_structured_name={})".format(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册