提交 f0a85b08 编写于 作者: Y Yu Yang

Rename __is_close -> assert_is_close()

上级 c957445c
......@@ -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__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册