From f0a85b08053440b9a49346f6d07cc106472c5c33 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 9 Aug 2017 18:03:39 +0800 Subject: [PATCH] Rename __is_close -> assert_is_close() --- python/paddle/v2/framework/tests/gradient_checker.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/paddle/v2/framework/tests/gradient_checker.py b/python/paddle/v2/framework/tests/gradient_checker.py index 7c4eda5f303..aacc5e88fee 100644 --- a/python/paddle/v2/framework/tests/gradient_checker.py +++ b/python/paddle/v2/framework/tests/gradient_checker.py @@ -92,7 +92,8 @@ def get_numeric_gradient(op, class GradientChecker(unittest.TestCase): - def __is_close(self, numeric_grads, scope, max_relative_error, msg_prefix): + def assert_is_close(self, numeric_grads, scope, max_relative_error, + msg_prefix): for name in numeric_grads: b = numpy.array(scope.find_var(grad_var_name(name)).get_tensor()) a = numeric_grads[name] @@ -199,8 +200,8 @@ class GradientChecker(unittest.TestCase): backward_op.infer_shape(scope) backward_op.run(scope, ctx) - self.__is_close(numeric_grad, scope, max_relative_error, - "Gradient Check On %s" % str(place)) + self.assert_is_close(numeric_grad, scope, max_relative_error, + "Gradient Check On %s" % str(place)) if __name__ == '__main__': -- GitLab