diff --git a/python/paddle/fluid/net_drawer.py b/python/paddle/fluid/net_drawer.py index f991310384f769ce091197b16db953e7af94a3c3..fd8f6eaf364c419d44b62c860d0d506d4a481942 100644 --- a/python/paddle/fluid/net_drawer.py +++ b/python/paddle/fluid/net_drawer.py @@ -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") diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model.py index 4f35befda8e2cdd7e238dc22f2cea78b68fc70e6..affec2f7dfefc3d8f385077055de5028df28bea7 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model.py @@ -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): diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model_v2.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model_v2.py index e0b7e9033dd5e62110dde39e3f8d399b0f3b1662..5cbaeb0f4046e3e9e6404586ca59f2b2d7f3c8fc 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model_v2.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/simnet_dygraph_model_v2.py @@ -14,6 +14,7 @@ from functools import reduce import paddle +from paddle.static import Variable class EmbeddingLayer(object): diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_static_analysis.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_static_analysis.py index e72688d800ba59f63503248f2a5d385da23d6882..0fffb0c985375be5f126852b8fa890bb0c32ab9d 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_static_analysis.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_static_analysis.py @@ -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 diff --git a/python/paddle/text/datasets/wmt14.py b/python/paddle/text/datasets/wmt14.py index a50b9e81aac6d6d19d67c3de215361ed7ebdd3b8..38ca09bf299831add72d04ade5e5a30b4948344b 100644 --- a/python/paddle/text/datasets/wmt14.py +++ b/python/paddle/text/datasets/wmt14.py @@ -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