From: Fergal Cotter Date: Tue, 22 May 2018 18:44:57 +0000 (+0100) Subject: Corrected compute_gradient docstring X-Git-Tag: upstream/v1.9.0_rc1~65^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2058a241f159a9a6658d48156cca2a2906e1d712;p=platform%2Fupstream%2Ftensorflow.git Corrected compute_gradient docstring After testing the tf.test.compute_gradient function with complex inputs, noticed that the docstring specifies that the real/imag partial derivatives are in the four corners of a larger matrix, when the result given indicates they are instead interleaved. --- diff --git a/tensorflow/python/ops/gradient_checker.py b/tensorflow/python/ops/gradient_checker.py index 12afcd0..94c8d79 100644 --- a/tensorflow/python/ops/gradient_checker.py +++ b/tensorflow/python/ops/gradient_checker.py @@ -283,10 +283,10 @@ def compute_gradient(x, numbers. For example, if `x` is complex with shape `[m]` and `y` is complex with shape `[n]`, each Jacobian `J` will have shape `[m * 2, n * 2]` with - J[:m, :n] = d(Re y)/d(Re x) - J[:m, n:] = d(Im y)/d(Re x) - J[m:, :n] = d(Re y)/d(Im x) - J[m:, n:] = d(Im y)/d(Im x) + J[::2, ::2] = d(Re y)/d(Re x) + J[::2, 1::2] = d(Im y)/d(Re x) + J[1::2, ::2] = d(Re y)/d(Im x) + J[1::2, 1::2] = d(Im y)/d(Im x) Args: x: a tensor or list of tensors