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

fix undefined-variable-1 (#33425)

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