class_docstr: Gradients Debugger.
  
  Allows retrieval of gradient tensors created by TensorFlow's automatic
  differentiation algorithm, i.e., `tf.gradients` and optimizer classes that
  use it.
class_docstr_tok: ["Gradients","Debugger",".","Allows","retrieval","of","gradient","tensors","created","by","TensorFlow","'s","automatic","differentiation","algorithm",",","i.e.",",","`","tf.gradients","`","and","optimizer","classes","that","use","it","."]
code: def _get_tensor_name(self, tensor):
      if isinstance(tensor, (tensor_lib.Tensor, variables.Variable)):
          return tensor.name
      elif isinstance(tensor, str):
          return tensor
      else:
          raise TypeError(
              "x_tensor must be a str or tf.Tensor or tf.Variable, "
              "but instead has type %s" % type(tensor)
          )
  
imports: import re
  import uuid
  from tensorflow.python.debug.lib import debug_data
  from tensorflow.python.debug.lib import debug_graphs
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.ops import variables
label_desc: Use image node_id 13 for calling the GradientsDebugger obj's underlying member method code with example usage: obj._get_tensor_name(tensor) and returns: tensor, tensor