code: def _as_graph_element(self):
      
      if self.is_sequence():
        raise TypeError('A Pretty Tensor that holds a sequence cannot be '
                        'represented as a graph element.')
      else:
        # Self might be holding something else that isn't a true tensor, so
        # if the 'tensor' can behave like a graph element, look for its
        # _AsGraphElement method and call it. Graph elements themselves may not
        # have or need this method, so just return other items directly.
        obj = self.tensor
        conv_fn = getattr(obj, '_as_graph_element', None)
        if conv_fn and isinstance(conv_fn, collections.Callable):
          obj = conv_fn()
        return obj
docs: Returns the underlying graph element if possible.