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]