code: def tensor_name(tensor):
      """Returns the Tensor's name.
  
      Tensor names always have the structure <op_name>:<int>. This method
      returns the portion before the ':'.
  
      Args:
        tensor: Tensor.
  
      Returns:
        String name of the Tensor.
      """
  
      return tensor.name.split(":")[-2]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from distutils.version import LooseVersion
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow.python import tf2
  from tensorflow.python.keras.metrics import Metric
  from tensorflow.python.tpu import tpu_function
  from tensorflow_estimator.python.estimator.head import regression_head
label_desc: Use image node_id 1 for calling a global function with example usage: tensor_name(tensor) and returns: tensor