From 2bfa9796bf4615e0898b33b7b97bb3ca0db013d5 Mon Sep 17 00:00:00 2001 From: Yang Yu Date: Tue, 26 Dec 2017 13:19:57 +0800 Subject: [PATCH] Fix check --- python/paddle/v2/fluid/tests/test_dynrnn_gradient_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/v2/fluid/tests/test_dynrnn_gradient_check.py b/python/paddle/v2/fluid/tests/test_dynrnn_gradient_check.py index 3018588c3a1..d0b805882fc 100644 --- a/python/paddle/v2/fluid/tests/test_dynrnn_gradient_check.py +++ b/python/paddle/v2/fluid/tests/test_dynrnn_gradient_check.py @@ -142,10 +142,10 @@ class BaseRNN(object): return feed_dict def get_numeric_gradient_of_param(self, param_name, delta=0.001): + p = self.params[param_name] if len(p.shape) != 2: raise ValueError("Not support get numeric gradient of an parameter," " which is not matrix") - p = self.params[param_name] g = numpy.zeros(shape=p.shape, dtype=p.dtype) for i in xrange(p.shape[0]): -- GitLab