title: Why do I get different results when printing tensor names?
body: <p>I was trying to print the names of the nodes in a graph and I got different results using different codes.</p>
  
  <p>The placeholder is defined as:</p>
  
  <pre><code>x = tf.placeholder("float", shape=[None, 784], name = 'input_x')
  </code></pre>
  
  <p>If I run the code:    </p>
  
  <pre><code>node_names = [node.name for node in tf.get_default_graph().as_graph_def().node]
  for item in node_names:
      print(item)
  </code></pre>
  
  <p>And I get the result like this:</p>
  
  <pre><code>input_x
  origin_y
  truncated_normal/shape
  truncated_normal/mean
  truncated_normal/stddev
  truncated_normal/TruncatedNormal
  truncated_normal/mul
  truncated_normal
  </code></pre>
  
  <p>But if I run the following code:</p>
  
  <pre><code>print('Name for input:')
  print(x.name)
  </code></pre>
  
  <p>There is a ":0" added at the end of the name:</p>
  
  <pre><code>Name for input:
  input_x:0
  </code></pre>
  
  <p>I am confused about it. Could any one explain this for me?
  Thanks.</p>