diff --git a/python/paddle/distributed/fleet/meta_optimizers/ascend/ascend_parser.py b/python/paddle/distributed/fleet/meta_optimizers/ascend/ascend_parser.py index 3331a45b3d9479dd1d1bc2208e689c7aad4a4f90..5f2b6df493b8fe709e0c6a74b16f870873fedaef 100644 --- a/python/paddle/distributed/fleet/meta_optimizers/ascend/ascend_parser.py +++ b/python/paddle/distributed/fleet/meta_optimizers/ascend/ascend_parser.py @@ -136,7 +136,7 @@ class AscendHelper(object): def dtype2np(self, index): assert index in self.dtype2np_map, "index[%d] is not supported %d" % ( - dtype) + index) return self.dtype2np_map[index] diff --git a/python/paddle/fluid/tests/unittests/asp/test_asp_pruning_2d_best.py b/python/paddle/fluid/tests/unittests/asp/test_asp_pruning_2d_best.py index 1b8b1e4a06ae4c6954aba4f380361dfc7383eb9b..b21f8edf4f477262d919c98031a4dc3d820a0d15 100644 --- a/python/paddle/fluid/tests/unittests/asp/test_asp_pruning_2d_best.py +++ b/python/paddle/fluid/tests/unittests/asp/test_asp_pruning_2d_best.py @@ -16,6 +16,7 @@ from __future__ import print_function import paddle +import unittest from paddle.fluid.contrib import sparsity from paddle.fluid.tests.unittests.asp.asp_pruning_base import TestASPHelperPruningBase diff --git a/python/paddle/fluid/tests/unittests/npu/test_collective_base_npu.py b/python/paddle/fluid/tests/unittests/npu/test_collective_base_npu.py index b871256acd4db77e71433f9a8e750593affc7802..6372e1ab85f6b41230518c7c9b483ec1e259ff56 100644 --- a/python/paddle/fluid/tests/unittests/npu/test_collective_base_npu.py +++ b/python/paddle/fluid/tests/unittests/npu/test_collective_base_npu.py @@ -27,6 +27,7 @@ from contextlib import closing import paddle.fluid as fluid import paddle.fluid.unique_name as nameGen from paddle.fluid import core +from six import string_types class TestCollectiveRunnerBase(object):