未验证 提交 71f8707b 编写于 作者: Z zhangchunle 提交者: GitHub

fix undefined-variable-1 (#33425)

上级 3a213d94
...@@ -102,11 +102,11 @@ def parse_graph(program, graph, var_dict, **kwargs): ...@@ -102,11 +102,11 @@ def parse_graph(program, graph, var_dict, **kwargs):
def draw_graph(startup_program, main_program, **kwargs): def draw_graph(startup_program, main_program, **kwargs):
if "graph_attr" in kwargs: if "graph_attr" in kwargs:
GRAPH_STYLE.update(kwargs[graph_attr]) GRAPH_STYLE.update(kwargs["graph_attr"])
if "node_attr" in kwargs: if "node_attr" in kwargs:
OP_STYLE.update(kwargs[node_attr]) OP_STYLE.update(kwargs["node_attr"])
if "edge_attr" in kwargs: if "edge_attr" in kwargs:
VAR_STYLE.update(kwargs[edge_attr]) VAR_STYLE.update(kwargs["edge_attr"])
graph_id = unique_id() graph_id = unique_id()
filename = kwargs.get("filename") filename = kwargs.get("filename")
......
...@@ -18,6 +18,7 @@ import paddle.fluid.param_attr as attr ...@@ -18,6 +18,7 @@ import paddle.fluid.param_attr as attr
from functools import reduce from functools import reduce
from paddle.fluid.dygraph import declarative, to_variable from paddle.fluid.dygraph import declarative, to_variable
from paddle.fluid.dygraph import Embedding, Layer, Linear from paddle.fluid.dygraph import Embedding, Layer, Linear
from paddle.static import Variable
class EmbeddingLayer(object): class EmbeddingLayer(object):
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
from functools import reduce from functools import reduce
import paddle import paddle
from paddle.static import Variable
class EmbeddingLayer(object): class EmbeddingLayer(object):
......
...@@ -17,6 +17,7 @@ from __future__ import print_function ...@@ -17,6 +17,7 @@ from __future__ import print_function
import gast import gast
import inspect import inspect
import numpy as np import numpy as np
import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import unittest import unittest
......
...@@ -18,6 +18,7 @@ import six ...@@ -18,6 +18,7 @@ import six
import tarfile import tarfile
import numpy as np import numpy as np
import gzip import gzip
import six
from paddle.io import Dataset from paddle.io import Dataset
import paddle.compat as cpt import paddle.compat as cpt
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册