From 78a9870ff8184771e022954a375faef2b73ce777 Mon Sep 17 00:00:00 2001 From: Jiangxinz Date: Wed, 16 Jun 2021 16:46:34 +0800 Subject: [PATCH] fix bad super call (#33533) --- python/paddle/distributed/entry_attr.py | 4 ++-- python/paddle/fluid/entry_attr.py | 4 ++-- python/paddle/fluid/incubate/fleet/base/role_maker.py | 2 +- .../tests/unittests/mkldnn/test_conv2d_transpose_mkldnn_op.py | 2 +- python/paddle/fluid/tests/unittests/test_backward.py | 4 ++-- python/paddle/fluid/tests/unittests/test_fleet_metric.py | 2 +- python/paddle/fluid/tests/unittests/test_fleet_rolemaker_2.py | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python/paddle/distributed/entry_attr.py b/python/paddle/distributed/entry_attr.py index e219ef6434a..d74a46f530c 100644 --- a/python/paddle/distributed/entry_attr.py +++ b/python/paddle/distributed/entry_attr.py @@ -82,7 +82,7 @@ class ProbabilityEntry(EntryAttr): """ def __init__(self, probability): - super(EntryAttr, self).__init__() + super(ProbabilityEntry, self).__init__() if not isinstance(probability, float): raise ValueError("probability must be a float in (0,1)") @@ -122,7 +122,7 @@ class CountFilterEntry(EntryAttr): """ def __init__(self, count_filter): - super(EntryAttr, self).__init__() + super(CountFilterEntry, self).__init__() if not isinstance(count_filter, int): raise ValueError( diff --git a/python/paddle/fluid/entry_attr.py b/python/paddle/fluid/entry_attr.py index c0d45432c57..0fbbf7c36e8 100644 --- a/python/paddle/fluid/entry_attr.py +++ b/python/paddle/fluid/entry_attr.py @@ -40,7 +40,7 @@ class EntryAttr(object): class ProbabilityEntry(EntryAttr): def __init__(self, probability): - super(EntryAttr, self).__init__() + super(ProbabilityEntry, self).__init__() if not isinstance(probability, float): raise ValueError("probability must be a float in (0,1)") @@ -57,7 +57,7 @@ class ProbabilityEntry(EntryAttr): class CountFilterEntry(EntryAttr): def __init__(self, count_filter): - super(EntryAttr, self).__init__() + super(CountFilterEntry, self).__init__() if not isinstance(count_filter, int): raise ValueError( diff --git a/python/paddle/fluid/incubate/fleet/base/role_maker.py b/python/paddle/fluid/incubate/fleet/base/role_maker.py index d3737e742b4..a5e508d0a0d 100644 --- a/python/paddle/fluid/incubate/fleet/base/role_maker.py +++ b/python/paddle/fluid/incubate/fleet/base/role_maker.py @@ -591,7 +591,7 @@ class GeneralRoleMaker(RoleMakerBase): """ def __init__(self, **kwargs): - super(RoleMakerBase, self).__init__() + super(GeneralRoleMaker, self).__init__() self._role_is_generated = False self._hdfs_name = kwargs.get("hdfs_name", "") self._hdfs_ugi = kwargs.get("hdfs_ugi", "") diff --git a/python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_transpose_mkldnn_op.py b/python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_transpose_mkldnn_op.py index f31ddf921f8..8e284c296db 100644 --- a/python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_transpose_mkldnn_op.py +++ b/python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_transpose_mkldnn_op.py @@ -134,7 +134,7 @@ class TestMKLDNNWithValidPad(TestConv2DTransposeMKLDNNOp): class TestMKLDNNWithValidPad_NHWC(TestMKLDNNWithValidPad): def init_test_case(self): - super(TestMKLDNNWithValidPad, self).init_test_case() + super(TestMKLDNNWithValidPad_NHWC, self).init_test_case() self.data_format = "NHWC" N, C, H, W = self.input_size self.input_size = [N, H, W, C] diff --git a/python/paddle/fluid/tests/unittests/test_backward.py b/python/paddle/fluid/tests/unittests/test_backward.py index 2a4d024aa43..7ca0832b718 100644 --- a/python/paddle/fluid/tests/unittests/test_backward.py +++ b/python/paddle/fluid/tests/unittests/test_backward.py @@ -160,7 +160,7 @@ class TestBackward(unittest.TestCase): class SimpleNet(BackwardNet): def __init__(self): - super(BackwardNet, self).__init__() + super(SimpleNet, self).__init__() self.stop_gradient_grad_vars = set([ u'x_no_grad@GRAD', u'x2_no_grad@GRAD', u'x3_no_grad@GRAD', u'label_no_grad@GRAD' @@ -330,7 +330,7 @@ class TestAppendBackwardWithError(unittest.TestCase): # TODO(Aurelius84): add conditional network test class ConditionalNet(BackwardNet): def __init__(self): - super(BackwardNet, self).__init__() + super(ConditionalNet, self).__init__() if __name__ == '__main__': diff --git a/python/paddle/fluid/tests/unittests/test_fleet_metric.py b/python/paddle/fluid/tests/unittests/test_fleet_metric.py index 724a0dfe013..5dce59ac23d 100644 --- a/python/paddle/fluid/tests/unittests/test_fleet_metric.py +++ b/python/paddle/fluid/tests/unittests/test_fleet_metric.py @@ -35,7 +35,7 @@ class TestFleetMetric(unittest.TestCase): class FakeUtil(UtilBase): def __init__(self, fake_fleet): - super(UtilBase, self).__init__() + super(FakeUtil, self).__init__() self.fleet = fake_fleet def all_reduce(self, input, mode="sum", comm_world="worker"): diff --git a/python/paddle/fluid/tests/unittests/test_fleet_rolemaker_2.py b/python/paddle/fluid/tests/unittests/test_fleet_rolemaker_2.py index e87d52752c8..cabd07a399a 100644 --- a/python/paddle/fluid/tests/unittests/test_fleet_rolemaker_2.py +++ b/python/paddle/fluid/tests/unittests/test_fleet_rolemaker_2.py @@ -199,7 +199,7 @@ class TestCloudRoleMaker2(unittest.TestCase): """ def __init__(self): - super(Fleet, self).__init__() + super(TmpFleet, self).__init__() self._role_maker = None def init_worker(self): -- GitLab