code: def testWatchGradientsByXTensorsWorks(self):
      y = math_ops.add(self.w, -1.0, name="foo/y")
      z = math_ops.square(y, name="foo/z")
  
      # The constructrion of the forward graph has completed.
      # But we can still get the gradient tensors by using
      # watch_gradients_by_x_tensors().
      grad_debugger = debug_gradients.GradientsDebugger()
      with grad_debugger.watch_gradients_by_tensors(
          self.sess.graph, [self.w, self.u, y]
      ):
          gradient_descent.GradientDescentOptimizer(0.1).minimize(z)
  
      self.assertEqual(3, len(grad_debugger.gradient_tensors()))
      u_grad = grad_debugger.gradient_tensor(self.u)
      w_grad = grad_debugger.gradient_tensor(self.w)
      y_grad = grad_debugger.gradient_tensor(y)
  
      self.sess.run(variables.global_variables_initializer())
      self.assertAllClose(10.0, self.sess.run(y_grad))
      self.assertAllClose(10.0, self.sess.run(w_grad))
      self.assertAllClose(30.0, self.sess.run(u_grad))
  
imports: import tempfile
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.debug.lib import debug_data
  from tensorflow.python.debug.lib import debug_gradients
  from tensorflow.python.debug.lib import debug_utils
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import googletest
  from tensorflow.python.training import gradient_descent
label_desc: Use image node_id 14 for calling the IdentifyGradientTest obj's underlying member method code with example usage: obj.testWatchGradientsByXTensorsWorks() without return types